code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
module dpq2.conv.from_bson;
import dpq2.value;
import dpq2.oids;
import dpq2.result: ArrayProperties, ArrayHeader_net, Dim_net;
import dpq2.conv.from_d_types;
import dpq2.conv.to_d_types;
import vibe.data.bson;
import std.bitmanip: nativeToBigEndian;
import std.conv: to;
/// Default type will be used for NULL value and for array without detected type
Value bsonToValue(Bson v, OidType defaultType = OidType.Undefined)
{
if(v.type == Bson.Type.array)
return bsonArrayToValue(v, defaultType);
else
return bsonValueToValue(v, defaultType);
}
private:
Value bsonValueToValue(Bson v, OidType defaultType)
{
Value ret;
with(Bson.Type)
switch(v.type)
{
case null_:
ret = Value(ValueFormat.BINARY, defaultType);
break;
case Bson.Type.object:
ret = v.toJson.toString.toValue;
ret.oidType = OidType.Json;
break;
case bool_:
ret = v.get!bool.toValue;
break;
case int_:
ret = v.get!int.toValue;
break;
case long_:
ret = v.get!long.toValue;
break;
case double_:
ret = v.get!double.toValue;
break;
case Bson.Type.string:
ret = v.get!(immutable(char)[]).toValue;
break;
default:
throw new ValueConvException(
ConvExceptionType.NOT_IMPLEMENTED,
"Format "~v.type.to!(immutable(char)[])~" doesn't supported by Bson to Value converter",
__FILE__, __LINE__
);
}
return ret;
}
unittest
{
{
Value v1 = bsonToValue(Bson(123));
Value v2 = (123).toValue;
assert(v1.as!int == v2.as!int);
}
{
Value v1 = bsonToValue(Bson("Test string"));
Value v2 = ("Test string").toValue;
assert(v1.as!string == v2.as!string);
}
{
Value t = bsonToValue(Bson(true));
Value f = bsonToValue(Bson(false));
assert(t.as!bool == true);
assert(f.as!bool == false);
}
}
Value bsonArrayToValue(ref Bson bsonArr, OidType defaultType)
{
ubyte[] nullValue() pure
{
ubyte[] ret = [0xff, 0xff, 0xff, 0xff]; //NULL magic number
return ret;
}
ubyte[] rawValue(Value v) pure
{
if(v.isNull)
{
return nullValue();
}
else
{
return v._data.length.to!uint.nativeToBigEndian ~ v._data;
}
}
ArrayProperties ap;
ubyte[] rawValues;
void recursive(ref Bson bsonArr, int dimension)
{
if(dimension == ap.dimsSize.length)
{
ap.dimsSize ~= bsonArr.length.to!int;
}
else
{
if(ap.dimsSize[dimension] != bsonArr.length)
throw new ValueConvException(ConvExceptionType.NOT_ARRAY, "Jagged arrays are unsupported", __FILE__, __LINE__);
}
foreach(bElem; bsonArr)
{
ap.nElems++;
switch(bElem.type)
{
case Bson.Type.array:
recursive(bElem, dimension + 1);
break;
case Bson.Type.null_:
rawValues ~= nullValue();
break;
default:
Value v = bsonValueToValue(bElem, OidType.Undefined);
if(ap.OID == OidType.Undefined)
{
ap.OID = v.oidType;
}
else
{
if(ap.OID != v.oidType)
throw new ValueConvException(
ConvExceptionType.NOT_ARRAY,
"Bson (which used for creating "~ap.OID.to!string~" array) also contains value of type "~v.oidType.to!string,
__FILE__, __LINE__
);
}
rawValues ~= rawValue(v);
}
}
}
recursive(bsonArr, 0);
if(ap.OID == OidType.Undefined) ap.OID = defaultType.oidConvTo!"element";
ArrayHeader_net h;
h.ndims = nativeToBigEndian(ap.dimsSize.length.to!int);
h.OID = nativeToBigEndian(ap.OID.to!Oid);
ubyte[] ret;
ret ~= (cast(ubyte*) &h)[0 .. h.sizeof];
foreach(i; 0 .. ap.dimsSize.length)
{
Dim_net dim;
dim.dim_size = nativeToBigEndian(ap.dimsSize[i]);
dim.lbound = nativeToBigEndian!int(1);
ret ~= (cast(ubyte*) &dim)[0 .. dim.sizeof];
}
ret ~= rawValues;
return Value(ret, ap.OID.oidConvTo!"array", false, ValueFormat.BINARY);
}
unittest
{
import dpq2.conv.to_bson;
{
Bson bsonArray = Bson(
[Bson(123), Bson(155), Bson(null), Bson(0), Bson(null)]
);
Value v = bsonToValue(bsonArray);
assert(v.isSupportedArray);
assert(v.as!Bson == bsonArray);
}
{
Bson bsonArray = Bson([
Bson([Bson(123), Bson(155), Bson(null)]),
Bson([Bson(0), Bson(null), Bson(155)])
]);
Value v = bsonToValue(bsonArray);
assert(v.isSupportedArray);
assert(v.as!Bson == bsonArray);
}
{
Bson bsonArray = Bson([
Bson([Bson(123), Bson(155)]),
Bson([Bson(0)])
]);
bool exceptionFlag = false;
try
bsonToValue(bsonArray);
catch(ValueConvException e)
{
if(e.type == ConvExceptionType.NOT_ARRAY)
exceptionFlag = true;
}
assert(exceptionFlag);
}
}
|
D
|
/Users/obuchiyuki/Desktop/SaftyDrive/Build/Intermediates/SaftyDrive.build/Debug-iphoneos/SaftyDrive.build/Objects-normal/arm64/MKCollectionViewCell.o : /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSnackbar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMMenu.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMTip.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKImageView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/etc.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKColor.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKNavigationBar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSwitch.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCollectionViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingCellViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLayer.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKActivityIndicator.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMReachability.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedMainControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMNavigationViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingDataController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedDrawerControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKRefreshControl.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSideDrawerViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCardView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTextField.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTableViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/ViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMAlertController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/swiftyJSON.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLabel.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKButton.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/AppDelegate.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMHorizontalMenu.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule
/Users/obuchiyuki/Desktop/SaftyDrive/Build/Intermediates/SaftyDrive.build/Debug-iphoneos/SaftyDrive.build/Objects-normal/arm64/MKCollectionViewCell~partial.swiftmodule : /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSnackbar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMMenu.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMTip.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKImageView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/etc.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKColor.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKNavigationBar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSwitch.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCollectionViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingCellViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLayer.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKActivityIndicator.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMReachability.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedMainControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMNavigationViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingDataController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedDrawerControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKRefreshControl.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSideDrawerViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCardView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTextField.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTableViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/ViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMAlertController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/swiftyJSON.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLabel.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKButton.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/AppDelegate.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMHorizontalMenu.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule
/Users/obuchiyuki/Desktop/SaftyDrive/Build/Intermediates/SaftyDrive.build/Debug-iphoneos/SaftyDrive.build/Objects-normal/arm64/MKCollectionViewCell~partial.swiftdoc : /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSnackbar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMMenu.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMTip.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKImageView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/etc.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKColor.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKNavigationBar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSwitch.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCollectionViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingCellViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLayer.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKActivityIndicator.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMReachability.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedMainControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMNavigationViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingDataController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedDrawerControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKRefreshControl.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSideDrawerViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCardView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTextField.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTableViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/ViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMAlertController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/swiftyJSON.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLabel.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKButton.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/AppDelegate.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMHorizontalMenu.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule
|
D
|
instance Mod_576_NONE_Fernando_NW (Npc_Default)
{
// ------ NSC ------
name = "Fernando";
guild = GIL_PAL;
id = 576;
voice = 11;
flags = 0;
npctype = NPCTYPE_MAIN;
// ------ Attribute ------
B_SetAttributesToChapter (self, 2);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG;
// ------ Equippte Waffen ------
EquipItem (self,ItMw_Zweihaender);
// ------ Inventory ------
B_CreateAmbientInv (self);
CreateInvItems (self,ItSe_GoldPocket100,1);
// ------ visuals ------
B_SetNpcVisual (self, MALE, "Hum_Head_Bald", Face_N_Corristo, BodyTex_N, ITAR_Governor);
Mdl_SetModelFatness (self, 3);
Mdl_ApplyOverlayMds (self, "Humans_Arrogance.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 30);
// ------ TA anmelden ------
daily_routine = Rtn_Start_576;
};
//Joly: NIE AUF EINE BANK ODER THRON SETZEN
FUNC VOID Rtn_Start_576 ()
{
TA_Sleep (22,05,07,59,"NW_CITY_REICH02_BED_01");
TA_Smalltalk (07,59,11,00,"NW_CITY_UPTOWN_PATH_08");
TA_Stand_WP (11,00,14,59,"NW_CITY_UPTOWN_PATH_04");
TA_Smalltalk (14,59,18,00,"NW_CITY_UPTOWN_PATH_08");
TA_Read_Bookstand (18,00,20,00,"NW_CITY_REICH02_READ");
TA_Read_Bookstand (20,00,22,05,"NW_CITY_REICH02_READ");
};
FUNC VOID Rtn_Gefangen_576()
{
TA_Sit_Campfire (08,00,20,00,"NW_CITY_HABOUR_KASERN_HALVOR");
TA_Sit_Campfire (20,00,08,00,"NW_CITY_HABOUR_KASERN_HALVOR");
};
|
D
|
instance DIA_Addon_Bones_EXIT(C_Info)
{
npc = PIR_1362_Addon_Bones;
nr = 999;
condition = DIA_Addon_Bones_EXIT_Condition;
information = DIA_Addon_Bones_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Addon_Bones_EXIT_Condition()
{
return TRUE;
};
func void DIA_Addon_Bones_EXIT_Info()
{
AI_StopProcessInfos(self);
};
func void B_Addon_Bones_KeineZeit()
{
AI_Output(self,other,"DIA_Addon_Bones_Train_01_01"); //Извини, у меня сейчас совсем нет времени.
AI_Output(self,other,"DIA_Addon_Bones_Train_01_02"); //Мне нужно тренироваться.
};
instance DIA_Addon_Bones_Anheuern(C_Info)
{
npc = PIR_1362_Addon_Bones;
nr = 1;
condition = DIA_Addon_Bones_Anheuern_Condition;
information = DIA_Addon_Bones_Anheuern_Info;
description = "Нас ждет каньон.";
};
func int DIA_Addon_Bones_Anheuern_Condition()
{
if(MIS_Addon_Greg_ClearCanyon == LOG_Running)
{
return TRUE;
};
};
func void DIA_Addon_Bones_Anheuern_Info()
{
AI_Output(other,self,"DIA_Addon_Bones_Anheuern_15_01"); //Нас ждет каньон.
B_Addon_Bones_KeineZeit();
};
instance DIA_Addon_Bones_Hello(C_Info)
{
npc = PIR_1362_Addon_Bones;
nr = 5;
condition = DIA_Addon_Bones_Hello_Condition;
information = DIA_Addon_Bones_Hello_Info;
permanent = FALSE;
description = "Как дела?";
};
func int DIA_Addon_Bones_Hello_Condition()
{
return TRUE;
};
func void DIA_Addon_Bones_Hello_Info()
{
AI_Output(other,self,"DIA_Addon_Bones_Hello_15_00"); //Как дела?
AI_Output(self,other,"DIA_Addon_Bones_Hello_01_01"); //Грех жаловаться. Немного скучновато, но зато работать не приходится.
AI_Output(self,other,"DIA_Addon_Bones_Work_01_01"); //Я готовлюсь к новому заданию, которое дал мне Грег.
AI_Output(other,self,"DIA_Addon_Bones_Work_15_02"); //Что это за задание?
AI_Output(self,other,"DIA_Addon_Bones_Work_01_03"); //Я не могу тебе сказать.
AI_Output(self,other,"DIA_Addon_Bones_Work_01_04"); //Не обижайся, приятель, но я тяжело трудился, чтобы получить это задание, и не хочу снова его потерять.
Npc_ExchangeRoutine(self,"START");
};
instance DIA_Addon_Bones_Train(C_Info)
{
npc = PIR_1362_Addon_Bones;
nr = 5;
condition = DIA_Addon_Bones_Train_Condition;
information = DIA_Addon_Bones_Train_Info;
permanent = FALSE;
description = "Ты можешь меня чему-нибудь научить?";
};
func int DIA_Addon_Bones_Train_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Bones_Hello))
{
return TRUE;
};
};
func void DIA_Addon_Bones_Train_Info()
{
AI_Output(other,self,"DIA_Addon_Bones_Train_15_00"); //Ты можешь меня чему-нибудь научить?
B_Addon_Bones_KeineZeit();
};
instance DIA_Addon_Bones_Teacher(C_Info)
{
npc = PIR_1362_Addon_Bones;
nr = 5;
condition = DIA_Addon_Bones_Teacher_Condition;
information = DIA_Addon_Bones_Teacher_Info;
permanent = FALSE;
description = "Кто здесь может чему-нибудь меня научить?";
};
func int DIA_Addon_Bones_Teacher_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Bones_Train))
{
return TRUE;
};
};
func void DIA_Addon_Bones_Teacher_Info()
{
AI_Output(other,self,"DIA_Addon_Bones_Teacher_15_00"); //Кто здесь может чему-нибудь меня научить?
AI_Output(self,other,"DIA_Addon_Bones_Teacher_01_04"); //Генри и Морган командуют нашими боевыми группами.
AI_Output(self,other,"DIA_Addon_Bones_Teacher_01_05"); //Они могут научить тебя лучше сражаться.
AI_Output(self,other,"DIA_Addon_Bones_Teacher_01_07"); //Люди Генри используют двуручное оружие.
AI_Output(self,other,"DIA_Addon_Bones_Teacher_01_08"); //Морган же предпочитает более быстрые одноручные клинки.
AI_Output(other,self,"DIA_Addon_Bones_Teacher_15_09"); //А еще?
AI_Output(self,other,"DIA_Addon_Bones_Teacher_01_10"); //Знаешь, честно говоря, я больше ничем не интересовался.
AI_Output(self,other,"DIA_Addon_Bones_Teacher_01_11"); //Но думаю, Аллигатору Джеку и Сэмюэлю найдется, чем с тобой поделиться.
Knows_HenrysEntertrupp = TRUE;
if(Henry_Addon_TeachPlayer == FALSE)
{
Log_CreateTopic(Topic_Addon_PIR_Teacher,LOG_NOTE);
B_LogEntry(Topic_Addon_PIR_Teacher,Log_Text_Addon_HenryTeach);
};
if(Morgan_Addon_TeachPlayer == FALSE)
{
Log_CreateTopic(Topic_Addon_PIR_Teacher,LOG_NOTE);
B_LogEntry(Topic_Addon_PIR_Teacher,Log_Text_Addon_MorganTeach);
};
};
instance DIA_Addon_Bones_Francis(C_Info)
{
npc = PIR_1362_Addon_Bones;
nr = 3;
condition = DIA_Addon_Bones_Francis_Condition;
information = DIA_Addon_Bones_Francis_Info;
permanent = FALSE;
description = "Что ты скажешь о Фрэнсисе?";
};
func int DIA_Addon_Bones_Francis_Condition()
{
if(C_CanAskPiratesAboutFrancis())
{
return TRUE;
};
};
func void DIA_Addon_Bones_Francis_Info()
{
AI_Output(other,self,"DIA_Addon_Bones_Francis_15_00"); //Что ты скажешь о Фрэнсисе?
if(GregIsBack == FALSE)
{
AI_Output(self,other,"DIA_Addon_Bones_Francis_01_03"); //Посмотри вокруг. Работает только Генри и его люди.
AI_Output(self,other,"DIA_Addon_Bones_Francis_01_04"); //Морган целыми днями либо спит, либо пьет самогон.
AI_Output(self,other,"DIA_Addon_Bones_Francis_01_05"); //При Греге такого не бывает. Если ты бездельничаешь, ты получаешь по шее. Вот и все.
}
else
{
B_Addon_Bones_KeineZeit();
};
};
var int DIA_Addon_Bones_WantArmor_Once;
instance DIA_Addon_Bones_WantArmor(C_Info)
{
npc = PIR_1362_Addon_Bones;
nr = 2;
condition = DIA_Addon_Bones_WantArmor_Condition;
information = DIA_Addon_Bones_WantArmor_Info;
permanent = TRUE;
description = "Отдай мне бандитские доспехи.";
};
func int DIA_Addon_Bones_WantArmor_Condition()
{
if((Greg_GaveArmorToBones == TRUE) && (MIS_Greg_ScoutBandits == FALSE) && !C_SCHasBDTArmor())
{
return TRUE;
};
};
func void DIA_Addon_Bones_WantArmor_Info()
{
AI_Output(other,self,"DIA_Addon_Bones_WantArmor_15_00"); //Отдай мне бандитские доспехи.
AI_Output(self,other,"DIA_Addon_Bones_WantArmor_01_01"); //Я еще не свихнулся. Грег мне голову оторвет.
AI_Output(self,other,"DIA_Addon_Bones_WantArmor_01_02"); //Он сказал мне, что без его приказа я не должен никому их отдавать.
if(GregIsBack == TRUE)
{
AI_Output(self,other,"DIA_Addon_Bones_WantArmor_01_03"); //Нет, я не могу дать их тебе. Тем более, когда Грег здесь.
};
if(DIA_Addon_Bones_WantArmor_Once == FALSE)
{
B_LogEntry(TOPIC_Addon_BDTRuestung,"Бонес не отдаст мне доспехи, пока я не получу разрешение Грега.");
DIA_Addon_Bones_WantArmor_Once = TRUE;
};
};
instance DIA_Addon_Bones_GiveArmor(C_Info)
{
npc = PIR_1362_Addon_Bones;
nr = 2;
condition = DIA_Addon_Bones_GiveArmor_Condition;
information = DIA_Addon_Bones_GiveArmor_Info;
permanent = FALSE;
description = "Ты должен отдать мне доспехи бандитов. Приказ Грега.";
};
func int DIA_Addon_Bones_GiveArmor_Condition()
{
if((MIS_Greg_ScoutBandits == LOG_Running) && !C_SCHasBDTArmor())
{
return TRUE;
};
};
func void DIA_Addon_Bones_GiveArmor_Info()
{
AI_Output(other,self,"DIA_Addon_Bones_GiveArmor_15_00"); //Ты должен отдать мне доспехи бандитов. Приказ Грега.
AI_Output(self,other,"DIA_Addon_Bones_GiveArmor_01_01"); //Приказ Грега? Фу, а я-то думал мне действительно придется идти на это задание.
AI_Output(self,other,"DIA_Addon_Bones_GiveArmor_01_02"); //Разведка в лагере бандитов - это просто самоубийство.
AI_Output(self,other,"DIA_Addon_Bones_GiveArmor_01_03"); //Пусть уж лучше Грег взвалит на меня какую-нибудь скучную работу...
AI_Output(other,self,"DIA_Addon_Bones_GiveArmor_15_04"); //(раздраженно) Доспехи.
AI_Output(self,other,"DIA_Addon_Bones_GiveArmor_01_05"); //Да, конечно, вот они.
B_GiveArmor(ITAR_BDT_M);
Bones_ArmorGiven = TRUE;
AI_Output(self,other,"DIA_Addon_Bones_GiveArmor_01_06"); //Будь осторожнее. С этими бандитами шутки плохи.
self.flags = 0;
Greg.flags = 0;
B_LogEntry(TOPIC_Addon_BDTRuestung,"Приказ Грега возымел свое действие. Доспехи у меня!");
B_GivePlayerXP(XP_Bones_GetBDTArmor);
};
|
D
|
/Users/Matt/XCode/GeoBase/DerivedData/Build/Intermediates/GeoBase.build/Debug-iphoneos/GeoBase.build/Objects-normal/arm64/MeasurementController.o : /Users/Matt/XCode/GeoBase/GeoBase/SettingsController.swift /Users/Matt/XCode/GeoBase/GeoBase/ProjectController.swift /Users/Matt/XCode/GeoBase/GeoBase/Stereonet.swift /Users/Matt/XCode/GeoBase/GeoBase/ViewController.swift /Users/Matt/XCode/GeoBase/GeoBase/CompassController.swift /Users/Matt/XCode/GeoBase/GeoBase/SaveButton.swift /Users/Matt/XCode/GeoBase/GeoBase/ProjectDetailController.swift /Users/Matt/XCode/GeoBase/GeoBase/MapController.swift /Users/Matt/XCode/GeoBase/GeoBase/DataViewController.swift /Users/Matt/XCode/GeoBase/GeoBase/Locality.swift /Users/Matt/XCode/GeoBase/GeoBase/AppDelegate.swift /Users/Matt/XCode/GeoBase/GeoBase/DataModel.swift /Users/Matt/XCode/GeoBase/GeoBase/MeasurementController.swift /Users/Matt/XCode/GeoBase/GeoBase/Project.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreLocation.swiftmodule
/Users/Matt/XCode/GeoBase/DerivedData/Build/Intermediates/GeoBase.build/Debug-iphoneos/GeoBase.build/Objects-normal/arm64/MeasurementController~partial.swiftmodule : /Users/Matt/XCode/GeoBase/GeoBase/SettingsController.swift /Users/Matt/XCode/GeoBase/GeoBase/ProjectController.swift /Users/Matt/XCode/GeoBase/GeoBase/Stereonet.swift /Users/Matt/XCode/GeoBase/GeoBase/ViewController.swift /Users/Matt/XCode/GeoBase/GeoBase/CompassController.swift /Users/Matt/XCode/GeoBase/GeoBase/SaveButton.swift /Users/Matt/XCode/GeoBase/GeoBase/ProjectDetailController.swift /Users/Matt/XCode/GeoBase/GeoBase/MapController.swift /Users/Matt/XCode/GeoBase/GeoBase/DataViewController.swift /Users/Matt/XCode/GeoBase/GeoBase/Locality.swift /Users/Matt/XCode/GeoBase/GeoBase/AppDelegate.swift /Users/Matt/XCode/GeoBase/GeoBase/DataModel.swift /Users/Matt/XCode/GeoBase/GeoBase/MeasurementController.swift /Users/Matt/XCode/GeoBase/GeoBase/Project.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreLocation.swiftmodule
/Users/Matt/XCode/GeoBase/DerivedData/Build/Intermediates/GeoBase.build/Debug-iphoneos/GeoBase.build/Objects-normal/arm64/MeasurementController~partial.swiftdoc : /Users/Matt/XCode/GeoBase/GeoBase/SettingsController.swift /Users/Matt/XCode/GeoBase/GeoBase/ProjectController.swift /Users/Matt/XCode/GeoBase/GeoBase/Stereonet.swift /Users/Matt/XCode/GeoBase/GeoBase/ViewController.swift /Users/Matt/XCode/GeoBase/GeoBase/CompassController.swift /Users/Matt/XCode/GeoBase/GeoBase/SaveButton.swift /Users/Matt/XCode/GeoBase/GeoBase/ProjectDetailController.swift /Users/Matt/XCode/GeoBase/GeoBase/MapController.swift /Users/Matt/XCode/GeoBase/GeoBase/DataViewController.swift /Users/Matt/XCode/GeoBase/GeoBase/Locality.swift /Users/Matt/XCode/GeoBase/GeoBase/AppDelegate.swift /Users/Matt/XCode/GeoBase/GeoBase/DataModel.swift /Users/Matt/XCode/GeoBase/GeoBase/MeasurementController.swift /Users/Matt/XCode/GeoBase/GeoBase/Project.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreLocation.swiftmodule
|
D
|
// Copyright © 2012, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/charge/charge.d (GPLv2 only).
module miners.menu.pause;
import charge.charge;
import charge.game.gui.layout;
import charge.game.gui.textbased;
import charge.platform.homefolder;
import miners.options;
import miners.interfaces;
import miners.menu.base;
class PauseMenu : MenuSceneBase
{
private:
const string header = `Options`;
const int minButtonWidth = 32;
const aaOnText = "Aa: on";
const aaOffText = "Aa: off";
const fogOnText = "Fog: on";
const fogOffText = "Fog: off";
const noClipOnText = "NoClip: on";
const noClipOffText = "NoClip: off";
const shadowOnText = "Shadow: on";
const shadowOffText = "Shadow: off";
const fullscreenOnText = "Fullscreen: on";
const fullscreenOffText = "Fullscreen: off";
const otherPartText = "Part";
const otherCloseText = "Close";
const quitText = "Quit";
const fullscreenInfoText = `
In order for the fullscreen option to take
effect you need to restart Charged-Miners.`;
const spacerStr = " ";
Scene partScene;
public:
this(Router r, Options opts, Scene part)
{
this.partScene = part;
auto mb = new MenuBase(header);
auto t = new Text(mb, 0, 0, spacerStr);
auto b1 = new Button(mb, 0, 8, "", minButtonWidth);
auto b2 = new Button(mb, 0, b1.y + b1.h, "", minButtonWidth);
auto b3 = new Button(mb, 0, b2.y + b2.h, "", minButtonWidth);
auto b4 = new Button(mb, 0, b3.y + b3.h, "", minButtonWidth);
auto b5 = new Button(mb, 0, b4.y + b4.h, "", minButtonWidth);
auto b6 = new Button(mb, 0, b5.y + b5.h, "", minButtonWidth);
auto b7 = new Button(mb, 0, b6.y + b6.h, "", minButtonWidth);
auto b8 = new Button(mb, 0, b7.y + b7.h + 16, "", minButtonWidth);
auto lastButton = b8;
int bY = lastButton.y + lastButton.h + 16;
string otherText = part !is null ? otherPartText : otherCloseText;
auto bQuit = new Button(mb, 0, bY, quitText, 8);
auto bOther = new Button(mb, bY, bY, otherText, 8);
bQuit.pressed ~= &quit;
bOther.pressed ~= &other;
mb.repack();
auto center = mb.plane.w / 2;
// Center the children
foreach(c; mb.getChildren) {
c.x = center - c.w/2;
}
// Place the buttons next to each other.
bQuit.x = center - 8 - bQuit.w;
bOther.x = center + 8;
super(r, opts, mb);
setAaText(b1); b1.pressed ~= &aa;
setFogText(b2); b2.pressed ~= &fog;
setShadowText(b3); b3.pressed ~= &shadow;
setNoClipText(b4); b4.pressed ~= &noClip;
setViewText(b5); b5.pressed ~= &view;
setFovText(b6); b6.pressed ~= &fov;
setFullscreenText(b7); b7.pressed ~= &fullscreen;
lastButton.setText("Open textures & screenshots");
lastButton.pressed ~= &openFolder;
}
void quit(Button b) { r.quit(); }
void other(Button b)
{
if (partScene !is null) {
r.deleteMe(partScene);
r.displayClassicMenu();
}
r.deleteMe(this);
}
void view(Button b)
{
auto d = cast(int)opts.viewDistance() * 2;
if (d > 2048)
d = 32;
opts.viewDistance = d;
setViewText(b);
}
void setViewText(Button b)
{
string str;
switch(cast(int)opts.viewDistance()) {
case 32: str = "Distance: Tiny"; break;
case 64: str = "Distance: Short"; break;
case 128: str = "Distance: Medium"; break;
case 256: str = "Distance: Far"; break;
case 512: str = "Distance: Further"; break;
case 1024: str = "Distance: Furthest"; break;
case 2048: str = "Distance: Furthestest"; break;
default: str = "Distance: Unknown"; break;
}
b.setText(str, minButtonWidth);
}
void aa(Button b)
{
opts.aa.toggle();
setAaText(b);
}
void setAaText(Button b)
{
b.setText(opts.aa() ? aaOnText : aaOffText, minButtonWidth);
}
void fov(Button b)
{
int fov = opts.fov();
if (fov < 70)
fov = 70;
else if (fov < 120)
fov = 120;
else
fov = 45;
opts.fov = fov;
setFovText(b);
}
void setFovText(Button b)
{
string str;
switch(opts.fov()) {
case 45: str = "Fov: Charged"; break;
case 70: str = "Fov: Minecraft"; break;
case 120: str = "Fov: Quake Pro"; break;
default: str = "Fov: Custom"; break;
}
b.setText(str, minButtonWidth);
}
void fog(Button b)
{
opts.fog.toggle();
setFogText(b);
}
void setFogText(Button b)
{
b.setText(opts.fog() ? fogOnText : fogOffText, minButtonWidth);
}
void noClip(Button b)
{
opts.noClip.toggle();
setNoClipText(b);
}
void setNoClipText(Button b)
{
b.setText(opts.noClip() ? noClipOnText : noClipOffText, minButtonWidth);
}
void shadow(Button b)
{
opts.shadow.toggle();
setShadowText(b);
}
void setShadowText(Button b)
{
b.setText(opts.shadow() ? shadowOnText : shadowOffText, minButtonWidth);
}
void fullscreen(Button b)
{
auto p = Core().properties;
auto res = p.getBool("fullscreen", Core.defaultFullscreen);
res = !res;
p.add("fullscreen", res);
r.displayInfo("Info", [fullscreenInfoText], "Ok", &r.displayPauseMenu);
r.deleteMe(this);
}
void setFullscreenText(Button b)
{
auto p = Core().properties;
auto r = p.getBool("fullscreen", Core.defaultFullscreen);
b.setText(r ? fullscreenOnText : fullscreenOffText, minButtonWidth);
}
void openFolder(Button b)
{
version(Windows) {
try {
windowsOpenFolder();
} catch (Exception e) {
r.displayError(e, false);
r.deleteMe(this);
}
} else {
r.displayInfo("Sorry", [
"Can't open the settings folder on this platform",
chargeConfigFolder], "Ok", &r.displayPauseMenu);
r.deleteMe(this);
}
}
}
version(Windows)
{
void windowsOpenFolder()
{
bool bRet;
uint uRet;
STARTUPINFO si;
PROCESS_INFORMATION pi;
si.cb = cast(uint)si.sizeof;
auto cmd = "explorer.exe \"" ~ chargeConfigFolder ~ "\"\0";
bRet = CreateProcessA(
null,
cmd.ptr,
null,
null,
false,
0,
null,
null,
&si,
&pi);
if (!bRet)
throw new Exception("Failed to show folder");
scope(exit) {
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
}
struct STARTUPINFO {
uint cb;
void* lpReserved;
void* lpDesktop;
void* lpTitle;
uint dwX;
uint dwY;
uint dwXSize;
uint dwYSize;
uint dwXCountChars;
uint dwYCountChars;
uint dwFillAttribute;
uint dwFlags;
short wShowWindow;
short cbReserved2;
void* lpReserved2;
void* hStdInput;
void* hStdOutput;
void* hStdError;
}
struct PROCESS_INFORMATION {
void* hProcess;
void* hThread;
uint dwProcessId;
uint dwThreadId;
}
extern(System) bool CreateProcessA(
char* lpApplicationName,
char* lpCommandLine,
void* lpProcessAttributes,
void* lpThreadAttributes,
bool bInheritHandles,
uint dwCreationFlags,
void* lpEnvironment,
void* lpCurrentDirectory,
STARTUPINFO* lpStartupInfo,
PROCESS_INFORMATION* lpProcessInformation
);
extern(System) uint WaitForSingleObject(
void* hHandle,
uint dwMilliseconds,
);
extern(System) bool GetExitCodeProcess(
void* hHandle,
uint* lpDword
);
extern(System) bool CloseHandle(
void* hHandle
);
}
|
D
|
module krepel.math.quaternion;
import krepel.math.vector3;
import krepel.math.vector4;
import krepel.math.math;
import krepel.math.matrix4;
@safe:
Quaternion ConcatenateQuaternion(Quaternion Quat1, Quaternion Quat2)
{
return Quaternion(
((Quat1.W * Quat2.X) + (Quat1.X * Quat2.W) + (Quat1.Y * Quat2.Z) - (Quat1.Z * Quat2.Y)),
((Quat1.W * Quat2.Y) + (Quat1.Y * Quat2.W) + (Quat1.Z * Quat2.X) - (Quat1.X * Quat2.Z)),
((Quat1.W * Quat2.Z) + (Quat1.Z * Quat2.W) + (Quat1.X * Quat2.Y) - (Quat1.Y * Quat2.X)),
((Quat1.W * Quat2.W) - (Quat1.X * Quat2.X) - (Quat1.Y * Quat2.Y) - (Quat1.Z * Quat2.Z))
);
}
Quaternion ComponentWiseAddition(Quaternion Quat1, Quaternion Quat2)
{
return Quaternion(
Quat1.X + Quat2.X,
Quat1.Y + Quat2.Y,
Quat1.Z + Quat2.Z,
Quat1.W + Quat2.W
);
}
Quaternion ComponentWiseSubtraction(Quaternion Quat1, Quaternion Quat2)
{
return Quaternion(
Quat1.X - Quat2.X,
Quat1.Y - Quat2.Y,
Quat1.Z - Quat2.Z,
Quat1.W - Quat2.W
);
}
float LengthSquared(Quaternion Quat)
{
return Quat.X * Quat.X + Quat.Y * Quat.Y + Quat.Z * Quat.Z + Quat.W * Quat.W;
}
float Length(Quaternion Quat)
{
return Sqrt(LengthSquared(Quat));
}
Matrix4 ToRotationMatrix(Quaternion Quat)
{
const float X2 = Quat.X + Quat.X;
const float Y2 = Quat.Y + Quat.Y;
const float Z2 = Quat.Z + Quat.Z;
const float XX = Quat.X * X2;
const float XY = Quat.X * Y2;
const float XZ = Quat.X * Z2;
const float YY = Quat.Y * Y2;
const float YZ = Quat.Y * Z2;
const float ZZ = Quat.Z * Z2;
const float WX = Quat.W * X2;
const float WY = Quat.W * Y2;
const float WZ = Quat.W * Z2;
return Matrix4([
[1.0f - (YY + ZZ), XY + WZ, XZ - WY, 0.0f],
[XY - WZ, 1.0f - (XX + ZZ), YZ + WX, 0.0f],
[XZ + WY, YZ - WX, 1.0f - (XX + YY), 0.0f],
[0.0f, 0.0f, 0.0f, 1.0f]
]);
}
Vector3 TransformDirection(Quaternion Quat, Vector3 Direction)
{
const Q = Vector3(Quat.X, Quat.Y, Quat.Z);
const T = 2.0f * Q.Cross(Direction);
return Direction + (Quat.W * T) + Q.Cross(T);
}
/// Rotation of the Vector
/// The W component of the vector will be unchanged
Vector4 TransformDirection(Quaternion Quat, Vector4 Direction)
{
const Q = Vector3(Quat.X, Quat.Y, Quat.Z);
const T = 2.0f * Q.Cross(Direction.XYZ);
return Vector4(Direction.XYZ + (Quat.W * T) + Q.Cross(T), Direction.W);
}
/// Inverse Rotation of the Vector, using the Inverse Quaternion of the given one.
/// E.g. if the Quaternion will rotate your Vector on the Z Axis in Clockwise direction, this operation will rotate
/// the given Vector in Counter-Clockwise Direction
Vector3 InverseTransformDirection(Quaternion Quat, Vector3 Direction)
{
const Q = Vector3(-Quat.X, -Quat.Y, -Quat.Z);
const T = 2.0f * Q.Cross(Direction);
return Direction + (Quat.W * T) + Q.Cross(T);
}
/// Inverse Rotation of the Vector, using the Inverse Quaternion of the given one.
/// E.g. if the Quaternion will rotate your Vector on the Z Axis in Clockwise direction, this operation will rotate
/// the given Vector in Counter-Clockwise Direction
/// The W component of the vector will be unchanged
Vector4 InverseTransformDirection(Quaternion Quat, Vector4 Direction)
{
const Q = Vector3(-Quat.X, -Quat.Y, -Quat.Z);
const T = 2.0f * Q.Cross(Direction.XYZ);
return Vector4(Direction.XYZ + (Quat.W * T) + Q.Cross(T), Direction.W);
}
Quaternion SafeNormalizedCopy(Quaternion Quat, float Epsilon = 1e-4f)
{
Quat.SafeNormalize(Epsilon);
return Quat;
}
Quaternion UnsafeNormalizedCopy(Quaternion Quat)
{
Quat.UnsafeNormalize();
return Quat;
}
bool IsNormalized(Quaternion Quat)
{
return krepel.math.math.NearlyEquals(LengthSquared(Quat),1);
}
float Angle(Quaternion Quat)
{
return ACos(Quat.W) * 2;
}
Vector3 Axis(Quaternion Quat)
{
const float Scale = Sin(Angle(Quat) * 0.5f);
return Vector3(Quat.Data[0..3]) / Scale;
}
bool NearlyEquals(Quaternion Quat1, Quaternion Quat2, float Epsilon = 1e-4f)
{
return
krepel.math.math.NearlyEquals(Quat1.X, Quat2.X, Epsilon) &&
krepel.math.math.NearlyEquals(Quat1.Y, Quat2.Y, Epsilon) &&
krepel.math.math.NearlyEquals(Quat1.Z, Quat2.Z, Epsilon) &&
krepel.math.math.NearlyEquals(Quat1.W, Quat2.W, Epsilon);
}
/// Checks if any of the components of the quaternion is QNaN
bool ContainsNaN(Quaternion Quat)
{
return
krepel.math.math.IsNaN(Quat.X) ||
krepel.math.math.IsNaN(Quat.Y) ||
krepel.math.math.IsNaN(Quat.Z) ||
krepel.math.math.IsNaN(Quat.W);
}
/// Creates an inversed Copy of the Quaternion, which will rotate in the opposite direction.
Quaternion InversedCopy(Quaternion Quat)
{
Quat.Invert();
return Quat;
}
struct Quaternion
{
@safe:
union
{
struct{
float X = 0;
float Y = 0;
float Z = 0;
float W = 1;
}
float[4] Data;
}
this(float[4] Data)
{
this.Data[] = Data[];
}
this(float X, float Y, float Z, float W)
{
this.X = X;
this.Y = Y;
this.Z = Z;
this.W = W;
}
/// Creates a rotation around the given Axis with the given Angle
/// Params:
/// Axis = The Vector which we rotate around, needs NOT be normalized
/// Angle = The amount of rotation in radians
this(Vector3 Axis, float Angle)
{
Axis.SafeNormalize();
W = Cos(Angle * 0.5f);
const float Sinus = Sin(Angle * 0.5f);
X = Sinus * Axis.X;
Y = Sinus * Axis.Y;
Z = Sinus * Axis.Z;
}
void SafeNormalize(float Epsilon = 1e-4f)
{
const float Length = this.Length;
if (Length > Epsilon)
{
X /= Length;
Y /= Length;
Z /= Length;
W /= Length;
}
else
{
this = this.init;
}
}
void UnsafeNormalize()
{
const float Length = this.Length;
X /= Length;
Y /= Length;
Z /= Length;
W /= Length;
}
/// Inverts the quaternion, meaning that it rotates in the opposite direction (using the negative Axis)
/// This will change the direction of the Axis and not the Angle
void Invert()
{
X *= -1;
Y *= -1;
Z *= -1;
}
void opOpAssign(string Operator)(Quaternion Quat)
{
this.Data[] = this.opBinary!(Operator)(Quat).Data[];
}
Quaternion opBinary(string Operator)(Quaternion Quat) const
{
static if(Operator == "*")
{
return ConcatenateQuaternion(this, Quat);
}
else static if(Operator == "+")
{
return ComponentWiseAddition(this, Quat);
}
else static if(Operator == "-")
{
return ComponentWiseSubtraction(this, Quat);
}
else
{
static assert(false, "No operator " ~ Operator ~ " defined");
}
}
Vector3 opBinary(string Operator : "*")(Vector3 Vec) const
{
return TransformDirection(this, Vec);
}
__gshared immutable Identity = Quaternion();
}
/// Default Initialization
unittest
{
Quaternion TestQuat;
assert(TestQuat.X == 0);
assert(TestQuat.Y == 0);
assert(TestQuat.Z == 0);
assert(TestQuat.W == 1);
}
/// Constructors
unittest
{
Quaternion TestQuat = Quaternion(1,2,3,4);
assert(TestQuat.X == 1);
assert(TestQuat.Y == 2);
assert(TestQuat.Z == 3);
assert(TestQuat.W == 4);
TestQuat = Quaternion([1,2,3,4]);
assert(TestQuat.X == 1);
assert(TestQuat.Y == 2);
assert(TestQuat.Z == 3);
assert(TestQuat.W == 4);
}
/// From Axis Angle Creation and Rotation Matrix Conversion
unittest
{
Quaternion RotateCCW = Quaternion(Vector3.UpVector, -PI/2);
Vector3 Result = krepel.math.matrix4.TransformDirection(RotateCCW.ToRotationMatrix(),Vector3(1,0,0));
assert(krepel.math.vector3.NearlyEquals(Result,Vector3(0,-1,0)));
}
/// Quaternion concatenation
unittest
{
Quaternion RotateCCW = Quaternion(Vector3.UpVector, -PI/2);
RotateCCW *= RotateCCW;
Vector3 Result = krepel.math.matrix4.TransformDirection(RotateCCW.ToRotationMatrix(),Vector3(1,0,0));
Vector3 Result2 = RotateCCW.TransformDirection(Vector3(1,0,0));
Vector3 Result3 = RotateCCW * Vector3(1,0,0);
assert(krepel.math.vector3.NearlyEquals(Result,Vector3(-1,0,0)));
assert(krepel.math.vector3.NearlyEquals(Result,Result2));
assert(krepel.math.vector3.NearlyEquals(Result,Result3));
}
/// Inversion
unittest
{
Quaternion RotateCCW = Quaternion(Vector3.UpVector, -PI/2);
Quaternion RotateCW = RotateCCW.InversedCopy();
Vector3 Result = RotateCCW.TransformDirection(Vector3(1,0,0));
assert(krepel.math.vector3.NearlyEquals(Result, Vector3(0,-1,0)));
Vector3 Result2 = RotateCW.TransformDirection(Result);
Vector3 Result3 = RotateCCW.InverseTransformDirection(Result);
assert(krepel.math.vector3.NearlyEquals(Result2, Vector3(1,0,0)));
assert(krepel.math.vector3.NearlyEquals(Result2, Result3));
}
/// Inversion Vec4
unittest
{
Quaternion RotateCCW = Quaternion(Vector3.UpVector, -PI/2);
Quaternion RotateCW = RotateCCW.InversedCopy();
Vector4 Result = RotateCCW.TransformDirection(Vector4(1,0,0,5));
assert(krepel.math.vector4.NearlyEquals(Result, Vector4(0,-1,0,5)));
Vector4 Result2 = RotateCW.TransformDirection(Result);
Vector4 Result3 = RotateCCW.InverseTransformDirection(Result);
assert(krepel.math.vector4.NearlyEquals(Result2, Vector4(1,0,0,5)));
assert(krepel.math.vector4.NearlyEquals(Result2, Result3));
}
/// Axis angle Creation and Getters
unittest
{
Quaternion Quat = Quaternion(Vector3(1,2,3), 2);
assert(krepel.math.math.NearlyEquals(Quat.Angle(),2));
assert(krepel.math.vector3.NearlyEquals(
Quat.Axis(),
krepel.math.vector3.SafeNormalizedCopy(Vector3(1,2,3))));
}
/// Safe Normalization
unittest
{
Quaternion Quat = Quaternion(1,2,3,4);
assert(!Quat.IsNormalized);
Quat.SafeNormalize();
assert(Quat.IsNormalized);
Quat = Quaternion(0,0,0,0);
assert(!Quat.IsNormalized);
Quat.SafeNormalize();
assert(Quat.IsNormalized);
assert(Quat == Quat.Identity);
}
/// Unsafe Normalization NaN Check
unittest
{
Quaternion Quat = Quaternion(1,2,3,4);
assert(!Quat.IsNormalized);
Quat.UnsafeNormalize();
assert(Quat.IsNormalized);
Quat = Quaternion(0,0,0,0);
assert(!Quat.ContainsNaN());
assert(!Quat.IsNormalized);
Quat.UnsafeNormalize();
assert(!Quat.IsNormalized);
assert(Quat != Quat.Identity);
assert(Quat.ContainsNaN);
}
|
D
|
/**
* Droits d’auteur: Enalye
* Licence: Zlib
* Auteur: Enalye
*/
module grimoire.runtime.object;
import grimoire.compiler, grimoire.assembly;
import grimoire.runtime.channel;
import grimoire.runtime.value;
import grimoire.runtime.string;
import grimoire.runtime.list;
/**
Un champ d’un objet. \
On ne peut pas savoir le type du champs durant l’exécution,
il faut donc se référer à sa définition de type.
*/
package final class GrField {
string name;
GrValue value;
}
/// Instance d’une classe
final class GrObject {
package {
/// Référence un parent qui serait un type natif
GrPointer _nativeParent;
/// Champs de l’objet, les index sont connus à la compilation
GrField[] _fields;
/// Init depuis sa définition
this(const GrClassBuilder class_) {
_fields.length = class_.fields.length;
for (size_t index; index < _fields.length; ++index) {
_fields[index] = new GrField;
_fields[index].name = class_.fields[index];
}
}
}
/// Init avec des champs bruts
this(const string[] fields_) {
_fields.length = fields_.length;
for (size_t index; index < _fields.length; ++index) {
_fields[index] = new GrField;
_fields[index].name = fields_[index];
}
}
pragma(inline) T getNativeParent(T)() {
return cast(T) cast(Object) _nativeParent;
}
alias getValue = getField!GrValue;
alias getBool = getField!GrBool;
alias getInt = getField!GrInt;
alias getUInt = getField!GrUInt;
alias getChar = getField!GrChar;
alias getFloat = getField!GrFloat;
alias getPointer = getField!GrPointer;
pragma(inline) T getEnum(T)(const string fieldName) const {
return cast(T) getField!GrInt(fieldName);
}
pragma(inline) GrString getString(const string fieldName) const {
return cast(GrString) getField!GrPointer(fieldName);
}
pragma(inline) GrList getList(const string fieldName) const {
return cast(GrList) getField!GrPointer(fieldName);
}
pragma(inline) GrChannel getChannel(const string fieldName) const {
return cast(GrChannel) getField!GrPointer(fieldName);
}
pragma(inline) GrObject getObject(const string fieldName) const {
return cast(GrObject) getField!GrPointer(fieldName);
}
pragma(inline) T getNative(T)(const string fieldName) const {
// On change en objet d’abord pour éviter un plantage en changeant pour une classe mère
return cast(T) cast(Object) getField!GrPointer(fieldName);
}
pragma(inline) private T getField(T)(const string fieldName) const {
for (size_t index; index < _fields.length; ++index) {
if (_fields[index].name == fieldName) {
static if (is(T == GrValue))
return _fields[index].value;
else static if (is(T == GrInt))
return _fields[index].value.getInt();
else static if (is(T == GrUInt))
return _fields[index].value.getUInt();
else static if (is(T == GrBool))
return _fields[index].value.getBool();
else static if (is(T == GrChar))
return _fields[index].value.getChar();
else static if (is(T == GrFloat))
return _fields[index].value.getFloat();
else static if (is(T == GrPointer))
return _fields[index].value.getPointer();
else
static assert(false, "invalid field type `" ~ T.stringof ~ "`");
}
}
assert(false, "invalid field name `" ~ fieldName ~ "`");
}
alias setValue = setField!GrValue;
alias setBool = setField!GrBool;
alias setInt = setField!GrInt;
alias setUInt = setField!GrUInt;
alias setChar = setField!GrChar;
alias setFloat = setField!GrFloat;
alias setPointer = setField!GrPointer;
pragma(inline) void setEnum(T)(const string fieldName, T value) {
setField!GrInt(fieldName, cast(GrInt) value);
}
pragma(inline) void setString(const string fieldName, string value) {
setField!GrPointer(fieldName, cast(GrPointer) new GrString(value));
}
pragma(inline) void setList(const string fieldName, GrList value) {
setField!GrPointer(fieldName, cast(GrPointer) value);
}
pragma(inline) void setList(const string fieldName, GrValue[] value) {
setField!GrPointer(fieldName, cast(GrPointer) new GrList(value));
}
pragma(inline) void setChannel(const string fieldName, GrChannel value) {
setField!GrPointer(fieldName, cast(GrPointer) value);
}
pragma(inline) void setObject(const string fieldName, GrObject value) {
setField!GrPointer(fieldName, cast(GrPointer) value);
}
pragma(inline) void setNative(T)(const string fieldName, T value) {
setField!GrPointer(fieldName, *cast(GrPointer*)&value);
}
pragma(inline) private T setField(T)(const string fieldName, T value) {
for (size_t index; index < _fields.length; ++index) {
if (_fields[index].name == fieldName) {
static if (is(T == GrValue))
return _fields[index].value = value;
else static if (is(T == GrInt))
return _fields[index].value._intValue = value;
else static if (is(T == GrBool))
return _fields[index].value._intValue = cast(GrInt) value;
else static if (is(T == GrUInt))
return _fields[index].value._uintValue = value;
else static if (is(T == GrChar))
return _fields[index].value._uintValue = cast(GrChar) value;
else static if (is(T == GrFloat))
return _fields[index].value._floatValue = value;
else static if (is(T == GrPointer))
return _fields[index].value._ptrValue = value;
else
static assert(false, "invalid field type `" ~ T.stringof ~ "`");
}
}
assert(false, "invalid field name `" ~ fieldName ~ "`");
}
}
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (c) 1999-2017 by Digital Mars, 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: $(DMDSRC _dsymbol.d)
*/
module ddmd.dsymbol;
import core.stdc.stdarg;
import core.stdc.stdio;
import core.stdc.string;
import core.stdc.stdlib;
import ddmd.aggregate;
import ddmd.aliasthis;
import ddmd.arraytypes;
import ddmd.attrib;
import ddmd.gluelayer;
import ddmd.dclass;
import ddmd.declaration;
import ddmd.denum;
import ddmd.dimport;
import ddmd.dmodule;
import ddmd.dscope;
import ddmd.dstruct;
import ddmd.dtemplate;
import ddmd.errors;
import ddmd.expression;
import ddmd.func;
import ddmd.globals;
import ddmd.id;
import ddmd.identifier;
import ddmd.init;
import ddmd.lexer;
import ddmd.mtype;
import ddmd.nspace;
import ddmd.opover;
import ddmd.root.aav;
import ddmd.root.rmem;
import ddmd.root.rootobject;
import ddmd.root.speller;
import ddmd.statement;
import ddmd.tokens;
import ddmd.visitor;
struct Ungag
{
uint oldgag;
extern (D) this(uint old)
{
this.oldgag = old;
}
extern (C++) ~this()
{
global.gag = oldgag;
}
}
enum PROTKIND : int
{
PROTundefined,
PROTnone, // no access
PROTprivate,
PROTpackage,
PROTprotected,
PROTpublic,
PROTexport,
}
alias PROTundefined = PROTKIND.PROTundefined;
alias PROTnone = PROTKIND.PROTnone;
alias PROTprivate = PROTKIND.PROTprivate;
alias PROTpackage = PROTKIND.PROTpackage;
alias PROTprotected = PROTKIND.PROTprotected;
alias PROTpublic = PROTKIND.PROTpublic;
alias PROTexport = PROTKIND.PROTexport;
struct Prot
{
PROTKIND kind;
Package pkg;
extern (D) this(PROTKIND kind)
{
this.kind = kind;
}
extern (C++):
/**
* Checks if `this` is superset of `other` restrictions.
* For example, "protected" is more restrictive than "public".
*/
bool isMoreRestrictiveThan(const Prot other) const
{
return this.kind < other.kind;
}
/**
* Checks if `this` is absolutely identical protection attribute to `other`
*/
bool opEquals(ref const Prot other) const
{
if (this.kind == other.kind)
{
if (this.kind == PROTpackage)
return this.pkg == other.pkg;
return true;
}
return false;
}
/**
* Checks if parent defines different access restrictions than this one.
*
* Params:
* parent = protection attribute for scope that hosts this one
*
* Returns:
* 'true' if parent is already more restrictive than this one and thus
* no differentiation is needed.
*/
bool isSubsetOf(ref const Prot parent) const
{
if (this.kind != parent.kind)
return false;
if (this.kind == PROTpackage)
{
if (!this.pkg)
return true;
if (!parent.pkg)
return false;
if (parent.pkg.isAncestorPackageOf(this.pkg))
return true;
}
return true;
}
}
enum PASS : int
{
PASSinit, // initial state
PASSsemantic, // semantic() started
PASSsemanticdone, // semantic() done
PASSsemantic2, // semantic2() started
PASSsemantic2done, // semantic2() done
PASSsemantic3, // semantic3() started
PASSsemantic3done, // semantic3() done
PASSinline, // inline started
PASSinlinedone, // inline done
PASSobj, // toObjFile() run
}
alias PASSinit = PASS.PASSinit;
alias PASSsemantic = PASS.PASSsemantic;
alias PASSsemanticdone = PASS.PASSsemanticdone;
alias PASSsemantic2 = PASS.PASSsemantic2;
alias PASSsemantic2done = PASS.PASSsemantic2done;
alias PASSsemantic3 = PASS.PASSsemantic3;
alias PASSsemantic3done = PASS.PASSsemantic3done;
alias PASSinline = PASS.PASSinline;
alias PASSinlinedone = PASS.PASSinlinedone;
alias PASSobj = PASS.PASSobj;
// Search options
enum : int
{
IgnoreNone = 0x00, // default
IgnorePrivateImports = 0x01, // don't search private imports
IgnoreErrors = 0x02, // don't give error messages
IgnoreAmbiguous = 0x04, // return NULL if ambiguous
SearchLocalsOnly = 0x08, // only look at locals (don't search imports)
SearchImportsOnly = 0x10, // only look in imports
SearchUnqualifiedModule = 0x20, // the module scope search is unqualified,
// meaning don't search imports in that scope,
// because qualified module searches search
// their imports
IgnoreSymbolVisibility = 0x80, // also find private and package protected symbols
}
extern (C++) alias Dsymbol_apply_ft_t = int function(Dsymbol, void*);
/***********************************************************
*/
extern (C++) class Dsymbol : RootObject
{
Identifier ident;
Dsymbol parent;
Symbol* csym; // symbol for code generator
Symbol* isym; // import version of csym
const(char)* comment; // documentation comment for this Dsymbol
Loc loc; // where defined
Scope* _scope; // !=null means context to use for semantic()
const(char)* prettystring; // cached value of toPrettyChars()
bool errors; // this symbol failed to pass semantic()
PASS semanticRun;
DeprecatedDeclaration depdecl; // customized deprecation message
UserAttributeDeclaration userAttribDecl; // user defined attributes
// !=null means there's a ddoc unittest associated with this symbol
// (only use this with ddoc)
UnitTestDeclaration ddocUnittest;
final extern (D) this()
{
//printf("Dsymbol::Dsymbol(%p)\n", this);
this.semanticRun = PASSinit;
}
final extern (D) this(Identifier ident)
{
//printf("Dsymbol::Dsymbol(%p, ident)\n", this);
this.ident = ident;
this.semanticRun = PASSinit;
}
static Dsymbol create(Identifier ident)
{
return new Dsymbol(ident);
}
override const(char)* toChars()
{
return ident ? ident.toChars() : "__anonymous";
}
// helper to print fully qualified (template) arguments
const(char)* toPrettyCharsHelper()
{
return toChars();
}
final ref Loc getLoc()
{
if (!loc.filename) // avoid bug 5861.
{
auto m = getModule();
if (m && m.srcfile)
loc.filename = m.srcfile.toChars();
}
return loc;
}
final const(char)* locToChars()
{
return getLoc().toChars();
}
override bool equals(RootObject o)
{
if (this == o)
return true;
Dsymbol s = cast(Dsymbol)o;
// Overload sets don't have an ident
if (s && ident && s.ident && ident.equals(s.ident))
return true;
return false;
}
final bool isAnonymous()
{
return ident is null;
}
final void error(Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
.verror(loc, format, ap, kind(), toPrettyChars());
va_end(ap);
}
final void error(const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
.verror(getLoc(), format, ap, kind(), toPrettyChars());
va_end(ap);
}
final void deprecation(Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
.vdeprecation(loc, format, ap, kind(), toPrettyChars());
va_end(ap);
}
final void deprecation(const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
.vdeprecation(getLoc(), format, ap, kind(), toPrettyChars());
va_end(ap);
}
final void checkDeprecated(Loc loc, Scope* sc)
{
if (global.params.useDeprecated != 1 && isDeprecated())
{
// Don't complain if we're inside a deprecated symbol's scope
for (Dsymbol sp = sc.parent; sp; sp = sp.parent)
{
if (sp.isDeprecated())
goto L1;
}
for (Scope* sc2 = sc; sc2; sc2 = sc2.enclosing)
{
if (sc2.scopesym && sc2.scopesym.isDeprecated())
goto L1;
// If inside a StorageClassDeclaration that is deprecated
if (sc2.stc & STCdeprecated)
goto L1;
}
const(char)* message = null;
for (Dsymbol p = this; p; p = p.parent)
{
message = p.depdecl ? p.depdecl.getMessage() : null;
if (message)
break;
}
if (message)
deprecation(loc, "is deprecated - %s", message);
else
deprecation(loc, "is deprecated");
}
L1:
Declaration d = isDeclaration();
if (d && d.storage_class & STCdisable)
{
if (!(sc.func && sc.func.storage_class & STCdisable))
{
if (d.toParent() && d.isPostBlitDeclaration())
d.toParent().error(loc, "is not copyable because it is annotated with @disable");
else
error(loc, "is not callable because it is annotated with @disable");
}
}
}
/**********************************
* Determine which Module a Dsymbol is in.
*/
final Module getModule()
{
//printf("Dsymbol::getModule()\n");
if (TemplateInstance ti = isInstantiated())
return ti.tempdecl.getModule();
Dsymbol s = this;
while (s)
{
//printf("\ts = %s '%s'\n", s.kind(), s.toPrettyChars());
Module m = s.isModule();
if (m)
return m;
s = s.parent;
}
return null;
}
/**********************************
* Determine which Module a Dsymbol is in, as far as access rights go.
*/
final Module getAccessModule()
{
//printf("Dsymbol::getAccessModule()\n");
if (TemplateInstance ti = isInstantiated())
return ti.tempdecl.getAccessModule();
Dsymbol s = this;
while (s)
{
//printf("\ts = %s '%s'\n", s.kind(), s.toPrettyChars());
Module m = s.isModule();
if (m)
return m;
TemplateInstance ti = s.isTemplateInstance();
if (ti && ti.enclosing)
{
/* Because of local template instantiation, the parent isn't where the access
* rights come from - it's the template declaration
*/
s = ti.tempdecl;
}
else
s = s.parent;
}
return null;
}
final inout(Dsymbol) pastMixin() inout
{
//printf("Dsymbol::pastMixin() %s\n", toChars());
if (!isTemplateMixin())
return this;
if (!parent)
return null;
return parent.pastMixin();
}
/**********************************
* `parent` field returns a lexically enclosing scope symbol this is a member of.
*
* `toParent()` returns a logically enclosing scope symbol this is a member of.
* It skips over TemplateMixin's.
*
* `toParent2()` returns an enclosing scope symbol this is living at runtime.
* It skips over both TemplateInstance's and TemplateMixin's.
* It's used when looking for the 'this' pointer of the enclosing function/class.
*
* Examples:
* module mod;
* template Foo(alias a) { mixin Bar!(); }
* mixin template Bar() {
* public { // ProtDeclaration
* void baz() { a = 2; }
* }
* }
* void test() {
* int v = 1;
* alias foo = Foo!(v);
* foo.baz();
* assert(v == 2);
* }
*
* // s == FuncDeclaration('mod.test.Foo!().Bar!().baz()')
* // s.parent == TemplateMixin('mod.test.Foo!().Bar!()')
* // s.toParent() == TemplateInstance('mod.test.Foo!()')
* // s.toParent2() == FuncDeclaration('mod.test')
*/
final inout(Dsymbol) toParent() inout
{
return parent ? parent.pastMixin() : null;
}
/// ditto
final inout(Dsymbol) toParent2() inout
{
if (!parent || !parent.isTemplateInstance)
return parent;
return parent.toParent2;
}
final inout(TemplateInstance) isInstantiated() inout
{
if (!parent)
return null;
auto ti = parent.isTemplateInstance();
if (ti && !ti.isTemplateMixin())
return ti;
return parent.isInstantiated();
}
// Check if this function is a member of a template which has only been
// instantiated speculatively, eg from inside is(typeof()).
// Return the speculative template instance it is part of,
// or NULL if not speculative.
final inout(TemplateInstance) isSpeculative() inout
{
if (!parent)
return null;
auto ti = parent.isTemplateInstance();
if (ti && ti.gagged)
return ti;
if (!parent.toParent())
return null;
return parent.isSpeculative();
}
final Ungag ungagSpeculative() const
{
uint oldgag = global.gag;
if (global.gag && !isSpeculative() && !toParent2().isFuncDeclaration())
global.gag = 0;
return Ungag(oldgag);
}
// kludge for template.isSymbol()
override final DYNCAST dyncast() const
{
return DYNCAST_DSYMBOL;
}
/*************************************
* Do syntax copy of an array of Dsymbol's.
*/
static Dsymbols* arraySyntaxCopy(Dsymbols* a)
{
Dsymbols* b = null;
if (a)
{
b = a.copy();
for (size_t i = 0; i < b.dim; i++)
{
(*b)[i] = (*b)[i].syntaxCopy(null);
}
}
return b;
}
Identifier getIdent()
{
return ident;
}
const(char)* toPrettyChars(bool QualifyTypes = false)
{
if (prettystring && !QualifyTypes)
return prettystring;
//printf("Dsymbol::toPrettyChars() '%s'\n", toChars());
if (!parent)
{
auto s = toChars();
if (!QualifyTypes)
prettystring = s;
return s;
}
// Computer number of components
size_t complength = 0;
for (Dsymbol p = this; p; p = p.parent)
++complength;
// Allocate temporary array comp[]
alias T = const(char)[];
auto compptr = cast(T*)malloc(complength * T.sizeof);
if (!compptr)
Mem.error();
auto comp = compptr[0 .. complength];
// Fill in comp[] and compute length of final result
size_t length = 0;
int i;
for (Dsymbol p = this; p; p = p.parent)
{
const s = QualifyTypes ? p.toPrettyCharsHelper() : p.toChars();
const len = strlen(s);
comp[i] = s[0 .. len];
++i;
length += len + 1;
}
auto s = cast(char*)mem.xmalloc(length);
auto q = s + length - 1;
*q = 0;
foreach (j; 0 .. complength)
{
const t = comp[j].ptr;
const len = comp[j].length;
q -= len;
memcpy(q, t, len);
if (q == s)
break;
*--q = '.';
}
free(comp.ptr);
if (!QualifyTypes)
prettystring = s;
return s;
}
const(char)* kind() const
{
return "symbol";
}
/*********************************
* If this symbol is really an alias for another,
* return that other.
* If needed, semantic() is invoked due to resolve forward reference.
*/
Dsymbol toAlias()
{
return this;
}
/*********************************
* Resolve recursive tuple expansion in eponymous template.
*/
Dsymbol toAlias2()
{
return toAlias();
}
/*********************************
* Iterate this dsymbol or members of this scoped dsymbol, then
* call `fp` with the found symbol and `param`.
* Params:
* fp = function pointer to process the iterated symbol.
* If it returns nonzero, the iteration will be aborted.
* param = a parameter passed to fp.
* Returns:
* nonzero if the iteration is aborted by the return value of fp,
* or 0 if it's completed.
*/
int apply(Dsymbol_apply_ft_t fp, void* param)
{
return (*fp)(this, param);
}
void addMember(Scope* sc, ScopeDsymbol sds)
{
//printf("Dsymbol::addMember('%s')\n", toChars());
//printf("Dsymbol::addMember(this = %p, '%s' scopesym = '%s')\n", this, toChars(), sds.toChars());
//printf("Dsymbol::addMember(this = %p, '%s' sds = %p, sds.symtab = %p)\n", this, toChars(), sds, sds.symtab);
parent = sds;
if (!isAnonymous()) // no name, so can't add it to symbol table
{
if (!sds.symtabInsert(this)) // if name is already defined
{
Dsymbol s2 = sds.symtab.lookup(ident);
if (!s2.overloadInsert(this))
{
sds.multiplyDefined(Loc(), this, s2);
errors = true;
}
}
if (sds.isAggregateDeclaration() || sds.isEnumDeclaration())
{
if (ident == Id.__sizeof || ident == Id.__xalignof || ident == Id._mangleof)
{
error(".%s property cannot be redefined", ident.toChars());
errors = true;
}
}
}
}
/*************************************
* Set scope for future semantic analysis so we can
* deal better with forward references.
*/
void setScope(Scope* sc)
{
//printf("Dsymbol::setScope() %p %s, %p stc = %llx\n", this, toChars(), sc, sc.stc);
if (!sc.nofree)
sc.setNoFree(); // may need it even after semantic() finishes
_scope = sc;
if (sc.depdecl)
depdecl = sc.depdecl;
if (!userAttribDecl)
userAttribDecl = sc.userAttribDecl;
}
void importAll(Scope* sc)
{
}
/*************************************
* Does semantic analysis on the public face of declarations.
*/
void semantic(Scope* sc)
{
error("%p has no semantic routine", this);
}
/*************************************
* Does semantic analysis on initializers and members of aggregates.
*/
void semantic2(Scope* sc)
{
// Most Dsymbols have no further semantic analysis needed
}
/*************************************
* Does semantic analysis on function bodies.
*/
void semantic3(Scope* sc)
{
// Most Dsymbols have no further semantic analysis needed
}
/*********************************************
* Search for ident as member of s.
* Params:
* loc = location to print for error messages
* ident = identifier to search for
* flags = IgnoreXXXX
* Returns:
* null if not found
*/
Dsymbol search(Loc loc, Identifier ident, int flags = IgnoreNone)
{
//printf("Dsymbol::search(this=%p,%s, ident='%s')\n", this, toChars(), ident.toChars());
return null;
}
final Dsymbol search_correct(Identifier ident)
{
/***************************************************
* Search for symbol with correct spelling.
*/
extern (D) void* symbol_search_fp(const(char)* seed, ref int cost)
{
/* If not in the lexer's string table, it certainly isn't in the symbol table.
* Doing this first is a lot faster.
*/
size_t len = strlen(seed);
if (!len)
return null;
Identifier id = Identifier.lookup(seed, len);
if (!id)
return null;
cost = 0;
Dsymbol s = this;
Module.clearCache();
return cast(void*)s.search(Loc(), id, IgnoreErrors);
}
if (global.gag)
return null; // don't do it for speculative compiles; too time consuming
return cast(Dsymbol)speller(ident.toChars(), &symbol_search_fp, idchars);
}
/***************************************
* Search for identifier id as a member of 'this'.
* id may be a template instance.
* Returns:
* symbol found, NULL if not
*/
final Dsymbol searchX(Loc loc, Scope* sc, RootObject id)
{
//printf("Dsymbol::searchX(this=%p,%s, ident='%s')\n", this, toChars(), ident.toChars());
Dsymbol s = toAlias();
Dsymbol sm;
if (Declaration d = s.isDeclaration())
{
if (d.inuse)
{
.error(loc, "circular reference to '%s'", d.toPrettyChars());
return null;
}
}
switch (id.dyncast())
{
case DYNCAST_IDENTIFIER:
sm = s.search(loc, cast(Identifier)id);
break;
case DYNCAST_DSYMBOL:
{
// It's a template instance
//printf("\ttemplate instance id\n");
Dsymbol st = cast(Dsymbol)id;
TemplateInstance ti = st.isTemplateInstance();
sm = s.search(loc, ti.name);
if (!sm)
{
sm = s.search_correct(ti.name);
if (sm)
.error(loc, "template identifier '%s' is not a member of %s '%s', did you mean %s '%s'?", ti.name.toChars(), s.kind(), s.toPrettyChars(), sm.kind(), sm.toChars());
else
.error(loc, "template identifier '%s' is not a member of %s '%s'", ti.name.toChars(), s.kind(), s.toPrettyChars());
return null;
}
sm = sm.toAlias();
TemplateDeclaration td = sm.isTemplateDeclaration();
if (!td)
{
.error(loc, "%s.%s is not a template, it is a %s", s.toPrettyChars(), ti.name.toChars(), sm.kind());
return null;
}
ti.tempdecl = td;
if (!ti.semanticRun)
ti.semantic(sc);
sm = ti.toAlias();
break;
}
case DYNCAST_TYPE:
case DYNCAST_EXPRESSION:
default:
assert(0);
}
return sm;
}
bool overloadInsert(Dsymbol s)
{
//printf("Dsymbol::overloadInsert('%s')\n", s.toChars());
return false;
}
/*********************************
* Returns:
* SIZE_INVALID when the size cannot be determined
*/
d_uns64 size(Loc loc)
{
error("Dsymbol '%s' has no size", toChars());
return SIZE_INVALID;
}
bool isforwardRef()
{
return false;
}
// is a 'this' required to access the member
AggregateDeclaration isThis()
{
return null;
}
// is Dsymbol exported?
bool isExport()
{
return false;
}
// is Dsymbol imported?
bool isImportedSymbol()
{
return false;
}
// is Dsymbol deprecated?
bool isDeprecated()
{
return false;
}
bool isOverloadable()
{
return false;
}
// is this a LabelDsymbol()?
LabelDsymbol isLabel()
{
return null;
}
/// Returns an AggregateDeclaration when toParent() is that.
final AggregateDeclaration isMember()
{
//printf("Dsymbol::isMember() %s\n", toChars());
auto p = toParent();
//printf("parent is %s %s\n", p.kind(), p.toChars());
return p ? p.isAggregateDeclaration() : null;
}
/// Returns an AggregateDeclaration when toParent2() is that.
final AggregateDeclaration isMember2()
{
//printf("Dsymbol::isMember2() '%s'\n", toChars());
auto p = toParent2();
//printf("parent is %s %s\n", p.kind(), p.toChars());
return p ? p.isAggregateDeclaration() : null;
}
// is this a member of a ClassDeclaration?
final ClassDeclaration isClassMember()
{
auto ad = isMember();
return ad ? ad.isClassDeclaration() : null;
}
// is this a type?
Type getType()
{
return null;
}
// need a 'this' pointer?
bool needThis()
{
return false;
}
/*************************************
*/
Prot prot()
{
return Prot(PROTpublic);
}
/**************************************
* Copy the syntax.
* Used for template instantiations.
* If s is NULL, allocate the new object, otherwise fill it in.
*/
Dsymbol syntaxCopy(Dsymbol s)
{
print();
printf("%s %s\n", kind(), toChars());
assert(0);
}
/**************************************
* Determine if this symbol is only one.
* Returns:
* false, *ps = NULL: There are 2 or more symbols
* true, *ps = NULL: There are zero symbols
* true, *ps = symbol: The one and only one symbol
*/
bool oneMember(Dsymbol* ps, Identifier ident)
{
//printf("Dsymbol::oneMember()\n");
*ps = this;
return true;
}
/*****************************************
* Same as Dsymbol::oneMember(), but look at an array of Dsymbols.
*/
static bool oneMembers(Dsymbols* members, Dsymbol* ps, Identifier ident)
{
//printf("Dsymbol::oneMembers() %d\n", members ? members.dim : 0);
Dsymbol s = null;
if (members)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol sx = (*members)[i];
bool x = sx.oneMember(ps, ident);
//printf("\t[%d] kind %s = %d, s = %p\n", i, sx.kind(), x, *ps);
if (!x)
{
//printf("\tfalse 1\n");
assert(*ps is null);
return false;
}
if (*ps)
{
assert(ident);
if (!(*ps).ident || !(*ps).ident.equals(ident))
continue;
if (!s)
s = *ps;
else if (s.isOverloadable() && (*ps).isOverloadable())
{
// keep head of overload set
FuncDeclaration f1 = s.isFuncDeclaration();
FuncDeclaration f2 = (*ps).isFuncDeclaration();
if (f1 && f2)
{
assert(!f1.isFuncAliasDeclaration());
assert(!f2.isFuncAliasDeclaration());
for (; f1 != f2; f1 = f1.overnext0)
{
if (f1.overnext0 is null)
{
f1.overnext0 = f2;
break;
}
}
}
}
else // more than one symbol
{
*ps = null;
//printf("\tfalse 2\n");
return false;
}
}
}
}
*ps = s; // s is the one symbol, null if none
//printf("\ttrue\n");
return true;
}
void setFieldOffset(AggregateDeclaration ad, uint* poffset, bool isunion)
{
}
/*****************************************
* Is Dsymbol a variable that contains pointers?
*/
bool hasPointers()
{
//printf("Dsymbol::hasPointers() %s\n", toChars());
return false;
}
bool hasStaticCtorOrDtor()
{
//printf("Dsymbol::hasStaticCtorOrDtor() %s\n", toChars());
return false;
}
void addLocalClass(ClassDeclarations*)
{
}
void checkCtorConstInit()
{
}
/****************************************
* Add documentation comment to Dsymbol.
* Ignore NULL comments.
*/
void addComment(const(char)* comment)
{
//if (comment)
// printf("adding comment '%s' to symbol %p '%s'\n", comment, this, toChars());
if (!this.comment)
this.comment = comment;
else if (comment && strcmp(cast(char*)comment, cast(char*)this.comment) != 0)
{
// Concatenate the two
this.comment = Lexer.combineComments(this.comment, comment, true);
}
}
/****************************************
* Returns true if this symbol is defined in a non-root module without instantiation.
*/
final bool inNonRoot()
{
Dsymbol s = parent;
for (; s; s = s.toParent())
{
if (auto ti = s.isTemplateInstance())
{
return false;
}
if (auto m = s.isModule())
{
if (!m.isRoot())
return true;
break;
}
}
return false;
}
// Eliminate need for dynamic_cast
inout(Package) isPackage() inout
{
return null;
}
inout(Module) isModule() inout
{
return null;
}
inout(EnumMember) isEnumMember() inout
{
return null;
}
inout(TemplateDeclaration) isTemplateDeclaration() inout
{
return null;
}
inout(TemplateInstance) isTemplateInstance() inout
{
return null;
}
inout(TemplateMixin) isTemplateMixin() inout
{
return null;
}
inout(Nspace) isNspace() inout
{
return null;
}
inout(Declaration) isDeclaration() inout
{
return null;
}
inout(ThisDeclaration) isThisDeclaration() inout
{
return null;
}
inout(TypeInfoDeclaration) isTypeInfoDeclaration() inout
{
return null;
}
inout(TupleDeclaration) isTupleDeclaration() inout
{
return null;
}
inout(AliasDeclaration) isAliasDeclaration() inout
{
return null;
}
inout(AggregateDeclaration) isAggregateDeclaration() inout
{
return null;
}
inout(FuncDeclaration) isFuncDeclaration() inout
{
return null;
}
inout(FuncAliasDeclaration) isFuncAliasDeclaration() inout
{
return null;
}
inout(OverDeclaration) isOverDeclaration() inout
{
return null;
}
inout(FuncLiteralDeclaration) isFuncLiteralDeclaration() inout
{
return null;
}
inout(CtorDeclaration) isCtorDeclaration() inout
{
return null;
}
inout(PostBlitDeclaration) isPostBlitDeclaration() inout
{
return null;
}
inout(DtorDeclaration) isDtorDeclaration() inout
{
return null;
}
inout(StaticCtorDeclaration) isStaticCtorDeclaration() inout
{
return null;
}
inout(StaticDtorDeclaration) isStaticDtorDeclaration() inout
{
return null;
}
inout(SharedStaticCtorDeclaration) isSharedStaticCtorDeclaration() inout
{
return null;
}
inout(SharedStaticDtorDeclaration) isSharedStaticDtorDeclaration() inout
{
return null;
}
inout(InvariantDeclaration) isInvariantDeclaration() inout
{
return null;
}
inout(UnitTestDeclaration) isUnitTestDeclaration() inout
{
return null;
}
inout(NewDeclaration) isNewDeclaration() inout
{
return null;
}
inout(VarDeclaration) isVarDeclaration() inout
{
return null;
}
inout(ClassDeclaration) isClassDeclaration() inout
{
return null;
}
inout(StructDeclaration) isStructDeclaration() inout
{
return null;
}
inout(UnionDeclaration) isUnionDeclaration() inout
{
return null;
}
inout(InterfaceDeclaration) isInterfaceDeclaration() inout
{
return null;
}
inout(ScopeDsymbol) isScopeDsymbol() inout
{
return null;
}
inout(WithScopeSymbol) isWithScopeSymbol() inout
{
return null;
}
inout(ArrayScopeSymbol) isArrayScopeSymbol() inout
{
return null;
}
inout(Import) isImport() inout
{
return null;
}
inout(EnumDeclaration) isEnumDeclaration() inout
{
return null;
}
inout(DeleteDeclaration) isDeleteDeclaration() inout
{
return null;
}
inout(SymbolDeclaration) isSymbolDeclaration() inout
{
return null;
}
inout(AttribDeclaration) isAttribDeclaration() inout
{
return null;
}
inout(AnonDeclaration) isAnonDeclaration() inout
{
return null;
}
inout(OverloadSet) isOverloadSet() inout
{
return null;
}
/************
*/
void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Dsymbol that generates a scope
*/
extern (C++) class ScopeDsymbol : Dsymbol
{
Dsymbols* members; // all Dsymbol's in this scope
DsymbolTable symtab; // members[] sorted into table
uint endlinnum; // the linnumber of the statement after the scope (0 if unknown)
private:
/// symbols whose members have been imported, i.e. imported modules and template mixins
Dsymbols* importedScopes;
PROTKIND* prots; // array of PROTKIND, one for each import
import ddmd.root.array : BitArray;
BitArray accessiblePackages, privateAccessiblePackages;// whitelists of accessible (imported) packages
public:
final extern (D) this()
{
}
final extern (D) this(Identifier id)
{
super(id);
}
override Dsymbol syntaxCopy(Dsymbol s)
{
//printf("ScopeDsymbol::syntaxCopy('%s')\n", toChars());
ScopeDsymbol sds = s ? cast(ScopeDsymbol)s : new ScopeDsymbol(ident);
sds.members = arraySyntaxCopy(members);
sds.endlinnum = endlinnum;
return sds;
}
/*****************************************
* This function is #1 on the list of functions that eat cpu time.
* Be very, very careful about slowing it down.
*/
override Dsymbol search(Loc loc, Identifier ident, int flags = SearchLocalsOnly)
{
//printf("%s.ScopeDsymbol::search(ident='%s', flags=x%x)\n", toChars(), ident.toChars(), flags);
//if (strcmp(ident.toChars(),"c") == 0) *(char*)0=0;
// Look in symbols declared in this module
if (symtab && !(flags & SearchImportsOnly))
{
//printf(" look in locals\n");
auto s1 = symtab.lookup(ident);
if (s1)
{
//printf("\tfound in locals = '%s.%s'\n",toChars(),s1.toChars());
return s1;
}
}
//printf(" not found in locals\n");
// Look in imported scopes
if (importedScopes)
{
//printf(" look in imports\n");
Dsymbol s = null;
OverloadSet a = null;
// Look in imported modules
for (size_t i = 0; i < importedScopes.dim; i++)
{
// If private import, don't search it
if ((flags & IgnorePrivateImports) && prots[i] == PROTprivate)
continue;
int sflags = flags & (IgnoreErrors | IgnoreAmbiguous | IgnoreSymbolVisibility); // remember these in recursive searches
Dsymbol ss = (*importedScopes)[i];
//printf("\tscanning import '%s', prots = %d, isModule = %p, isImport = %p\n", ss.toChars(), prots[i], ss.isModule(), ss.isImport());
if (ss.isModule())
{
if (flags & SearchLocalsOnly)
continue;
}
else // mixin template
{
if (flags & SearchImportsOnly)
continue;
// compatibility with -transition=import (Bugzilla 15925)
// SearchLocalsOnly should always get set for new lookup rules
sflags |= (flags & SearchLocalsOnly);
}
/* Don't find private members if ss is a module
*/
Dsymbol s2 = ss.search(loc, ident, sflags | (ss.isModule() ? IgnorePrivateImports : IgnoreNone));
import ddmd.access : symbolIsVisible;
if (!s2 || !(flags & IgnoreSymbolVisibility) && !symbolIsVisible(this, s2))
continue;
if (!s)
{
s = s2;
if (s && s.isOverloadSet())
a = mergeOverloadSet(ident, a, s);
}
else if (s2 && s != s2)
{
if (s.toAlias() == s2.toAlias() || s.getType() == s2.getType() && s.getType())
{
/* After following aliases, we found the same
* symbol, so it's not an ambiguity. But if one
* alias is deprecated or less accessible, prefer
* the other.
*/
if (s.isDeprecated() || s.prot().isMoreRestrictiveThan(s2.prot()) && s2.prot().kind != PROTnone)
s = s2;
}
else
{
/* Two imports of the same module should be regarded as
* the same.
*/
Import i1 = s.isImport();
Import i2 = s2.isImport();
if (!(i1 && i2 && (i1.mod == i2.mod || (!i1.parent.isImport() && !i2.parent.isImport() && i1.ident.equals(i2.ident)))))
{
/* Bugzilla 8668:
* Public selective import adds AliasDeclaration in module.
* To make an overload set, resolve aliases in here and
* get actual overload roots which accessible via s and s2.
*/
s = s.toAlias();
s2 = s2.toAlias();
/* If both s2 and s are overloadable (though we only
* need to check s once)
*/
if ((s2.isOverloadSet() || s2.isOverloadable()) && (a || s.isOverloadable()))
{
a = mergeOverloadSet(ident, a, s2);
continue;
}
if (flags & IgnoreAmbiguous) // if return NULL on ambiguity
return null;
if (!(flags & IgnoreErrors))
ScopeDsymbol.multiplyDefined(loc, s, s2);
break;
}
}
}
}
if (s)
{
/* Build special symbol if we had multiple finds
*/
if (a)
{
if (!s.isOverloadSet())
a = mergeOverloadSet(ident, a, s);
s = a;
}
// TODO: remove once private symbol visibility has been deprecated
if (!(flags & IgnoreErrors) && s.prot().kind == PROTprivate &&
!s.isOverloadable() && !s.parent.isTemplateMixin() && !s.parent.isNspace())
{
AliasDeclaration ad = void;
// accessing private selective and renamed imports is
// deprecated by restricting the symbol visibility
if (s.isImport() || (ad = s.isAliasDeclaration()) !is null && ad._import !is null)
{}
else
error(loc, "%s %s is private", s.kind(), s.toPrettyChars());
}
//printf("\tfound in imports %s.%s\n", toChars(), s.toChars());
return s;
}
//printf(" not found in imports\n");
}
return null;
}
final OverloadSet mergeOverloadSet(Identifier ident, OverloadSet os, Dsymbol s)
{
if (!os)
{
os = new OverloadSet(ident);
os.parent = this;
}
if (OverloadSet os2 = s.isOverloadSet())
{
// Merge the cross-module overload set 'os2' into 'os'
if (os.a.dim == 0)
{
os.a.setDim(os2.a.dim);
memcpy(os.a.tdata(), os2.a.tdata(), (os.a[0]).sizeof * os2.a.dim);
}
else
{
for (size_t i = 0; i < os2.a.dim; i++)
{
os = mergeOverloadSet(ident, os, os2.a[i]);
}
}
}
else
{
assert(s.isOverloadable());
/* Don't add to os[] if s is alias of previous sym
*/
for (size_t j = 0; j < os.a.dim; j++)
{
Dsymbol s2 = os.a[j];
if (s.toAlias() == s2.toAlias())
{
if (s2.isDeprecated() || (s2.prot().isMoreRestrictiveThan(s.prot()) && s.prot().kind != PROTnone))
{
os.a[j] = s;
}
goto Lcontinue;
}
}
os.push(s);
Lcontinue:
}
return os;
}
final void importScope(Dsymbol s, Prot protection)
{
//printf("%s.ScopeDsymbol::importScope(%s, %d)\n", toChars(), s.toChars(), protection);
// No circular or redundant import's
if (s != this)
{
if (!importedScopes)
importedScopes = new Dsymbols();
else
{
for (size_t i = 0; i < importedScopes.dim; i++)
{
Dsymbol ss = (*importedScopes)[i];
if (ss == s) // if already imported
{
if (protection.kind > prots[i])
prots[i] = protection.kind; // upgrade access
return;
}
}
}
importedScopes.push(s);
prots = cast(PROTKIND*)mem.xrealloc(prots, importedScopes.dim * (prots[0]).sizeof);
prots[importedScopes.dim - 1] = protection.kind;
}
}
final void addAccessiblePackage(Package p, Prot protection)
{
auto pary = protection.kind == PROTprivate ? &privateAccessiblePackages : &accessiblePackages;
if (pary.length <= p.tag)
pary.length = p.tag + 1;
(*pary)[p.tag] = true;
}
bool isPackageAccessible(Package p, Prot protection, int flags = 0)
{
if (p.tag < accessiblePackages.length && accessiblePackages[p.tag] ||
protection.kind == PROTprivate && p.tag < privateAccessiblePackages.length && privateAccessiblePackages[p.tag])
return true;
foreach (i, ss; importedScopes ? (*importedScopes)[] : null)
{
// only search visible scopes && imported modules should ignore private imports
if (protection.kind <= prots[i] &&
ss.isScopeDsymbol.isPackageAccessible(p, protection, IgnorePrivateImports))
return true;
}
return false;
}
override final bool isforwardRef()
{
return (members is null);
}
static void multiplyDefined(Loc loc, Dsymbol s1, Dsymbol s2)
{
version (none)
{
printf("ScopeDsymbol::multiplyDefined()\n");
printf("s1 = %p, '%s' kind = '%s', parent = %s\n", s1, s1.toChars(), s1.kind(), s1.parent ? s1.parent.toChars() : "");
printf("s2 = %p, '%s' kind = '%s', parent = %s\n", s2, s2.toChars(), s2.kind(), s2.parent ? s2.parent.toChars() : "");
}
if (loc.filename)
{
.error(loc, "%s at %s conflicts with %s at %s", s1.toPrettyChars(), s1.locToChars(), s2.toPrettyChars(), s2.locToChars());
}
else
{
s1.error(s1.loc, "conflicts with %s %s at %s", s2.kind(), s2.toPrettyChars(), s2.locToChars());
}
}
override const(char)* kind() const
{
return "ScopeDsymbol";
}
/*******************************************
* Look for member of the form:
* const(MemberInfo)[] getMembers(string);
* Returns NULL if not found
*/
final FuncDeclaration findGetMembers()
{
Dsymbol s = search_function(this, Id.getmembers);
FuncDeclaration fdx = s ? s.isFuncDeclaration() : null;
version (none)
{
// Finish
static __gshared TypeFunction tfgetmembers;
if (!tfgetmembers)
{
Scope sc;
auto parameters = new Parameters();
Parameters* p = new Parameter(STCin, Type.tchar.constOf().arrayOf(), null, null);
parameters.push(p);
Type tret = null;
tfgetmembers = new TypeFunction(parameters, tret, 0, LINKd);
tfgetmembers = cast(TypeFunction)tfgetmembers.semantic(Loc(), &sc);
}
if (fdx)
fdx = fdx.overloadExactMatch(tfgetmembers);
}
if (fdx && fdx.isVirtual())
fdx = null;
return fdx;
}
Dsymbol symtabInsert(Dsymbol s)
{
return symtab.insert(s);
}
/****************************************
* Return true if any of the members are static ctors or static dtors, or if
* any members have members that are.
*/
override bool hasStaticCtorOrDtor()
{
if (members)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol member = (*members)[i];
if (member.hasStaticCtorOrDtor())
return true;
}
}
return false;
}
/***************************************
* Determine number of Dsymbols, folding in AttribDeclaration members.
*/
static size_t dim(Dsymbols* members)
{
size_t n = 0;
int dimDg(size_t idx, Dsymbol s)
{
++n;
return 0;
}
_foreach(null, members, &dimDg, &n);
return n;
}
/***************************************
* Get nth Dsymbol, folding in AttribDeclaration members.
* Returns:
* Dsymbol* nth Dsymbol
* NULL not found, *pn gets incremented by the number
* of Dsymbols
*/
static Dsymbol getNth(Dsymbols* members, size_t nth, size_t* pn = null)
{
Dsymbol sym = null;
int getNthSymbolDg(size_t n, Dsymbol s)
{
if (n == nth)
{
sym = s;
return 1;
}
return 0;
}
int res = _foreach(null, members, &getNthSymbolDg);
return res ? sym : null;
}
extern (D) alias ForeachDg = int delegate(size_t idx, Dsymbol s);
/***************************************
* Expands attribute declarations in members in depth first
* order. Calls dg(size_t symidx, Dsymbol *sym) for each
* member.
* If dg returns !=0, stops and returns that value else returns 0.
* Use this function to avoid the O(N + N^2/2) complexity of
* calculating dim and calling N times getNth.
* Returns:
* last value returned by dg()
*/
extern (D) static int _foreach(Scope* sc, Dsymbols* members, scope ForeachDg dg, size_t* pn = null)
{
assert(dg);
if (!members)
return 0;
size_t n = pn ? *pn : 0; // take over index
int result = 0;
foreach (size_t i; 0 .. members.dim)
{
Dsymbol s = (*members)[i];
if (AttribDeclaration a = s.isAttribDeclaration())
result = _foreach(sc, a.include(sc, null), dg, &n);
else if (TemplateMixin tm = s.isTemplateMixin())
result = _foreach(sc, tm.members, dg, &n);
else if (s.isTemplateInstance())
{
}
else if (s.isUnitTestDeclaration())
{
}
else
result = dg(n++, s);
if (result)
break;
}
if (pn)
*pn = n; // update index
return result;
}
override final inout(ScopeDsymbol) isScopeDsymbol() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* With statement scope
*/
extern (C++) final class WithScopeSymbol : ScopeDsymbol
{
WithStatement withstate;
extern (D) this(WithStatement withstate)
{
this.withstate = withstate;
}
override Dsymbol search(Loc loc, Identifier ident, int flags = SearchLocalsOnly)
{
//printf("WithScopeSymbol.search(%s)\n", ident.toChars());
if (flags & SearchImportsOnly)
return null;
// Acts as proxy to the with class declaration
Dsymbol s = null;
Expression eold = null;
for (Expression e = withstate.exp; e != eold; e = resolveAliasThis(_scope, e))
{
if (e.op == TOKscope)
{
s = (cast(ScopeExp)e).sds;
}
else if (e.op == TOKtype)
{
s = e.type.toDsymbol(null);
}
else
{
Type t = e.type.toBasetype();
s = t.toDsymbol(null);
}
if (s)
{
s = s.search(loc, ident, flags);
if (s)
return s;
}
eold = e;
}
return null;
}
override inout(WithScopeSymbol) isWithScopeSymbol() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Array Index/Slice scope
*/
extern (C++) final class ArrayScopeSymbol : ScopeDsymbol
{
Expression exp; // IndexExp or SliceExp
TypeTuple type; // for tuple[length]
TupleDeclaration td; // for tuples of objects
Scope* sc;
extern (D) this(Scope* sc, Expression e)
{
assert(e.op == TOKindex || e.op == TOKslice || e.op == TOKarray);
exp = e;
this.sc = sc;
}
extern (D) this(Scope* sc, TypeTuple t)
{
type = t;
this.sc = sc;
}
extern (D) this(Scope* sc, TupleDeclaration s)
{
td = s;
this.sc = sc;
}
override Dsymbol search(Loc loc, Identifier ident, int flags = IgnoreNone)
{
//printf("ArrayScopeSymbol::search('%s', flags = %d)\n", ident.toChars(), flags);
if (ident == Id.dollar)
{
VarDeclaration* pvar;
Expression ce;
L1:
if (td)
{
/* $ gives the number of elements in the tuple
*/
auto v = new VarDeclaration(loc, Type.tsize_t, Id.dollar, null);
Expression e = new IntegerExp(Loc(), td.objects.dim, Type.tsize_t);
v._init = new ExpInitializer(Loc(), e);
v.storage_class |= STCtemp | STCstatic | STCconst;
v.semantic(sc);
return v;
}
if (type)
{
/* $ gives the number of type entries in the type tuple
*/
auto v = new VarDeclaration(loc, Type.tsize_t, Id.dollar, null);
Expression e = new IntegerExp(Loc(), type.arguments.dim, Type.tsize_t);
v._init = new ExpInitializer(Loc(), e);
v.storage_class |= STCtemp | STCstatic | STCconst;
v.semantic(sc);
return v;
}
if (exp.op == TOKindex)
{
/* array[index] where index is some function of $
*/
IndexExp ie = cast(IndexExp)exp;
pvar = &ie.lengthVar;
ce = ie.e1;
}
else if (exp.op == TOKslice)
{
/* array[lwr .. upr] where lwr or upr is some function of $
*/
SliceExp se = cast(SliceExp)exp;
pvar = &se.lengthVar;
ce = se.e1;
}
else if (exp.op == TOKarray)
{
/* array[e0, e1, e2, e3] where e0, e1, e2 are some function of $
* $ is a opDollar!(dim)() where dim is the dimension(0,1,2,...)
*/
ArrayExp ae = cast(ArrayExp)exp;
pvar = &ae.lengthVar;
ce = ae.e1;
}
else
{
/* Didn't find $, look in enclosing scope(s).
*/
return null;
}
while (ce.op == TOKcomma)
ce = (cast(CommaExp)ce).e2;
/* If we are indexing into an array that is really a type
* tuple, rewrite this as an index into a type tuple and
* try again.
*/
if (ce.op == TOKtype)
{
Type t = (cast(TypeExp)ce).type;
if (t.ty == Ttuple)
{
type = cast(TypeTuple)t;
goto L1;
}
}
/* *pvar is lazily initialized, so if we refer to $
* multiple times, it gets set only once.
*/
if (!*pvar) // if not already initialized
{
/* Create variable v and set it to the value of $
*/
VarDeclaration v;
Type t;
if (ce.op == TOKtuple)
{
/* It is for an expression tuple, so the
* length will be a const.
*/
Expression e = new IntegerExp(Loc(), (cast(TupleExp)ce).exps.dim, Type.tsize_t);
v = new VarDeclaration(loc, Type.tsize_t, Id.dollar, new ExpInitializer(Loc(), e));
v.storage_class |= STCtemp | STCstatic | STCconst;
}
else if (ce.type && (t = ce.type.toBasetype()) !is null && (t.ty == Tstruct || t.ty == Tclass))
{
// Look for opDollar
assert(exp.op == TOKarray || exp.op == TOKslice);
AggregateDeclaration ad = isAggregate(t);
assert(ad);
Dsymbol s = ad.search(loc, Id.opDollar);
if (!s) // no dollar exists -- search in higher scope
return null;
s = s.toAlias();
Expression e = null;
// Check for multi-dimensional opDollar(dim) template.
if (TemplateDeclaration td = s.isTemplateDeclaration())
{
dinteger_t dim = 0;
if (exp.op == TOKarray)
{
dim = (cast(ArrayExp)exp).currentDimension;
}
else if (exp.op == TOKslice)
{
dim = 0; // slices are currently always one-dimensional
}
else
{
assert(0);
}
auto tiargs = new Objects();
Expression edim = new IntegerExp(Loc(), dim, Type.tsize_t);
edim = edim.semantic(sc);
tiargs.push(edim);
e = new DotTemplateInstanceExp(loc, ce, td.ident, tiargs);
}
else
{
/* opDollar exists, but it's not a template.
* This is acceptable ONLY for single-dimension indexing.
* Note that it's impossible to have both template & function opDollar,
* because both take no arguments.
*/
if (exp.op == TOKarray && (cast(ArrayExp)exp).arguments.dim != 1)
{
exp.error("%s only defines opDollar for one dimension", ad.toChars());
return null;
}
Declaration d = s.isDeclaration();
assert(d);
e = new DotVarExp(loc, ce, d);
}
e = e.semantic(sc);
if (!e.type)
exp.error("%s has no value", e.toChars());
t = e.type.toBasetype();
if (t && t.ty == Tfunction)
e = new CallExp(e.loc, e);
v = new VarDeclaration(loc, null, Id.dollar, new ExpInitializer(Loc(), e));
v.storage_class |= STCtemp | STCctfe | STCrvalue;
}
else
{
/* For arrays, $ will either be a compile-time constant
* (in which case its value in set during constant-folding),
* or a variable (in which case an expression is created in
* toir.c).
*/
auto e = new VoidInitializer(Loc());
e.type = Type.tsize_t;
v = new VarDeclaration(loc, Type.tsize_t, Id.dollar, e);
v.storage_class |= STCtemp | STCctfe; // it's never a true static variable
}
*pvar = v;
}
(*pvar).semantic(sc);
return (*pvar);
}
return null;
}
override inout(ArrayScopeSymbol) isArrayScopeSymbol() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Overload Sets
*/
extern (C++) final class OverloadSet : Dsymbol
{
Dsymbols a; // array of Dsymbols
extern (D) this(Identifier ident, OverloadSet os = null)
{
super(ident);
if (os)
{
for (size_t i = 0; i < os.a.dim; i++)
a.push(os.a[i]);
}
}
void push(Dsymbol s)
{
a.push(s);
}
override inout(OverloadSet) isOverloadSet() inout
{
return this;
}
override const(char)* kind() const
{
return "overloadset";
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Table of Dsymbol's
*/
extern (C++) final class DsymbolTable : RootObject
{
AA* tab;
// Look up Identifier. Return Dsymbol if found, NULL if not.
Dsymbol lookup(const Identifier ident)
{
//printf("DsymbolTable::lookup(%s)\n", (char*)ident.string);
return cast(Dsymbol)dmd_aaGetRvalue(tab, cast(void*)ident);
}
// Insert Dsymbol in table. Return NULL if already there.
Dsymbol insert(Dsymbol s)
{
//printf("DsymbolTable::insert(this = %p, '%s')\n", this, s.ident.toChars());
const ident = s.ident;
Dsymbol* ps = cast(Dsymbol*)dmd_aaGet(&tab, cast(void*)ident);
if (*ps)
return null; // already in table
*ps = s;
return s;
}
// Look for Dsymbol in table. If there, return it. If not, insert s and return that.
Dsymbol update(Dsymbol s)
{
const ident = s.ident;
Dsymbol* ps = cast(Dsymbol*)dmd_aaGet(&tab, cast(void*)ident);
*ps = s;
return s;
}
// when ident and s are not the same
Dsymbol insert(const Identifier ident, Dsymbol s)
{
//printf("DsymbolTable::insert()\n");
Dsymbol* ps = cast(Dsymbol*)dmd_aaGet(&tab, cast(void*)ident);
if (*ps)
return null; // already in table
*ps = s;
return s;
}
/*****
* Returns:
* number of symbols in symbol table
*/
uint len() const pure
{
return cast(uint)dmd_aaLen(tab);
}
}
|
D
|
/**
Memory pool with destructors, useful for scoped allocators.
Copyright: © 2012-2013 RejectedSoftware e.K.
© 2014-2015 Etienne Cimon
License: Subject to the terms of the MIT license.
Authors: Sönke Ludwig, Etienne Cimon
*/
module memutils.pool;
import memutils.allocators;
import std.conv : emplace;
import std.algorithm : min, max;
import memutils.vector;
final class PoolAllocator(Base : Allocator)
{
public int id = -1; // intrusive ID used for ScopedPools
static align(8) struct Pool { Pool* next; void[] data; void[] remaining; }
private {
Allocator m_baseAllocator;
Pool* m_freePools;
Pool* m_fullPools;
Vector!(void delegate()) m_destructors;
int m_pools;
}
public size_t m_poolSize;
this(size_t pool_size = 64*1024)
{
m_poolSize = pool_size;
m_baseAllocator = getAllocator!Base();
}
void[] alloc(size_t sz)
{
auto aligned_sz = alignedSize(sz);
Pool* pprev = null;
Pool* p = cast(Pool*)m_freePools;
size_t i;
while(i < m_pools && p && p.remaining.length < aligned_sz ) {
pprev = p;
p = p.next;
i++;
}
if( !p || p.remaining.length == 0 || p.remaining.length < aligned_sz ) {
auto pmem = m_baseAllocator.alloc(AllocSize!Pool);
p = emplace!Pool(pmem);
p.data = m_baseAllocator.alloc(max(aligned_sz, m_poolSize));
p.remaining = p.data;
p.next = cast(Pool*)m_freePools;
m_freePools = p;
m_pools++;
pprev = null;
}
logTrace("0 .. ", aligned_sz, " but remaining: ", p.remaining.length);
auto ret = p.remaining[0 .. aligned_sz];
logTrace("p.remaining: ", aligned_sz, " .. ", p.remaining.length);
p.remaining = p.remaining[aligned_sz .. $];
if( !p.remaining.length ){
if( pprev ) {
pprev.next = p.next;
} else {
m_freePools = p.next;
}
p.next = cast(Pool*)m_fullPools;
m_fullPools = p;
}
//logDebug("PoolAllocator ", id, " allocated ", sz, " with ", totalSize());
return ret[0 .. sz];
}
void[] realloc(void[] arr, size_t newsize)
{
auto aligned_sz = alignedSize(arr.length);
auto aligned_newsz = alignedSize(newsize);
logTrace("realloc: ", arr.ptr, " sz ", arr.length, " aligned: ", aligned_sz, " => ", newsize, " aligned: ", aligned_newsz);
if( aligned_newsz <= aligned_sz ) return arr.ptr[0 .. newsize];
auto pool = m_freePools;
bool last_in_pool = pool && arr.ptr+aligned_sz == pool.remaining.ptr;
if( last_in_pool && pool.remaining.length+aligned_sz >= aligned_newsz ) {
pool.remaining = pool.remaining[aligned_newsz-aligned_sz .. $];
arr = arr.ptr[0 .. aligned_newsz];
assert(arr.ptr+arr.length == pool.remaining.ptr, "Last block does not align with the remaining space!?");
return arr[0 .. newsize];
} else {
auto ret = alloc(newsize);
assert(ret.ptr >= arr.ptr+aligned_sz || ret.ptr+ret.length <= arr.ptr, "New block overlaps old one!?");
ret[0 .. min(arr.length, newsize)] = arr[0 .. min(arr.length, newsize)];
return ret;
}
}
void free(void[] mem)
{
}
void freeAll()
{
//logDebug("Destroying ", totalSize(), " of data, allocated: ", allocatedSize());
// destroy all initialized objects
foreach_reverse (ref dtor; m_destructors[])
dtor();
destroy(m_destructors);
size_t i;
// put all full Pools into the free pools list
for (Pool* p = cast(Pool*)m_fullPools, pnext; p && i < m_pools; (p = pnext), i++) {
pnext = p.next;
p.next = cast(Pool*)m_freePools;
m_freePools = cast(Pool*)p;
}
i=0;
// free up all pools
for (Pool* p = cast(Pool*)m_freePools; p && i < m_pools; (p = p.next), i++) {
p.remaining = p.data;
}
}
void reset()
{
//logDebug("Reset()");
freeAll();
Pool* pnext;
size_t i;
for (auto p = cast(Pool*)m_freePools; p && i < m_pools; (p = pnext), i++) {
pnext = p.next;
m_baseAllocator.free(p.data);
m_baseAllocator.free((cast(void*)p)[0 .. AllocSize!Pool]);
}
m_freePools = null;
}
package void onDestroy(void delegate() dtor) {
m_destructors ~= dtor;
}
package void removeArrayDtors(void delegate() last_dtor, size_t n) {
bool found;
foreach_reverse(i, ref el; m_destructors[]) {
if (el == last_dtor)
{
Vector!(void delegate()) arr;
if (n >= i)
arr ~= m_destructors[0 .. i-n+1];
if (i != m_destructors.length - 1)
arr ~= m_destructors[i+1 .. $];
m_destructors[] = arr[];
found = true;
break;
}
}
assert(found);
}
@property size_t totalSize()
{
size_t amt = 0;
size_t i;
for (auto p = m_fullPools; p && i < m_pools; (p = p.next), i++)
amt += p.data.length;
i=0;
for (auto p = m_freePools; p && i < m_pools; (p = p.next), i++)
amt += p.data.length;
return amt;
}
@property size_t allocatedSize()
{
size_t amt = 0;
size_t i;
for (auto p = m_fullPools; p && i < m_pools; (p = p.next), i++)
amt += p.data.length;
i = 0;
for (auto p = m_freePools; p && i < m_pools; (p = p.next), i++)
amt += p.data.length - p.remaining.length;
return amt;
}
~this() { reset(); }
}
|
D
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module SWIGTYPE_p_CreateFunction;
static import vtkd_im;
class SWIGTYPE_p_CreateFunction {
private void* swigCPtr;
public this(void* cObject, bool futureUse) {
swigCPtr = cObject;
}
protected this() {
swigCPtr = null;
}
public static void* swigGetCPtr(SWIGTYPE_p_CreateFunction obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
}
|
D
|
module items.weapons.ratClaw;
import items.weapons.weapon;
import types.damage;
import items.weapons.attack;
class RatClaw : Weapon
{
this()
{
damage = 1;
attacks = [swipe];
}
}
public Attack swipe = {name: "swipe", damageModifier: 1, damageType: DamageTypes.slash};
|
D
|
/**
* The read/write mutex module provides a primitive for maintaining shared read
* access and mutually exclusive write access.
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Sean Kelly
* Source: $(DRUNTIMESRC core/sync/_rwmutex.d)
*/
/* 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.sync.rwmutex;
public import core.sync.exception;
private import core.sync.condition;
private import core.sync.mutex;
private import core.memory;
version (Posix)
{
private import core.sys.posix.pthread;
}
////////////////////////////////////////////////////////////////////////////////
// ReadWriteMutex
//
// Reader reader();
// Writer writer();
////////////////////////////////////////////////////////////////////////////////
/**
* This class represents a mutex that allows any number of readers to enter,
* but when a writer enters, all other readers and writers are blocked.
*
* Please note that this mutex is not recursive and is intended to guard access
* to data only. Also, no deadlock checking is in place because doing so would
* require dynamic memory allocation, which would reduce performance by an
* unacceptable amount. As a result, any attempt to recursively acquire this
* mutex may well deadlock the caller, particularly if a write lock is acquired
* while holding a read lock, or vice-versa. In practice, this should not be
* an issue however, because it is uncommon to call deeply into unknown code
* while holding a lock that simply protects data.
*/
class ReadWriteMutex
{
/**
* Defines the policy used by this mutex. Currently, two policies are
* defined.
*
* The first will queue writers until no readers hold the mutex, then
* pass the writers through one at a time. If a reader acquires the mutex
* while there are still writers queued, the reader will take precedence.
*
* The second will queue readers if there are any writers queued. Writers
* are passed through one at a time, and once there are no writers present,
* all queued readers will be alerted.
*
* Future policies may offer a more even balance between reader and writer
* precedence.
*/
enum Policy
{
PREFER_READERS, /// Readers get preference. This may starve writers.
PREFER_WRITERS /// Writers get preference. This may starve readers.
}
////////////////////////////////////////////////////////////////////////////
// Initialization
////////////////////////////////////////////////////////////////////////////
/**
* Initializes a read/write mutex object with the supplied policy.
*
* Params:
* policy = The policy to use.
*
* Throws:
* SyncError on error.
*/
this( Policy policy = Policy.PREFER_WRITERS )
{
m_commonMutex = new Mutex;
if ( !m_commonMutex )
throw new SyncError( "Unable to initialize mutex" );
m_readerQueue = new Condition( m_commonMutex );
if ( !m_readerQueue )
throw new SyncError( "Unable to initialize mutex" );
m_writerQueue = new Condition( m_commonMutex );
if ( !m_writerQueue )
throw new SyncError( "Unable to initialize mutex" );
m_policy = policy;
m_reader = new Reader;
m_writer = new Writer;
}
////////////////////////////////////////////////////////////////////////////
// General Properties
////////////////////////////////////////////////////////////////////////////
/**
* Gets the policy used by this mutex.
*
* Returns:
* The policy used by this mutex.
*/
@property Policy policy()
{
return m_policy;
}
////////////////////////////////////////////////////////////////////////////
// Reader/Writer Handles
////////////////////////////////////////////////////////////////////////////
/**
* Gets an object representing the reader lock for the associated mutex.
*
* Returns:
* A reader sub-mutex.
*/
@property Reader reader()
{
return m_reader;
}
/**
* Gets an object representing the writer lock for the associated mutex.
*
* Returns:
* A writer sub-mutex.
*/
@property Writer writer()
{
return m_writer;
}
////////////////////////////////////////////////////////////////////////////
// Reader
////////////////////////////////////////////////////////////////////////////
/**
* This class can be considered a mutex in its own right, and is used to
* negotiate a read lock for the enclosing mutex.
*/
class Reader :
Object.Monitor
{
/**
* Initializes a read/write mutex reader proxy object.
*/
this()
{
m_proxy.link = this;
this.__monitor = &m_proxy;
}
/**
* Acquires a read lock on the enclosing mutex.
*/
@trusted void lock()
{
synchronized( m_commonMutex )
{
++m_numQueuedReaders;
scope(exit) --m_numQueuedReaders;
while ( shouldQueueReader )
m_readerQueue.wait();
++m_numActiveReaders;
}
}
/**
* Releases a read lock on the enclosing mutex.
*/
@trusted void unlock()
{
synchronized( m_commonMutex )
{
if ( --m_numActiveReaders < 1 )
{
if ( m_numQueuedWriters > 0 )
m_writerQueue.notify();
}
}
}
/**
* Attempts to acquire a read lock on the enclosing mutex. If one can
* be obtained without blocking, the lock is acquired and true is
* returned. If not, the lock is not acquired and false is returned.
*
* Returns:
* true if the lock was acquired and false if not.
*/
bool tryLock()
{
synchronized( m_commonMutex )
{
if ( shouldQueueReader )
return false;
++m_numActiveReaders;
return true;
}
}
/**
* Attempts to acquire a read lock on the enclosing mutex. If one can
* be obtained without blocking, the lock is acquired and true is
* returned. If not, the function blocks until either the lock can be
* obtained or the time elapsed exceeds $(D_PARAM timeout), returning
* true if the lock was acquired and false if the function timed out.
*
* Params:
* timeout = maximum amount of time to wait for the lock
* Returns:
* true if the lock was acquired and false if not.
*/
bool tryLock(Duration timeout)
{
const initialTime = MonoTime.currTime;
synchronized( m_commonMutex )
{
++m_numQueuedReaders;
scope(exit) --m_numQueuedReaders;
while (shouldQueueReader)
{
const timeElapsed = MonoTime.currTime - initialTime;
if (timeElapsed >= timeout)
return false;
auto nextWait = timeout - timeElapsed;
// Avoid problems calling wait(Duration) with huge arguments.
enum maxWaitPerCall = dur!"hours"(24 * 365);
m_readerQueue.wait(nextWait < maxWaitPerCall ? nextWait : maxWaitPerCall);
}
++m_numActiveReaders;
return true;
}
}
private:
@property bool shouldQueueReader()
{
if ( m_numActiveWriters > 0 )
return true;
switch ( m_policy )
{
case Policy.PREFER_WRITERS:
return m_numQueuedWriters > 0;
case Policy.PREFER_READERS:
default:
break;
}
return false;
}
struct MonitorProxy
{
Object.Monitor link;
}
MonitorProxy m_proxy;
}
////////////////////////////////////////////////////////////////////////////
// Writer
////////////////////////////////////////////////////////////////////////////
/**
* This class can be considered a mutex in its own right, and is used to
* negotiate a write lock for the enclosing mutex.
*/
class Writer :
Object.Monitor
{
/**
* Initializes a read/write mutex writer proxy object.
*/
this()
{
m_proxy.link = this;
this.__monitor = &m_proxy;
}
/**
* Acquires a write lock on the enclosing mutex.
*/
@trusted void lock()
{
synchronized( m_commonMutex )
{
++m_numQueuedWriters;
scope(exit) --m_numQueuedWriters;
while ( shouldQueueWriter )
m_writerQueue.wait();
++m_numActiveWriters;
}
}
/**
* Releases a write lock on the enclosing mutex.
*/
@trusted void unlock()
{
synchronized( m_commonMutex )
{
if ( --m_numActiveWriters < 1 )
{
switch ( m_policy )
{
default:
case Policy.PREFER_READERS:
if ( m_numQueuedReaders > 0 )
m_readerQueue.notifyAll();
else if ( m_numQueuedWriters > 0 )
m_writerQueue.notify();
break;
case Policy.PREFER_WRITERS:
if ( m_numQueuedWriters > 0 )
m_writerQueue.notify();
else if ( m_numQueuedReaders > 0 )
m_readerQueue.notifyAll();
}
}
}
}
/**
* Attempts to acquire a write lock on the enclosing mutex. If one can
* be obtained without blocking, the lock is acquired and true is
* returned. If not, the lock is not acquired and false is returned.
*
* Returns:
* true if the lock was acquired and false if not.
*/
bool tryLock()
{
synchronized( m_commonMutex )
{
if ( shouldQueueWriter )
return false;
++m_numActiveWriters;
return true;
}
}
/**
* Attempts to acquire a write lock on the enclosing mutex. If one can
* be obtained without blocking, the lock is acquired and true is
* returned. If not, the function blocks until either the lock can be
* obtained or the time elapsed exceeds $(D_PARAM timeout), returning
* true if the lock was acquired and false if the function timed out.
*
* Params:
* timeout = maximum amount of time to wait for the lock
* Returns:
* true if the lock was acquired and false if not.
*/
bool tryLock(Duration timeout)
{
const initialTime = MonoTime.currTime;
synchronized( m_commonMutex )
{
++m_numQueuedWriters;
scope(exit) --m_numQueuedWriters;
while (shouldQueueWriter)
{
const timeElapsed = MonoTime.currTime - initialTime;
if (timeElapsed >= timeout)
return false;
auto nextWait = timeout - timeElapsed;
// Avoid problems calling wait(Duration) with huge arguments.
enum maxWaitPerCall = dur!"hours"(24 * 365);
m_writerQueue.wait(nextWait < maxWaitPerCall ? nextWait : maxWaitPerCall);
}
++m_numActiveWriters;
return true;
}
}
private:
@property bool shouldQueueWriter()
{
if ( m_numActiveWriters > 0 ||
m_numActiveReaders > 0 )
return true;
switch ( m_policy )
{
case Policy.PREFER_READERS:
return m_numQueuedReaders > 0;
case Policy.PREFER_WRITERS:
default:
break;
}
return false;
}
struct MonitorProxy
{
Object.Monitor link;
}
MonitorProxy m_proxy;
}
private:
Policy m_policy;
Reader m_reader;
Writer m_writer;
Mutex m_commonMutex;
Condition m_readerQueue;
Condition m_writerQueue;
int m_numQueuedReaders;
int m_numActiveReaders;
int m_numQueuedWriters;
int m_numActiveWriters;
}
////////////////////////////////////////////////////////////////////////////////
// Unit Tests
////////////////////////////////////////////////////////////////////////////////
unittest
{
import core.atomic, core.thread, core.sync.semaphore;
static void runTest(ReadWriteMutex.Policy policy)
{
scope mutex = new ReadWriteMutex(policy);
scope rdSemA = new Semaphore, rdSemB = new Semaphore,
wrSemA = new Semaphore, wrSemB = new Semaphore;
shared size_t numReaders, numWriters;
void readerFn()
{
synchronized (mutex.reader)
{
atomicOp!"+="(numReaders, 1);
rdSemA.notify();
rdSemB.wait();
atomicOp!"-="(numReaders, 1);
}
}
void writerFn()
{
synchronized (mutex.writer)
{
atomicOp!"+="(numWriters, 1);
wrSemA.notify();
wrSemB.wait();
atomicOp!"-="(numWriters, 1);
}
}
void waitQueued(size_t queuedReaders, size_t queuedWriters)
{
for (;;)
{
synchronized (mutex.m_commonMutex)
{
if (mutex.m_numQueuedReaders == queuedReaders &&
mutex.m_numQueuedWriters == queuedWriters)
break;
}
Thread.yield();
}
}
scope group = new ThreadGroup;
// 2 simultaneous readers
group.create(&readerFn); group.create(&readerFn);
rdSemA.wait(); rdSemA.wait();
assert(numReaders == 2);
rdSemB.notify(); rdSemB.notify();
group.joinAll();
assert(numReaders == 0);
foreach (t; group) group.remove(t);
// 1 writer at a time
group.create(&writerFn); group.create(&writerFn);
wrSemA.wait();
assert(!wrSemA.tryWait());
assert(numWriters == 1);
wrSemB.notify();
wrSemA.wait();
assert(numWriters == 1);
wrSemB.notify();
group.joinAll();
assert(numWriters == 0);
foreach (t; group) group.remove(t);
// reader and writer are mutually exclusive
group.create(&readerFn);
rdSemA.wait();
group.create(&writerFn);
waitQueued(0, 1);
assert(!wrSemA.tryWait());
assert(numReaders == 1 && numWriters == 0);
rdSemB.notify();
wrSemA.wait();
assert(numReaders == 0 && numWriters == 1);
wrSemB.notify();
group.joinAll();
assert(numReaders == 0 && numWriters == 0);
foreach (t; group) group.remove(t);
// writer and reader are mutually exclusive
group.create(&writerFn);
wrSemA.wait();
group.create(&readerFn);
waitQueued(1, 0);
assert(!rdSemA.tryWait());
assert(numReaders == 0 && numWriters == 1);
wrSemB.notify();
rdSemA.wait();
assert(numReaders == 1 && numWriters == 0);
rdSemB.notify();
group.joinAll();
assert(numReaders == 0 && numWriters == 0);
foreach (t; group) group.remove(t);
// policy determines whether queued reader or writers progress first
group.create(&writerFn);
wrSemA.wait();
group.create(&readerFn);
group.create(&writerFn);
waitQueued(1, 1);
assert(numReaders == 0 && numWriters == 1);
wrSemB.notify();
if (policy == ReadWriteMutex.Policy.PREFER_READERS)
{
rdSemA.wait();
assert(numReaders == 1 && numWriters == 0);
rdSemB.notify();
wrSemA.wait();
assert(numReaders == 0 && numWriters == 1);
wrSemB.notify();
}
else if (policy == ReadWriteMutex.Policy.PREFER_WRITERS)
{
wrSemA.wait();
assert(numReaders == 0 && numWriters == 1);
wrSemB.notify();
rdSemA.wait();
assert(numReaders == 1 && numWriters == 0);
rdSemB.notify();
}
group.joinAll();
assert(numReaders == 0 && numWriters == 0);
foreach (t; group) group.remove(t);
}
runTest(ReadWriteMutex.Policy.PREFER_READERS);
runTest(ReadWriteMutex.Policy.PREFER_WRITERS);
}
unittest
{
import core.atomic, core.thread;
__gshared ReadWriteMutex rwmutex;
shared static bool threadTriedOnceToGetLock;
shared static bool threadFinallyGotLock;
rwmutex = new ReadWriteMutex();
atomicFence;
const maxTimeAllowedForTest = dur!"seconds"(20);
// Test ReadWriteMutex.Reader.tryLock(Duration).
{
static void testReaderTryLock()
{
assert(!rwmutex.reader.tryLock(Duration.min));
threadTriedOnceToGetLock.atomicStore(true);
assert(rwmutex.reader.tryLock(Duration.max));
threadFinallyGotLock.atomicStore(true);
rwmutex.reader.unlock;
}
assert(rwmutex.writer.tryLock(Duration.zero), "should have been able to obtain lock without blocking");
auto otherThread = new Thread(&testReaderTryLock).start;
const failIfThisTimeisReached = MonoTime.currTime + maxTimeAllowedForTest;
Thread.yield;
// We started otherThread with the writer lock held so otherThread's
// first rwlock.reader.tryLock with timeout Duration.min should fail.
while (!threadTriedOnceToGetLock.atomicLoad)
{
assert(MonoTime.currTime < failIfThisTimeisReached, "timed out");
Thread.yield;
}
rwmutex.writer.unlock;
// Soon after we release the writer lock otherThread's second
// rwlock.reader.tryLock with timeout Duration.max should succeed.
while (!threadFinallyGotLock.atomicLoad)
{
assert(MonoTime.currTime < failIfThisTimeisReached, "timed out");
Thread.yield;
}
otherThread.join;
}
threadTriedOnceToGetLock.atomicStore(false); // Reset.
threadFinallyGotLock.atomicStore(false); // Reset.
// Test ReadWriteMutex.Writer.tryLock(Duration).
{
static void testWriterTryLock()
{
assert(!rwmutex.writer.tryLock(Duration.min));
threadTriedOnceToGetLock.atomicStore(true);
assert(rwmutex.writer.tryLock(Duration.max));
threadFinallyGotLock.atomicStore(true);
rwmutex.writer.unlock;
}
assert(rwmutex.reader.tryLock(Duration.zero), "should have been able to obtain lock without blocking");
auto otherThread = new Thread(&testWriterTryLock).start;
const failIfThisTimeisReached = MonoTime.currTime + maxTimeAllowedForTest;
Thread.yield;
// We started otherThread with the reader lock held so otherThread's
// first rwlock.writer.tryLock with timeout Duration.min should fail.
while (!threadTriedOnceToGetLock.atomicLoad)
{
assert(MonoTime.currTime < failIfThisTimeisReached, "timed out");
Thread.yield;
}
rwmutex.reader.unlock;
// Soon after we release the reader lock otherThread's second
// rwlock.writer.tryLock with timeout Duration.max should succeed.
while (!threadFinallyGotLock.atomicLoad)
{
assert(MonoTime.currTime < failIfThisTimeisReached, "timed out");
Thread.yield;
}
otherThread.join;
}
}
|
D
|
module java.lang.reflect.Field;
import java.lang;
import java.lang.Class;
import java.lang.String;
class Field {
public override equals_t opEquals(Object obj){
implMissing(__FILE__,__LINE__);
return false;
}
Object get(Object obj){
implMissing(__FILE__,__LINE__);
return null;
}
bool getBoolean(Object obj){
implMissing(__FILE__,__LINE__);
return false;
}
byte getByte(Object obj){
implMissing(__FILE__,__LINE__);
return 0;
}
char getChar(Object obj){
implMissing(__FILE__,__LINE__);
return 0;
}
Class getDeclaringClass(){
implMissing(__FILE__,__LINE__);
return null;
}
double getDouble(Object obj){
implMissing(__FILE__,__LINE__);
return 0;
}
float getFloat(Object obj){
implMissing(__FILE__,__LINE__);
return 0;
}
int getInt(Object obj){
implMissing(__FILE__,__LINE__);
return 0;
}
long getLong(Object obj){
implMissing(__FILE__,__LINE__);
return 0;
}
int getModifiers(){
implMissing(__FILE__,__LINE__);
return 0;
}
String getName(){
implMissing(__FILE__,__LINE__);
return null;
}
short getShort(Object obj){
implMissing(__FILE__,__LINE__);
return 0;
}
Class getType(){
implMissing(__FILE__,__LINE__);
return null;
}
public override hash_t toHash(){
implMissingSafe(__FILE__,__LINE__);
return 0;
}
void set(Object obj, Object value){
implMissing(__FILE__,__LINE__);
}
void setBoolean(Object obj, bool z){
implMissing(__FILE__,__LINE__);
}
void setByte(Object obj, byte b){
implMissing(__FILE__,__LINE__);
}
void setChar(Object obj, char c){
implMissing(__FILE__,__LINE__);
}
void setDouble(Object obj, double d){
implMissing(__FILE__,__LINE__);
}
void setFloat(Object obj, float f){
implMissing(__FILE__,__LINE__);
}
void setInt(Object obj, int i){
implMissing(__FILE__,__LINE__);
}
void setLong(Object obj, long l){
implMissing(__FILE__,__LINE__);
}
void setShort(Object obj, short s){
implMissing(__FILE__,__LINE__);
}
public override String toString(){
implMissing(__FILE__,__LINE__);
return null;
}
}
|
D
|
/Users/mac/Desktop/诵诗/诵诗/DerivedData/诵诗/Build/Intermediates/诵诗.build/Debug-iphonesimulator/诵诗.build/Objects-normal/x86_64/explainViewController.o : /Users/mac/Desktop/诵诗/诵诗/诵诗/explainViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/LevelsViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/singleViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/ViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/AppDelegate.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/GuideViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/mac/Desktop/诵诗/诵诗/SQLiteBridge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk/usr/include/SQLite3.h /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/SwiftOnoneSupport.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/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/QuartzCore.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
/Users/mac/Desktop/诵诗/诵诗/DerivedData/诵诗/Build/Intermediates/诵诗.build/Debug-iphonesimulator/诵诗.build/Objects-normal/x86_64/explainViewController~partial.swiftmodule : /Users/mac/Desktop/诵诗/诵诗/诵诗/explainViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/LevelsViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/singleViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/ViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/AppDelegate.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/GuideViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/mac/Desktop/诵诗/诵诗/SQLiteBridge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk/usr/include/SQLite3.h /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/SwiftOnoneSupport.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/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/QuartzCore.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
/Users/mac/Desktop/诵诗/诵诗/DerivedData/诵诗/Build/Intermediates/诵诗.build/Debug-iphonesimulator/诵诗.build/Objects-normal/x86_64/explainViewController~partial.swiftdoc : /Users/mac/Desktop/诵诗/诵诗/诵诗/explainViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/LevelsViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/singleViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/ViewController.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/AppDelegate.swift /Users/mac/Desktop/诵诗/诵诗/诵诗/GuideViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/mac/Desktop/诵诗/诵诗/SQLiteBridge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk/usr/include/SQLite3.h /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/SwiftOnoneSupport.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/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/QuartzCore.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
|
D
|
/**
* Code generation 3
*
* Includes:
* - generating a function prolog (pushing return address, loading paramters)
* - generating a function epilog (restoring registers, returning)
* - generation / peephole optimizations of jump / branch instructions
*
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1994-1998 by Symantec
* Copyright (C) 2000-2021 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/cod3.d, backend/cod3.d)
* Documentation: https://dlang.org/phobos/dmd_backend_cod3.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/backend/cod3.d
*/
module dmd.backend.cod3;
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.cgcse;
import dmd.backend.code;
import dmd.backend.code_x86;
import dmd.backend.codebuilder;
import dmd.backend.dlist;
import dmd.backend.dvec;
import dmd.backend.melf;
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.outbuf;
import dmd.backend.rtlsym;
import dmd.backend.symtab;
import dmd.backend.ty;
import dmd.backend.type;
import dmd.backend.xmm;
version (SCPP)
{
import parser;
import precomp;
}
extern (C++):
nothrow:
@safe:
version (MARS)
enum MARS = true;
else
enum MARS = false;
int REGSIZE();
extern __gshared CGstate cgstate;
extern __gshared ubyte[FLMAX] segfl;
extern __gshared bool[FLMAX] stackfl, flinsymtab;
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); }
extern __gshared targ_size_t retsize;
enum JMPJMPTABLE = false; // benchmarking shows it's slower
enum MINLL = 0x8000_0000_0000_0000L;
enum MAXLL = 0x7FFF_FFFF_FFFF_FFFFL;
/*************
* Size in bytes of each instruction.
* 0 means illegal instruction.
* bit M: if there is a modregrm field (EV1 is reserved for modregrm)
* bit T: if there is a second operand (EV2)
* bit E: if second operand is only 8 bits
* bit A: a short version exists for the AX reg
* bit R: a short version exists for regs
* bits 2..0: size of instruction (excluding optional bytes)
*/
enum
{
M = 0x80,
T = 0x40,
E = 0x20,
A = 0x10,
R = 0x08,
W = 0,
}
private __gshared ubyte[256] inssize =
[ M|2,M|2,M|2,M|2, T|E|2,T|3,1,1, /* 00 */
M|2,M|2,M|2,M|2, T|E|2,T|3,1,1, /* 08 */
M|2,M|2,M|2,M|2, T|E|2,T|3,1,1, /* 10 */
M|2,M|2,M|2,M|2, T|E|2,T|3,1,1, /* 18 */
M|2,M|2,M|2,M|2, T|E|2,T|3,1,1, /* 20 */
M|2,M|2,M|2,M|2, T|E|2,T|3,1,1, /* 28 */
M|2,M|2,M|2,M|2, T|E|2,T|3,1,1, /* 30 */
M|2,M|2,M|2,M|2, T|E|2,T|3,1,1, /* 38 */
1,1,1,1, 1,1,1,1, /* 40 */
1,1,1,1, 1,1,1,1, /* 48 */
1,1,1,1, 1,1,1,1, /* 50 */
1,1,1,1, 1,1,1,1, /* 58 */
1,1,M|2,M|2, 1,1,1,1, /* 60 */
T|3,M|T|4,T|E|2,M|T|E|3, 1,1,1,1, /* 68 */
T|E|2,T|E|2,T|E|2,T|E|2, T|E|2,T|E|2,T|E|2,T|E|2, /* 70 */
T|E|2,T|E|2,T|E|2,T|E|2, T|E|2,T|E|2,T|E|2,T|E|2, /* 78 */
M|T|E|A|3,M|T|A|4,M|T|E|3,M|T|E|3, M|2,M|2,M|2,M|A|R|2, /* 80 */
M|A|2,M|A|2,M|A|2,M|A|2, M|2,M|2,M|2,M|R|2, /* 88 */
1,1,1,1, 1,1,1,1, /* 90 */
1,1,T|5,1, 1,1,1,1, /* 98 */
// cod3_set32() patches this
// T|5,T|5,T|5,T|5, 1,1,1,1, /* A0 */
T|3,T|3,T|3,T|3, 1,1,1,1, /* A0 */
T|E|2,T|3,1,1, 1,1,1,1, /* A8 */
T|E|2,T|E|2,T|E|2,T|E|2, T|E|2,T|E|2,T|E|2,T|E|2, /* B0 */
T|3,T|3,T|3,T|3, T|3,T|3,T|3,T|3, /* B8 */
M|T|E|3,M|T|E|3,T|3,1, M|2,M|2,M|T|E|R|3,M|T|R|4, /* C0 */
T|E|4,1,T|3,1, 1,T|E|2,1,1, /* C8 */
M|2,M|2,M|2,M|2, T|E|2,T|E|2,0,1, /* D0 */
/* For the floating instructions, allow room for the FWAIT */
M|2,M|2,M|2,M|2, M|2,M|2,M|2,M|2, /* D8 */
T|E|2,T|E|2,T|E|2,T|E|2, T|E|2,T|E|2,T|E|2,T|E|2, /* E0 */
T|3,T|3,T|5,T|E|2, 1,1,1,1, /* E8 */
1,0,1,1, 1,1,M|A|2,M|A|2, /* F0 */
1,1,1,1, 1,1,M|2,M|R|2 /* F8 */
];
private __gshared const ubyte[256] inssize32 =
[ 2,2,2,2, 2,5,1,1, /* 00 */
2,2,2,2, 2,5,1,1, /* 08 */
2,2,2,2, 2,5,1,1, /* 10 */
2,2,2,2, 2,5,1,1, /* 18 */
2,2,2,2, 2,5,1,1, /* 20 */
2,2,2,2, 2,5,1,1, /* 28 */
2,2,2,2, 2,5,1,1, /* 30 */
2,2,2,2, 2,5,1,1, /* 38 */
1,1,1,1, 1,1,1,1, /* 40 */
1,1,1,1, 1,1,1,1, /* 48 */
1,1,1,1, 1,1,1,1, /* 50 */
1,1,1,1, 1,1,1,1, /* 58 */
1,1,2,2, 1,1,1,1, /* 60 */
5,6,2,3, 1,1,1,1, /* 68 */
2,2,2,2, 2,2,2,2, /* 70 */
2,2,2,2, 2,2,2,2, /* 78 */
3,6,3,3, 2,2,2,2, /* 80 */
2,2,2,2, 2,2,2,2, /* 88 */
1,1,1,1, 1,1,1,1, /* 90 */
1,1,7,1, 1,1,1,1, /* 98 */
5,5,5,5, 1,1,1,1, /* A0 */
2,5,1,1, 1,1,1,1, /* A8 */
2,2,2,2, 2,2,2,2, /* B0 */
5,5,5,5, 5,5,5,5, /* B8 */
3,3,3,1, 2,2,3,6, /* C0 */
4,1,3,1, 1,2,1,1, /* C8 */
2,2,2,2, 2,2,0,1, /* D0 */
/* For the floating instructions, don't need room for the FWAIT */
2,2,2,2, 2,2,2,2, /* D8 */
2,2,2,2, 2,2,2,2, /* E0 */
5,5,7,2, 1,1,1,1, /* E8 */
1,0,1,1, 1,1,2,2, /* F0 */
1,1,1,1, 1,1,2,2 /* F8 */
];
/* For 2 byte opcodes starting with 0x0F */
private __gshared ubyte[256] inssize2 =
[ M|3,M|3,M|3,M|3, 2,2,2,2, // 00
2,2,M|3,2, 2,M|3,2,M|T|E|4, // 08
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 10
M|3,2,2,2, 2,2,2,2, // 18
M|3,M|3,M|3,M|3, M|3,2,M|3,2, // 20
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 28
2,2,2,2, 2,2,2,2, // 30
M|4,2,M|T|E|5,2, 2,2,2,2, // 38
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 40
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 48
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 50
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 58
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 60
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 68
M|T|E|4,M|T|E|4,M|T|E|4,M|T|E|4, M|3,M|3,M|3,2, // 70
2,2,2,2, M|3,M|3,M|3,M|3, // 78
W|T|4,W|T|4,W|T|4,W|T|4, W|T|4,W|T|4,W|T|4,W|T|4, // 80
W|T|4,W|T|4,W|T|4,W|T|4, W|T|4,W|T|4,W|T|4,W|T|4, // 88
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 90
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // 98
2,2,2,M|3, M|T|E|4,M|3,2,2, // A0
2,2,2,M|3, M|T|E|4,M|3,M|3,M|3, // A8
M|E|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // B0
M|3,2,M|T|E|4,M|3, M|3,M|3,M|3,M|3, // B8
M|3,M|3,M|T|E|4,M|3, M|T|E|4,M|T|E|4,M|T|E|4,M|3, // C0
2,2,2,2, 2,2,2,2, // C8
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // D0
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // D8
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // E0
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // E8
M|3,M|3,M|3,M|3, M|3,M|3,M|3,M|3, // F0
M|3,M|3,M|3,M|3, M|3,M|3,M|3,2 // F8
];
/*************************************************
* Generate code to save `reg` in `regsave` stack area.
* Params:
* regsave = register save areay on stack
* cdb = where to write generated code
* reg = register to save
* idx = set to location in regsave for use in REGSAVE_restore()
*/
@trusted
void REGSAVE_save(ref REGSAVE regsave, ref CodeBuilder cdb, reg_t reg, out uint idx)
{
if (isXMMreg(reg))
{
regsave.alignment = 16;
regsave.idx = (regsave.idx + 15) & ~15;
idx = regsave.idx;
regsave.idx += 16;
// MOVD idx[RBP],xmm
opcode_t op = STOAPD;
if (TARGET_LINUX && I32)
// Haven't yet figured out why stack is not aligned to 16
op = STOUPD;
cdb.genc1(op,modregxrm(2, reg - XMM0, BPRM),FLregsave,cast(targ_uns) idx);
}
else
{
if (!regsave.alignment)
regsave.alignment = REGSIZE;
idx = regsave.idx;
regsave.idx += REGSIZE;
// MOV idx[RBP],reg
cdb.genc1(0x89,modregxrm(2, reg, BPRM),FLregsave,cast(targ_uns) idx);
if (I64)
code_orrex(cdb.last(), REX_W);
}
reflocal = true;
if (regsave.idx > regsave.top)
regsave.top = regsave.idx; // keep high water mark
}
/*******************************
* Restore `reg` from `regsave` area.
* Complement REGSAVE_save().
*/
@trusted
void REGSAVE_restore(const ref REGSAVE regsave, ref CodeBuilder cdb, reg_t reg, uint idx)
{
if (isXMMreg(reg))
{
assert(regsave.alignment == 16);
// MOVD xmm,idx[RBP]
opcode_t op = LODAPD;
if (TARGET_LINUX && I32)
// Haven't yet figured out why stack is not aligned to 16
op = LODUPD;
cdb.genc1(op,modregxrm(2, reg - XMM0, BPRM),FLregsave,cast(targ_uns) idx);
}
else
{ // MOV reg,idx[RBP]
cdb.genc1(0x8B,modregxrm(2, reg, BPRM),FLregsave,cast(targ_uns) idx);
if (I64)
code_orrex(cdb.last(), REX_W);
}
}
/************************************
* Size for vex encoded instruction.
*/
@trusted
ubyte vex_inssize(code *c)
{
assert(c.Iflags & CFvex && c.Ivex.pfx == 0xC4);
ubyte ins;
if (c.Iflags & CFvex3)
{
switch (c.Ivex.mmmm)
{
case 0: // no prefix
case 1: // 0F
ins = cast(ubyte)(inssize2[c.Ivex.op] + 2);
break;
case 2: // 0F 38
ins = cast(ubyte)(inssize2[0x38] + 1);
break;
case 3: // 0F 3A
ins = cast(ubyte)(inssize2[0x3A] + 1);
break;
default:
printf("Iop = %x mmmm = %x\n", c.Iop, c.Ivex.mmmm);
assert(0);
}
}
else
{
ins = cast(ubyte)(inssize2[c.Ivex.op] + 1);
}
return ins;
}
/************************************
* Determine if there is a modregrm byte for code.
*/
@trusted
int cod3_EA(code *c)
{ uint ins;
opcode_t op1 = c.Iop & 0xFF;
if (op1 == ESCAPE)
ins = 0;
else if ((c.Iop & 0xFFFD00) == 0x0F3800)
ins = inssize2[(c.Iop >> 8) & 0xFF];
else if ((c.Iop & 0xFF00) == 0x0F00)
ins = inssize2[op1];
else
ins = inssize[op1];
return ins & M;
}
/********************************
* setup ALLREGS and BYTEREGS
* called by: codgen
*/
@trusted
void cod3_initregs()
{
if (I64)
{
ALLREGS = mAX|mBX|mCX|mDX|mSI|mDI| mR8|mR9|mR10|mR11|mR12|mR13|mR14|mR15;
BYTEREGS = ALLREGS;
}
else
{
ALLREGS = ALLREGS_INIT;
BYTEREGS = BYTEREGS_INIT;
}
}
/********************************
* set initial global variable values
*/
@trusted
void cod3_setdefault()
{
fregsaved = mBP | mSI | mDI;
}
/********************************
* Fix global variables for 386.
*/
@trusted
void cod3_set32()
{
inssize[0xA0] = T|5;
inssize[0xA1] = T|5;
inssize[0xA2] = T|5;
inssize[0xA3] = T|5;
BPRM = 5; /* [EBP] addressing mode */
fregsaved = mBP | mBX | mSI | mDI; // saved across function calls
FLOATREGS = FLOATREGS_32;
FLOATREGS2 = FLOATREGS2_32;
DOUBLEREGS = DOUBLEREGS_32;
if (config.flags3 & CFG3eseqds)
fregsaved |= mES;
foreach (ref v; inssize2[0x80 .. 0x90])
v = W|T|6;
TARGET_STACKALIGN = config.fpxmmregs ? 16 : 4;
}
/********************************
* Fix global variables for I64.
*/
@trusted
void cod3_set64()
{
inssize[0xA0] = T|5; // MOV AL,mem
inssize[0xA1] = T|5; // MOV RAX,mem
inssize[0xA2] = T|5; // MOV mem,AL
inssize[0xA3] = T|5; // MOV mem,RAX
BPRM = 5; // [RBP] addressing mode
fregsaved = (config.exe & EX_windos)
? mBP | mBX | mDI | mSI | mR12 | mR13 | mR14 | mR15 | mES | mXMM6 | mXMM7 // also XMM8..15;
: mBP | mBX | mR12 | mR13 | mR14 | mR15 | mES; // saved across function calls
FLOATREGS = FLOATREGS_64;
FLOATREGS2 = FLOATREGS2_64;
DOUBLEREGS = DOUBLEREGS_64;
ALLREGS = mAX|mBX|mCX|mDX|mSI|mDI| mR8|mR9|mR10|mR11|mR12|mR13|mR14|mR15;
BYTEREGS = ALLREGS;
foreach (ref v; inssize2[0x80 .. 0x90])
v = W|T|6;
TARGET_STACKALIGN = config.fpxmmregs ? 16 : 8;
}
/*********************************
* Word or dword align start of function.
* Params:
* seg = segment to write alignment bytes to
* nbytes = number of alignment bytes to write
*/
@trusted
void cod3_align_bytes(int seg, size_t nbytes)
{
/* Table 4-2 from Intel Instruction Set Reference M-Z
* 1 bytes NOP 90
* 2 bytes 66 NOP 66 90
* 3 bytes NOP DWORD ptr [EAX] 0F 1F 00
* 4 bytes NOP DWORD ptr [EAX + 00H] 0F 1F 40 00
* 5 bytes NOP DWORD ptr [EAX + EAX*1 + 00H] 0F 1F 44 00 00
* 6 bytes 66 NOP DWORD ptr [EAX + EAX*1 + 00H] 66 0F 1F 44 00 00
* 7 bytes NOP DWORD ptr [EAX + 00000000H] 0F 1F 80 00 00 00 00
* 8 bytes NOP DWORD ptr [EAX + EAX*1 + 00000000H] 0F 1F 84 00 00 00 00 00
* 9 bytes 66 NOP DWORD ptr [EAX + EAX*1 + 00000000H] 66 0F 1F 84 00 00 00 00 00
* only for CPUs: CPUID.01H.EAX[Bytes 11:8] = 0110B or 1111B
*/
assert(SegData[seg].SDseg == seg);
while (nbytes)
{ size_t n = nbytes;
const(char)* p;
if (nbytes > 1 && (I64 || config.fpxmmregs))
{
switch (n)
{
case 2: p = "\x66\x90"; break;
case 3: p = "\x0F\x1F\x00"; break;
case 4: p = "\x0F\x1F\x40\x00"; break;
case 5: p = "\x0F\x1F\x44\x00\x00"; break;
case 6: p = "\x66\x0F\x1F\x44\x00\x00"; break;
case 7: p = "\x0F\x1F\x80\x00\x00\x00\x00"; break;
case 8: p = "\x0F\x1F\x84\x00\x00\x00\x00\x00"; break;
default: p = "\x66\x0F\x1F\x84\x00\x00\x00\x00\x00"; n = 9; break;
}
}
else
{
static immutable ubyte[15] nops = [
0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90
]; // XCHG AX,AX
if (n > nops.length)
n = nops.length;
p = cast(char*)nops;
}
objmod.write_bytes(SegData[seg],cast(uint)n,cast(char*)p);
nbytes -= n;
}
}
/****************************
* Align start of function.
* Params:
* seg = segment of function
*/
@trusted
void cod3_align(int seg)
{
if (config.exe & EX_windos)
{
if (config.flags4 & CFG4speed) // if optimized for speed
{
// Pick alignment based on CPU target
if (config.target_cpu == TARGET_80486 ||
config.target_cpu >= TARGET_PentiumPro)
{ // 486 does reads on 16 byte boundaries, so if we are near
// such a boundary, align us to it
const nbytes = -Offset(seg) & 15;
if (nbytes < 8)
cod3_align_bytes(seg, nbytes);
}
}
}
else
{
const nbytes = -Offset(seg) & 7;
cod3_align_bytes(seg, nbytes);
}
}
/**********************************
* Generate code to adjust the stack pointer by `nbytes`
* Params:
* cdb = code builder
* nbytes = number of bytes to adjust stack pointer
*/
void cod3_stackadj(ref CodeBuilder cdb, int nbytes)
{
//printf("cod3_stackadj(%d)\n", nbytes);
uint grex = I64 ? REX_W << 16 : 0;
uint rm;
if (nbytes > 0)
rm = modregrm(3,5,SP); // SUB ESP,nbytes
else
{
nbytes = -nbytes;
rm = modregrm(3,0,SP); // ADD ESP,nbytes
}
cdb.genc2(0x81, grex | rm, nbytes);
}
/**********************************
* Generate code to align the stack pointer at `nbytes`
* Params:
* cdb = code builder
* nbytes = number of bytes to align stack pointer
*/
void cod3_stackalign(ref CodeBuilder cdb, int nbytes)
{
//printf("cod3_stackalign(%d)\n", nbytes);
const grex = I64 ? REX_W << 16 : 0;
const rm = modregrm(3, 4, SP); // AND ESP,-nbytes
cdb.genc2(0x81, grex | rm, -nbytes);
}
/* Constructor that links the ModuleReference to the head of
* the list pointed to by _Dmoduleref
*
* For ELF object files.
*/
static if (0)
{
void cod3_buildmodulector(Outbuffer* buf, int codeOffset, int refOffset)
{
/* ret
* codeOffset:
* pushad
* mov EAX,&ModuleReference
* mov ECX,_DmoduleRef
* mov EDX,[ECX]
* mov [EAX],EDX
* mov [ECX],EAX
* popad
* ret
*/
const int seg = CODE;
if (I64 && config.flags3 & CFG3pic)
{ // LEA RAX,ModuleReference[RIP]
buf.writeByte(REX | REX_W);
buf.writeByte(LEA);
buf.writeByte(modregrm(0,AX,5));
codeOffset += 3;
codeOffset += Obj.writerel(seg, codeOffset, R_X86_64_PC32, 3 /*STI_DATA*/, refOffset - 4);
// MOV RCX,_DmoduleRef@GOTPCREL[RIP]
buf.writeByte(REX | REX_W);
buf.writeByte(0x8B);
buf.writeByte(modregrm(0,CX,5));
codeOffset += 3;
codeOffset += Obj.writerel(seg, codeOffset, R_X86_64_GOTPCREL, Obj.external_def("_Dmodule_ref"), -4);
}
else
{
/* movl ModuleReference*, %eax */
buf.writeByte(0xB8);
codeOffset += 1;
const uint reltype = I64 ? R_X86_64_32 : R_386_32;
codeOffset += Obj.writerel(seg, codeOffset, reltype, 3 /*STI_DATA*/, refOffset);
/* movl _Dmodule_ref, %ecx */
buf.writeByte(0xB9);
codeOffset += 1;
codeOffset += Obj.writerel(seg, codeOffset, reltype, Obj.external_def("_Dmodule_ref"), 0);
}
if (I64)
buf.writeByte(REX | REX_W);
buf.writeByte(0x8B); buf.writeByte(0x11); /* movl (%ecx), %edx */
if (I64)
buf.writeByte(REX | REX_W);
buf.writeByte(0x89); buf.writeByte(0x10); /* movl %edx, (%eax) */
if (I64)
buf.writeByte(REX | REX_W);
buf.writeByte(0x89); buf.writeByte(0x01); /* movl %eax, (%ecx) */
buf.writeByte(0xC3); /* ret */
}
}
/*****************************
* Given a type, return a mask of
* registers to hold that type.
* Input:
* tyf function type
*/
@trusted
regm_t regmask(tym_t tym, tym_t tyf)
{
switch (tybasic(tym))
{
case TYvoid:
case TYnoreturn:
case TYstruct:
case TYarray:
return 0;
case TYbool:
case TYwchar_t:
case TYchar16:
case TYchar:
case TYschar:
case TYuchar:
case TYshort:
case TYushort:
case TYint:
case TYuint:
case TYnullptr:
case TYnptr:
case TYnref:
case TYsptr:
case TYcptr:
case TYimmutPtr:
case TYsharePtr:
case TYrestrictPtr:
case TYfgPtr:
return mAX;
case TYfloat:
case TYifloat:
if (I64)
return mXMM0;
if (config.exe & EX_flat)
return mST0;
goto case TYlong;
case TYlong:
case TYulong:
case TYdchar:
if (!I16)
return mAX;
goto case TYfptr;
case TYfptr:
case TYhptr:
return mDX | mAX;
case TYcent:
case TYucent:
assert(I64);
return mDX | mAX;
case TYvptr:
return mDX | mBX;
case TYdouble:
case TYdouble_alias:
case TYidouble:
if (I64)
return mXMM0;
if (config.exe & EX_flat)
return mST0;
return DOUBLEREGS;
case TYllong:
case TYullong:
return I64 ? cast(regm_t) mAX : (I32 ? mDX | mAX : DOUBLEREGS);
case TYldouble:
case TYildouble:
return mST0;
case TYcfloat:
if (config.exe & EX_posix && I32 && tybasic(tyf) == TYnfunc)
return mDX | mAX;
goto case TYcdouble;
case TYcdouble:
if (I64)
return mXMM0 | mXMM1;
goto case TYcldouble;
case TYcldouble:
return mST01;
// SIMD vector types
case TYfloat4:
case TYdouble2:
case TYschar16:
case TYuchar16:
case TYshort8:
case TYushort8:
case TYlong4:
case TYulong4:
case TYllong2:
case TYullong2:
case TYfloat8:
case TYdouble4:
case TYschar32:
case TYuchar32:
case TYshort16:
case TYushort16:
case TYlong8:
case TYulong8:
case TYllong4:
case TYullong4:
if (!config.fpxmmregs)
{ printf("SIMD operations not supported on this platform\n");
exit(1);
}
return mXMM0;
default:
debug WRTYxx(tym);
assert(0);
}
}
/*******************************
* setup register allocator parameters with platform specific data
*/
void cgreg_dst_regs(reg_t* dst_integer_reg, reg_t* dst_float_reg)
{
*dst_integer_reg = AX;
*dst_float_reg = XMM0;
}
@trusted
void cgreg_set_priorities(tym_t ty, const(reg_t)** pseq, const(reg_t)** pseqmsw)
{
//printf("cgreg_set_priorities %x\n", ty);
const sz = tysize(ty);
if (tyxmmreg(ty))
{
static immutable ubyte[9] sequence = [XMM0,XMM1,XMM2,XMM3,XMM4,XMM5,XMM6,XMM7,NOREG];
*pseq = sequence.ptr;
}
else if (I64)
{
if (sz == REGSIZE * 2)
{
static immutable ubyte[3] seqmsw1 = [CX,DX,NOREG];
static immutable ubyte[5] seqlsw1 = [AX,BX,SI,DI,NOREG];
*pseq = seqlsw1.ptr;
*pseqmsw = seqmsw1.ptr;
}
else
{ // R10 is reserved for the static link
static immutable ubyte[15] sequence2 = [AX,CX,DX,SI,DI,R8,R9,R11,BX,R12,R13,R14,R15,BP,NOREG];
*pseq = cast(ubyte*)sequence2.ptr;
}
}
else if (I32)
{
if (sz == REGSIZE * 2)
{
static immutable ubyte[5] seqlsw3 = [AX,BX,SI,DI,NOREG];
static immutable ubyte[3] seqmsw3 = [CX,DX,NOREG];
*pseq = seqlsw3.ptr;
*pseqmsw = seqmsw3.ptr;
}
else
{
static immutable ubyte[8] sequence4 = [AX,CX,DX,BX,SI,DI,BP,NOREG];
*pseq = sequence4.ptr;
}
}
else
{ assert(I16);
if (typtr(ty))
{
// For pointer types, try to pick index register first
static immutable ubyte[8] seqidx5 = [BX,SI,DI,AX,CX,DX,BP,NOREG];
*pseq = seqidx5.ptr;
}
else
{
// Otherwise, try to pick index registers last
static immutable ubyte[8] sequence6 = [AX,CX,DX,BX,SI,DI,BP,NOREG];
*pseq = sequence6.ptr;
}
}
}
/*******************************************
* Call finally block.
* Params:
* bf = block to call
* retregs = registers to preserve across call
* Returns:
* code generated
*/
@trusted
private code *callFinallyBlock(block *bf, regm_t retregs)
{
CodeBuilder cdbs; cdbs.ctor();
CodeBuilder cdbr; cdbr.ctor();
int nalign = 0;
calledFinally = true;
uint npush = gensaverestore(retregs,cdbs,cdbr);
if (STACKALIGN >= 16)
{ npush += REGSIZE;
if (npush & (STACKALIGN - 1))
{ nalign = STACKALIGN - (npush & (STACKALIGN - 1));
cod3_stackadj(cdbs, nalign);
}
}
cdbs.genc(0xE8,0,0,0,FLblock,cast(targ_size_t)bf);
regcon.immed.mval = 0;
if (nalign)
cod3_stackadj(cdbs, -nalign);
cdbs.append(cdbr);
return cdbs.finish();
}
/*******************************
* Generate block exit code
*/
@trusted
void outblkexitcode(ref CodeBuilder cdb, block *bl, ref int anyspill, const(char)* sflsave, Symbol** retsym, const regm_t mfuncregsave)
{
CodeBuilder cdb2; cdb2.ctor();
elem *e = bl.Belem;
block *nextb;
regm_t retregs = 0;
if (bl.BC != BCasm)
assert(bl.Bcode == null);
switch (bl.BC) /* block exit condition */
{
case BCiftrue:
{
bool jcond = true;
block *bs1 = bl.nthSucc(0);
block *bs2 = bl.nthSucc(1);
if (bs1 == bl.Bnext)
{ // Swap bs1 and bs2
block *btmp;
jcond ^= 1;
btmp = bs1;
bs1 = bs2;
bs2 = btmp;
}
logexp(cdb,e,jcond,FLblock,cast(code *) bs1);
nextb = bs2;
}
L5:
if (configv.addlinenumbers && bl.Bsrcpos.Slinnum &&
!(funcsym_p.ty() & mTYnaked))
{
//printf("BCiftrue: %s(%u)\n", bl.Bsrcpos.Sfilename ? bl.Bsrcpos.Sfilename : "", bl.Bsrcpos.Slinnum);
cdb.genlinnum(bl.Bsrcpos);
}
if (nextb != bl.Bnext)
{
assert(!(bl.Bflags & BFLepilog));
genjmp(cdb,JMP,FLblock,nextb);
}
break;
case BCjmptab:
case BCifthen:
case BCswitch:
{
assert(!(bl.Bflags & BFLepilog));
doswitch(cdb,bl); // hide messy details
break;
}
version (MARS)
{
case BCjcatch: // D catch clause of try-catch
assert(ehmethod(funcsym_p) != EHmethod.EH_NONE);
// Mark all registers as destroyed. This will prevent
// register assignments to variables used in catch blocks.
getregs(cdb,lpadregs());
if (config.ehmethod == EHmethod.EH_DWARF)
{
/* Each block must have ESP set to the same value it was at the end
* of the prolog. But the unwinder calls catch blocks with ESP set
* at the value it was when the throwing function was called, which
* may have arguments pushed on the stack.
* This instruction will reset ESP to the correct offset from EBP.
*/
cdb.gen1(ESCAPE | ESCfixesp);
}
goto case_goto;
}
version (SCPP)
{
case BCcatch: // C++ catch clause of try-catch
// Mark all registers as destroyed. This will prevent
// register assignments to variables used in catch blocks.
getregs(cdb,allregs | mES);
goto case_goto;
case BCtry:
usednteh |= EHtry;
if (config.exe == EX_WIN32)
usednteh |= NTEHtry;
goto case_goto;
}
case BCgoto:
nextb = bl.nthSucc(0);
if ((MARS ||
funcsym_p.Sfunc.Fflags3 & Fnteh) &&
ehmethod(funcsym_p) != EHmethod.EH_DWARF &&
bl.Btry != nextb.Btry &&
nextb.BC != BC_finally)
{
regm_t retregsx = 0;
gencodelem(cdb,e,&retregsx,true);
int toindex = nextb.Btry ? nextb.Btry.Bscope_index : -1;
assert(bl.Btry);
int fromindex = bl.Btry.Bscope_index;
version (MARS)
{
if (toindex + 1 == fromindex)
{ // Simply call __finally
if (bl.Btry &&
bl.Btry.nthSucc(1).BC == BCjcatch)
{
goto L5; // it's a try-catch, not a try-finally
}
}
}
if (config.ehmethod == EHmethod.EH_WIN32 && !(funcsym_p.Sfunc.Fflags3 & Feh_none) ||
config.ehmethod == EHmethod.EH_SEH)
{
nteh_unwind(cdb,0,toindex);
}
else
{
version (MARS)
{
if (toindex + 1 <= fromindex)
{
//c = cat(c, linux_unwind(0, toindex));
block *bt;
//printf("B%d: fromindex = %d, toindex = %d\n", bl.Bdfoidx, fromindex, toindex);
bt = bl;
while ((bt = bt.Btry) != null && bt.Bscope_index != toindex)
{ block *bf;
//printf("\tbt.Bscope_index = %d, bt.Blast_index = %d\n", bt.Bscope_index, bt.Blast_index);
bf = bt.nthSucc(1);
// Only look at try-finally blocks
if (bf.BC == BCjcatch)
continue;
if (bf == nextb)
continue;
//printf("\tbf = B%d, nextb = B%d\n", bf.Bdfoidx, nextb.Bdfoidx);
if (nextb.BC == BCgoto &&
!nextb.Belem &&
bf == nextb.nthSucc(0))
continue;
// call __finally
cdb.append(callFinallyBlock(bf.nthSucc(0), retregsx));
}
}
}
}
goto L5;
}
case_goto:
{
regm_t retregsx = 0;
gencodelem(cdb,e,&retregsx,true);
if (anyspill)
{ // Add in the epilog code
CodeBuilder cdbstore; cdbstore.ctor();
CodeBuilder cdbload; cdbload.ctor();
for (int i = 0; i < anyspill; i++)
{ Symbol *s = globsym[i];
if (s.Sflags & SFLspill &&
vec_testbit(dfoidx,s.Srange))
{
s.Sfl = sflsave[i]; // undo block register assignments
cgreg_spillreg_epilog(bl,s,cdbstore,cdbload);
}
}
cdb.append(cdbstore);
cdb.append(cdbload);
}
nextb = bl.nthSucc(0);
goto L5;
}
case BC_try:
if (config.ehmethod == EHmethod.EH_NONE || funcsym_p.Sfunc.Fflags3 & Feh_none)
{
/* Need to use frame pointer to access locals, not the stack pointer,
* because we'll be calling the BC_finally blocks and the stack will be off.
*/
needframe = 1;
}
else if (config.ehmethod == EHmethod.EH_SEH || config.ehmethod == EHmethod.EH_WIN32)
{
usednteh |= NTEH_try;
nteh_usevars();
}
else
usednteh |= EHtry;
goto case_goto;
case BC_finally:
if (ehmethod(funcsym_p) == EHmethod.EH_DWARF)
{
// Mark scratch registers as destroyed.
getregsNoSave(lpadregs());
regm_t retregsx = 0;
gencodelem(cdb,bl.Belem,&retregsx,true);
// JMP bl.nthSucc(1)
nextb = bl.nthSucc(1);
goto L5;
}
else
{
if (config.ehmethod == EHmethod.EH_SEH ||
config.ehmethod == EHmethod.EH_WIN32 && !(funcsym_p.Sfunc.Fflags3 & Feh_none))
{
// Mark all registers as destroyed. This will prevent
// register assignments to variables used in finally blocks.
getregsNoSave(lpadregs());
}
assert(!e);
// Generate CALL to finalizer code
cdb.append(callFinallyBlock(bl.nthSucc(0), 0));
// JMP bl.nthSucc(1)
nextb = bl.nthSucc(1);
goto L5;
}
case BC_lpad:
{
assert(ehmethod(funcsym_p) == EHmethod.EH_DWARF);
// Mark all registers as destroyed. This will prevent
// register assignments to variables used in finally blocks.
getregsNoSave(lpadregs());
regm_t retregsx = 0;
gencodelem(cdb,bl.Belem,&retregsx,true);
// JMP bl.nthSucc(0)
nextb = bl.nthSucc(0);
goto L5;
}
case BC_ret:
{
regm_t retregsx = 0;
gencodelem(cdb,e,&retregsx,true);
if (ehmethod(funcsym_p) == EHmethod.EH_DWARF)
{
}
else
cdb.gen1(0xC3); // RET
break;
}
static if (NTEXCEPTIONS)
{
case BC_except:
{
assert(!e);
usednteh |= NTEH_except;
nteh_setsp(cdb,0x8B);
getregsNoSave(allregs);
nextb = bl.nthSucc(0);
goto L5;
}
case BC_filter:
{
nteh_filter(cdb, bl);
// Mark all registers as destroyed. This will prevent
// register assignments to variables used in filter blocks.
getregsNoSave(allregs);
regm_t retregsx = regmask(e.Ety, TYnfunc);
gencodelem(cdb,e,&retregsx,true);
cdb.gen1(0xC3); // RET
break;
}
}
case BCretexp:
reg_t reg1, reg2, lreg, mreg;
retregs = allocretregs(e.Ety, e.ET, funcsym_p.ty(), reg1, reg2);
lreg = mreg = NOREG;
if (reg1 == NOREG)
{}
else if (tybasic(e.Ety) == TYcfloat)
lreg = ST01;
else if (mask(reg1) & (mST0 | mST01))
lreg = reg1;
else if (reg2 == NOREG)
lreg = reg1;
else if (mask(reg1) & XMMREGS)
{
lreg = XMM0;
mreg = XMM1;
}
else
{
lreg = mask(reg1) & mLSW ? reg1 : AX;
mreg = mask(reg2) & mMSW ? reg2 : DX;
}
if (reg1 != NOREG)
retregs = (mask(lreg) | mask(mreg)) & ~mask(NOREG);
// For the final load into the return regs, don't set regcon.used,
// so that the optimizer can potentially use retregs for register
// variable assignments.
if (config.flags4 & CFG4optimized)
{ regm_t usedsave;
docommas(cdb,&e);
usedsave = regcon.used;
if (!OTleaf(e.Eoper))
gencodelem(cdb,e,&retregs,true);
else
{
if (e.Eoper == OPconst)
regcon.mvar = 0;
gencodelem(cdb,e,&retregs,true);
regcon.used = usedsave;
if (e.Eoper == OPvar)
{ Symbol *s = e.EV.Vsym;
if (s.Sfl == FLreg && s.Sregm != mAX)
*retsym = s;
}
}
}
else
{
gencodelem(cdb,e,&retregs,true);
}
if (reg1 == NOREG)
{
}
else if ((mask(reg1) | mask(reg2)) & (mST0 | mST01))
{
assert(reg1 == lreg && reg2 == NOREG);
regm_t pretregs = mask(reg1) | mask(reg2);
fixresult87(cdb, e, retregs, &pretregs, true);
}
// fix return registers
else if (tybasic(e.Ety) == TYcfloat)
{
assert(lreg == ST01);
if (I64)
{
assert(reg2 == NOREG);
// spill
pop87();
pop87();
cdb.genfltreg(0xD9, 3, tysize(TYfloat));
genfwait(cdb);
cdb.genfltreg(0xD9, 3, 0);
genfwait(cdb);
// reload
if (config.exe == EX_WIN64)
{
assert(reg1 == AX);
cdb.genfltreg(LOD, reg1, 0);
code_orrex(cdb.last(), REX_W);
}
else
{
assert(reg1 == XMM0);
cdb.genxmmreg(xmmload(TYdouble), reg1, 0, TYdouble);
}
}
else
{
assert(reg1 == AX && reg2 == DX);
regm_t pretregs = mask(reg1) | mask(reg2);
fixresult_complex87(cdb, e, retregs, &pretregs, true);
}
}
else if (reg2 == NOREG)
assert(lreg == reg1);
else for (int v = 0; v < 2; v++)
{
if (v ^ (reg1 != mreg))
genmovreg(cdb, reg1, lreg);
else
genmovreg(cdb, reg2, mreg);
}
if (reg1 != NOREG)
retregs = (mask(reg1) | mask(reg2)) & ~mask(NOREG);
goto L4;
case BCret:
retregs = 0;
gencodelem(cdb,e,&retregs,true);
L4:
if (retregs == mST0)
{ assert(global87.stackused == 1);
pop87(); // account for return value
}
else if (retregs == mST01)
{ assert(global87.stackused == 2);
pop87();
pop87(); // account for return value
}
if (MARS || usednteh & NTEH_try)
{
block *bt = bl;
while ((bt = bt.Btry) != null)
{
block *bf = bt.nthSucc(1);
version (MARS)
{
// Only look at try-finally blocks
if (bf.BC == BCjcatch)
{
continue;
}
}
if (config.ehmethod == EHmethod.EH_WIN32 && !(funcsym_p.Sfunc.Fflags3 & Feh_none) ||
config.ehmethod == EHmethod.EH_SEH)
{
if (bt.Bscope_index == 0)
{
// call __finally
CodeBuilder cdbs; cdbs.ctor();
CodeBuilder cdbr; cdbr.ctor();
nteh_gensindex(cdb,-1);
gensaverestore(retregs,cdbs,cdbr);
cdb.append(cdbs);
cdb.genc(0xE8,0,0,0,FLblock,cast(targ_size_t)bf.nthSucc(0));
regcon.immed.mval = 0;
cdb.append(cdbr);
}
else
{
nteh_unwind(cdb,retregs,~0);
}
break;
}
else
{
// call __finally
cdb.append(callFinallyBlock(bf.nthSucc(0), retregs));
}
}
}
break;
case BCexit:
retregs = 0;
gencodelem(cdb,e,&retregs,true);
if (config.flags4 & CFG4optimized)
mfuncreg = mfuncregsave;
break;
case BCasm:
{
assert(!e);
// Mark destroyed registers
CodeBuilder cdbx; cdbx.ctor();
getregs(cdbx,iasm_regs(bl)); // mark destroyed registers
code *c = cdbx.finish();
if (bl.Bsucc)
{ nextb = bl.nthSucc(0);
if (!bl.Bnext)
{
cdb.append(bl.Bcode);
cdb.append(c);
goto L5;
}
if (nextb != bl.Bnext &&
bl.Bnext &&
!(bl.Bnext.BC == BCgoto &&
!bl.Bnext.Belem &&
nextb == bl.Bnext.nthSucc(0)))
{
// See if already have JMP at end of block
code *cl = code_last(bl.Bcode);
if (!cl || cl.Iop != JMP)
{
cdb.append(bl.Bcode);
cdb.append(c);
goto L5; // add JMP at end of block
}
}
}
cdb.append(bl.Bcode);
break;
}
default:
debug
printf("bl.BC = %d\n",bl.BC);
assert(0);
}
}
/***************************
* Allocate registers for function return values.
*
* Params:
* ty = return type
* t = return type extended info
* tyf = function type
* reg1 = set to the first part register, else NOREG
* reg2 = set to the second part register, else NOREG
*
* Returns:
* a bit mask of return registers.
* 0 if function returns on the stack or returns void.
*/
@trusted
regm_t allocretregs(const tym_t ty, type* t, const tym_t tyf, out reg_t reg1, out reg_t reg2)
{
//printf("allocretregs()\n");
reg1 = reg2 = NOREG;
if (!(config.exe & EX_posix))
return regmask(ty, tyf); // for non-Posix ABI
/* The rest is for the Itanium ABI
*/
const tyb = tybasic(ty);
if (tyb == TYvoid || tyb == TYnoreturn)
return 0;
tym_t ty1 = tyb;
tym_t ty2 = TYMAX; // stays TYMAX if only one register is needed
if (ty & mTYxmmgpr)
{
ty1 = TYdouble;
ty2 = TYllong;
}
else if (ty & mTYgprxmm)
{
ty1 = TYllong;
ty2 = TYdouble;
}
if (tyb == TYstruct)
{
assert(t);
ty1 = t.Tty;
}
const tyfb = tybasic(tyf);
switch (tyrelax(ty1))
{
case TYcent:
if (I32)
return 0;
ty1 = ty2 = TYllong;
break;
case TYcdouble:
if (tyfb == TYjfunc && I32)
break;
if (I32)
return 0;
ty1 = ty2 = TYdouble;
break;
case TYcfloat:
if (tyfb == TYjfunc && I32)
break;
if (I32)
goto case TYllong;
ty1 = TYdouble;
break;
case TYcldouble:
if (tyfb == TYjfunc && I32)
break;
if (I32)
return 0;
break;
case TYllong:
if (I32)
ty1 = ty2 = TYlong;
break;
case TYarray:
type* targ1, targ2;
argtypes(t, targ1, targ2);
if (targ1)
ty1 = targ1.Tty;
else
return 0;
if (targ2)
ty2 = targ2.Tty;
break;
case TYstruct:
assert(t);
if (I64)
{
assert(tybasic(t.Tty) == TYstruct);
if (const targ1 = t.Ttag.Sstruct.Sarg1type)
ty1 = targ1.Tty;
else
return 0;
if (const targ2 = t.Ttag.Sstruct.Sarg2type)
ty2 = targ2.Tty;
break;
}
return 0;
default:
break;
}
/* now we have ty1 and ty2, use that to determine which register
* is used for ty1 and which for ty2
*/
static struct RetRegsAllocator
{
nothrow:
static immutable reg_t[2] gpr_regs = [AX, DX];
static immutable reg_t[2] xmm_regs = [XMM0, XMM1];
uint cntgpr = 0,
cntxmm = 0;
reg_t gpr() { return gpr_regs[cntgpr++]; }
reg_t xmm() { return xmm_regs[cntxmm++]; }
}
RetRegsAllocator rralloc;
reg_t allocreg(tym_t tym)
{
if (tym == TYMAX)
return NOREG;
switch (tysize(tym))
{
case 1:
case 2:
case 4:
if (tyfloating(tym))
return I64 ? rralloc.xmm() : ST0;
else
return rralloc.gpr();
case 8:
if (tycomplex(tym))
{
assert(tyfb == TYjfunc && I32);
return ST01;
}
assert(I64 || tyfloating(tym));
goto case 4;
default:
if (tybasic(tym) == TYldouble || tybasic(tym) == TYildouble)
{
return ST0;
}
else if (tybasic(tym) == TYcldouble)
{
return ST01;
}
else if (tycomplex(tym) && tyfb == TYjfunc && I32)
{
return ST01;
}
else if (tysimd(tym))
{
return rralloc.xmm();
}
debug WRTYxx(tym);
assert(0);
}
}
reg1 = allocreg(ty1);
reg2 = allocreg(ty2);
return (mask(reg1) | mask(reg2)) & ~mask(NOREG);
}
/***********************************************
* Struct necessary for sorting switch cases.
*/
alias _compare_fp_t = extern(C) nothrow int function(const void*, const void*);
extern(C) void qsort(void* base, size_t nmemb, size_t size, _compare_fp_t compar);
extern (C) // qsort cmp functions need to be "C"
{
struct CaseVal
{
targ_ullong val;
block *target;
/* Sort function for qsort() */
@trusted
extern (C) static nothrow int cmp(scope const(void*) p, scope const(void*) q)
{
const(CaseVal)* c1 = cast(const(CaseVal)*)p;
const(CaseVal)* c2 = cast(const(CaseVal)*)q;
return (c1.val < c2.val) ? -1 : ((c1.val == c2.val) ? 0 : 1);
}
}
}
/***
* Generate comparison of [reg2,reg] with val
*/
@trusted
private void cmpval(ref CodeBuilder cdb, targ_llong val, uint sz, reg_t reg, reg_t reg2, reg_t sreg)
{
if (I64 && sz == 8)
{
assert(reg2 == NOREG);
if (val == cast(int)val) // if val is a 64 bit value sign-extended from 32 bits
{
cdb.genc2(0x81,modregrmx(3,7,reg),cast(targ_size_t)val); // CMP reg,value32
cdb.last().Irex |= REX_W; // 64 bit operand
}
else
{
assert(sreg != NOREG);
movregconst(cdb,sreg,cast(targ_size_t)val,64); // MOV sreg,val64
genregs(cdb,0x3B,reg,sreg); // CMP reg,sreg
code_orrex(cdb.last(), REX_W);
getregsNoSave(mask(sreg)); // don't remember we loaded this constant
}
}
else if (reg2 == NOREG)
cdb.genc2(0x81,modregrmx(3,7,reg),cast(targ_size_t)val); // CMP reg,casevalue
else
{
cdb.genc2(0x81,modregrm(3,7,reg2),cast(targ_size_t)MSREG(val)); // CMP reg2,MSREG(casevalue)
code *cnext = gennop(null);
genjmp(cdb,JNE,FLcode,cast(block *) cnext); // JNE cnext
cdb.genc2(0x81,modregrm(3,7,reg),cast(targ_size_t)val); // CMP reg,casevalue
cdb.append(cnext);
}
}
@trusted
private void ifthen(ref CodeBuilder cdb, CaseVal *casevals, size_t ncases,
uint sz, reg_t reg, reg_t reg2, reg_t sreg, block *bdefault, bool last)
{
if (ncases >= 4 && config.flags4 & CFG4speed)
{
size_t pivot = ncases >> 1;
// Compares for casevals[0..pivot]
CodeBuilder cdb1; cdb1.ctor();
ifthen(cdb1, casevals, pivot, sz, reg, reg2, sreg, bdefault, true);
// Compares for casevals[pivot+1..ncases]
CodeBuilder cdb2; cdb2.ctor();
ifthen(cdb2, casevals + pivot + 1, ncases - pivot - 1, sz, reg, reg2, sreg, bdefault, last);
code *c2 = gennop(null);
// Compare for caseval[pivot]
cmpval(cdb, casevals[pivot].val, sz, reg, reg2, sreg);
genjmp(cdb,JE,FLblock,casevals[pivot].target); // JE target
// Note uint jump here, as cases were sorted using uint comparisons
genjmp(cdb,JA,FLcode,cast(block *) c2); // JG c2
cdb.append(cdb1);
cdb.append(c2);
cdb.append(cdb2);
}
else
{ // Not worth doing a binary search, just do a sequence of CMP/JE
for (size_t n = 0; n < ncases; n++)
{
targ_llong val = casevals[n].val;
cmpval(cdb, val, sz, reg, reg2, sreg);
code *cnext = null;
if (reg2 != NOREG)
{
cnext = gennop(null);
genjmp(cdb,JNE,FLcode,cast(block *) cnext); // JNE cnext
cdb.genc2(0x81,modregrm(3,7,reg2),cast(targ_size_t)MSREG(val)); // CMP reg2,MSREG(casevalue)
}
genjmp(cdb,JE,FLblock,casevals[n].target); // JE caseaddr
cdb.append(cnext);
}
if (last) // if default is not next block
genjmp(cdb,JMP,FLblock,bdefault);
}
}
/*******************************
* Generate code for blocks ending in a switch statement.
* Take BCswitch and decide on
* BCifthen use if - then code
* BCjmptab index into jump table
* BCswitch search table for match
*/
@trusted
void doswitch(ref CodeBuilder cdb, block *b)
{
targ_ulong msw;
// If switch tables are in code segment and we need a CS: override to get at them
bool csseg = cast(bool)(config.flags & CFGromable);
//printf("doswitch(%d)\n", b.BC);
elem *e = b.Belem;
elem_debug(e);
docommas(cdb,&e);
cgstate.stackclean++;
tym_t tys = tybasic(e.Ety);
int sz = _tysize[tys];
bool dword = (sz == 2 * REGSIZE);
bool mswsame = true; // assume all msw's are the same
targ_llong *p = b.Bswitch; // pointer to case data
assert(p);
uint ncases = cast(uint)*p++; // number of cases
targ_llong vmax = MINLL; // smallest possible llong
targ_llong vmin = MAXLL; // largest possible llong
for (uint n = 0; n < ncases; n++) // find max and min case values
{
targ_llong val = *p++;
if (val > vmax) vmax = val;
if (val < vmin) vmin = val;
if (REGSIZE == 2)
{
ushort ms = (val >> 16) & 0xFFFF;
if (n == 0)
msw = ms;
else if (msw != ms)
mswsame = 0;
}
else // REGSIZE == 4
{
targ_ulong ms = (val >> 32) & 0xFFFFFFFF;
if (n == 0)
msw = ms;
else if (msw != ms)
mswsame = 0;
}
}
p -= ncases;
//dbg_printf("vmax = x%lx, vmin = x%lx, vmax-vmin = x%lx\n",vmax,vmin,vmax - vmin);
/* Three kinds of switch strategies - pick one
*/
if (ncases <= 3)
goto Lifthen;
else if (I16 && cast(targ_ullong)(vmax - vmin) <= ncases * 2)
goto Ljmptab; // >=50% of the table is case values, rest is default
else if (cast(targ_ullong)(vmax - vmin) <= ncases * 3)
goto Ljmptab; // >= 33% of the table is case values, rest is default
else if (I16)
goto Lswitch;
else
goto Lifthen;
/*************************************************************************/
{ // generate if-then sequence
Lifthen:
regm_t retregs = ALLREGS;
b.BC = BCifthen;
scodelem(cdb,e,&retregs,0,true);
reg_t reg, reg2;
if (dword)
{ reg = findreglsw(retregs);
reg2 = findregmsw(retregs);
}
else
{
reg = findreg(retregs); // reg that result is in
reg2 = NOREG;
}
list_t bl = b.Bsucc;
block *bdefault = b.nthSucc(0);
if (dword && mswsame)
{
cdb.genc2(0x81,modregrm(3,7,reg2),msw); // CMP reg2,MSW
genjmp(cdb,JNE,FLblock,bdefault); // JNE default
reg2 = NOREG;
}
reg_t sreg = NOREG; // may need a scratch register
// Put into casevals[0..ncases] so we can sort then slice
CaseVal *casevals = cast(CaseVal *)malloc(ncases * CaseVal.sizeof);
assert(casevals);
for (uint n = 0; n < ncases; n++)
{
casevals[n].val = p[n];
bl = list_next(bl);
casevals[n].target = list_block(bl);
// See if we need a scratch register
if (sreg == NOREG && I64 && sz == 8 && p[n] != cast(int)p[n])
{ regm_t regm = ALLREGS & ~mask(reg);
allocreg(cdb,®m, &sreg, TYint);
}
}
// Sort cases so we can do a runtime binary search
qsort(casevals, ncases, CaseVal.sizeof, &CaseVal.cmp);
//for (uint n = 0; n < ncases; n++)
//printf("casevals[%lld] = x%x\n", n, casevals[n].val);
// Generate binary tree of comparisons
ifthen(cdb, casevals, ncases, sz, reg, reg2, sreg, bdefault, bdefault != b.Bnext);
free(casevals);
cgstate.stackclean--;
return;
}
/*************************************************************************/
{
// Use switch value to index into jump table
Ljmptab:
//printf("Ljmptab:\n");
b.BC = BCjmptab;
/* If vmin is small enough, we can just set it to 0 and the jump
* table entries from 0..vmin-1 can be set with the default target.
* This saves the SUB instruction.
* Must be same computation as used in outjmptab().
*/
if (vmin > 0 && vmin <= _tysize[TYint])
vmin = 0;
b.Btablesize = cast(int) (vmax - vmin + 1) * tysize(TYnptr);
regm_t retregs = IDXREGS;
if (dword)
retregs |= mMSW;
if (config.exe & EX_posix && I32 && config.flags3 & CFG3pic)
retregs &= ~mBX; // need EBX for GOT
bool modify = (I16 || I64 || vmin);
scodelem(cdb,e,&retregs,0,!modify);
reg_t reg = findreg(retregs & IDXREGS); // reg that result is in
reg_t reg2;
if (dword)
reg2 = findregmsw(retregs);
if (modify)
{
assert(!(retregs & regcon.mvar));
getregs(cdb,retregs);
}
if (vmin) // if there is a minimum
{
cdb.genc2(0x81,modregrm(3,5,reg),cast(targ_size_t)vmin); // SUB reg,vmin
if (dword)
{ cdb.genc2(0x81,modregrm(3,3,reg2),cast(targ_size_t)MSREG(vmin)); // SBB reg2,vmin
genjmp(cdb,JNE,FLblock,b.nthSucc(0)); // JNE default
}
}
else if (dword)
{ gentstreg(cdb,reg2); // TEST reg2,reg2
genjmp(cdb,JNE,FLblock,b.nthSucc(0)); // JNE default
}
if (vmax - vmin != REGMASK) // if there is a maximum
{ // CMP reg,vmax-vmin
cdb.genc2(0x81,modregrm(3,7,reg),cast(targ_size_t)(vmax-vmin));
if (I64 && sz == 8)
code_orrex(cdb.last(), REX_W);
genjmp(cdb,JA,FLblock,b.nthSucc(0)); // JA default
}
if (I64)
{
if (!vmin)
{ // Need to clear out high 32 bits of reg
// Use 8B instead of 89, as 89 will be optimized away as a NOP
genregs(cdb,0x8B,reg,reg); // MOV reg,reg
}
if (config.flags3 & CFG3pic || config.exe == EX_WIN64)
{
/* LEA R1,disp[RIP] 48 8D 05 00 00 00 00
* MOVSXD R2,[reg*4][R1] 48 63 14 B8
* LEA R1,[R1][R2] 48 8D 04 02
* JMP R1 FF E0
*/
reg_t r1;
regm_t scratchm = ALLREGS & ~mask(reg);
allocreg(cdb,&scratchm,&r1,TYint);
reg_t r2;
scratchm = ALLREGS & ~(mask(reg) | mask(r1));
allocreg(cdb,&scratchm,&r2,TYint);
CodeBuilder cdbe; cdbe.ctor();
cdbe.genc1(LEA,(REX_W << 16) | modregxrm(0,r1,5),FLswitch,0); // LEA R1,disp[RIP]
cdbe.last().IEV1.Vswitch = b;
cdbe.gen2sib(0x63,(REX_W << 16) | modregxrm(0,r2,4), modregxrmx(2,reg,r1)); // MOVSXD R2,[reg*4][R1]
cdbe.gen2sib(LEA,(REX_W << 16) | modregxrm(0,r1,4),modregxrmx(0,r1,r2)); // LEA R1,[R1][R2]
cdbe.gen2(0xFF,modregrmx(3,4,r1)); // JMP R1
b.Btablesize = cast(int) (vmax - vmin + 1) * 4;
code *ce = cdbe.finish();
pinholeopt(ce, null);
cdb.append(cdbe);
}
else
{
cdb.genc1(0xFF,modregrm(0,4,4),FLswitch,0); // JMP disp[reg*8]
cdb.last().IEV1.Vswitch = b;
cdb.last().Isib = modregrm(3,reg & 7,5);
if (reg & 8)
cdb.last().Irex |= REX_X;
}
}
else if (I32)
{
static if (JMPJMPTABLE)
{
/* LEA jreg,offset ctable[reg][reg * 4]
JMP jreg
ctable:
JMP case0
JMP case1
...
*/
CodeBuilder ctable; ctable.ctor();
block *bdef = b.nthSucc(0);
targ_llong u;
for (u = vmin; ; u++)
{ block *targ = bdef;
for (n = 0; n < ncases; n++)
{
if (p[n] == u)
{ targ = b.nthSucc(n + 1);
break;
}
}
genjmp(ctable,JMP,FLblock,targ);
ctable.last().Iflags |= CFjmp5; // don't shrink these
if (u == vmax)
break;
}
// Allocate scratch register jreg
regm_t scratchm = ALLREGS & ~mask(reg);
uint jreg = AX;
allocreg(cdb,&scratchm,&jreg,TYint);
// LEA jreg, offset ctable[reg][reg*4]
cdb.genc1(LEA,modregrm(2,jreg,4),FLcode,6);
cdb.last().Isib = modregrm(2,reg,reg);
cdb.gen2(0xFF,modregrm(3,4,jreg)); // JMP jreg
cdb.append(ctable);
b.Btablesize = 0;
cgstate.stackclean--;
return;
}
else
{
if (config.exe & (EX_OSX | EX_OSX64))
{
/* CALL L1
* L1: POP R1
* ADD R1,disp[reg*4][R1]
* JMP R1
*/
// Allocate scratch register r1
regm_t scratchm = ALLREGS & ~mask(reg);
reg_t r1;
allocreg(cdb,&scratchm,&r1,TYint);
cdb.genc2(CALL,0,0); // CALL L1
cdb.gen1(0x58 + r1); // L1: POP R1
cdb.genc1(0x03,modregrm(2,r1,4),FLswitch,0); // ADD R1,disp[reg*4][EBX]
cdb.last().IEV1.Vswitch = b;
cdb.last().Isib = modregrm(2,reg,r1);
cdb.gen2(0xFF,modregrm(3,4,r1)); // JMP R1
}
else
{
if (config.flags3 & CFG3pic)
{
/* MOV R1,EBX
* SUB R1,funcsym_p@GOTOFF[offset][reg*4][EBX]
* JMP R1
*/
// Load GOT in EBX
load_localgot(cdb);
// Allocate scratch register r1
regm_t scratchm = ALLREGS & ~(mask(reg) | mBX);
reg_t r1;
allocreg(cdb,&scratchm,&r1,TYint);
genmovreg(cdb,r1,BX); // MOV R1,EBX
cdb.genc1(0x2B,modregxrm(2,r1,4),FLswitch,0); // SUB R1,disp[reg*4][EBX]
cdb.last().IEV1.Vswitch = b;
cdb.last().Isib = modregrm(2,reg,BX);
cdb.gen2(0xFF,modregrmx(3,4,r1)); // JMP R1
}
else
{
cdb.genc1(0xFF,modregrm(0,4,4),FLswitch,0); // JMP disp[idxreg*4]
cdb.last().IEV1.Vswitch = b;
cdb.last().Isib = modregrm(2,reg,5);
}
}
}
}
else if (I16)
{
cdb.gen2(0xD1,modregrm(3,4,reg)); // SHL reg,1
uint rm = getaddrmode(retregs) | modregrm(0,4,0);
cdb.genc1(0xFF,rm,FLswitch,0); // JMP [CS:]disp[idxreg]
cdb.last().IEV1.Vswitch = b;
cdb.last().Iflags |= csseg ? CFcs : 0; // segment override
}
else
assert(0);
cgstate.stackclean--;
return;
}
/*************************************************************************/
{
/* Scan a table of case values, and jump to corresponding address.
* Since it relies on REPNE SCASW, it has really nothing to recommend it
* over Lifthen for 32 and 64 bit code.
* Note that it has not been tested with MACHOBJ (OSX).
*/
Lswitch:
regm_t retregs = mAX; // SCASW requires AX
if (dword)
retregs |= mDX;
else if (ncases <= 6 || config.flags4 & CFG4speed)
goto Lifthen;
scodelem(cdb,e,&retregs,0,true);
if (dword && mswsame)
{ /* CMP DX,MSW */
cdb.genc2(0x81,modregrm(3,7,DX),msw);
genjmp(cdb,JNE,FLblock,b.nthSucc(0)); // JNE default
}
getregs(cdb,mCX|mDI);
if (config.flags3 & CFG3pic && config.exe & EX_posix)
{ // Add in GOT
getregs(cdb,mDX);
cdb.genc2(CALL,0,0); // CALL L1
cdb.gen1(0x58 + DI); // L1: POP EDI
// ADD EDI,_GLOBAL_OFFSET_TABLE_+3
Symbol *gotsym = Obj.getGOTsym();
cdb.gencs(0x81,modregrm(3,0,DI),FLextern,gotsym);
cdb.last().Iflags = CFoff;
cdb.last().IEV2.Voffset = 3;
makeitextern(gotsym);
genmovreg(cdb, DX, DI); // MOV EDX, EDI
// ADD EDI,offset of switch table
cdb.gencs(0x81,modregrm(3,0,DI),FLswitch,null);
cdb.last().IEV2.Vswitch = b;
}
if (!(config.flags3 & CFG3pic))
{
// MOV DI,offset of switch table
cdb.gencs(0xC7,modregrm(3,0,DI),FLswitch,null);
cdb.last().IEV2.Vswitch = b;
}
movregconst(cdb,CX,ncases,0); // MOV CX,ncases
/* The switch table will be accessed through ES:DI.
* Therefore, load ES with proper segment value.
*/
if (config.flags3 & CFG3eseqds)
{
assert(!csseg);
getregs(cdb,mCX); // allocate CX
}
else
{
getregs(cdb,mES|mCX); // allocate ES and CX
cdb.gen1(csseg ? 0x0E : 0x1E); // PUSH CS/DS
cdb.gen1(0x07); // POP ES
}
targ_size_t disp = (ncases - 1) * _tysize[TYint]; // displacement to jump table
if (dword && !mswsame)
{
/* Build the following:
L1: SCASW
JNE L2
CMP DX,[CS:]disp[DI]
L2: LOOPNE L1
*/
const int mod = (disp > 127) ? 2 : 1; // displacement size
code *cloop = genc2(null,0xE0,0,-7 - mod - csseg); // LOOPNE scasw
cdb.gen1(0xAF); // SCASW
code_orflag(cdb.last(),CFtarg2); // target of jump
genjmp(cdb,JNE,FLcode,cast(block *) cloop); // JNE loop
// CMP DX,[CS:]disp[DI]
cdb.genc1(0x39,modregrm(mod,DX,5),FLconst,disp);
cdb.last().Iflags |= csseg ? CFcs : 0; // possible seg override
cdb.append(cloop);
disp += ncases * _tysize[TYint]; // skip over msw table
}
else
{
cdb.gen1(0xF2); // REPNE
cdb.gen1(0xAF); // SCASW
}
genjmp(cdb,JNE,FLblock,b.nthSucc(0)); // JNE default
const int mod = (disp > 127) ? 2 : 1; // 1 or 2 byte displacement
if (csseg)
cdb.gen1(SEGCS); // table is in code segment
if (config.flags3 & CFG3pic &&
config.exe & EX_posix)
{ // ADD EDX,(ncases-1)*2[EDI]
cdb.genc1(0x03,modregrm(mod,DX,7),FLconst,disp);
// JMP EDX
cdb.gen2(0xFF,modregrm(3,4,DX));
}
if (!(config.flags3 & CFG3pic))
{ // JMP (ncases-1)*2[DI]
cdb.genc1(0xFF,modregrm(mod,4,(I32 ? 7 : 5)),FLconst,disp);
cdb.last().Iflags |= csseg ? CFcs : 0;
}
b.Btablesize = disp + _tysize[TYint] + ncases * tysize(TYnptr);
//assert(b.Bcode);
cgstate.stackclean--;
return;
}
}
/******************************
* Output data block for a jump table (BCjmptab).
* The 'holes' in the table get filled with the
* default label.
*/
@trusted
void outjmptab(block *b)
{
if (JMPJMPTABLE && I32)
return;
targ_llong *p = b.Bswitch; // pointer to case data
size_t ncases = cast(size_t)*p++; // number of cases
/* Find vmin and vmax, the range of the table will be [vmin .. vmax + 1]
* Must be same computation as used in doswitch().
*/
targ_llong vmax = MINLL; // smallest possible llong
targ_llong vmin = MAXLL; // largest possible llong
for (size_t n = 0; n < ncases; n++) // find min case value
{ targ_llong val = p[n];
if (val > vmax) vmax = val;
if (val < vmin) vmin = val;
}
if (vmin > 0 && vmin <= _tysize[TYint])
vmin = 0;
assert(vmin <= vmax);
/* Segment and offset into which the jump table will be emitted
*/
int jmpseg = objmod.jmpTableSegment(funcsym_p);
targ_size_t *poffset = &Offset(jmpseg);
/* Align start of jump table
*/
targ_size_t alignbytes = _align(0,*poffset) - *poffset;
objmod.lidata(jmpseg,*poffset,alignbytes);
assert(*poffset == b.Btableoffset); // should match precomputed value
Symbol *gotsym = null;
targ_size_t def = b.nthSucc(0).Boffset; // default address
for (targ_llong u = vmin; ; u++)
{ targ_size_t targ = def; // default
for (size_t n = 0; n < ncases; n++)
{ if (p[n] == u)
{ targ = b.nthSucc(cast(int)(n + 1)).Boffset;
break;
}
}
if (config.exe & (EX_LINUX64 | EX_FREEBSD64 | EX_OPENBSD64 | EX_DRAGONFLYBSD64 | EX_SOLARIS64))
{
if (config.flags3 & CFG3pic)
{
objmod.reftodatseg(jmpseg,*poffset,cast(targ_size_t)(targ + (u - vmin) * 4),funcsym_p.Sseg,CFswitch);
*poffset += 4;
}
else
{
objmod.reftodatseg(jmpseg,*poffset,targ,funcsym_p.Sxtrnnum,CFoffset64 | CFswitch);
*poffset += 8;
}
}
else if (config.exe & (EX_LINUX | EX_FREEBSD | EX_OPENBSD | EX_SOLARIS))
{
if (config.flags3 & CFG3pic)
{
assert(config.flags & CFGromable);
// Want a GOTPC fixup to _GLOBAL_OFFSET_TABLE_
if (!gotsym)
gotsym = Obj.getGOTsym();
objmod.reftoident(jmpseg,*poffset,gotsym,*poffset - targ,CFswitch);
}
else
objmod.reftocodeseg(jmpseg,*poffset,targ);
*poffset += 4;
}
else if (config.exe & (EX_OSX | EX_OSX64))
{
targ_size_t val;
if (I64)
val = targ - b.Btableoffset;
else
val = targ - b.Btablebase;
objmod.write_bytes(SegData[jmpseg],4,&val);
}
else
{
if (I64)
{
targ_size_t val = targ - b.Btableoffset;
objmod.write_bytes(SegData[jmpseg],4,&val);
}
else
{
objmod.reftocodeseg(jmpseg,*poffset,targ);
*poffset += tysize(TYnptr);
}
}
if (u == vmax) // for case that (vmax == ~0)
break;
}
}
/******************************
* Output data block for a switch table.
* Two consecutive tables, the first is the case value table, the
* second is the address table.
*/
@trusted
void outswitab(block *b)
{
//printf("outswitab()\n");
targ_llong *p = b.Bswitch; // pointer to case data
uint ncases = cast(uint)*p++; // number of cases
const int seg = objmod.jmpTableSegment(funcsym_p);
targ_size_t *poffset = &Offset(seg);
targ_size_t offset = *poffset;
targ_size_t alignbytes = _align(0,*poffset) - *poffset;
objmod.lidata(seg,*poffset,alignbytes); // any alignment bytes necessary
assert(*poffset == offset + alignbytes);
uint sz = _tysize[TYint];
assert(SegData[seg].SDseg == seg);
for (uint n = 0; n < ncases; n++) // send out value table
{
//printf("\tcase %d, offset = x%x\n", n, *poffset);
objmod.write_bytes(SegData[seg],sz,p);
p++;
}
offset += alignbytes + sz * ncases;
assert(*poffset == offset);
if (b.Btablesize == ncases * (REGSIZE * 2 + tysize(TYnptr)))
{
// Send out MSW table
p -= ncases;
for (uint n = 0; n < ncases; n++)
{
targ_size_t val = cast(targ_size_t)MSREG(*p);
p++;
objmod.write_bytes(SegData[seg],REGSIZE,&val);
}
offset += REGSIZE * ncases;
assert(*poffset == offset);
}
list_t bl = b.Bsucc;
for (uint n = 0; n < ncases; n++) // send out address table
{
bl = list_next(bl);
objmod.reftocodeseg(seg,*poffset,list_block(bl).Boffset);
*poffset += tysize(TYnptr);
}
assert(*poffset == offset + ncases * tysize(TYnptr));
}
/*****************************
* Return a jump opcode relevant to the elem for a JMP true.
*/
@trusted
int jmpopcode(elem *e)
{
//printf("jmpopcode()\n"); elem_print(e);
tym_t tym;
int zero,i,jp,op;
static immutable ubyte[6][2][2] jops =
[ /* <= > < >= == != <=0 >0 <0 >=0 ==0 !=0 */
[ [JLE,JG ,JL ,JGE,JE ,JNE],[JLE,JG ,JS ,JNS,JE ,JNE] ], /* signed */
[ [JBE,JA ,JB ,JAE,JE ,JNE],[JE ,JNE,JB ,JAE,JE ,JNE] ], /* uint */
/+
[ [JLE,JG ,JL ,JGE,JE ,JNE],[JLE,JG ,JL ,JGE,JE ,JNE] ], /* real */
[ [JBE,JA ,JB ,JAE,JE ,JNE],[JBE,JA ,JB ,JAE,JE ,JNE] ], /* 8087 */
[ [JA ,JBE,JAE,JB ,JE ,JNE],[JBE,JA ,JB ,JAE,JE ,JNE] ], /* 8087 R */
+/
];
enum
{
XP = (JP << 8),
XNP = (JNP << 8),
}
static immutable uint[26][1] jfops =
/* le gt lt ge eqeq ne unord lg leg ule ul uge */
[
[ XNP|JBE,JA,XNP|JB,JAE,XNP|JE, XP|JNE,JP, JNE,JNP, JBE,JC,XP|JAE,
/* ug ue ngt nge nlt nle ord nlg nleg nule nul nuge nug nue */
XP|JA,JE,JBE,JB, XP|JAE,XP|JA, JNP,JE, JP, JA, JNC,XNP|JB, XNP|JBE,JNE ], /* 8087 */
];
assert(e);
while (e.Eoper == OPcomma ||
/* The OTleaf(e.EV.E1.Eoper) is to line up with the case in cdeq() where */
/* we decide if mPSW is passed on when evaluating E2 or not. */
(e.Eoper == OPeq && OTleaf(e.EV.E1.Eoper)))
{
e = e.EV.E2; /* right operand determines it */
}
op = e.Eoper;
tym_t tymx = tybasic(e.Ety);
bool needsNanCheck = tyfloating(tymx) && config.inline8087 &&
(tymx == TYldouble || tymx == TYildouble || tymx == TYcldouble ||
tymx == TYcdouble || tymx == TYcfloat ||
(tyxmmreg(tymx) && config.fpxmmregs && e.Ecount != e.Ecomsub) ||
op == OPind ||
(OTcall(op) && (regmask(tymx, tybasic(e.EV.E1.Eoper)) & (mST0 | XMMREGS))));
if (!needsNanCheck)
{
/* If e is in an XMM register, need to use XP.
* Match same test in loaddata()
*/
Symbol* s;
needsNanCheck = e.Eoper == OPvar &&
(s = e.EV.Vsym).Sfl == FLreg &&
s.Sregm & XMMREGS &&
(tymx == TYfloat || tymx == TYifloat || tymx == TYdouble || tymx ==TYidouble);
}
if (e.Ecount != e.Ecomsub) // comsubs just get Z bit set
{
if (needsNanCheck) // except for floating point values that need a NaN check
return XP|JNE;
else
return JNE;
}
if (!OTrel(op)) // not relational operator
{
if (needsNanCheck)
return XP|JNE;
if (op == OPu32_64) { e = e.EV.E1; op = e.Eoper; }
if (op == OPu16_32) { e = e.EV.E1; op = e.Eoper; }
if (op == OPu8_16) op = e.EV.E1.Eoper;
return ((op >= OPbt && op <= OPbts) || op == OPbtst) ? JC : JNE;
}
if (e.EV.E2.Eoper == OPconst)
zero = !boolres(e.EV.E2);
else
zero = 0;
tym = e.EV.E1.Ety;
if (tyfloating(tym))
{
static if (1)
{
i = 0;
if (config.inline8087)
{ i = 1;
static if (1)
{
if (rel_exception(op) || config.flags4 & CFG4fastfloat)
{
const bool NOSAHF = (I64 || config.fpxmmregs);
if (zero)
{
if (NOSAHF)
op = swaprel(op);
}
else if (NOSAHF)
op = swaprel(op);
else if (cmporder87(e.EV.E2))
op = swaprel(op);
else
{ }
}
else
{
if (zero && config.target_cpu < TARGET_80386)
{ }
else
op = swaprel(op);
}
}
else
{
if (zero && !rel_exception(op) && config.target_cpu >= TARGET_80386)
op = swaprel(op);
else if (!zero &&
(cmporder87(e.EV.E2) || !(rel_exception(op) || config.flags4 & CFG4fastfloat)))
/* compare is reversed */
op = swaprel(op);
}
}
jp = jfops[0][op - OPle];
goto L1;
}
else
{
i = (config.inline8087) ? (3 + cmporder87(e.EV.E2)) : 2;
}
}
else if (tyuns(tym) || tyuns(e.EV.E2.Ety))
i = 1;
else if (tyintegral(tym) || typtr(tym))
i = 0;
else
{
debug
elem_print(e);
WRTYxx(tym);
assert(0);
}
jp = jops[i][zero][op - OPle]; /* table starts with OPle */
/* Try to rewrite uint comparisons so they rely on just the Carry flag
*/
if (i == 1 && (jp == JA || jp == JBE) &&
(e.EV.E2.Eoper != OPconst && e.EV.E2.Eoper != OPrelconst))
{
jp = (jp == JA) ? JC : JNC;
}
L1:
debug
if ((jp & 0xF0) != 0x70)
{
WROP(op);
printf("i %d zero %d op x%x jp x%x\n",i,zero,op,jp);
}
assert((jp & 0xF0) == 0x70);
return jp;
}
/**********************************
* Append code to cdb which validates pointer described by
* addressing mode in *pcs. Modify addressing mode in *pcs.
* Params:
* cdb = append generated code to this
* pcs = original addressing mode to be updated
* keepmsk = mask of registers we must not destroy or use
* if (keepmsk & RMstore), this will be only a store operation
* into the lvalue
*/
@trusted
void cod3_ptrchk(ref CodeBuilder cdb,code *pcs,regm_t keepmsk)
{
ubyte sib;
reg_t reg;
uint flagsave;
assert(!I64);
if (!I16 && pcs.Iflags & (CFes | CFss | CFcs | CFds | CFfs | CFgs))
return; // not designed to deal with 48 bit far pointers
ubyte rm = pcs.Irm;
assert(!(rm & 0x40)); // no disp8 or reg addressing modes
// If the addressing mode is already a register
reg = rm & 7;
if (I16)
{ static immutable ubyte[8] imode = [ BP,BP,BP,BP,SI,DI,BP,BX ];
reg = imode[reg]; // convert [SI] to SI, etc.
}
regm_t idxregs = mask(reg);
if ((rm & 0x80 && (pcs.IFL1 != FLoffset || pcs.IEV1.Vuns)) ||
!(idxregs & ALLREGS)
)
{
// Load the offset into a register, so we can push the address
regm_t idxregs2 = (I16 ? IDXREGS : ALLREGS) & ~keepmsk; // only these can be index regs
assert(idxregs2);
allocreg(cdb,&idxregs2,®,TYoffset);
const opsave = pcs.Iop;
flagsave = pcs.Iflags;
pcs.Iop = LEA;
pcs.Irm |= modregrm(0,reg,0);
pcs.Iflags &= ~(CFopsize | CFss | CFes | CFcs); // no prefix bytes needed
cdb.gen(pcs); // LEA reg,EA
pcs.Iflags = flagsave;
pcs.Iop = opsave;
}
// registers destroyed by the function call
//used = (mBP | ALLREGS | mES) & ~fregsaved;
regm_t used = 0; // much less code generated this way
code *cs2 = null;
regm_t tosave = used & (keepmsk | idxregs);
for (int i = 0; tosave; i++)
{
regm_t mi = mask(i);
assert(i < REGMAX);
if (mi & tosave) /* i = register to save */
{
int push,pop;
stackchanged = 1;
if (i == ES)
{ push = 0x06;
pop = 0x07;
}
else
{ push = 0x50 + i;
pop = push | 8;
}
cdb.gen1(push); // PUSH i
cs2 = cat(gen1(null,pop),cs2); // POP i
tosave &= ~mi;
}
}
// For 16 bit models, push a far pointer
if (I16)
{
int segreg;
switch (pcs.Iflags & (CFes | CFss | CFcs | CFds | CFfs | CFgs))
{ case CFes: segreg = 0x06; break;
case CFss: segreg = 0x16; break;
case CFcs: segreg = 0x0E; break;
case 0: segreg = 0x1E; break; // DS
default:
assert(0);
}
// See if we should default to SS:
// (Happens when BP is part of the addressing mode)
if (segreg == 0x1E && (rm & 0xC0) != 0xC0 &&
rm & 2 && (rm & 7) != 7)
{
segreg = 0x16;
if (config.wflags & WFssneds)
pcs.Iflags |= CFss; // because BP won't be there anymore
}
cdb.gen1(segreg); // PUSH segreg
}
cdb.gen1(0x50 + reg); // PUSH reg
// Rewrite the addressing mode in *pcs so it is just 0[reg]
setaddrmode(pcs, idxregs);
pcs.IFL1 = FLoffset;
pcs.IEV1.Vuns = 0;
// Call the validation function
{
makeitextern(getRtlsym(RTLSYM_PTRCHK));
used &= ~(keepmsk | idxregs); // regs destroyed by this exercise
getregs(cdb,used);
// CALL __ptrchk
cdb.gencs((LARGECODE) ? 0x9A : CALL,0,FLfunc,getRtlsym(RTLSYM_PTRCHK));
}
cdb.append(cs2);
}
/***********************************
* Determine if BP can be used as a general purpose register.
* Note parallels between this routine and prolog().
* Returns:
* 0 can't be used, needed for frame
* mBP can be used
*/
@trusted
regm_t cod3_useBP()
{
tym_t tym;
tym_t tyf;
// Note that DOSX memory model cannot use EBP as a general purpose
// register, as SS != DS.
if (!(config.exe & EX_flat) || config.flags & (CFGalwaysframe | CFGnoebp))
goto Lcant;
if (anyiasm)
goto Lcant;
tyf = funcsym_p.ty();
if (tyf & mTYnaked) // if no prolog/epilog for function
goto Lcant;
if (funcsym_p.Sfunc.Fflags3 & Ffakeeh)
{
goto Lcant; // need consistent stack frame
}
tym = tybasic(tyf);
if (tym == TYifunc)
goto Lcant;
stackoffsets(globsym, true); // estimate stack offsets
localsize = Auto.offset + Fast.offset; // an estimate only
// if (localsize)
{
if (!(config.flags4 & CFG4speed) ||
config.target_cpu < TARGET_Pentium ||
tyfarfunc(tym) ||
config.flags & CFGstack ||
localsize >= 0x100 || // arbitrary value < 0x1000
(usednteh & (NTEH_try | NTEH_except | NTEHcpp | EHcleanup | EHtry | NTEHpassthru)) ||
calledFinally ||
Alloca.size
)
goto Lcant;
}
return mBP;
Lcant:
return 0;
}
/*************************************************
* Generate code segment to be used later to restore a cse
*/
@trusted
bool cse_simple(code *c, elem *e)
{
regm_t regm;
reg_t reg;
int sz = tysize(e.Ety);
if (!I16 && // don't bother with 16 bit code
e.Eoper == OPadd &&
sz == REGSIZE &&
e.EV.E2.Eoper == OPconst &&
e.EV.E1.Eoper == OPvar &&
isregvar(e.EV.E1,®m,®) &&
!(e.EV.E1.EV.Vsym.Sflags & SFLspill)
)
{
memset(c,0,(*c).sizeof);
// Make this an LEA instruction
c.Iop = LEA;
buildEA(c,reg,-1,1,e.EV.E2.EV.Vuns);
if (I64)
{ if (sz == 8)
c.Irex |= REX_W;
}
return true;
}
else if (e.Eoper == OPind &&
sz <= REGSIZE &&
e.EV.E1.Eoper == OPvar &&
isregvar(e.EV.E1,®m,®) &&
(I32 || I64 || regm & IDXREGS) &&
!(e.EV.E1.EV.Vsym.Sflags & SFLspill)
)
{
memset(c,0,(*c).sizeof);
// Make this a MOV instruction
c.Iop = (sz == 1) ? 0x8A : 0x8B; // MOV reg,EA
buildEA(c,reg,-1,1,0);
if (sz == 2 && I32)
c.Iflags |= CFopsize;
else if (I64)
{ if (sz == 8)
c.Irex |= REX_W;
}
return true;
}
return false;
}
/**************************
* Store `reg` to the common subexpression save area in index `slot`.
* Params:
* cdb = where to write code to
* tym = type of value that's in `reg`
* reg = register to save
* slot = index into common subexpression save area
*/
@trusted
void gen_storecse(ref CodeBuilder cdb, tym_t tym, reg_t reg, size_t slot)
{
// MOV slot[BP],reg
if (isXMMreg(reg) && config.fpxmmregs) // watch out for ES
{
const aligned = tyvector(tym) ? STACKALIGN >= 16 : true;
const op = xmmstore(tym, aligned);
cdb.genc1(op,modregxrm(2, reg - XMM0, BPRM),FLcs,cast(targ_size_t)slot);
return;
}
opcode_t op = STO; // normal mov
if (reg == ES)
{
reg = 0; // the real reg number
op = 0x8C; // segment reg mov
}
cdb.genc1(op,modregxrm(2, reg, BPRM),FLcs,cast(targ_uns)slot);
if (I64)
code_orrex(cdb.last(), REX_W);
}
@trusted
void gen_testcse(ref CodeBuilder cdb, tym_t tym, uint sz, size_t slot)
{
// CMP slot[BP],0
cdb.genc(sz == 1 ? 0x80 : 0x81,modregrm(2,7,BPRM),
FLcs,cast(targ_uns)slot, FLconst,cast(targ_uns) 0);
if ((I64 || I32) && sz == 2)
cdb.last().Iflags |= CFopsize;
if (I64 && sz == 8)
code_orrex(cdb.last(), REX_W);
}
@trusted
void gen_loadcse(ref CodeBuilder cdb, tym_t tym, reg_t reg, size_t slot)
{
// MOV reg,slot[BP]
if (isXMMreg(reg) && config.fpxmmregs)
{
const aligned = tyvector(tym) ? STACKALIGN >= 16 : true;
const op = xmmload(tym, aligned);
cdb.genc1(op,modregxrm(2, reg - XMM0, BPRM),FLcs,cast(targ_size_t)slot);
return;
}
opcode_t op = LOD;
if (reg == ES)
{
op = 0x8E;
reg = 0;
}
cdb.genc1(op,modregxrm(2,reg,BPRM),FLcs,cast(targ_uns)slot);
if (I64)
code_orrex(cdb.last(), REX_W);
}
/***************************************
* Gen code for OPframeptr
*/
@trusted
void cdframeptr(ref CodeBuilder cdb, elem *e, regm_t *pretregs)
{
regm_t retregs = *pretregs & allregs;
if (!retregs)
retregs = allregs;
reg_t reg;
allocreg(cdb,&retregs, ®, TYint);
code cs;
cs.Iop = ESCAPE | ESCframeptr;
cs.Iflags = 0;
cs.Irex = 0;
cs.Irm = cast(ubyte)reg;
cdb.gen(&cs);
fixresult(cdb,e,retregs,pretregs);
}
/***************************************
* Gen code for load of _GLOBAL_OFFSET_TABLE_.
* This value gets cached in the local variable 'localgot'.
*/
@trusted
void cdgot(ref CodeBuilder cdb, elem *e, regm_t *pretregs)
{
if (config.exe & (EX_OSX | EX_OSX64))
{
regm_t retregs = *pretregs & allregs;
if (!retregs)
retregs = allregs;
reg_t reg;
allocreg(cdb,&retregs, ®, TYnptr);
cdb.genc(CALL,0,0,0,FLgot,0); // CALL L1
cdb.gen1(0x58 + reg); // L1: POP reg
fixresult(cdb,e,retregs,pretregs);
}
else if (config.exe & EX_posix)
{
regm_t retregs = *pretregs & allregs;
if (!retregs)
retregs = allregs;
reg_t reg;
allocreg(cdb,&retregs, ®, TYnptr);
cdb.genc2(CALL,0,0); // CALL L1
cdb.gen1(0x58 + reg); // L1: POP reg
// ADD reg,_GLOBAL_OFFSET_TABLE_+3
Symbol *gotsym = Obj.getGOTsym();
cdb.gencs(0x81,modregrm(3,0,reg),FLextern,gotsym);
/* Because the 2:3 offset from L1: is hardcoded,
* this sequence of instructions must not
* have any instructions in between,
* so set CFvolatile to prevent the scheduler from rearranging it.
*/
code *cgot = cdb.last();
cgot.Iflags = CFoff | CFvolatile;
cgot.IEV2.Voffset = (reg == AX) ? 2 : 3;
makeitextern(gotsym);
fixresult(cdb,e,retregs,pretregs);
}
else
assert(0);
}
/**************************************************
* Load contents of localgot into EBX.
*/
@trusted
void load_localgot(ref CodeBuilder cdb)
{
if (config.exe & (EX_LINUX | EX_FREEBSD | EX_OPENBSD | EX_SOLARIS)) // note: I32 only
{
if (config.flags3 & CFG3pic)
{
if (localgot && !(localgot.Sflags & SFLdead))
{
localgot.Sflags &= ~GTregcand; // because this hack doesn't work with reg allocator
elem *e = el_var(localgot);
regm_t retregs = mBX;
codelem(cdb,e,&retregs,false);
el_free(e);
}
else
{
elem *e = el_long(TYnptr, 0);
e.Eoper = OPgot;
regm_t retregs = mBX;
codelem(cdb,e,&retregs,false);
el_free(e);
}
}
}
}
/*****************************
* Returns:
* # of bytes stored
*/
@trusted
int obj_namestring(char *p,const(char)* name)
{
size_t len = strlen(name);
if (len > 255)
{
short *ps = cast(short *)p;
p[0] = 0xFF;
p[1] = 0;
ps[1] = cast(short)len;
memcpy(p + 4,name,len);
const int ONS_OHD = 4; // max # of extra bytes added by obj_namestring()
len += ONS_OHD;
}
else
{
p[0] = cast(char)len;
memcpy(p + 1,name,len);
len++;
}
return cast(int)len;
}
void genregs(ref CodeBuilder cdb,opcode_t op,uint dstreg,uint srcreg)
{
return cdb.gen2(op,modregxrmx(3,dstreg,srcreg));
}
void gentstreg(ref CodeBuilder cdb, uint t)
{
cdb.gen2(0x85,modregxrmx(3,t,t)); // TEST t,t
code_orflag(cdb.last(),CFpsw);
}
void genpush(ref CodeBuilder cdb, reg_t reg)
{
cdb.gen1(0x50 + (reg & 7));
if (reg & 8)
code_orrex(cdb.last(), REX_B);
}
void genpop(ref CodeBuilder cdb, reg_t reg)
{
cdb.gen1(0x58 + (reg & 7));
if (reg & 8)
code_orrex(cdb.last(), REX_B);
}
/**************************
* Generate a MOV to,from register instruction.
* Smart enough to dump redundant register moves, and segment
* register moves.
*/
code *genmovreg(uint to,uint from)
{
CodeBuilder cdb; cdb.ctor();
genmovreg(cdb, to, from);
return cdb.finish();
}
void genmovreg(ref CodeBuilder cdb,uint to,uint from)
{
genmovreg(cdb, to, from, TYMAX);
}
@trusted
void genmovreg(ref CodeBuilder cdb, uint to, uint from, tym_t tym)
{
// register kind. ex: GPR,XMM,SEG
static uint _K(uint reg)
{
switch (reg)
{
case ES: return ES;
case XMM15:
case XMM0: .. case XMM7: return XMM0;
case AX: .. case R15: return AX;
default: return reg;
}
}
// kind combination (order kept)
static uint _X(uint to, uint from) { return (_K(to) << 8) + _K(from); }
if (to != from)
{
if (tym == TYMAX) tym = TYsize_t; // avoid register slicing
switch (_X(to, from))
{
case _X(AX, AX):
genregs(cdb, 0x89, from, to); // MOV to,from
if (I64 && tysize(tym) >= 8)
code_orrex(cdb.last(), REX_W);
break;
case _X(XMM0, XMM0): // MOVD/Q to,from
genregs(cdb, xmmload(tym), to-XMM0, from-XMM0);
checkSetVex(cdb.last(), tym);
break;
case _X(AX, XMM0): // MOVD/Q to,from
genregs(cdb, STOD, from-XMM0, to);
if (I64 && tysize(tym) >= 8)
code_orrex(cdb.last(), REX_W);
checkSetVex(cdb.last(), tym);
break;
case _X(XMM0, AX): // MOVD/Q to,from
genregs(cdb, LODD, to-XMM0, from);
if (I64 && tysize(tym) >= 8)
code_orrex(cdb.last(), REX_W);
checkSetVex(cdb.last(), tym);
break;
case _X(ES, AX):
assert(tysize(tym) <= REGSIZE);
genregs(cdb, 0x8E, 0, from);
break;
case _X(AX, ES):
assert(tysize(tym) <= REGSIZE);
genregs(cdb, 0x8C, 0, to);
break;
default:
debug printf("genmovreg(to = %s, from = %s)\n"
, regm_str(mask(to)), regm_str(mask(from)));
assert(0);
}
}
}
/***************************************
* Generate immediate multiply instruction for r1=r2*imm.
* Optimize it into LEA's if we can.
*/
@trusted
void genmulimm(ref CodeBuilder cdb,uint r1,uint r2,targ_int imm)
{
// These optimizations should probably be put into pinholeopt()
switch (imm)
{
case 1:
genmovreg(cdb,r1,r2);
break;
case 5:
{
code cs;
cs.Iop = LEA;
cs.Iflags = 0;
cs.Irex = 0;
buildEA(&cs,r2,r2,4,0);
cs.orReg(r1);
cdb.gen(&cs);
break;
}
default:
cdb.genc2(0x69,modregxrmx(3,r1,r2),imm); // IMUL r1,r2,imm
break;
}
}
/******************************
* Load CX with the value of _AHSHIFT.
*/
void genshift(ref CodeBuilder cdb)
{
version (SCPP)
{
// Set up ahshift to trick ourselves into giving the right fixup,
// which must be seg-relative, external frame, external target.
cdb.gencs(0xC7,modregrm(3,0,CX),FLfunc,getRtlsym(RTLSYM_AHSHIFT));
cdb.last().Iflags |= CFoff;
}
else
assert(0);
}
/******************************
* Move constant value into reg.
* Take advantage of existing values in registers.
* If flags & mPSW
* set flags based on result
* Else if flags & 8
* do not disturb flags
* Else
* don't care about flags
* If flags & 1 then byte move
* If flags & 2 then short move (for I32 and I64)
* If flags & 4 then don't disturb unused portion of register
* If flags & 16 then reg is a byte register AL..BH
* If flags & 64 (0x40) then 64 bit move (I64 only)
* Returns:
* code (if any) generated
*/
@trusted
void movregconst(ref CodeBuilder cdb,reg_t reg,targ_size_t value,regm_t flags)
{
reg_t r;
regm_t mreg;
//printf("movregconst(reg=%s, value= %lld (%llx), flags=%x)\n", regm_str(mask(reg)), value, value, flags);
regm_t regm = regcon.immed.mval & mask(reg);
targ_size_t regv = regcon.immed.value[reg];
if (flags & 1) // 8 bits
{
value &= 0xFF;
regm &= BYTEREGS;
// If we already have the right value in the right register
if (regm && (regv & 0xFF) == value)
goto L2;
if (flags & 16 && reg & 4 && // if an H byte register
regcon.immed.mval & mask(reg & 3) &&
(((regv = regcon.immed.value[reg & 3]) >> 8) & 0xFF) == value)
goto L2;
/* Avoid byte register loads to avoid dependency stalls.
*/
if ((I32 || I64) &&
config.target_cpu >= TARGET_PentiumPro && !(flags & 4))
goto L3;
// See if another register has the right value
r = 0;
for (mreg = (regcon.immed.mval & BYTEREGS); mreg; mreg >>= 1)
{
if (mreg & 1)
{
if ((regcon.immed.value[r] & 0xFF) == value)
{
genregs(cdb,0x8A,reg,r); // MOV regL,rL
if (I64 && reg >= 4 || r >= 4)
code_orrex(cdb.last(), REX);
goto L2;
}
if (!(I64 && reg >= 4) &&
r < 4 && ((regcon.immed.value[r] >> 8) & 0xFF) == value)
{
genregs(cdb,0x8A,reg,r | 4); // MOV regL,rH
goto L2;
}
}
r++;
}
if (value == 0 && !(flags & 8))
{
if (!(flags & 4) && // if we can set the whole register
!(flags & 16 && reg & 4)) // and reg is not an H register
{
genregs(cdb,0x31,reg,reg); // XOR reg,reg
regimmed_set(reg,value);
regv = 0;
}
else
genregs(cdb,0x30,reg,reg); // XOR regL,regL
flags &= ~mPSW; // flags already set by XOR
}
else
{
cdb.genc2(0xC6,modregrmx(3,0,reg),value); // MOV regL,value
if (reg >= 4 && I64)
{
code_orrex(cdb.last(), REX);
}
}
L2:
if (flags & mPSW)
genregs(cdb,0x84,reg,reg); // TEST regL,regL
if (regm)
// Set just the 'L' part of the register value
regimmed_set(reg,(regv & ~cast(targ_size_t)0xFF) | value);
else if (flags & 16 && reg & 4 && regcon.immed.mval & mask(reg & 3))
// Set just the 'H' part of the register value
regimmed_set((reg & 3),(regv & ~cast(targ_size_t)0xFF00) | (value << 8));
return;
}
L3:
if (I16)
value = cast(targ_short) value; // sign-extend MSW
else if (I32)
value = cast(targ_int) value;
if (!I16 && flags & 2) // load 16 bit value
{
value &= 0xFFFF;
if (value && !(flags & mPSW))
{
cdb.genc2(0xC7,modregrmx(3,0,reg),value); // MOV reg,value
regimmed_set(reg, value);
return;
}
}
// If we already have the right value in the right register
if (regm && (regv & 0xFFFFFFFF) == (value & 0xFFFFFFFF) && !(flags & 64))
{
if (flags & mPSW)
gentstreg(cdb,reg);
}
else if (flags & 64 && regm && regv == value)
{ // Look at the full 64 bits
if (flags & mPSW)
{
gentstreg(cdb,reg);
code_orrex(cdb.last(), REX_W);
}
}
else
{
if (flags & mPSW)
{
switch (value)
{
case 0:
genregs(cdb,0x31,reg,reg);
break;
case 1:
if (I64)
goto L4;
genregs(cdb,0x31,reg,reg);
goto inc;
case ~cast(targ_size_t)0:
if (I64)
goto L4;
genregs(cdb,0x31,reg,reg);
goto dec;
default:
L4:
if (flags & 64)
{
cdb.genc2(0xB8 + (reg&7),REX_W << 16 | (reg&8) << 13,value); // MOV reg,value64
gentstreg(cdb,reg);
code_orrex(cdb.last(), REX_W);
}
else
{
value &= 0xFFFFFFFF;
cdb.genc2(0xB8 + (reg&7),(reg&8) << 13,value); // MOV reg,value
gentstreg(cdb,reg);
}
break;
}
}
else
{
// Look for single byte conversion
if (regcon.immed.mval & mAX)
{
if (I32)
{
if (reg == AX && value == cast(targ_short) regv)
{
cdb.gen1(0x98); // CWDE
goto done;
}
if (reg == DX &&
value == (regcon.immed.value[AX] & 0x80000000 ? 0xFFFFFFFF : 0) &&
!(config.flags4 & CFG4speed && config.target_cpu >= TARGET_Pentium)
)
{
cdb.gen1(0x99); // CDQ
goto done;
}
}
else if (I16)
{
if (reg == AX &&
cast(targ_short) value == cast(byte) regv)
{
cdb.gen1(0x98); // CBW
goto done;
}
if (reg == DX &&
cast(targ_short) value == (regcon.immed.value[AX] & 0x8000 ? cast(targ_short) 0xFFFF : cast(targ_short) 0) &&
!(config.flags4 & CFG4speed && config.target_cpu >= TARGET_Pentium)
)
{
cdb.gen1(0x99); // CWD
goto done;
}
}
}
if (value == 0 && !(flags & 8) && config.target_cpu >= TARGET_80486)
{
genregs(cdb,0x31,reg,reg); // XOR reg,reg
goto done;
}
if (!I64 && regm && !(flags & 8))
{
if (regv + 1 == value ||
// Catch case of (0xFFFF+1 == 0) for 16 bit compiles
(I16 && cast(targ_short)(regv + 1) == cast(targ_short)value))
{
inc:
cdb.gen1(0x40 + reg); // INC reg
goto done;
}
if (regv - 1 == value)
{
dec:
cdb.gen1(0x48 + reg); // DEC reg
goto done;
}
}
// See if another register has the right value
r = 0;
for (mreg = regcon.immed.mval; mreg; mreg >>= 1)
{
debug
assert(!I16 || regcon.immed.value[r] == cast(targ_short)regcon.immed.value[r]);
if (mreg & 1 && regcon.immed.value[r] == value)
{
genmovreg(cdb,reg,r);
goto done;
}
r++;
}
if (value == 0 && !(flags & 8))
{
genregs(cdb,0x31,reg,reg); // XOR reg,reg
}
else
{ // See if we can just load a byte
if (regm & BYTEREGS &&
!(config.flags4 & CFG4speed && config.target_cpu >= TARGET_PentiumPro)
)
{
if ((regv & ~cast(targ_size_t)0xFF) == (value & ~cast(targ_size_t)0xFF))
{
movregconst(cdb,reg,value,(flags & 8) |4|1); // load regL
return;
}
if (regm & (mAX|mBX|mCX|mDX) &&
(regv & ~cast(targ_size_t)0xFF00) == (value & ~cast(targ_size_t)0xFF00) &&
!I64)
{
movregconst(cdb,4|reg,value >> 8,(flags & 8) |4|1|16); // load regH
return;
}
}
if (flags & 64)
cdb.genc2(0xB8 + (reg&7),REX_W << 16 | (reg&8) << 13,value); // MOV reg,value64
else
{
value &= 0xFFFFFFFF;
cdb.genc2(0xB8 + (reg&7),(reg&8) << 13,value); // MOV reg,value
}
}
}
done:
regimmed_set(reg,value);
}
}
/**************************
* Generate a jump instruction.
*/
@trusted
void genjmp(ref CodeBuilder cdb,opcode_t op,uint fltarg,block *targ)
{
code cs;
cs.Iop = op & 0xFF;
cs.Iflags = 0;
cs.Irex = 0;
if (op != JMP && op != 0xE8) // if not already long branch
cs.Iflags = CFjmp16; // assume long branch for op = 0x7x
cs.IFL2 = cast(ubyte)fltarg; // FLblock (or FLcode)
cs.IEV2.Vblock = targ; // target block (or code)
if (fltarg == FLcode)
(cast(code *)targ).Iflags |= CFtarg;
if (config.flags4 & CFG4fastfloat) // if fast floating point
{
cdb.gen(&cs);
return;
}
switch (op & 0xFF00) // look at second jump opcode
{
// The JP and JNP come from floating point comparisons
case JP << 8:
cdb.gen(&cs);
cs.Iop = JP;
cdb.gen(&cs);
break;
case JNP << 8:
{
// Do a JP around the jump instruction
code *cnop = gennop(null);
genjmp(cdb,JP,FLcode,cast(block *) cnop);
cdb.gen(&cs);
cdb.append(cnop);
break;
}
case 1 << 8: // toggled no jump
case 0 << 8:
cdb.gen(&cs);
break;
default:
debug
printf("jop = x%x\n",op);
assert(0);
}
}
/*********************************************
* Generate first part of prolog for interrupt function.
*/
@trusted
void prolog_ifunc(ref CodeBuilder cdb, tym_t* tyf)
{
static immutable ubyte[4] ops2 = [ 0x60,0x1E,0x06,0 ];
static immutable ubyte[11] ops0 = [ 0x50,0x51,0x52,0x53,
0x54,0x55,0x56,0x57,
0x1E,0x06,0 ];
immutable(ubyte)* p = (config.target_cpu >= TARGET_80286) ? ops2.ptr : ops0.ptr;
do
cdb.gen1(*p);
while (*++p);
genregs(cdb,0x8B,BP,SP); // MOV BP,SP
if (localsize)
cod3_stackadj(cdb, cast(int)localsize);
*tyf |= mTYloadds;
}
@trusted
void prolog_ifunc2(ref CodeBuilder cdb, tym_t tyf, tym_t tym, bool pushds)
{
/* Determine if we need to reload DS */
if (tyf & mTYloadds)
{
if (!pushds) // if not already pushed
cdb.gen1(0x1E); // PUSH DS
spoff += _tysize[TYint];
cdb.genc(0xC7,modregrm(3,0,AX),0,0,FLdatseg,cast(targ_uns) 0); // MOV AX,DGROUP
code *c = cdb.last();
c.IEV2.Vseg = DATA;
c.Iflags ^= CFseg | CFoff; // turn off CFoff, on CFseg
cdb.gen2(0x8E,modregrm(3,3,AX)); // MOV DS,AX
useregs(mAX);
}
if (tym == TYifunc)
cdb.gen1(0xFC); // CLD
}
@trusted
void prolog_16bit_windows_farfunc(ref CodeBuilder cdb, tym_t* tyf, bool* pushds)
{
int wflags = config.wflags;
if (wflags & WFreduced && !(*tyf & mTYexport))
{ // reduced prolog/epilog for non-exported functions
wflags &= ~(WFdgroup | WFds | WFss);
}
getregsNoSave(mAX); // should not have any value in AX
int segreg;
switch (wflags & (WFdgroup | WFds | WFss))
{
case WFdgroup: // MOV AX,DGROUP
{
if (wflags & WFreduced)
*tyf &= ~mTYloadds; // remove redundancy
cdb.genc(0xC7,modregrm(3,0,AX),0,0,FLdatseg,cast(targ_uns) 0);
code *c = cdb.last();
c.IEV2.Vseg = DATA;
c.Iflags ^= CFseg | CFoff; // turn off CFoff, on CFseg
break;
}
case WFss:
segreg = 2; // SS
goto Lmovax;
case WFds:
segreg = 3; // DS
Lmovax:
cdb.gen2(0x8C,modregrm(3,segreg,AX)); // MOV AX,segreg
if (wflags & WFds)
cdb.gen1(0x90); // NOP
break;
case 0:
break;
default:
debug
printf("config.wflags = x%x\n",config.wflags);
assert(0);
}
if (wflags & WFincbp)
cdb.gen1(0x40 + BP); // INC BP
cdb.gen1(0x50 + BP); // PUSH BP
genregs(cdb,0x8B,BP,SP); // MOV BP,SP
if (wflags & (WFsaveds | WFds | WFss | WFdgroup))
{
cdb.gen1(0x1E); // PUSH DS
*pushds = true;
BPoff = -REGSIZE;
}
if (wflags & (WFds | WFss | WFdgroup))
cdb.gen2(0x8E,modregrm(3,3,AX)); // MOV DS,AX
}
/**********************************************
* Set up frame register.
* Params:
* cdb = write generated code here
* farfunc = true if a far function
* enter = set to true if ENTER instruction can be used, false otherwise
* xlocalsize = amount of local variables, set to amount to be subtracted from stack pointer
* cfa_offset = set to frame pointer's offset from the CFA
* Returns:
* generated code
*/
@trusted
void prolog_frame(ref CodeBuilder cdb, bool farfunc, ref uint xlocalsize, out bool enter, out int cfa_offset)
{
//printf("prolog_frame\n");
cfa_offset = 0;
if (0 && config.exe == EX_WIN64)
{
// PUSH RBP
// LEA RBP,0[RSP]
cdb. gen1(0x50 + BP);
cdb.genc1(LEA,(REX_W<<16) | (modregrm(0,4,SP)<<8) | modregrm(2,BP,4),FLconst,0);
enter = false;
return;
}
if (config.wflags & WFincbp && farfunc)
cdb.gen1(0x40 + BP); // INC BP
if (config.target_cpu < TARGET_80286 ||
config.exe & (EX_posix | EX_WIN64) ||
!localsize ||
config.flags & CFGstack ||
(xlocalsize >= 0x1000 && config.exe & EX_flat) ||
localsize >= 0x10000 ||
(NTEXCEPTIONS == 2 &&
(usednteh & (NTEH_try | NTEH_except | NTEHcpp | EHcleanup | EHtry | NTEHpassthru) && (config.ehmethod == EHmethod.EH_WIN32 && !(funcsym_p.Sfunc.Fflags3 & Feh_none) || config.ehmethod == EHmethod.EH_SEH))) ||
(config.target_cpu >= TARGET_80386 &&
config.flags4 & CFG4speed)
)
{
cdb.gen1(0x50 + BP); // PUSH BP
genregs(cdb,0x8B,BP,SP); // MOV BP,SP
if (I64)
code_orrex(cdb.last(), REX_W); // MOV RBP,RSP
if ((config.objfmt & (OBJ_ELF | OBJ_MACH)) && config.fulltypes)
// Don't reorder instructions, as dwarf CFA relies on it
code_orflag(cdb.last(), CFvolatile);
static if (NTEXCEPTIONS == 2)
{
if (usednteh & (NTEH_try | NTEH_except | NTEHcpp | EHcleanup | EHtry | NTEHpassthru) && (config.ehmethod == EHmethod.EH_WIN32 && !(funcsym_p.Sfunc.Fflags3 & Feh_none) || config.ehmethod == EHmethod.EH_SEH))
{
nteh_prolog(cdb);
int sz = nteh_contextsym_size();
assert(sz != 0); // should be 5*4, not 0
xlocalsize -= sz; // sz is already subtracted from ESP
// by nteh_prolog()
}
}
if (config.fulltypes == CVDWARF_C || config.fulltypes == CVDWARF_D ||
config.ehmethod == EHmethod.EH_DWARF)
{
int off = 2 * REGSIZE; // 1 for the return address + 1 for the PUSH EBP
dwarf_CFA_set_loc(1); // address after PUSH EBP
dwarf_CFA_set_reg_offset(SP, off); // CFA is now 8[ESP]
dwarf_CFA_offset(BP, -off); // EBP is at 0[ESP]
dwarf_CFA_set_loc(I64 ? 4 : 3); // address after MOV EBP,ESP
/* Oddly, the CFA is not the same as the frame pointer,
* which is why the offset of BP is set to 8
*/
dwarf_CFA_set_reg_offset(BP, off); // CFA is now 0[EBP]
cfa_offset = off; // remember the difference between the CFA and the frame pointer
}
enter = false; /* do not use ENTER instruction */
}
else
enter = true;
}
/**********************************************
* Enforce stack alignment.
* Input:
* cdb code builder.
* Returns:
* generated code
*/
@trusted
void prolog_stackalign(ref CodeBuilder cdb)
{
if (!enforcealign)
return;
const offset = (hasframe ? 2 : 1) * REGSIZE; // 1 for the return address + 1 for the PUSH EBP
if (offset & (STACKALIGN - 1) || TARGET_STACKALIGN < STACKALIGN)
cod3_stackalign(cdb, STACKALIGN);
}
@trusted
void prolog_frameadj(ref CodeBuilder cdb, tym_t tyf, uint xlocalsize, bool enter, bool* pushalloc)
{
uint pushallocreg = (tyf == TYmfunc) ? CX : AX;
bool check;
if (config.exe & (EX_LINUX | EX_LINUX64))
check = false; // seems that Linux doesn't need to fault in stack pages
else
check = (config.flags & CFGstack && !(I32 && xlocalsize < 0x1000)) // if stack overflow check
|| (config.exe & (EX_windos & EX_flat) && xlocalsize >= 0x1000);
if (check)
{
if (I16)
{
// BUG: Won't work if parameter is passed in AX
movregconst(cdb,AX,xlocalsize,false); // MOV AX,localsize
makeitextern(getRtlsym(RTLSYM_CHKSTK));
// CALL _chkstk
cdb.gencs((LARGECODE) ? 0x9A : CALL,0,FLfunc,getRtlsym(RTLSYM_CHKSTK));
useregs((ALLREGS | mBP | mES) & ~getRtlsym(RTLSYM_CHKSTK).Sregsaved);
}
else
{
/* Watch out for 64 bit code where EDX is passed as a register parameter
*/
reg_t reg = I64 ? R11 : DX; // scratch register
/* MOV EDX, xlocalsize/0x1000
* L1: SUB ESP, 0x1000
* TEST [ESP],ESP
* DEC EDX
* JNE L1
* SUB ESP, xlocalsize % 0x1000
*/
movregconst(cdb, reg, xlocalsize / 0x1000, false);
cod3_stackadj(cdb, 0x1000);
code_orflag(cdb.last(), CFtarg2);
cdb.gen2sib(0x85, modregrm(0,SP,4),modregrm(0,4,SP));
if (I64)
{ cdb.gen2(0xFF, modregrmx(3,1,R11)); // DEC R11D
cdb.genc2(JNE,0,cast(targ_uns)-15);
}
else
{ cdb.gen1(0x48 + DX); // DEC EDX
cdb.genc2(JNE,0,cast(targ_uns)-12);
}
regimmed_set(reg,0); // reg is now 0
cod3_stackadj(cdb, xlocalsize & 0xFFF);
useregs(mask(reg));
}
}
else
{
if (enter)
{ // ENTER xlocalsize,0
cdb.genc(ENTER,0,FLconst,xlocalsize,FLconst,cast(targ_uns) 0);
assert(!(config.fulltypes == CVDWARF_C || config.fulltypes == CVDWARF_D)); // didn't emit Dwarf data
}
else if (xlocalsize == REGSIZE && config.flags4 & CFG4optimized)
{
cdb. gen1(0x50 + pushallocreg); // PUSH AX
// Do this to prevent an -x[EBP] to be moved in
// front of the push.
code_orflag(cdb.last(),CFvolatile);
*pushalloc = true;
}
else
cod3_stackadj(cdb, xlocalsize);
}
}
void prolog_frameadj2(ref CodeBuilder cdb, tym_t tyf, uint xlocalsize, bool* pushalloc)
{
uint pushallocreg = (tyf == TYmfunc) ? CX : AX;
if (xlocalsize == REGSIZE)
{
cdb.gen1(0x50 + pushallocreg); // PUSH AX
*pushalloc = true;
}
else if (xlocalsize == 2 * REGSIZE)
{
cdb.gen1(0x50 + pushallocreg); // PUSH AX
cdb.gen1(0x50 + pushallocreg); // PUSH AX
*pushalloc = true;
}
else
cod3_stackadj(cdb, xlocalsize);
}
@trusted
void prolog_setupalloca(ref CodeBuilder cdb)
{
//printf("prolog_setupalloca() offset x%x size x%x alignment x%x\n",
//cast(int)Alloca.offset, cast(int)Alloca.size, cast(int)Alloca.alignment);
// Set up magic parameter for alloca()
// MOV -REGSIZE[BP],localsize - BPoff
cdb.genc(0xC7,modregrm(2,0,BPRM),
FLconst,Alloca.offset + BPoff,
FLconst,localsize - BPoff);
if (I64)
code_orrex(cdb.last(), REX_W);
}
/**************************************
* Save registers that the function destroys,
* but that the ABI says should be preserved across
* function calls.
*
* Emit Dwarf info for these saves.
* Params:
* cdb = append generated instructions to this
* topush = mask of registers to push
* cfa_offset = offset of frame pointer from CFA
*/
@trusted
void prolog_saveregs(ref CodeBuilder cdb, regm_t topush, int cfa_offset)
{
if (pushoffuse)
{
// Save to preallocated section in the stack frame
int xmmtopush = numbitsset(topush & XMMREGS); // XMM regs take 16 bytes
int gptopush = numbitsset(topush) - xmmtopush; // general purpose registers to save
targ_size_t xmmoffset = pushoff + BPoff;
if (!hasframe || enforcealign)
xmmoffset += EBPtoESP;
targ_size_t gpoffset = xmmoffset + xmmtopush * 16;
while (topush)
{
reg_t reg = findreg(topush);
topush &= ~mask(reg);
if (isXMMreg(reg))
{
if (hasframe && !enforcealign)
{
// MOVUPD xmmoffset[EBP],xmm
cdb.genc1(STOUPD,modregxrm(2,reg-XMM0,BPRM),FLconst,xmmoffset);
}
else
{
// MOVUPD xmmoffset[ESP],xmm
cdb.genc1(STOUPD,modregxrm(2,reg-XMM0,4) + 256*modregrm(0,4,SP),FLconst,xmmoffset);
}
xmmoffset += 16;
}
else
{
if (hasframe && !enforcealign)
{
// MOV gpoffset[EBP],reg
cdb.genc1(0x89,modregxrm(2,reg,BPRM),FLconst,gpoffset);
}
else
{
// MOV gpoffset[ESP],reg
cdb.genc1(0x89,modregxrm(2,reg,4) + 256*modregrm(0,4,SP),FLconst,gpoffset);
}
if (I64)
code_orrex(cdb.last(), REX_W);
if (config.fulltypes == CVDWARF_C || config.fulltypes == CVDWARF_D ||
config.ehmethod == EHmethod.EH_DWARF)
{ // Emit debug_frame data giving location of saved register
code *c = cdb.finish();
pinholeopt(c, null);
dwarf_CFA_set_loc(calcblksize(c)); // address after save
dwarf_CFA_offset(reg, cast(int)(gpoffset - cfa_offset));
cdb.reset();
cdb.append(c);
}
gpoffset += REGSIZE;
}
}
}
else
{
while (topush) /* while registers to push */
{
reg_t reg = findreg(topush);
topush &= ~mask(reg);
if (isXMMreg(reg))
{
// SUB RSP,16
cod3_stackadj(cdb, 16);
// MOVUPD 0[RSP],xmm
cdb.genc1(STOUPD,modregxrm(2,reg-XMM0,4) + 256*modregrm(0,4,SP),FLconst,0);
EBPtoESP += 16;
spoff += 16;
}
else
{
genpush(cdb, reg);
EBPtoESP += REGSIZE;
spoff += REGSIZE;
if (config.fulltypes == CVDWARF_C || config.fulltypes == CVDWARF_D ||
config.ehmethod == EHmethod.EH_DWARF)
{ // Emit debug_frame data giving location of saved register
// relative to 0[EBP]
code *c = cdb.finish();
pinholeopt(c, null);
dwarf_CFA_set_loc(calcblksize(c)); // address after PUSH reg
dwarf_CFA_offset(reg, -EBPtoESP - cfa_offset);
cdb.reset();
cdb.append(c);
}
}
}
}
}
/**************************************
* Undo prolog_saveregs()
*/
@trusted
private void epilog_restoreregs(ref CodeBuilder cdb, regm_t topop)
{
debug
if (topop & ~(XMMREGS | 0xFFFF))
printf("fregsaved = %s, mfuncreg = %s\n",regm_str(fregsaved),regm_str(mfuncreg));
assert(!(topop & ~(XMMREGS | 0xFFFF)));
if (pushoffuse)
{
// Save to preallocated section in the stack frame
int xmmtopop = numbitsset(topop & XMMREGS); // XMM regs take 16 bytes
int gptopop = numbitsset(topop) - xmmtopop; // general purpose registers to save
targ_size_t xmmoffset = pushoff + BPoff;
if (!hasframe || enforcealign)
xmmoffset += EBPtoESP;
targ_size_t gpoffset = xmmoffset + xmmtopop * 16;
while (topop)
{
reg_t reg = findreg(topop);
topop &= ~mask(reg);
if (isXMMreg(reg))
{
if (hasframe && !enforcealign)
{
// MOVUPD xmm,xmmoffset[EBP]
cdb.genc1(LODUPD,modregxrm(2,reg-XMM0,BPRM),FLconst,xmmoffset);
}
else
{
// MOVUPD xmm,xmmoffset[ESP]
cdb.genc1(LODUPD,modregxrm(2,reg-XMM0,4) + 256*modregrm(0,4,SP),FLconst,xmmoffset);
}
xmmoffset += 16;
}
else
{
if (hasframe && !enforcealign)
{
// MOV reg,gpoffset[EBP]
cdb.genc1(0x8B,modregxrm(2,reg,BPRM),FLconst,gpoffset);
}
else
{
// MOV reg,gpoffset[ESP]
cdb.genc1(0x8B,modregxrm(2,reg,4) + 256*modregrm(0,4,SP),FLconst,gpoffset);
}
if (I64)
code_orrex(cdb.last(), REX_W);
gpoffset += REGSIZE;
}
}
}
else
{
reg_t reg = I64 ? XMM7 : DI;
if (!(topop & XMMREGS))
reg = R15;
regm_t regm = 1 << reg;
while (topop)
{ if (topop & regm)
{
if (isXMMreg(reg))
{
// MOVUPD xmm,0[RSP]
cdb.genc1(LODUPD,modregxrm(2,reg-XMM0,4) + 256*modregrm(0,4,SP),FLconst,0);
// ADD RSP,16
cod3_stackadj(cdb, -16);
}
else
{
cdb.gen1(0x58 + (reg & 7)); // POP reg
if (reg & 8)
code_orrex(cdb.last(), REX_B);
}
topop &= ~regm;
}
regm >>= 1;
reg--;
}
}
}
version (SCPP)
{
@trusted
void prolog_trace(ref CodeBuilder cdb, bool farfunc, uint* regsaved)
{
Symbol *s = getRtlsym(farfunc ? RTLSYM_TRACE_PRO_F : RTLSYM_TRACE_PRO_N);
makeitextern(s);
cdb.gencs(I16 ? 0x9A : CALL,0,FLfunc,s); // CALL _trace
if (!I16)
code_orflag(cdb.last(),CFoff | CFselfrel);
/* Embedding the function name inline after the call works, but it
* makes disassembling the code annoying.
*/
static if (ELFOBJ || MACHOBJ)
{
// Generate length prefixed name that is recognized by profiler
size_t len = strlen(funcsym_p.Sident);
char *buffer = cast(char *)malloc(len + 4);
assert(buffer);
if (len <= 254)
{
buffer[0] = len;
memcpy(buffer + 1, funcsym_p.Sident, len);
len++;
}
else
{
buffer[0] = 0xFF;
buffer[1] = 0;
buffer[2] = len & 0xFF;
buffer[3] = len >> 8;
memcpy(buffer + 4, funcsym_p.Sident, len);
len += 4;
}
cdb.genasm(buffer, len); // append func name
free(buffer);
}
else
{
char [IDMAX+IDOHD+1] name = void;
size_t len = objmod.mangle(funcsym_p,name.ptr);
assert(len < name.length);
cdb.genasm(name.ptr,len); // append func name
}
*regsaved = s.Sregsaved;
}
}
/******************************
* Generate special varargs prolog for Posix 64 bit systems.
* Params:
* cdb = sink for generated code
* sv = symbol for __va_argsave
* namedargs = registers that named parameters (not ... arguments) were passed in.
*/
@trusted
void prolog_genvarargs(ref CodeBuilder cdb, Symbol* sv, regm_t namedargs)
{
/* Generate code to move any arguments passed in registers into
* the stack variable __va_argsave,
* so we can reference it via pointers through va_arg().
* struct __va_argsave_t {
* size_t[6] regs;
* real[8] fpregs;
* uint offset_regs;
* uint offset_fpregs;
* void* stack_args;
* void* reg_args;
* }
* The MOVAPS instructions seg fault if data is not aligned on
* 16 bytes, so this gives us a nice check to ensure no mistakes.
MOV voff+0*8[RBP],EDI
MOV voff+1*8[RBP],ESI
MOV voff+2*8[RBP],RDX
MOV voff+3*8[RBP],RCX
MOV voff+4*8[RBP],R8
MOV voff+5*8[RBP],R9
MOVZX EAX,AL // AL = 0..8, # of XMM registers used
SHL EAX,2 // 4 bytes for each MOVAPS
LEA R11,offset L2[RIP]
SUB R11,RAX
LEA RAX,voff+6*8+0x7F[RBP]
JMP R11d
MOVAPS -0x0F[RAX],XMM7 // only save XMM registers if actually used
MOVAPS -0x1F[RAX],XMM6
MOVAPS -0x2F[RAX],XMM5
MOVAPS -0x3F[RAX],XMM4
MOVAPS -0x4F[RAX],XMM3
MOVAPS -0x5F[RAX],XMM2
MOVAPS -0x6F[RAX],XMM1
MOVAPS -0x7F[RAX],XMM0
L2:
MOV 1[RAX],offset_regs // set __va_argsave.offset_regs
MOV 5[RAX],offset_fpregs // set __va_argsave.offset_fpregs
LEA R11, Para.size+Para.offset[RBP]
MOV 9[RAX],R11 // set __va_argsave.stack_args
SUB RAX,6*8+0x7F // point to start of __va_argsave
MOV 6*8+8*16+4+4+8[RAX],RAX // set __va_argsave.reg_args
* RAX and R11 are destroyed.
*/
/* Save registers into the voff area on the stack
*/
targ_size_t voff = Auto.size + BPoff + sv.Soffset; // EBP offset of start of sv
const int vregnum = 6;
const uint vsize = vregnum * 8 + 8 * 16;
static immutable ubyte[vregnum] regs = [ DI,SI,DX,CX,R8,R9 ];
if (!hasframe || enforcealign)
voff += EBPtoESP;
for (int i = 0; i < vregnum; i++)
{
uint r = regs[i];
if (!(mask(r) & namedargs)) // unnamed arguments would be the ... ones
{
uint ea = (REX_W << 16) | modregxrm(2,r,BPRM);
if (!hasframe || enforcealign)
ea = (REX_W << 16) | (modregrm(0,4,SP) << 8) | modregxrm(2,r,4);
cdb.genc1(0x89,ea,FLconst,voff + i*8);
}
}
genregs(cdb,MOVZXb,AX,AX); // MOVZX EAX,AL
cdb.genc2(0xC1,modregrm(3,4,AX),2); // SHL EAX,2
int raxoff = cast(int)(voff+6*8+0x7F);
uint L2offset = (raxoff < -0x7F) ? 0x2D : 0x2A;
if (!hasframe || enforcealign)
L2offset += 1; // +1 for sib byte
// LEA R11,offset L2[RIP]
cdb.genc1(LEA,(REX_W << 16) | modregxrm(0,R11,5),FLconst,L2offset);
genregs(cdb,0x29,AX,R11); // SUB R11,RAX
code_orrex(cdb.last(), REX_W);
// LEA RAX,voff+vsize-6*8-16+0x7F[RBP]
uint ea = (REX_W << 16) | modregrm(2,AX,BPRM);
if (!hasframe || enforcealign)
// add sib byte for [RSP] addressing
ea = (REX_W << 16) | (modregrm(0,4,SP) << 8) | modregxrm(2,AX,4);
cdb.genc1(LEA,ea,FLconst,raxoff);
cdb.gen2(0xFF,modregrmx(3,4,R11)); // JMP R11d
for (int i = 0; i < 8; i++)
{
// MOVAPS -15-16*i[RAX],XMM7-i
cdb.genc1(0x0F29,modregrm(0,XMM7-i,0),FLconst,-15-16*i);
}
/* Compute offset_regs and offset_fpregs
*/
uint offset_regs = 0;
uint offset_fpregs = vregnum * 8;
for (int i = AX; i <= XMM7; i++)
{
regm_t m = mask(i);
if (m & namedargs)
{
if (m & (mDI|mSI|mDX|mCX|mR8|mR9))
offset_regs += 8;
else if (m & XMMREGS)
offset_fpregs += 16;
namedargs &= ~m;
if (!namedargs)
break;
}
}
// MOV 1[RAX],offset_regs
cdb.genc(0xC7,modregrm(2,0,AX),FLconst,1,FLconst,offset_regs);
// MOV 5[RAX],offset_fpregs
cdb.genc(0xC7,modregrm(2,0,AX),FLconst,5,FLconst,offset_fpregs);
// LEA R11, Para.size+Para.offset[RBP]
ea = modregxrm(2,R11,BPRM);
if (!hasframe)
ea = (modregrm(0,4,SP) << 8) | modregrm(2,DX,4);
Para.offset = (Para.offset + (REGSIZE - 1)) & ~(REGSIZE - 1);
cdb.genc1(LEA,(REX_W << 16) | ea,FLconst,Para.size + Para.offset);
// MOV 9[RAX],R11
cdb.genc1(0x89,(REX_W << 16) | modregxrm(2,R11,AX),FLconst,9);
// SUB RAX,6*8+0x7F // point to start of __va_argsave
cdb.genc2(0x2D,0,6*8+0x7F);
code_orrex(cdb.last(), REX_W);
// MOV 6*8+8*16+4+4+8[RAX],RAX // set __va_argsave.reg_args
cdb.genc1(0x89,(REX_W << 16) | modregrm(2,AX,AX),FLconst,6*8+8*16+4+4+8);
pinholeopt(cdb.peek(), null);
useregs(mAX|mR11);
}
void prolog_gen_win64_varargs(ref CodeBuilder cdb)
{
/* The Microsoft scheme.
* http://msdn.microsoft.com/en-US/library/dd2wa36c(v=vs.80)
* Copy registers onto stack.
mov 8[RSP],RCX
mov 010h[RSP],RDX
mov 018h[RSP],R8
mov 020h[RSP],R9
*/
}
/************************************
* Params:
* cdb = generated code sink
* tf = what's the type of the function
* pushalloc = use PUSH to allocate on the stack rather than subtracting from SP
* namedargs = set to the registers that named parameters were passed in
*/
@trusted
void prolog_loadparams(ref CodeBuilder cdb, tym_t tyf, bool pushalloc, out regm_t namedargs)
{
//printf("prolog_loadparams()\n");
debug
for (SYMIDX si = 0; si < globsym.length; si++)
{
Symbol *s = globsym[si];
if (debugr && (s.Sclass == SCfastpar || s.Sclass == SCshadowreg))
{
printf("symbol '%s' is fastpar in register [l %s, m %s]\n", s.Sident.ptr,
regm_str(mask(s.Spreg)),
(s.Spreg2 == NOREG ? "NOREG" : regm_str(mask(s.Spreg2))));
if (s.Sfl == FLreg)
printf("\tassigned to register %s\n", regm_str(mask(s.Sreglsw)));
}
}
uint pushallocreg = (tyf == TYmfunc) ? CX : AX;
/* Copy SCfastpar and SCshadowreg (parameters passed in registers) that were not assigned
* registers into their stack locations.
*/
regm_t shadowregm = 0;
for (SYMIDX si = 0; si < globsym.length; si++)
{
Symbol *s = globsym[si];
uint sz = cast(uint)type_size(s.Stype);
if (!((s.Sclass == SCfastpar || s.Sclass == SCshadowreg) && s.Sfl != FLreg))
continue;
// Argument is passed in a register
type *t = s.Stype;
type *t2 = null;
tym_t tyb = tybasic(t.Tty);
// This logic is same as FuncParamRegs_alloc function at src/dmd/backend/cod1.d
//
// Find suitable SROA based on the element type
// (Don't put volatile parameters in registers)
if (tyb == TYarray && !(t.Tty & mTYvolatile))
{
type *targ1;
argtypes(t, targ1, t2);
if (targ1)
t = targ1;
}
// If struct just wraps another type
if (tyb == TYstruct)
{
// On windows 64 bits, structs occupy a general purpose register,
// regardless of the struct size or the number & types of its fields.
if (config.exe != EX_WIN64)
{
type *targ1 = t.Ttag.Sstruct.Sarg1type;
t2 = t.Ttag.Sstruct.Sarg2type;
if (targ1)
t = targ1;
}
}
if (Symbol_Sisdead(s, anyiasm))
{
// Ignore it, as it is never referenced
continue;
}
targ_size_t offset = Fast.size + BPoff;
if (s.Sclass == SCshadowreg)
offset = Para.size;
offset += s.Soffset;
if (!hasframe || (enforcealign && s.Sclass != SCshadowreg))
offset += EBPtoESP;
reg_t preg = s.Spreg;
foreach (i; 0 .. 2) // twice, once for each possible parameter register
{
static type* type_arrayBase(type* ta)
{
while (tybasic(ta.Tty) == TYarray)
ta = ta.Tnext;
return ta;
}
shadowregm |= mask(preg);
const opcode_t op = isXMMreg(preg)
? xmmstore(type_arrayBase(t).Tty)
: 0x89; // MOV x[EBP],preg
if (!(pushalloc && preg == pushallocreg) || s.Sclass == SCshadowreg)
{
if (hasframe && (!enforcealign || s.Sclass == SCshadowreg))
{
// MOV x[EBP],preg
cdb.genc1(op,modregxrm(2,preg,BPRM),FLconst,offset);
if (isXMMreg(preg))
{
checkSetVex(cdb.last(), t.Tty);
}
else
{
//printf("%s Fast.size = %d, BPoff = %d, Soffset = %d, sz = %d\n",
// s.Sident, (int)Fast.size, (int)BPoff, (int)s.Soffset, (int)sz);
if (I64 && sz > 4)
code_orrex(cdb.last(), REX_W);
}
}
else
{
// MOV offset[ESP],preg
// BUG: byte size?
cdb.genc1(op,
(modregrm(0,4,SP) << 8) |
modregxrm(2,preg,4),FLconst,offset);
if (isXMMreg(preg))
{
checkSetVex(cdb.last(), t.Tty);
}
else
{
if (I64 && sz > 4)
cdb.last().Irex |= REX_W;
}
}
}
preg = s.Spreg2;
if (preg == NOREG)
break;
if (t2)
t = t2;
offset += REGSIZE;
}
}
if (config.exe == EX_WIN64 && variadic(funcsym_p.Stype))
{
/* The Microsoft scheme.
* http://msdn.microsoft.com/en-US/library/dd2wa36c(v=vs.80)
* Copy registers onto stack.
mov 8[RSP],RCX or XMM0
mov 010h[RSP],RDX or XMM1
mov 018h[RSP],R8 or XMM2
mov 020h[RSP],R9 or XMM3
*/
static immutable reg_t[4] vregs = [ CX,DX,R8,R9 ];
for (int i = 0; i < vregs.length; ++i)
{
uint preg = vregs[i];
uint offset = cast(uint)(Para.size + i * REGSIZE);
if (!(shadowregm & (mask(preg) | mask(XMM0 + i))))
{
if (hasframe)
{
// MOV x[EBP],preg
cdb.genc1(0x89,
modregxrm(2,preg,BPRM),FLconst, offset);
code_orrex(cdb.last(), REX_W);
}
else
{
// MOV offset[ESP],preg
cdb.genc1(0x89,
(modregrm(0,4,SP) << 8) |
modregxrm(2,preg,4),FLconst,offset + EBPtoESP);
}
cdb.last().Irex |= REX_W;
}
}
}
/* Copy SCfastpar and SCshadowreg (parameters passed in registers) that were assigned registers
* into their assigned registers.
* Note that we have a big problem if Pa is passed in R1 and assigned to R2,
* and Pb is passed in R2 but assigned to R1. Detect it and assert.
*/
regm_t assignregs = 0;
for (SYMIDX si = 0; si < globsym.length; si++)
{
Symbol *s = globsym[si];
uint sz = cast(uint)type_size(s.Stype);
if (s.Sclass == SCfastpar || s.Sclass == SCshadowreg)
namedargs |= s.Spregm();
if (!((s.Sclass == SCfastpar || s.Sclass == SCshadowreg) && s.Sfl == FLreg))
{
// Argument is passed in a register
continue;
}
type *t = s.Stype;
type *t2 = null;
if (tybasic(t.Tty) == TYstruct && config.exe != EX_WIN64)
{ type *targ1 = t.Ttag.Sstruct.Sarg1type;
t2 = t.Ttag.Sstruct.Sarg2type;
if (targ1)
t = targ1;
}
reg_t preg = s.Spreg;
reg_t r = s.Sreglsw;
for (int i = 0; i < 2; ++i)
{
if (preg == NOREG)
break;
assert(!(mask(preg) & assignregs)); // not already stepped on
assignregs |= mask(r);
// MOV reg,preg
if (r == preg)
{
}
else if (mask(preg) & XMMREGS)
{
const op = xmmload(t.Tty); // MOVSS/D xreg,preg
uint xreg = r - XMM0;
cdb.gen2(op,modregxrmx(3,xreg,preg - XMM0));
}
else
{
//printf("test1 mov %s, %s\n", regstring[r], regstring[preg]);
genmovreg(cdb,r,preg);
if (I64 && sz == 8)
code_orrex(cdb.last(), REX_W);
}
preg = s.Spreg2;
r = s.Sregmsw;
if (t2)
t = t2;
}
}
/* For parameters that were passed on the stack, but are enregistered,
* initialize the registers with the parameter stack values.
* Do not use assignaddr(), as it will replace the stack reference with
* the register.
*/
for (SYMIDX si = 0; si < globsym.length; si++)
{
Symbol *s = globsym[si];
uint sz = cast(uint)type_size(s.Stype);
if (!((s.Sclass == SCregpar || s.Sclass == SCparameter) &&
s.Sfl == FLreg &&
(refparam
// This variable has been reference by a nested function
|| MARS && s.Stype.Tty & mTYvolatile
)))
{
continue;
}
// MOV reg,param[BP]
//assert(refparam);
if (mask(s.Sreglsw) & XMMREGS)
{
const op = xmmload(s.Stype.Tty); // MOVSS/D xreg,mem
uint xreg = s.Sreglsw - XMM0;
cdb.genc1(op,modregxrm(2,xreg,BPRM),FLconst,Para.size + s.Soffset);
if (!hasframe)
{ // Convert to ESP relative address rather than EBP
code *c = cdb.last();
c.Irm = cast(ubyte)modregxrm(2,xreg,4);
c.Isib = modregrm(0,4,SP);
c.IEV1.Vpointer += EBPtoESP;
}
continue;
}
cdb.genc1(sz == 1 ? 0x8A : 0x8B,
modregxrm(2,s.Sreglsw,BPRM),FLconst,Para.size + s.Soffset);
code *c = cdb.last();
if (!I16 && sz == SHORTSIZE)
c.Iflags |= CFopsize; // operand size
if (I64 && sz >= REGSIZE)
c.Irex |= REX_W;
if (I64 && sz == 1 && s.Sreglsw >= 4)
c.Irex |= REX;
if (!hasframe)
{ // Convert to ESP relative address rather than EBP
assert(!I16);
c.Irm = cast(ubyte)modregxrm(2,s.Sreglsw,4);
c.Isib = modregrm(0,4,SP);
c.IEV1.Vpointer += EBPtoESP;
}
if (sz > REGSIZE)
{
cdb.genc1(0x8B,
modregxrm(2,s.Sregmsw,BPRM),FLconst,Para.size + s.Soffset + REGSIZE);
code *cx = cdb.last();
if (I64)
cx.Irex |= REX_W;
if (!hasframe)
{ // Convert to ESP relative address rather than EBP
assert(!I16);
cx.Irm = cast(ubyte)modregxrm(2,s.Sregmsw,4);
cx.Isib = modregrm(0,4,SP);
cx.IEV1.Vpointer += EBPtoESP;
}
}
}
}
/*******************************
* Generate and return function epilog.
* Output:
* retsize Size of function epilog
*/
@trusted
void epilog(block *b)
{
code *cpopds;
reg_t reg;
reg_t regx; // register that's not a return reg
regm_t topop,regm;
targ_size_t xlocalsize = localsize;
CodeBuilder cdbx; cdbx.ctor();
tym_t tyf = funcsym_p.ty();
tym_t tym = tybasic(tyf);
bool farfunc = tyfarfunc(tym) != 0;
if (!(b.Bflags & BFLepilog)) // if no epilog code
goto Lret; // just generate RET
regx = (b.BC == BCret) ? AX : CX;
retsize = 0;
if (tyf & mTYnaked) // if no prolog/epilog
return;
if (tym == TYifunc)
{
static immutable ubyte[5] ops2 = [ 0x07,0x1F,0x61,0xCF,0 ];
static immutable ubyte[12] ops0 = [ 0x07,0x1F,0x5F,0x5E,
0x5D,0x5B,0x5B,0x5A,
0x59,0x58,0xCF,0 ];
genregs(cdbx,0x8B,SP,BP); // MOV SP,BP
auto p = (config.target_cpu >= TARGET_80286) ? ops2.ptr : ops0.ptr;
do
cdbx.gen1(*p);
while (*++p);
goto Lopt;
}
if (config.flags & CFGtrace &&
(!(config.flags4 & CFG4allcomdat) ||
funcsym_p.Sclass == SCcomdat ||
funcsym_p.Sclass == SCglobal ||
(config.flags2 & CFG2comdat && SymInline(funcsym_p))
)
)
{
Symbol *s = getRtlsym(farfunc ? RTLSYM_TRACE_EPI_F : RTLSYM_TRACE_EPI_N);
makeitextern(s);
cdbx.gencs(I16 ? 0x9A : CALL,0,FLfunc,s); // CALLF _trace
if (!I16)
code_orflag(cdbx.last(),CFoff | CFselfrel);
useregs((ALLREGS | mBP | mES) & ~s.Sregsaved);
}
if (usednteh & (NTEH_try | NTEH_except | NTEHcpp | EHcleanup | EHtry | NTEHpassthru) && (config.exe == EX_WIN32 || MARS))
{
nteh_epilog(cdbx);
}
cpopds = null;
if (tyf & mTYloadds)
{
cdbx.gen1(0x1F); // POP DS
cpopds = cdbx.last();
}
/* Pop all the general purpose registers saved on the stack
* by the prolog code. Remember to do them in the reverse
* order they were pushed.
*/
topop = fregsaved & ~mfuncreg;
epilog_restoreregs(cdbx, topop);
version (MARS)
{
if (usednteh & NTEHjmonitor)
{
regm_t retregs = 0;
if (b.BC == BCretexp)
retregs = regmask(b.Belem.Ety, tym);
nteh_monitor_epilog(cdbx,retregs);
xlocalsize += 8;
}
}
if (config.wflags & WFwindows && farfunc)
{
int wflags = config.wflags;
if (wflags & WFreduced && !(tyf & mTYexport))
{ // reduced prolog/epilog for non-exported functions
wflags &= ~(WFdgroup | WFds | WFss);
if (!(wflags & WFsaveds))
goto L4;
}
if (localsize)
{
cdbx.genc1(LEA,modregrm(1,SP,6),FLconst,cast(targ_uns)-2); /* LEA SP,-2[BP] */
}
if (wflags & (WFsaveds | WFds | WFss | WFdgroup))
{
if (cpopds)
cpopds.Iop = NOP; // don't need previous one
cdbx.gen1(0x1F); // POP DS
}
cdbx.gen1(0x58 + BP); // POP BP
if (config.wflags & WFincbp)
cdbx.gen1(0x48 + BP); // DEC BP
assert(hasframe);
}
else
{
if (needframe || (xlocalsize && hasframe))
{
L4:
assert(hasframe);
if (xlocalsize || enforcealign)
{
if (config.flags2 & CFG2stomp)
{ /* MOV ECX,0xBEAF
* L1:
* MOV [ESP],ECX
* ADD ESP,4
* CMP EBP,ESP
* JNE L1
* POP EBP
*/
/* Value should be:
* 1. != 0 (code checks for null pointers)
* 2. be odd (to mess up alignment)
* 3. fall in first 64K (likely marked as inaccessible)
* 4. be a value that stands out in the debugger
*/
assert(I32 || I64);
targ_size_t value = 0x0000BEAF;
reg_t regcx = CX;
mfuncreg &= ~mask(regcx);
uint grex = I64 ? REX_W << 16 : 0;
cdbx.genc2(0xC7,grex | modregrmx(3,0,regcx),value); // MOV regcx,value
cdbx.gen2sib(0x89,grex | modregrm(0,regcx,4),modregrm(0,4,SP)); // MOV [ESP],regcx
code *c1 = cdbx.last();
cdbx.genc2(0x81,grex | modregrm(3,0,SP),REGSIZE); // ADD ESP,REGSIZE
genregs(cdbx,0x39,SP,BP); // CMP EBP,ESP
if (I64)
code_orrex(cdbx.last(),REX_W);
genjmp(cdbx,JNE,FLcode,cast(block *)c1); // JNE L1
// explicitly mark as short jump, needed for correct retsize calculation (Bugzilla 15779)
cdbx.last().Iflags &= ~CFjmp16;
cdbx.gen1(0x58 + BP); // POP BP
}
else if (config.exe == EX_WIN64)
{ // See http://msdn.microsoft.com/en-us/library/tawsa7cb(v=vs.80).aspx
// LEA RSP,0[RBP]
cdbx.genc1(LEA,(REX_W<<16)|modregrm(2,SP,BPRM),FLconst,0);
cdbx.gen1(0x58 + BP); // POP RBP
}
else if (config.target_cpu >= TARGET_80286 &&
!(config.target_cpu >= TARGET_80386 && config.flags4 & CFG4speed)
)
cdbx.gen1(LEAVE); // LEAVE
else if (0 && xlocalsize == REGSIZE && Alloca.size == 0 && I32)
{ // This doesn't work - I should figure out why
mfuncreg &= ~mask(regx);
cdbx.gen1(0x58 + regx); // POP regx
cdbx.gen1(0x58 + BP); // POP BP
}
else
{
genregs(cdbx,0x8B,SP,BP); // MOV SP,BP
if (I64)
code_orrex(cdbx.last(), REX_W); // MOV RSP,RBP
cdbx.gen1(0x58 + BP); // POP BP
}
}
else
cdbx.gen1(0x58 + BP); // POP BP
if (config.wflags & WFincbp && farfunc)
cdbx.gen1(0x48 + BP); // DEC BP
}
else if (xlocalsize == REGSIZE && (!I16 || b.BC == BCret))
{
mfuncreg &= ~mask(regx);
cdbx.gen1(0x58 + regx); // POP regx
}
else if (xlocalsize)
cod3_stackadj(cdbx, cast(int)-xlocalsize);
}
if (b.BC == BCret || b.BC == BCretexp)
{
Lret:
opcode_t op = tyfarfunc(tym) ? 0xCA : 0xC2;
if (tym == TYhfunc)
{
cdbx.genc2(0xC2,0,4); // RET 4
}
else if (!typfunc(tym) || // if caller cleans the stack
config.exe == EX_WIN64 ||
Para.offset == 0) // or nothing pushed on the stack anyway
{
op++; // to a regular RET
cdbx.gen1(op);
}
else
{ // Stack is always aligned on register size boundary
Para.offset = (Para.offset + (REGSIZE - 1)) & ~(REGSIZE - 1);
if (Para.offset >= 0x10000)
{
/*
POP REG
ADD ESP, Para.offset
JMP REG
*/
cdbx.gen1(0x58+regx);
cdbx.genc2(0x81, modregrm(3,0,SP), Para.offset);
if (I64)
code_orrex(cdbx.last(), REX_W);
cdbx.genc2(0xFF, modregrm(3,4,regx), 0);
if (I64)
code_orrex(cdbx.last(), REX_W);
}
else
cdbx.genc2(op,0,Para.offset); // RET Para.offset
}
}
Lopt:
// If last instruction in ce is ADD SP,imm, and first instruction
// in c sets SP, we can dump the ADD.
CodeBuilder cdb; cdb.ctor();
cdb.append(b.Bcode);
code *cr = cdb.last();
code *c = cdbx.peek();
if (cr && c && !I64)
{
if (cr.Iop == 0x81 && cr.Irm == modregrm(3,0,SP)) // if ADD SP,imm
{
if (
c.Iop == LEAVE || // LEAVE
(c.Iop == 0x8B && c.Irm == modregrm(3,SP,BP)) || // MOV SP,BP
(c.Iop == LEA && c.Irm == modregrm(1,SP,6)) // LEA SP,-imm[BP]
)
cr.Iop = NOP;
else if (c.Iop == 0x58 + BP) // if POP BP
{
cr.Iop = 0x8B;
cr.Irm = modregrm(3,SP,BP); // MOV SP,BP
}
}
else
{
static if (0)
{
// These optimizations don't work if the called function
// cleans off the stack.
if (c.Iop == 0xC3 && cr.Iop == CALL) // CALL near
{
cr.Iop = 0xE9; // JMP near
c.Iop = NOP;
}
else if (c.Iop == 0xCB && cr.Iop == 0x9A) // CALL far
{
cr.Iop = 0xEA; // JMP far
c.Iop = NOP;
}
}
}
}
pinholeopt(c, null);
retsize += calcblksize(c); // compute size of function epilog
cdb.append(cdbx);
b.Bcode = cdb.finish();
}
/*******************************
* Return offset of SP from BP.
*/
@trusted
targ_size_t cod3_spoff()
{
//printf("spoff = x%x, localsize = x%x\n", (int)spoff, (int)localsize);
return spoff + localsize;
}
@trusted
void gen_spill_reg(ref CodeBuilder cdb, Symbol* s, bool toreg)
{
code cs;
const regm_t keepmsk = toreg ? RMload : RMstore;
elem* e = el_var(s); // so we can trick getlvalue() into working for us
if (mask(s.Sreglsw) & XMMREGS)
{ // Convert to save/restore of XMM register
if (toreg)
cs.Iop = xmmload(s.Stype.Tty); // MOVSS/D xreg,mem
else
cs.Iop = xmmstore(s.Stype.Tty); // MOVSS/D mem,xreg
getlvalue(cdb,&cs,e,keepmsk);
cs.orReg(s.Sreglsw - XMM0);
cdb.gen(&cs);
}
else
{
const int sz = cast(int)type_size(s.Stype);
cs.Iop = toreg ? 0x8B : 0x89; // MOV reg,mem[ESP] : MOV mem[ESP],reg
cs.Iop ^= (sz == 1);
getlvalue(cdb,&cs,e,keepmsk);
cs.orReg(s.Sreglsw);
if (I64 && sz == 1 && s.Sreglsw >= 4)
cs.Irex |= REX;
if ((cs.Irm & 0xC0) == 0xC0 && // reg,reg
(((cs.Irm >> 3) ^ cs.Irm) & 7) == 0 && // registers match
(((cs.Irex >> 2) ^ cs.Irex) & 1) == 0) // REX_R and REX_B match
{ } // skip MOV reg,reg
else
cdb.gen(&cs);
if (sz > REGSIZE)
{
cs.setReg(s.Sregmsw);
getlvalue_msw(&cs);
if ((cs.Irm & 0xC0) == 0xC0 && // reg,reg
(((cs.Irm >> 3) ^ cs.Irm) & 7) == 0 && // registers match
(((cs.Irex >> 2) ^ cs.Irex) & 1) == 0) // REX_R and REX_B match
{ } // skip MOV reg,reg
else
cdb.gen(&cs);
}
}
el_free(e);
}
/****************************
* Generate code for, and output a thunk.
* Params:
* sthunk = Symbol of thunk
* sfunc = Symbol of thunk's target function
* thisty = Type of this pointer
* p = ESP parameter offset to this pointer
* d = offset to add to 'this' pointer
* d2 = offset from 'this' to vptr
* i = offset into vtbl[]
*/
@trusted
void cod3_thunk(Symbol *sthunk,Symbol *sfunc,uint p,tym_t thisty,
uint d,int i,uint d2)
{
targ_size_t thunkoffset;
int seg = sthunk.Sseg;
cod3_align(seg);
// Skip over return address
tym_t thunkty = tybasic(sthunk.ty());
if (tyfarfunc(thunkty))
p += I32 ? 8 : tysize(TYfptr); // far function
else
p += tysize(TYnptr);
if (tybasic(sfunc.ty()) == TYhfunc)
p += tysize(TYnptr); // skip over hidden pointer
CodeBuilder cdb; cdb.ctor();
if (!I16)
{
/*
Generate:
ADD p[ESP],d
For direct call:
JMP sfunc
For virtual call:
MOV EAX, p[ESP] EAX = this
MOV EAX, d2[EAX] EAX = this.vptr
JMP i[EAX] jump to virtual function
*/
reg_t reg = 0;
if (cast(int)d < 0)
{
d = -d;
reg = 5; // switch from ADD to SUB
}
if (thunkty == TYmfunc)
{ // ADD ECX,d
if (d)
cdb.genc2(0x81,modregrm(3,reg,CX),d);
}
else if (thunkty == TYjfunc || (I64 && thunkty == TYnfunc))
{ // ADD EAX,d
int rm = AX;
if (config.exe == EX_WIN64)
rm = CX;
else if (I64)
rm = (thunkty == TYnfunc && (sfunc.Sfunc.Fflags3 & F3hiddenPtr)) ? SI : DI;
if (d)
cdb.genc2(0x81,modregrm(3,reg,rm),d);
}
else
{
cdb.genc(0x81,modregrm(2,reg,4),
FLconst,p, // to this
FLconst,d); // ADD p[ESP],d
cdb.last().Isib = modregrm(0,4,SP);
}
if (I64 && cdb.peek())
cdb.last().Irex |= REX_W;
}
else
{
/*
Generate:
MOV BX,SP
ADD [SS:] p[BX],d
For direct call:
JMP sfunc
For virtual call:
MOV BX, p[BX] BX = this
MOV BX, d2[BX] BX = this.vptr
JMP i[BX] jump to virtual function
*/
genregs(cdb,0x89,SP,BX); // MOV BX,SP
cdb.genc(0x81,modregrm(2,0,7),
FLconst,p, // to this
FLconst,d); // ADD p[BX],d
if (config.wflags & WFssneds ||
// If DS needs reloading from SS,
// then assume SS != DS on thunk entry
(LARGEDATA && config.wflags & WFss))
cdb.last().Iflags |= CFss; // SS:
}
if ((i & 0xFFFF) != 0xFFFF) // if virtual call
{
const bool FARTHIS = (tysize(thisty) > REGSIZE);
const bool FARVPTR = FARTHIS;
assert(thisty != TYvptr); // can't handle this case
if (!I16)
{
assert(!FARTHIS && !LARGECODE);
if (thunkty == TYmfunc) // if 'this' is in ECX
{
// MOV EAX,d2[ECX]
cdb.genc1(0x8B,modregrm(2,AX,CX),FLconst,d2);
}
else if (thunkty == TYjfunc) // if 'this' is in EAX
{
// MOV EAX,d2[EAX]
cdb.genc1(0x8B,modregrm(2,AX,AX),FLconst,d2);
}
else
{
// MOV EAX,p[ESP]
cdb.genc1(0x8B,(modregrm(0,4,SP) << 8) | modregrm(2,AX,4),FLconst,cast(targ_uns) p);
if (I64)
cdb.last().Irex |= REX_W;
// MOV EAX,d2[EAX]
cdb.genc1(0x8B,modregrm(2,AX,AX),FLconst,d2);
}
if (I64)
code_orrex(cdb.last(), REX_W);
// JMP i[EAX]
cdb.genc1(0xFF,modregrm(2,4,0),FLconst,cast(targ_uns) i);
}
else
{
// MOV/LES BX,[SS:] p[BX]
cdb.genc1((FARTHIS ? 0xC4 : 0x8B),modregrm(2,BX,7),FLconst,cast(targ_uns) p);
if (config.wflags & WFssneds ||
// If DS needs reloading from SS,
// then assume SS != DS on thunk entry
(LARGEDATA && config.wflags & WFss))
cdb.last().Iflags |= CFss; // SS:
// MOV/LES BX,[ES:]d2[BX]
cdb.genc1((FARVPTR ? 0xC4 : 0x8B),modregrm(2,BX,7),FLconst,d2);
if (FARTHIS)
cdb.last().Iflags |= CFes; // ES:
// JMP i[BX]
cdb.genc1(0xFF,modregrm(2,(LARGECODE ? 5 : 4),7),FLconst,cast(targ_uns) i);
if (FARVPTR)
cdb.last().Iflags |= CFes; // ES:
}
}
else
{
if (config.flags3 & CFG3pic)
{
localgot = null; // no local variables
CodeBuilder cdbgot; cdbgot.ctor();
load_localgot(cdbgot); // load GOT in EBX
code *c1 = cdbgot.finish();
if (c1)
{
assignaddrc(c1);
cdb.append(c1);
}
}
cdb.gencs((LARGECODE ? 0xEA : 0xE9),0,FLfunc,sfunc); // JMP sfunc
cdb.last().Iflags |= LARGECODE ? (CFseg | CFoff) : (CFselfrel | CFoff);
}
thunkoffset = Offset(seg);
code *c = cdb.finish();
pinholeopt(c,null);
codout(seg,c);
code_free(c);
sthunk.Soffset = thunkoffset;
sthunk.Ssize = Offset(seg) - thunkoffset; // size of thunk
sthunk.Sseg = seg;
if (config.exe & EX_posix ||
config.objfmt == OBJ_MSCOFF)
{
objmod.pubdef(seg,sthunk,sthunk.Soffset);
}
searchfixlist(sthunk); // resolve forward refs
}
/*****************************
* Assume symbol s is extern.
*/
@trusted
void makeitextern(Symbol *s)
{
if (s.Sxtrnnum == 0)
{
s.Sclass = SCextern; /* external */
/*printf("makeitextern(x%x)\n",s);*/
objmod.external(s);
}
}
/*******************************
* Replace JMPs in Bgotocode with JMP SHORTs whereever possible.
* This routine depends on FLcode jumps to only be forward
* referenced.
* BFLjmpoptdone is set to true if nothing more can be done
* with this block.
* Input:
* flag !=0 means don't have correct Boffsets yet
* Returns:
* number of bytes saved
*/
@trusted
int branch(block *bl,int flag)
{
int bytesaved;
code* c,cn,ct;
targ_size_t offset,disp;
targ_size_t csize;
if (!flag)
bl.Bflags |= BFLjmpoptdone; // assume this will be all
c = bl.Bcode;
if (!c)
return 0;
bytesaved = 0;
offset = bl.Boffset; /* offset of start of block */
while (1)
{
ubyte op;
csize = calccodsize(c);
cn = code_next(c);
op = cast(ubyte)c.Iop;
if ((op & ~0x0F) == 0x70 && c.Iflags & CFjmp16 ||
(op == JMP && !(c.Iflags & CFjmp5)))
{
L1:
switch (c.IFL2)
{
case FLblock:
if (flag) // no offsets yet, don't optimize
goto L3;
disp = c.IEV2.Vblock.Boffset - offset - csize;
/* If this is a forward branch, and there is an aligned
* block intervening, it is possible that shrinking
* the jump instruction will cause it to be out of
* range of the target. This happens if the alignment
* prevents the target block from moving correspondingly
* closer.
*/
if (disp >= 0x7F-4 && c.IEV2.Vblock.Boffset > offset)
{ /* Look for intervening alignment
*/
for (block *b = bl.Bnext; b; b = b.Bnext)
{
if (b.Balign)
{
bl.Bflags &= ~BFLjmpoptdone; // some JMPs left
goto L3;
}
if (b == c.IEV2.Vblock)
break;
}
}
break;
case FLcode:
{
code *cr;
disp = 0;
ct = c.IEV2.Vcode; /* target of branch */
assert(ct.Iflags & (CFtarg | CFtarg2));
for (cr = cn; cr; cr = code_next(cr))
{
if (cr == ct)
break;
disp += calccodsize(cr);
}
if (!cr)
{ // Didn't find it in forward search. Try backwards jump
int s = 0;
disp = 0;
for (cr = bl.Bcode; cr != cn; cr = code_next(cr))
{
assert(cr != null); // must have found it
if (cr == ct)
s = 1;
if (s)
disp += calccodsize(cr);
}
}
if (config.flags4 & CFG4optimized && !flag)
{
/* Propagate branch forward past junk */
while (1)
{
if (ct.Iop == NOP ||
ct.Iop == (ESCAPE | ESClinnum))
{
ct = code_next(ct);
if (!ct)
goto L2;
}
else
{
c.IEV2.Vcode = ct;
ct.Iflags |= CFtarg;
break;
}
}
/* And eliminate jmps to jmps */
if ((op == ct.Iop || ct.Iop == JMP) &&
(op == JMP || c.Iflags & CFjmp16))
{
c.IFL2 = ct.IFL2;
c.IEV2.Vcode = ct.IEV2.Vcode;
/*printf("eliminating branch\n");*/
goto L1;
}
L2:
{ }
}
}
break;
default:
goto L3;
}
if (disp == 0) // bra to next instruction
{
bytesaved += csize;
c.Iop = NOP; // del branch instruction
c.IEV2.Vcode = null;
c = cn;
if (!c)
break;
continue;
}
else if (cast(targ_size_t)cast(targ_schar)(disp - 2) == (disp - 2) &&
cast(targ_size_t)cast(targ_schar)disp == disp)
{
if (op == JMP)
{
c.Iop = JMPS; // JMP SHORT
bytesaved += I16 ? 1 : 3;
}
else // else Jcond
{
c.Iflags &= ~CFjmp16; // a branch is ok
bytesaved += I16 ? 3 : 4;
// Replace a cond jump around a call to a function that
// never returns with a cond jump to that function.
if (config.flags4 & CFG4optimized &&
config.target_cpu >= TARGET_80386 &&
disp == (I16 ? 3 : 5) &&
cn &&
cn.Iop == CALL &&
cn.IFL2 == FLfunc &&
cn.IEV2.Vsym.Sflags & SFLexit &&
!(cn.Iflags & (CFtarg | CFtarg2))
)
{
cn.Iop = 0x0F00 | ((c.Iop & 0x0F) ^ 0x81);
c.Iop = NOP;
c.IEV2.Vcode = null;
bytesaved++;
// If nobody else points to ct, we can remove the CFtarg
if (flag && ct)
{
code *cx;
for (cx = bl.Bcode; 1; cx = code_next(cx))
{
if (!cx)
{
ct.Iflags &= ~CFtarg;
break;
}
if (cx.IEV2.Vcode == ct)
break;
}
}
}
}
csize = calccodsize(c);
}
else
bl.Bflags &= ~BFLjmpoptdone; // some JMPs left
}
L3:
if (cn)
{
offset += csize;
c = cn;
}
else
break;
}
//printf("bytesaved = x%x\n",bytesaved);
return bytesaved;
}
/************************************************
* Adjust all Soffset's of stack variables so they
* are all relative to the frame pointer.
*/
version (MARS)
{
@trusted
void cod3_adjSymOffsets()
{
SYMIDX si;
//printf("cod3_adjSymOffsets()\n");
for (si = 0; si < globsym.length; si++)
{
//printf("\tglobsym[%d] = %p\n",si,globsym[si]);
Symbol *s = globsym[si];
switch (s.Sclass)
{
case SCparameter:
case SCregpar:
case SCshadowreg:
//printf("s = '%s', Soffset = x%x, Para.size = x%x, EBPtoESP = x%x\n", s.Sident, s.Soffset, Para.size, EBPtoESP);
s.Soffset += Para.size;
if (0 && !(funcsym_p.Sfunc.Fflags3 & Fmember))
{
if (!hasframe)
s.Soffset += EBPtoESP;
if (funcsym_p.Sfunc.Fflags3 & Fnested)
s.Soffset += REGSIZE;
}
break;
case SCfastpar:
//printf("\tfastpar %s %p Soffset %x Fast.size %x BPoff %x\n", s.Sident, s, (int)s.Soffset, (int)Fast.size, (int)BPoff);
s.Soffset += Fast.size + BPoff;
break;
case SCauto:
case SCregister:
if (s.Sfl == FLfast)
s.Soffset += Fast.size + BPoff;
else
//printf("s = '%s', Soffset = x%x, Auto.size = x%x, BPoff = x%x EBPtoESP = x%x\n", s.Sident, (int)s.Soffset, (int)Auto.size, (int)BPoff, (int)EBPtoESP);
// if (!(funcsym_p.Sfunc.Fflags3 & Fnested))
s.Soffset += Auto.size + BPoff;
break;
case SCbprel:
break;
default:
continue;
}
static if (0)
{
if (!hasframe)
s.Soffset += EBPtoESP;
}
}
}
}
/*******************************
* Take symbol info in union ev and replace it with a real address
* in Vpointer.
*/
@trusted
void assignaddr(block *bl)
{
int EBPtoESPsave = EBPtoESP;
int hasframesave = hasframe;
if (bl.Bflags & BFLoutsideprolog)
{
EBPtoESP = -REGSIZE;
hasframe = 0;
}
assignaddrc(bl.Bcode);
hasframe = hasframesave;
EBPtoESP = EBPtoESPsave;
}
@trusted
void assignaddrc(code *c)
{
int sn;
Symbol *s;
ubyte ins,rm;
targ_size_t soff;
targ_size_t base;
base = EBPtoESP;
for (; c; c = code_next(c))
{
debug
{
if (0)
{ printf("assignaddrc()\n");
code_print(c);
}
if (code_next(c) && code_next(code_next(c)) == c)
assert(0);
}
if (c.Iflags & CFvex && c.Ivex.pfx == 0xC4)
ins = vex_inssize(c);
else if ((c.Iop & 0xFFFD00) == 0x0F3800)
ins = inssize2[(c.Iop >> 8) & 0xFF];
else if ((c.Iop & 0xFF00) == 0x0F00)
ins = inssize2[c.Iop & 0xFF];
else if ((c.Iop & 0xFF) == ESCAPE)
{
if (c.Iop == (ESCAPE | ESCadjesp))
{
//printf("adjusting EBPtoESP (%d) by %ld\n",EBPtoESP,(long)c.IEV1.Vint);
EBPtoESP += c.IEV1.Vint;
c.Iop = NOP;
}
else if (c.Iop == (ESCAPE | ESCfixesp))
{
//printf("fix ESP\n");
if (hasframe)
{
// LEA ESP,-EBPtoESP[EBP]
c.Iop = LEA;
if (c.Irm & 8)
c.Irex |= REX_R;
c.Irm = modregrm(2,SP,BP);
c.Iflags = CFoff;
c.IFL1 = FLconst;
c.IEV1.Vuns = -EBPtoESP;
if (enforcealign)
{
// AND ESP, -STACKALIGN
code *cn = code_calloc();
cn.Iop = 0x81;
cn.Irm = modregrm(3, 4, SP);
cn.Iflags = CFoff;
cn.IFL2 = FLconst;
cn.IEV2.Vsize_t = -STACKALIGN;
if (I64)
c.Irex |= REX_W;
cn.next = c.next;
c.next = cn;
}
}
}
else if (c.Iop == (ESCAPE | ESCframeptr))
{ // Convert to load of frame pointer
// c.Irm is the register to use
if (hasframe && !enforcealign)
{ // MOV reg,EBP
c.Iop = 0x89;
if (c.Irm & 8)
c.Irex |= REX_B;
c.Irm = modregrm(3,BP,c.Irm & 7);
}
else
{ // LEA reg,EBPtoESP[ESP]
c.Iop = LEA;
if (c.Irm & 8)
c.Irex |= REX_R;
c.Irm = modregrm(2,c.Irm & 7,4);
c.Isib = modregrm(0,4,SP);
c.Iflags = CFoff;
c.IFL1 = FLconst;
c.IEV1.Vuns = EBPtoESP;
}
}
if (I64)
c.Irex |= REX_W;
continue;
}
else
ins = inssize[c.Iop & 0xFF];
if (!(ins & M) ||
((rm = c.Irm) & 0xC0) == 0xC0)
goto do2; /* if no first operand */
if (is32bitaddr(I32,c.Iflags))
{
if (
((rm & 0xC0) == 0 && !((rm & 7) == 4 && (c.Isib & 7) == 5 || (rm & 7) == 5))
)
goto do2; /* if no first operand */
}
else
{
if (
((rm & 0xC0) == 0 && !((rm & 7) == 6))
)
goto do2; /* if no first operand */
}
s = c.IEV1.Vsym;
switch (c.IFL1)
{
case FLdata:
if (config.objfmt == OBJ_OMF && s.Sclass != SCcomdat && s.Sclass != SCextern)
{
version (MARS)
{
c.IEV1.Vseg = s.Sseg;
}
else
{
c.IEV1.Vseg = DATA;
}
c.IEV1.Vpointer += s.Soffset;
c.IFL1 = FLdatseg;
}
else
c.IFL1 = FLextern;
goto do2;
case FLudata:
if (config.objfmt == OBJ_OMF)
{
version (MARS)
{
c.IEV1.Vseg = s.Sseg;
}
else
{
c.IEV1.Vseg = UDATA;
}
c.IEV1.Vpointer += s.Soffset;
c.IFL1 = FLdatseg;
}
else
c.IFL1 = FLextern;
goto do2;
case FLtlsdata:
if (config.objfmt == OBJ_ELF || config.objfmt == OBJ_MACH)
c.IFL1 = FLextern;
goto do2;
case FLdatseg:
//c.IEV1.Vseg = DATA;
goto do2;
case FLfardata:
case FLcsdata:
case FLpseudo:
goto do2;
case FLstack:
//printf("Soffset = %d, EBPtoESP = %d, base = %d, pointer = %d\n",
//s.Soffset,EBPtoESP,base,c.IEV1.Vpointer);
c.IEV1.Vpointer += s.Soffset + EBPtoESP - base - EEStack.offset;
break;
case FLfast:
soff = Fast.size;
goto L1;
case FLreg:
case FLauto:
soff = Auto.size;
L1:
if (Symbol_Sisdead(s, anyiasm))
{
c.Iop = NOP; // remove references to it
continue;
}
if (s.Sfl == FLreg && c.IEV1.Vpointer < 2)
{
reg_t reg = s.Sreglsw;
assert(!(s.Sregm & ~mask(reg)));
if (c.IEV1.Vpointer == 1)
{
assert(reg < 4); /* must be a BYTEREGS */
reg |= 4; /* convert to high byte reg */
}
if (reg & 8)
{
assert(I64);
c.Irex |= REX_B;
reg &= 7;
}
c.Irm = (c.Irm & modregrm(0,7,0))
| modregrm(3,0,reg);
assert(c.Iop != LES && c.Iop != LEA);
goto do2;
}
else
{ c.IEV1.Vpointer += s.Soffset + soff + BPoff;
if (s.Sflags & SFLunambig)
c.Iflags |= CFunambig;
L2:
if (!hasframe || (enforcealign && c.IFL1 != FLpara))
{ /* Convert to ESP relative address instead of EBP */
assert(!I16);
c.IEV1.Vpointer += EBPtoESP;
ubyte crm = c.Irm;
if ((crm & 7) == 4) // if SIB byte
{
assert((c.Isib & 7) == BP);
assert((crm & 0xC0) != 0);
c.Isib = (c.Isib & ~7) | modregrm(0,0,SP);
}
else
{
assert((crm & 7) == 5);
c.Irm = (crm & modregrm(0,7,0))
| modregrm(2,0,4);
c.Isib = modregrm(0,4,SP);
}
}
}
break;
case FLpara:
//printf("s = %s, Soffset = %d, Para.size = %d, BPoff = %d, EBPtoESP = %d, Vpointer = %d\n",
//s.Sident.ptr, cast(int)s.Soffset, cast(int)Para.size, cast(int)BPoff,
//cast(int)EBPtoESP, cast(int)c.IEV1.Vpointer);
soff = Para.size - BPoff; // cancel out add of BPoff
goto L1;
case FLfltreg:
c.IEV1.Vpointer += Foff + BPoff;
c.Iflags |= CFunambig;
goto L2;
case FLallocatmp:
c.IEV1.Vpointer += Alloca.offset + BPoff;
goto L2;
case FLfuncarg:
c.IEV1.Vpointer += cgstate.funcarg.offset + BPoff;
goto L2;
case FLbprel:
c.IEV1.Vpointer += s.Soffset;
break;
case FLcs:
sn = c.IEV1.Vuns;
if (!CSE.loaded(sn)) // if never loaded
{
c.Iop = NOP;
continue;
}
c.IEV1.Vpointer = CSE.offset(sn) + CSoff + BPoff;
c.Iflags |= CFunambig;
goto L2;
case FLregsave:
sn = c.IEV1.Vuns;
c.IEV1.Vpointer = sn + regsave.off + BPoff;
c.Iflags |= CFunambig;
goto L2;
case FLndp:
version (MARS)
{
assert(c.IEV1.Vuns < global87.save.length);
}
c.IEV1.Vpointer = c.IEV1.Vuns * tysize(TYldouble) + NDPoff + BPoff;
c.Iflags |= CFunambig;
goto L2;
case FLoffset:
break;
case FLlocalsize:
c.IEV1.Vpointer += localsize;
break;
case FLconst:
default:
goto do2;
}
c.IFL1 = FLconst;
do2:
/* Ignore TEST (F6 and F7) opcodes */
if (!(ins & T)) goto done; /* if no second operand */
s = c.IEV2.Vsym;
switch (c.IFL2)
{
case FLdata:
if (config.objfmt == OBJ_ELF || config.objfmt == OBJ_MACH)
{
c.IFL2 = FLextern;
goto do2;
}
else
{
if (s.Sclass == SCcomdat)
{ c.IFL2 = FLextern;
goto do2;
}
c.IEV2.Vseg = MARS ? s.Sseg : DATA;
c.IEV2.Vpointer += s.Soffset;
c.IFL2 = FLdatseg;
goto done;
}
case FLudata:
if (config.objfmt == OBJ_ELF || config.objfmt == OBJ_MACH)
{
c.IFL2 = FLextern;
goto do2;
}
else
{
c.IEV2.Vseg = MARS ? s.Sseg : UDATA;
c.IEV2.Vpointer += s.Soffset;
c.IFL2 = FLdatseg;
goto done;
}
case FLtlsdata:
if (config.objfmt == OBJ_ELF || config.objfmt == OBJ_MACH)
{
c.IFL2 = FLextern;
goto do2;
}
goto done;
case FLdatseg:
//c.IEV2.Vseg = DATA;
goto done;
case FLcsdata:
case FLfardata:
goto done;
case FLreg:
case FLpseudo:
assert(0);
/* NOTREACHED */
case FLfast:
c.IEV2.Vpointer += s.Soffset + Fast.size + BPoff;
break;
case FLauto:
c.IEV2.Vpointer += s.Soffset + Auto.size + BPoff;
L3:
if (!hasframe || (enforcealign && c.IFL2 != FLpara))
/* Convert to ESP relative address instead of EBP */
c.IEV2.Vpointer += EBPtoESP;
break;
case FLpara:
c.IEV2.Vpointer += s.Soffset + Para.size;
goto L3;
case FLfltreg:
c.IEV2.Vpointer += Foff + BPoff;
goto L3;
case FLallocatmp:
c.IEV2.Vpointer += Alloca.offset + BPoff;
goto L3;
case FLfuncarg:
c.IEV2.Vpointer += cgstate.funcarg.offset + BPoff;
goto L3;
case FLbprel:
c.IEV2.Vpointer += s.Soffset;
break;
case FLstack:
c.IEV2.Vpointer += s.Soffset + EBPtoESP - base;
break;
case FLcs:
case FLndp:
case FLregsave:
assert(0);
case FLconst:
break;
case FLlocalsize:
c.IEV2.Vpointer += localsize;
break;
default:
goto done;
}
c.IFL2 = FLconst;
done:
{ }
}
}
/*******************************
* Return offset from BP of symbol s.
*/
@trusted
targ_size_t cod3_bpoffset(Symbol *s)
{
targ_size_t offset;
symbol_debug(s);
offset = s.Soffset;
switch (s.Sfl)
{
case FLpara:
offset += Para.size;
break;
case FLfast:
offset += Fast.size + BPoff;
break;
case FLauto:
offset += Auto.size + BPoff;
break;
default:
WRFL(cast(FL)s.Sfl);
symbol_print(s);
assert(0);
}
assert(hasframe);
return offset;
}
/*******************************
* Find shorter versions of the same instructions.
* Does these optimizations:
* replaces jmps to the next instruction with NOPs
* sign extension of modregrm displacement
* sign extension of immediate data (can't do it for OR, AND, XOR
* as the opcodes are not defined)
* short versions for AX EA
* short versions for reg EA
* Code is neither removed nor added.
* Params:
* b = block for code (or null)
* c = code list to optimize
*/
@trusted
void pinholeopt(code *c,block *b)
{
targ_size_t a;
uint mod;
ubyte ins;
int usespace;
int useopsize;
int space;
block *bn;
debug
{
__gshared int tested; if (!tested) { tested++; pinholeopt_unittest(); }
}
debug
{
code *cstart = c;
if (debugc)
{
printf("+pinholeopt(%p)\n",c);
}
}
if (b)
{
bn = b.Bnext;
usespace = (config.flags4 & CFG4space && b.BC != BCasm);
useopsize = (I16 || (config.flags4 & CFG4space && b.BC != BCasm));
}
else
{
bn = null;
usespace = (config.flags4 & CFG4space);
useopsize = (I16 || config.flags4 & CFG4space);
}
for (; c; c = code_next(c))
{
L1:
opcode_t op = c.Iop;
if (c.Iflags & CFvex && c.Ivex.pfx == 0xC4)
ins = vex_inssize(c);
else if ((op & 0xFFFD00) == 0x0F3800)
ins = inssize2[(op >> 8) & 0xFF];
else if ((op & 0xFF00) == 0x0F00)
ins = inssize2[op & 0xFF];
else
ins = inssize[op & 0xFF];
if (ins & M) // if modregrm byte
{
int shortop = (c.Iflags & CFopsize) ? !I16 : I16;
int local_BPRM = BPRM;
if (c.Iflags & CFaddrsize)
local_BPRM ^= 5 ^ 6; // toggle between 5 and 6
uint rm = c.Irm;
reg_t reg = rm & modregrm(0,7,0); // isolate reg field
reg_t ereg = rm & 7;
//printf("c = %p, op = %02x rm = %02x\n", c, op, rm);
/* If immediate second operand */
if ((ins & T ||
((op == 0xF6 || op == 0xF7) && (reg < modregrm(0,2,0) || reg > modregrm(0,3,0)))
) &&
c.IFL2 == FLconst)
{
int flags = c.Iflags & CFpsw; /* if want result in flags */
targ_long u = c.IEV2.Vuns;
if (ins & E)
u = cast(byte) u;
else if (shortop)
u = cast(short) u;
// Replace CMP reg,0 with TEST reg,reg
if ((op & 0xFE) == 0x80 && // 80 is CMP R8,imm8; 81 is CMP reg,imm
rm >= modregrm(3,7,AX) &&
u == 0)
{
c.Iop = (op & 1) | 0x84;
c.Irm = modregrm(3,ereg,ereg);
if (c.Irex & REX_B)
c.Irex |= REX_R;
goto L1;
}
/* Optimize ANDs with an immediate constant */
if ((op == 0x81 || op == 0x80) && reg == modregrm(0,4,0))
{
if (rm >= modregrm(3,4,AX)) // AND reg,imm
{
if (u == 0)
{
/* Replace with XOR reg,reg */
c.Iop = 0x30 | (op & 1);
c.Irm = modregrm(3,ereg,ereg);
if (c.Irex & REX_B)
c.Irex |= REX_R;
goto L1;
}
if (u == 0xFFFFFFFF && !flags)
{
c.Iop = NOP;
goto L1;
}
}
if (op == 0x81 && !flags)
{ // If we can do the operation in one byte
// If EA is not SI or DI
if ((rm < modregrm(3,4,SP) || I64) &&
(config.flags4 & CFG4space ||
config.target_cpu < TARGET_PentiumPro)
)
{
if ((u & 0xFFFFFF00) == 0xFFFFFF00)
goto L2;
else if (rm < modregrm(3,0,0) || (!c.Irex && ereg < 4))
{
if (!shortop)
{
if ((u & 0xFFFF00FF) == 0xFFFF00FF)
goto L3;
}
else
{
if ((u & 0xFF) == 0xFF)
goto L3;
}
}
}
if (!shortop && useopsize)
{
if ((u & 0xFFFF0000) == 0xFFFF0000)
{
c.Iflags ^= CFopsize;
goto L1;
}
if ((u & 0xFFFF) == 0xFFFF && rm < modregrm(3,4,AX))
{
c.IEV1.Voffset += 2; /* address MSW */
c.IEV2.Vuns >>= 16;
c.Iflags ^= CFopsize;
goto L1;
}
if (rm >= modregrm(3,4,AX))
{
if (u == 0xFF && (rm <= modregrm(3,4,BX) || I64))
{
c.Iop = MOVZXb; // MOVZX
c.Irm = modregrm(3,ereg,ereg);
if (c.Irex & REX_B)
c.Irex |= REX_R;
goto L1;
}
if (u == 0xFFFF)
{
c.Iop = MOVZXw; // MOVZX
c.Irm = modregrm(3,ereg,ereg);
if (c.Irex & REX_B)
c.Irex |= REX_R;
goto L1;
}
}
}
}
}
/* Look for ADD,OR,SUB,XOR with u that we can eliminate */
if (!flags &&
(op == 0x81 || op == 0x80) &&
(reg == modregrm(0,0,0) || reg == modregrm(0,1,0) || // ADD,OR
reg == modregrm(0,5,0) || reg == modregrm(0,6,0)) // SUB, XOR
)
{
if (u == 0)
{
c.Iop = NOP;
goto L1;
}
if (u == ~0 && reg == modregrm(0,6,0)) /* XOR */
{
c.Iop = 0xF6 | (op & 1); /* NOT */
c.Irm ^= modregrm(0,6^2,0);
goto L1;
}
if (!shortop &&
useopsize &&
op == 0x81 &&
(u & 0xFFFF0000) == 0 &&
(reg == modregrm(0,6,0) || reg == modregrm(0,1,0)))
{
c.Iflags ^= CFopsize;
goto L1;
}
}
/* Look for TEST or OR or XOR with an immediate constant */
/* that we can replace with a byte operation */
if (op == 0xF7 && reg == modregrm(0,0,0) ||
op == 0x81 && reg == modregrm(0,6,0) && !flags ||
op == 0x81 && reg == modregrm(0,1,0))
{
// See if we can replace a dword with a word
// (avoid for 32 bit instructions, because CFopsize
// is too slow)
if (!shortop && useopsize)
{
if ((u & 0xFFFF0000) == 0)
{
c.Iflags ^= CFopsize;
goto L1;
}
/* If memory (not register) addressing mode */
if ((u & 0xFFFF) == 0 && rm < modregrm(3,0,AX))
{
c.IEV1.Voffset += 2; /* address MSW */
c.IEV2.Vuns >>= 16;
c.Iflags ^= CFopsize;
goto L1;
}
}
// If EA is not SI or DI
if (rm < (modregrm(3,0,SP) | reg) &&
(usespace ||
config.target_cpu < TARGET_PentiumPro)
)
{
if ((u & 0xFFFFFF00) == 0)
{
L2: c.Iop--; /* to byte instruction */
c.Iflags &= ~CFopsize;
goto L1;
}
if (((u & 0xFFFF00FF) == 0 ||
(shortop && (u & 0xFF) == 0)) &&
(rm < modregrm(3,0,0) || (!c.Irex && ereg < 4)))
{
L3:
c.IEV2.Vuns >>= 8;
if (rm >= (modregrm(3,0,AX) | reg))
c.Irm |= 4; /* AX.AH, BX.BH, etc. */
else
c.IEV1.Voffset += 1;
goto L2;
}
}
// BUG: which is right?
//else if ((u & 0xFFFF0000) == 0)
else if (0 && op == 0xF7 &&
rm >= modregrm(3,0,SP) &&
(u & 0xFFFF0000) == 0)
c.Iflags &= ~CFopsize;
}
// Try to replace TEST reg,-1 with TEST reg,reg
if (op == 0xF6 && rm >= modregrm(3,0,AX) && rm <= modregrm(3,0,7)) // TEST regL,immed8
{
if ((u & 0xFF) == 0xFF)
{
L4:
c.Iop = 0x84; // TEST regL,regL
c.Irm = modregrm(3,ereg,ereg);
if (c.Irex & REX_B)
c.Irex |= REX_R;
c.Iflags &= ~CFopsize;
goto L1;
}
}
if (op == 0xF7 && rm >= modregrm(3,0,AX) && rm <= modregrm(3,0,7) && (I64 || ereg < 4))
{
if (u == 0xFF)
{
if (ereg & 4) // SIL,DIL,BPL,SPL need REX prefix
c.Irex |= REX;
goto L4;
}
if ((u & 0xFFFF) == 0xFF00 && shortop && !c.Irex && ereg < 4)
{
ereg |= 4; /* to regH */
goto L4;
}
}
/* Look for sign extended immediate data */
if (cast(byte) u == u)
{
if (op == 0x81)
{
if (reg != 0x08 && reg != 0x20 && reg != 0x30)
c.Iop = op = 0x83; /* 8 bit sgn ext */
}
else if (op == 0x69) /* IMUL rw,ew,dw */
c.Iop = op = 0x6B; /* IMUL rw,ew,db */
}
// Look for SHIFT EA,imm8 we can replace with short form
if (u == 1 && ((op & 0xFE) == 0xC0))
c.Iop |= 0xD0;
} /* if immediate second operand */
/* Look for AX short form */
if (ins & A)
{
if (rm == modregrm(0,AX,local_BPRM) &&
!(c.Irex & REX_R) && // and it's AX, not R8
(op & ~3) == 0x88 &&
!I64)
{
op = ((op & 3) + 0xA0) ^ 2;
/* 8A. A0 */
/* 8B. A1 */
/* 88. A2 */
/* 89. A3 */
c.Iop = op;
c.IFL2 = c.IFL1;
c.IEV2 = c.IEV1;
}
/* Replace MOV REG1,REG2 with MOV EREG1,EREG2 */
else if (!I16 &&
(op == 0x89 || op == 0x8B) &&
(rm & 0xC0) == 0xC0 &&
(!b || b.BC != BCasm)
)
c.Iflags &= ~CFopsize;
// If rm is AX
else if ((rm & modregrm(3,0,7)) == modregrm(3,0,AX) && !(c.Irex & (REX_R | REX_B)))
{
switch (op)
{
case 0x80: op = reg | 4; break;
case 0x81: op = reg | 5; break;
case 0x87: op = 0x90 + (reg>>3); break; // XCHG
case 0xF6:
if (reg == 0)
op = 0xA8; /* TEST AL,immed8 */
break;
case 0xF7:
if (reg == 0)
op = 0xA9; /* TEST AX,immed16 */
break;
default:
break;
}
c.Iop = op;
}
}
/* Look for reg short form */
if ((ins & R) && (rm & 0xC0) == 0xC0)
{
switch (op)
{
case 0xC6: op = 0xB0 + ereg; break;
case 0xC7: // if no sign extension
if (!(c.Irex & REX_W && c.IEV2.Vint < 0))
{
c.Irm = 0;
c.Irex &= ~REX_W;
op = 0xB8 + ereg;
}
break;
case 0xFF:
switch (reg)
{ case 6<<3: op = 0x50+ereg; break;/* PUSH*/
case 0<<3: if (!I64) op = 0x40+ereg; break; /* INC*/
case 1<<3: if (!I64) op = 0x48+ereg; break; /* DEC*/
default: break;
}
break;
case 0x8F: op = 0x58 + ereg; break;
case 0x87:
if (reg == 0 && !(c.Irex & (REX_R | REX_B))) // Issue 12968: Needed to ensure it's referencing RAX, not R8
op = 0x90 + ereg;
break;
default:
break;
}
c.Iop = op;
}
// Look to remove redundant REX prefix on XOR
if (c.Irex == REX_W // ignore ops involving R8..R15
&& (op == 0x31 || op == 0x33) // XOR
&& ((rm & 0xC0) == 0xC0) // register direct
&& ((reg >> 3) == ereg)) // register with itself
{
c.Irex = 0;
}
// Look to replace SHL reg,1 with ADD reg,reg
if ((op & ~1) == 0xD0 &&
(rm & modregrm(3,7,0)) == modregrm(3,4,0) &&
config.target_cpu >= TARGET_80486)
{
c.Iop &= 1;
c.Irm = cast(ubyte)((rm & modregrm(3,0,7)) | (ereg << 3));
if (c.Irex & REX_B)
c.Irex |= REX_R;
if (!(c.Iflags & CFpsw) && !I16)
c.Iflags &= ~CFopsize;
goto L1;
}
/* Look for sign extended modregrm displacement, or 0
* displacement.
*/
if (((rm & 0xC0) == 0x80) && // it's a 16/32 bit disp
c.IFL1 == FLconst) // and it's a constant
{
a = c.IEV1.Vpointer;
if (a == 0 && (rm & 7) != local_BPRM && // if 0[disp]
!(local_BPRM == 5 && (rm & 7) == 4 && (c.Isib & 7) == BP)
)
c.Irm &= 0x3F;
else if (!I16)
{
if (cast(targ_size_t)cast(targ_schar)a == a)
c.Irm ^= 0xC0; /* do 8 sx */
}
else if ((cast(targ_size_t)cast(targ_schar)a & 0xFFFF) == (a & 0xFFFF))
c.Irm ^= 0xC0; /* do 8 sx */
}
/* Look for LEA reg,[ireg], replace with MOV reg,ireg */
if (op == LEA)
{
rm = c.Irm & 7;
mod = c.Irm & modregrm(3,0,0);
if (mod == 0)
{
if (!I16)
{
switch (rm)
{
case 4:
case 5:
break;
default:
c.Irm |= modregrm(3,0,0);
c.Iop = 0x8B;
break;
}
}
else
{
switch (rm)
{
case 4: rm = modregrm(3,0,SI); goto L6;
case 5: rm = modregrm(3,0,DI); goto L6;
case 7: rm = modregrm(3,0,BX); goto L6;
L6: c.Irm = cast(ubyte)(rm + reg);
c.Iop = 0x8B;
break;
default:
break;
}
}
}
/* replace LEA reg,0[BP] with MOV reg,BP */
else if (mod == modregrm(1,0,0) && rm == local_BPRM &&
c.IFL1 == FLconst && c.IEV1.Vpointer == 0)
{
c.Iop = 0x8B; /* MOV reg,BP */
c.Irm = cast(ubyte)(modregrm(3,0,BP) + reg);
}
}
// Replace [R13] with 0[R13]
if (c.Irex & REX_B && ((c.Irm & modregrm(3,0,7)) == modregrm(0,0,BP) ||
issib(c.Irm) && (c.Irm & modregrm(3,0,0)) == 0 && (c.Isib & 7) == BP))
{
c.Irm |= modregrm(1,0,0);
c.IFL1 = FLconst;
c.IEV1.Vpointer = 0;
}
}
else if (!(c.Iflags & CFvex))
{
switch (op)
{
default:
// Look for MOV r64, immediate
if ((c.Irex & REX_W) && (op & ~7) == 0xB8)
{
/* Look for zero extended immediate data */
if (c.IEV2.Vsize_t == c.IEV2.Vuns)
{
c.Irex &= ~REX_W;
}
/* Look for sign extended immediate data */
else if (c.IEV2.Vsize_t == c.IEV2.Vint)
{
c.Irm = modregrm(3,0,op & 7);
c.Iop = op = 0xC7;
c.IEV2.Vsize_t = c.IEV2.Vuns;
}
}
if ((op & ~0x0F) != 0x70)
break;
goto case JMP;
case JMP:
switch (c.IFL2)
{
case FLcode:
if (c.IEV2.Vcode == code_next(c))
{
c.Iop = NOP;
continue;
}
break;
case FLblock:
if (!code_next(c) && c.IEV2.Vblock == bn)
{
c.Iop = NOP;
continue;
}
break;
case FLconst:
case FLfunc:
case FLextern:
break;
default:
WRFL(cast(FL)c.IFL2);
assert(0);
}
break;
case 0x68: // PUSH immed16
if (c.IFL2 == FLconst)
{
targ_long u = c.IEV2.Vuns;
if (I64 ||
((c.Iflags & CFopsize) ? I16 : I32))
{ // PUSH 32/64 bit operand
if (u == cast(byte) u)
c.Iop = 0x6A; // PUSH immed8
}
else // PUSH 16 bit operand
{
if (cast(short)u == cast(byte) u)
c.Iop = 0x6A; // PUSH immed8
}
}
break;
}
}
}
debug
if (debugc)
{
printf("-pinholeopt(%p)\n",cstart);
for (c = cstart; c; c = code_next(c))
code_print(c);
}
}
debug
{
@trusted
private void pinholeopt_unittest()
{
//printf("pinholeopt_unittest()\n");
static struct CS
{
uint model,op,ea;
targ_size_t ev1,ev2;
uint flags;
}
__gshared CS[2][22] tests =
[
// XOR reg,immed NOT regL
[ { 16,0x81,modregrm(3,6,BX),0,0xFF,0 }, { 0,0xF6,modregrm(3,2,BX),0,0xFF } ],
// MOV 0[BX],3 MOV [BX],3
[ { 16,0xC7,modregrm(2,0,7),0,3 }, { 0,0xC7,modregrm(0,0,7),0,3 } ],
/+ // only if config.flags4 & CFG4space
// TEST regL,immed8
[ { 0,0xF6,modregrm(3,0,BX),0,0xFF,0 }, { 0,0x84,modregrm(3,BX,BX),0,0xFF }],
[ { 0,0xF7,modregrm(3,0,BX),0,0xFF,0 }, { 0,0x84,modregrm(3,BX,BX),0,0xFF }],
[ { 64,0xF6,modregrmx(3,0,R8),0,0xFF,0 }, { 0,0x84,modregxrmx(3,R8,R8),0,0xFF }],
[ { 64,0xF7,modregrmx(3,0,R8),0,0xFF,0 }, { 0,0x84,modregxrmx(3,R8,R8),0,0xFF }],
+/
// PUSH immed => PUSH immed8
[ { 0,0x68,0,0,0 }, { 0,0x6A,0,0,0 }],
[ { 0,0x68,0,0,0x7F }, { 0,0x6A,0,0,0x7F }],
[ { 0,0x68,0,0,0x80 }, { 0,0x68,0,0,0x80 }],
[ { 16,0x68,0,0,0,CFopsize }, { 0,0x6A,0,0,0,CFopsize }],
[ { 16,0x68,0,0,0x7F,CFopsize }, { 0,0x6A,0,0,0x7F,CFopsize }],
[ { 16,0x68,0,0,0x80,CFopsize }, { 0,0x68,0,0,0x80,CFopsize }],
[ { 16,0x68,0,0,0x10000,0 }, { 0,0x6A,0,0,0x10000,0 }],
[ { 16,0x68,0,0,0x10000,CFopsize }, { 0,0x68,0,0,0x10000,CFopsize }],
[ { 32,0x68,0,0,0,CFopsize }, { 0,0x6A,0,0,0,CFopsize }],
[ { 32,0x68,0,0,0x7F,CFopsize }, { 0,0x6A,0,0,0x7F,CFopsize }],
[ { 32,0x68,0,0,0x80,CFopsize }, { 0,0x68,0,0,0x80,CFopsize }],
[ { 32,0x68,0,0,0x10000,CFopsize }, { 0,0x6A,0,0,0x10000,CFopsize }],
[ { 32,0x68,0,0,0x8000,CFopsize }, { 0,0x68,0,0,0x8000,CFopsize }],
// clear r64, for r64 != R8..R15
[ { 64,0x31,0x800C0,0,0,0 }, { 0,0x31,0xC0,0,0,0}],
[ { 64,0x33,0x800C0,0,0,0 }, { 0,0x33,0xC0,0,0,0}],
// MOV r64, immed
[ { 64,0xC7,0x800C0,0,0xFFFFFFFF,0 }, { 0,0xC7,0x800C0,0,0xFFFFFFFF,0}],
[ { 64,0xC7,0x800C0,0,0x7FFFFFFF,0 }, { 0,0xB8,0,0,0x7FFFFFFF,0}],
[ { 64,0xB8,0x80000,0,0xFFFFFFFF,0 }, { 0,0xB8,0,0,0xFFFFFFFF,0 }],
[ { 64,0xB8,0x80000,0,cast(targ_size_t)0x1FFFFFFFF,0 }, { 0,0xB8,0x80000,0,cast(targ_size_t)0x1FFFFFFFF,0 }],
[ { 64,0xB8,0x80000,0,cast(targ_size_t)0xFFFFFFFFFFFFFFFF,0 }, { 0,0xC7,0x800C0,0,cast(targ_size_t)0xFFFFFFFF,0}],
];
//config.flags4 |= CFG4space;
for (int i = 0; i < tests.length; i++)
{ CS *pin = &tests[i][0];
CS *pout = &tests[i][1];
code cs = void;
memset(&cs, 0, cs.sizeof);
if (pin.model)
{
if (I16 && pin.model != 16)
continue;
if (I32 && pin.model != 32)
continue;
if (I64 && pin.model != 64)
continue;
}
//printf("[%d]\n", i);
cs.Iop = pin.op;
cs.Iea = pin.ea;
cs.IFL1 = FLconst;
cs.IFL2 = FLconst;
cs.IEV1.Vsize_t = pin.ev1;
cs.IEV2.Vsize_t = pin.ev2;
cs.Iflags = pin.flags;
pinholeopt(&cs, null);
if (cs.Iop != pout.op)
{ printf("[%d] Iop = x%02x, pout = x%02x\n", i, cs.Iop, pout.op);
assert(0);
}
assert(cs.Iea == pout.ea);
assert(cs.IEV1.Vsize_t == pout.ev1);
assert(cs.IEV2.Vsize_t == pout.ev2);
assert(cs.Iflags == pout.flags);
}
}
}
@trusted
void simplify_code(code* c)
{
reg_t reg;
if (config.flags4 & CFG4optimized &&
(c.Iop == 0x81 || c.Iop == 0x80) &&
c.IFL2 == FLconst &&
reghasvalue((c.Iop == 0x80) ? BYTEREGS : ALLREGS,I64 ? c.IEV2.Vsize_t : c.IEV2.Vlong,®) &&
!(I16 && c.Iflags & CFopsize)
)
{
// See if we can replace immediate instruction with register instruction
static immutable ubyte[8] regop =
[ 0x00,0x08,0x10,0x18,0x20,0x28,0x30,0x38 ];
//printf("replacing 0x%02x, val = x%lx\n",c.Iop,c.IEV2.Vlong);
c.Iop = regop[(c.Irm & modregrm(0,7,0)) >> 3] | (c.Iop & 1);
code_newreg(c, reg);
if (I64 && !(c.Iop & 1) && (reg & 4))
c.Irex |= REX;
}
}
/**************************
* Compute jump addresses for FLcode.
* Note: only works for forward referenced code.
* only direct jumps and branches are detected.
* LOOP instructions only work for backward refs.
*/
@trusted
void jmpaddr(code *c)
{
code* ci,cn,ctarg,cstart;
targ_size_t ad;
//printf("jmpaddr()\n");
cstart = c; /* remember start of code */
while (c)
{
const op = c.Iop;
if (op <= 0xEB &&
inssize[op] & T && // if second operand
c.IFL2 == FLcode &&
((op & ~0x0F) == 0x70 || op == JMP || op == JMPS || op == JCXZ || op == CALL))
{
ci = code_next(c);
ctarg = c.IEV2.Vcode; /* target code */
ad = 0; /* IP displacement */
while (ci && ci != ctarg)
{
ad += calccodsize(ci);
ci = code_next(ci);
}
if (!ci)
goto Lbackjmp; // couldn't find it
if (!I16 || op == JMP || op == JMPS || op == JCXZ || op == CALL)
c.IEV2.Vpointer = ad;
else /* else conditional */
{
if (!(c.Iflags & CFjmp16)) /* if branch */
c.IEV2.Vpointer = ad;
else /* branch around a long jump */
{
cn = code_next(c);
c.next = code_calloc();
code_next(c).next = cn;
c.Iop = op ^ 1; /* converse jmp */
c.Iflags &= ~CFjmp16;
c.IEV2.Vpointer = I16 ? 3 : 5;
cn = code_next(c);
cn.Iop = JMP; /* long jump */
cn.IFL2 = FLconst;
cn.IEV2.Vpointer = ad;
}
}
c.IFL2 = FLconst;
}
if (op == LOOP && c.IFL2 == FLcode) /* backwards refs */
{
Lbackjmp:
ctarg = c.IEV2.Vcode;
for (ci = cstart; ci != ctarg; ci = code_next(ci))
if (!ci || ci == c)
assert(0);
ad = 2; /* - IP displacement */
while (ci != c)
{
assert(ci);
ad += calccodsize(ci);
ci = code_next(ci);
}
c.IEV2.Vpointer = (-ad) & 0xFF;
c.IFL2 = FLconst;
}
c = code_next(c);
}
}
/*******************************
* Calculate bl.Bsize.
*/
uint calcblksize(code *c)
{
uint size;
for (size = 0; c; c = code_next(c))
{
uint sz = calccodsize(c);
//printf("off=%02x, sz = %d, code %p: op=%02x\n", size, sz, c, c.Iop);
size += sz;
}
//printf("calcblksize(c = x%x) = %d\n", c, size);
return size;
}
/*****************************
* Calculate and return code size of a code.
* Note that NOPs are sometimes used as markers, but are
* never output. LINNUMs are never output.
* Note: This routine must be fast. Profiling shows it is significant.
*/
@trusted
uint calccodsize(code *c)
{
uint size;
ubyte rm,mod,ins;
uint iflags;
uint i32 = I32 || I64;
uint a32 = i32;
debug
assert((a32 & ~1) == 0);
iflags = c.Iflags;
opcode_t op = c.Iop;
//printf("calccodsize(x%08x), Iflags = x%x\n", op, iflags);
if (iflags & CFvex && c.Ivex.pfx == 0xC4)
{
ins = vex_inssize(c);
size = ins & 7;
goto Lmodrm;
}
else if ((op & 0xFF00) == 0x0F00 || (op & 0xFFFD00) == 0x0F3800)
op = 0x0F;
else
op &= 0xFF;
switch (op)
{
case 0x0F:
if ((c.Iop & 0xFFFD00) == 0x0F3800)
{ // 3 byte op ( 0F38-- or 0F3A-- )
ins = inssize2[(c.Iop >> 8) & 0xFF];
size = ins & 7;
if (c.Iop & 0xFF000000)
size++;
}
else
{ // 2 byte op ( 0F-- )
ins = inssize2[c.Iop & 0xFF];
size = ins & 7;
if (c.Iop & 0xFF0000)
size++;
}
break;
case 0x90:
size = (c.Iop == PAUSE) ? 2 : 1;
goto Lret2;
case NOP:
case ESCAPE:
size = 0; // since these won't be output
goto Lret2;
case ASM:
if (c.Iflags == CFaddrsize) // kludge for DA inline asm
size = _tysize[TYnptr];
else
size = cast(uint)c.IEV1.len;
goto Lret2;
case 0xA1:
case 0xA3:
if (c.Irex)
{
size = 9; // 64 bit immediate value for MOV to/from RAX
goto Lret;
}
goto Ldefault;
case 0xF6: /* TEST mem8,immed8 */
ins = inssize[op];
size = ins & 7;
if (i32)
size = inssize32[op];
if ((c.Irm & (7<<3)) == 0)
size++; /* size of immed8 */
break;
case 0xF7:
ins = inssize[op];
size = ins & 7;
if (i32)
size = inssize32[op];
if ((c.Irm & (7<<3)) == 0)
size += (i32 ^ ((iflags & CFopsize) !=0)) ? 4 : 2;
break;
default:
Ldefault:
ins = inssize[op];
size = ins & 7;
if (i32)
size = inssize32[op];
}
if (iflags & (CFwait | CFopsize | CFaddrsize | CFSEG))
{
if (iflags & CFwait) // if add FWAIT prefix
size++;
if (iflags & CFSEG) // if segment override
size++;
// If the instruction has a second operand that is not an 8 bit,
// and the operand size prefix is present, then fix the size computation
// because the operand size will be different.
// Walter, I had problems with this bit at the end. There can still be
// an ADDRSIZE prefix for these and it does indeed change the operand size.
if (iflags & (CFopsize | CFaddrsize))
{
if ((ins & (T|E)) == T)
{
if ((op & 0xAC) == 0xA0)
{
if (iflags & CFaddrsize && !I64)
{ if (I32)
size -= 2;
else
size += 2;
}
}
else if (iflags & CFopsize)
{ if (I16)
size += 2;
else
size -= 2;
}
}
if (iflags & CFaddrsize)
{ if (!I64)
a32 ^= 1;
size++;
}
if (iflags & CFopsize)
size++; /* +1 for OPSIZE prefix */
}
}
Lmodrm:
if ((op & ~0x0F) == 0x70)
{
if (iflags & CFjmp16) // if long branch
size += I16 ? 3 : 4; // + 3(4) bytes for JMP
}
else if (ins & M) // if modregrm byte
{
rm = c.Irm;
mod = rm & 0xC0;
if (a32 || I64)
{ // 32 bit addressing
if (issib(rm))
size++;
switch (mod)
{ case 0:
if (issib(rm) && (c.Isib & 7) == 5 ||
(rm & 7) == 5)
size += 4; /* disp32 */
if (c.Irex & REX_B && (rm & 7) == 5)
/* Instead of selecting R13, this mode is an [RIP] relative
* address. Although valid, it's redundant, and should not
* be generated. Instead, generate 0[R13] instead of [R13].
*/
assert(0);
break;
case 0x40:
size++; /* disp8 */
break;
case 0x80:
size += 4; /* disp32 */
break;
default:
break;
}
}
else
{ // 16 bit addressing
if (mod == 0x40) /* 01: 8 bit displacement */
size++;
else if (mod == 0x80 || (mod == 0 && (rm & 7) == 6))
size += 2;
}
}
Lret:
if (!(iflags & CFvex) && c.Irex)
{
size++;
if (c.Irex & REX_W && (op & ~7) == 0xB8)
size += 4;
}
Lret2:
//printf("op = x%02x, size = %d\n",op,size);
return size;
}
/********************************
* Return !=0 if codes match.
*/
static if (0)
{
int code_match(code *c1,code *c2)
{
code cs1,cs2;
ubyte ins;
if (c1 == c2)
goto match;
cs1 = *c1;
cs2 = *c2;
if (cs1.Iop != cs2.Iop)
goto nomatch;
switch (cs1.Iop)
{
case ESCAPE | ESCctor:
case ESCAPE | ESCdtor:
goto nomatch;
case NOP:
goto match;
case ASM:
if (cs1.IEV1.len == cs2.IEV1.len &&
memcmp(cs1.IEV1.bytes,cs2.IEV1.bytes,cs1.EV1.len) == 0)
goto match;
else
goto nomatch;
default:
if ((cs1.Iop & 0xFF) == ESCAPE)
goto match;
break;
}
if (cs1.Iflags != cs2.Iflags)
goto nomatch;
ins = inssize[cs1.Iop & 0xFF];
if ((cs1.Iop & 0xFFFD00) == 0x0F3800)
{
ins = inssize2[(cs1.Iop >> 8) & 0xFF];
}
else if ((cs1.Iop & 0xFF00) == 0x0F00)
{
ins = inssize2[cs1.Iop & 0xFF];
}
if (ins & M) // if modregrm byte
{
if (cs1.Irm != cs2.Irm)
goto nomatch;
if ((cs1.Irm & 0xC0) == 0xC0)
goto do2;
if (is32bitaddr(I32,cs1.Iflags))
{
if (issib(cs1.Irm) && cs1.Isib != cs2.Isib)
goto nomatch;
if (
((rm & 0xC0) == 0 && !((rm & 7) == 4 && (c.Isib & 7) == 5 || (rm & 7) == 5))
)
goto do2; /* if no first operand */
}
else
{
if (
((rm & 0xC0) == 0 && !((rm & 7) == 6))
)
goto do2; /* if no first operand */
}
if (cs1.IFL1 != cs2.IFL1)
goto nomatch;
if (flinsymtab[cs1.IFL1] && cs1.IEV1.Vsym != cs2.IEV1.Vsym)
goto nomatch;
if (cs1.IEV1.Voffset != cs2.IEV1.Voffset)
goto nomatch;
}
do2:
if (!(ins & T)) // if no second operand
goto match;
if (cs1.IFL2 != cs2.IFL2)
goto nomatch;
if (flinsymtab[cs1.IFL2] && cs1.IEV2.Vsym != cs2.IEV2.Vsym)
goto nomatch;
if (cs1.IEV2.Voffset != cs2.IEV2.Voffset)
goto nomatch;
match:
return 1;
nomatch:
return 0;
}
}
/**************************
* Write code to intermediate file.
* Code starts at offset.
* Returns:
* addr of end of code
*/
private struct MiniCodeBuf
{
nothrow:
size_t index;
size_t offset;
int seg;
char[100] bytes; // = void;
@trusted
this(int seg)
{
index = 0;
this.offset = cast(size_t)Offset(seg);
this.seg = seg;
}
@trusted
void flushx()
{
// Emit accumulated bytes to code segment
debug assert(index < bytes.length);
offset += objmod.bytes(seg, offset, cast(uint)index, bytes.ptr);
index = 0;
}
@trusted
void gen(char c) { bytes[index++] = c; }
@trusted
void genp(size_t n, void *p) { memcpy(&bytes[index], p, n); index += n; }
@trusted
void flush() { if (index) flushx(); }
@trusted
uint getOffset() { return cast(uint)(offset + index); }
@trusted
uint available() { return cast(uint)(bytes.sizeof - index); }
}
@trusted
uint codout(int seg, code *c)
{
ubyte rm,mod;
ubyte ins;
code *cn;
uint flags;
Symbol *s;
debug
if (debugc) printf("codout(%p), Coffset = x%llx\n",c,cast(ulong)Offset(seg));
MiniCodeBuf ggen = void;
ggen.index = 0;
ggen.offset = cast(size_t)Offset(seg);
ggen.seg = seg;
for (; c; c = code_next(c))
{
debug
{
if (debugc) { printf("off=%02x, sz=%d, ",cast(int)ggen.getOffset(),cast(int)calccodsize(c)); code_print(c); }
uint startoffset = ggen.getOffset();
}
opcode_t op = c.Iop;
ins = inssize[op & 0xFF];
switch (op & 0xFF)
{
case ESCAPE:
/* Check for SSE4 opcode v/pmaxuw xmm1,xmm2/m128 */
if(op == 0x660F383E || c.Iflags & CFvex) break;
switch (op & 0xFFFF00)
{ case ESClinnum:
/* put out line number stuff */
objmod.linnum(c.IEV1.Vsrcpos,seg,ggen.getOffset());
break;
version (SCPP)
{
static if (1)
{
case ESCctor:
case ESCdtor:
case ESCoffset:
if (config.exe != EX_WIN32)
except_pair_setoffset(c,ggen.getOffset() - funcoffset);
break;
case ESCmark:
case ESCrelease:
case ESCmark2:
case ESCrelease2:
break;
}
else
{
case ESCctor:
except_push(ggen.getOffset() - funcoffset,c.IEV1.Vtor,null);
break;
case ESCdtor:
except_pop(ggen.getOffset() - funcoffset,c.IEV1.Vtor,null);
break;
case ESCmark:
except_mark();
break;
case ESCrelease:
except_release();
break;
}
}
case ESCadjesp:
//printf("adjust ESP %ld\n", (long)c.IEV1.Vint);
break;
default:
break;
}
debug
assert(calccodsize(c) == 0);
continue;
case NOP: /* don't send them out */
if (op != NOP)
break;
debug
assert(calccodsize(c) == 0);
continue;
case ASM:
if (op != ASM)
break;
ggen.flush();
if (c.Iflags == CFaddrsize) // kludge for DA inline asm
{
do32bit(&ggen, FLblockoff,&c.IEV1,0,0);
}
else
{
ggen.offset += objmod.bytes(seg,ggen.offset,cast(uint)c.IEV1.len,c.IEV1.bytes);
}
debug
assert(calccodsize(c) == c.IEV1.len);
continue;
default:
break;
}
flags = c.Iflags;
// See if we need to flush (don't have room for largest code sequence)
if (ggen.available() < (1+4+4+8+8))
ggen.flush();
// see if we need to put out prefix bytes
if (flags & (CFwait | CFPREFIX | CFjmp16))
{
int override_;
if (flags & CFwait)
ggen.gen(0x9B); // FWAIT
/* ? SEGES : SEGSS */
switch (flags & CFSEG)
{ case CFes: override_ = SEGES; goto segover;
case CFss: override_ = SEGSS; goto segover;
case CFcs: override_ = SEGCS; goto segover;
case CFds: override_ = SEGDS; goto segover;
case CFfs: override_ = SEGFS; goto segover;
case CFgs: override_ = SEGGS; goto segover;
segover: ggen.gen(cast(ubyte)override_);
break;
default: break;
}
if (flags & CFaddrsize)
ggen.gen(0x67);
// Do this last because of instructions like ADDPD
if (flags & CFopsize)
ggen.gen(0x66); /* operand size */
if ((op & ~0x0F) == 0x70 && flags & CFjmp16) /* long condit jmp */
{
if (!I16)
{ // Put out 16 bit conditional jump
c.Iop = op = 0x0F00 | (0x80 | (op & 0x0F));
}
else
{
cn = code_calloc();
/*cxcalloc++;*/
cn.next = code_next(c);
c.next= cn; // link into code
cn.Iop = JMP; // JMP block
cn.IFL2 = c.IFL2;
cn.IEV2.Vblock = c.IEV2.Vblock;
c.Iop = op ^= 1; // toggle condition
c.IFL2 = FLconst;
c.IEV2.Vpointer = I16 ? 3 : 5; // skip over JMP block
c.Iflags &= ~CFjmp16;
}
}
}
if (flags & CFvex)
{
if (flags & CFvex3)
{
ggen.gen(0xC4);
ggen.gen(cast(ubyte)VEX3_B1(c.Ivex));
ggen.gen(cast(ubyte)VEX3_B2(c.Ivex));
ggen.gen(c.Ivex.op);
}
else
{
ggen.gen(0xC5);
ggen.gen(cast(ubyte)VEX2_B1(c.Ivex));
ggen.gen(c.Ivex.op);
}
ins = vex_inssize(c);
goto Lmodrm;
}
if (op > 0xFF)
{
if ((op & 0xFFFD00) == 0x0F3800)
ins = inssize2[(op >> 8) & 0xFF];
else if ((op & 0xFF00) == 0x0F00)
ins = inssize2[op & 0xFF];
if (op & 0xFF000000)
{
ubyte op1 = op >> 24;
if (op1 == 0xF2 || op1 == 0xF3 || op1 == 0x66)
{
ggen.gen(op1);
if (c.Irex)
ggen.gen(c.Irex | REX);
}
else
{
if (c.Irex)
ggen.gen(c.Irex | REX);
ggen.gen(op1);
}
ggen.gen((op >> 16) & 0xFF);
ggen.gen((op >> 8) & 0xFF);
ggen.gen(op & 0xFF);
}
else if (op & 0xFF0000)
{
ubyte op1 = cast(ubyte)(op >> 16);
if (op1 == 0xF2 || op1 == 0xF3 || op1 == 0x66)
{
ggen.gen(op1);
if (c.Irex)
ggen.gen(c.Irex | REX);
}
else
{
if (c.Irex)
ggen.gen(c.Irex | REX);
ggen.gen(op1);
}
ggen.gen((op >> 8) & 0xFF);
ggen.gen(op & 0xFF);
}
else
{
if (c.Irex)
ggen.gen(c.Irex | REX);
ggen.gen((op >> 8) & 0xFF);
ggen.gen(op & 0xFF);
}
}
else
{
if (c.Irex)
ggen.gen(c.Irex | REX);
ggen.gen(cast(ubyte)op);
}
Lmodrm:
if (ins & M) /* if modregrm byte */
{
rm = c.Irm;
ggen.gen(rm);
// Look for an address size override when working with the
// MOD R/M and SIB bytes
if (is32bitaddr( I32, flags))
{
if (issib(rm))
ggen.gen(c.Isib);
switch (rm & 0xC0)
{
case 0x40:
do8bit(&ggen, cast(FL) c.IFL1,&c.IEV1); // 8 bit
break;
case 0:
if (!(issib(rm) && (c.Isib & 7) == 5 ||
(rm & 7) == 5))
break;
goto case 0x80;
case 0x80:
{
int cfflags = CFoff;
targ_size_t val = 0;
if (I64)
{
if ((rm & modregrm(3,0,7)) == modregrm(0,0,5)) // if disp32[RIP]
{
cfflags |= CFpc32;
val = -4;
reg_t reg = rm & modregrm(0,7,0);
if (ins & T ||
((op == 0xF6 || op == 0xF7) && (reg == modregrm(0,0,0) || reg == modregrm(0,1,0))))
{ if (ins & E || op == 0xF6)
val = -5;
else if (c.Iflags & CFopsize)
val = -6;
else
val = -8;
}
if (config.exe & (EX_OSX64 | EX_WIN64))
/* Mach-O and Win64 fixups already take the 4 byte size
* into account, so bias by 4
*/
val += 4;
}
}
do32bit(&ggen, cast(FL)c.IFL1,&c.IEV1,cfflags,cast(int)val);
break;
}
default:
break;
}
}
else
{
switch (rm & 0xC0)
{ case 0x40:
do8bit(&ggen, cast(FL) c.IFL1,&c.IEV1); // 8 bit
break;
case 0:
if ((rm & 7) != 6)
break;
goto case 0x80;
case 0x80:
do16bit(&ggen, cast(FL)c.IFL1,&c.IEV1,CFoff);
break;
default:
break;
}
}
}
else
{
if (op == ENTER)
do16bit(&ggen, cast(FL)c.IFL1,&c.IEV1,0);
}
flags &= CFseg | CFoff | CFselfrel;
if (ins & T) /* if second operand */
{
if (ins & E) /* if data-8 */
do8bit(&ggen, cast(FL) c.IFL2,&c.IEV2);
else if (!I16)
{
switch (op)
{
case 0xC2: /* RETN imm16 */
case 0xCA: /* RETF imm16 */
do16:
do16bit(&ggen, cast(FL)c.IFL2,&c.IEV2,flags);
break;
case 0xA1:
case 0xA3:
if (I64 && c.Irex)
{
do64:
do64bit(&ggen, cast(FL)c.IFL2,&c.IEV2,flags);
break;
}
goto case 0xA0;
case 0xA0: /* MOV AL,byte ptr [] */
case 0xA2:
if (c.Iflags & CFaddrsize && !I64)
goto do16;
else
do32:
do32bit(&ggen, cast(FL)c.IFL2,&c.IEV2,flags,0);
break;
case 0x9A:
case 0xEA:
if (c.Iflags & CFopsize)
goto ptr1616;
else
goto ptr1632;
case 0x68: // PUSH immed32
if (cast(FL)c.IFL2 == FLblock)
{
c.IFL2 = FLblockoff;
goto do32;
}
else
goto case_default;
case CALL: // CALL rel
case JMP: // JMP rel
flags |= CFselfrel;
goto case_default;
default:
if ((op|0xF) == 0x0F8F) // Jcc rel16 rel32
flags |= CFselfrel;
if (I64 && (op & ~7) == 0xB8 && c.Irex & REX_W)
goto do64;
case_default:
if (c.Iflags & CFopsize)
goto do16;
else
goto do32;
}
}
else
{
switch (op)
{
case 0xC2:
case 0xCA:
goto do16;
case 0xA0:
case 0xA1:
case 0xA2:
case 0xA3:
if (c.Iflags & CFaddrsize)
goto do32;
else
goto do16;
case 0x9A:
case 0xEA:
if (c.Iflags & CFopsize)
goto ptr1632;
else
goto ptr1616;
ptr1616:
ptr1632:
//assert(c.IFL2 == FLfunc);
ggen.flush();
if (c.IFL2 == FLdatseg)
{
objmod.reftodatseg(seg,ggen.offset,c.IEV2.Vpointer,
c.IEV2.Vseg,flags);
ggen.offset += 4;
}
else
{
s = c.IEV2.Vsym;
ggen.offset += objmod.reftoident(seg,ggen.offset,s,0,flags);
}
break;
case 0x68: // PUSH immed16
if (cast(FL)c.IFL2 == FLblock)
{ c.IFL2 = FLblockoff;
goto do16;
}
else
goto case_default16;
case CALL:
case JMP:
flags |= CFselfrel;
goto default;
default:
case_default16:
if (c.Iflags & CFopsize)
goto do32;
else
goto do16;
}
}
}
else if (op == 0xF6) /* TEST mem8,immed8 */
{
if ((rm & (7<<3)) == 0)
do8bit(&ggen, cast(FL)c.IFL2,&c.IEV2);
}
else if (op == 0xF7)
{
if ((rm & (7<<3)) == 0) /* TEST mem16/32,immed16/32 */
{
if ((I32 || I64) ^ ((c.Iflags & CFopsize) != 0))
do32bit(&ggen, cast(FL)c.IFL2,&c.IEV2,flags,0);
else
do16bit(&ggen, cast(FL)c.IFL2,&c.IEV2,flags);
}
}
debug
if (ggen.getOffset() - startoffset != calccodsize(c))
{
printf("actual: %d, calc: %d\n", cast(int)(ggen.getOffset() - startoffset), cast(int)calccodsize(c));
code_print(c);
assert(0);
}
}
ggen.flush();
Offset(seg) = ggen.offset;
//printf("-codout(), Coffset = x%x\n", Offset(seg));
return cast(uint)ggen.offset; /* ending address */
}
@trusted
private void do64bit(MiniCodeBuf *pbuf, FL fl, evc *uev,int flags)
{
char *p;
Symbol *s;
targ_size_t ad;
assert(I64);
switch (fl)
{
case FLconst:
ad = *cast(targ_size_t *) uev;
L1:
pbuf.genp(8,&ad);
return;
case FLdatseg:
pbuf.flush();
objmod.reftodatseg(pbuf.seg,pbuf.offset,uev.Vpointer,uev.Vseg,CFoffset64 | flags);
break;
case FLframehandler:
framehandleroffset = pbuf.getOffset();
ad = 0;
goto L1;
case FLswitch:
pbuf.flush();
ad = uev.Vswitch.Btableoffset;
if (config.flags & CFGromable)
objmod.reftocodeseg(pbuf.seg,pbuf.offset,ad);
else
objmod.reftodatseg(pbuf.seg,pbuf.offset,ad,objmod.jmpTableSegment(funcsym_p),CFoff);
break;
case FLcsdata:
case FLfardata:
//symbol_print(uev.Vsym);
// NOTE: In ELFOBJ all symbol refs have been tagged FLextern
// strings and statics are treated like offsets from a
// un-named external with is the start of .rodata or .data
case FLextern: /* external data symbol */
case FLtlsdata:
pbuf.flush();
s = uev.Vsym; /* symbol pointer */
objmod.reftoident(pbuf.seg,pbuf.offset,s,uev.Voffset,CFoffset64 | flags);
break;
case FLgotoff:
if (config.exe & (EX_OSX | EX_OSX64))
{
assert(0);
}
else if (config.exe & EX_posix)
{
pbuf.flush();
s = uev.Vsym; /* symbol pointer */
objmod.reftoident(pbuf.seg,pbuf.offset,s,uev.Voffset,CFoffset64 | flags);
break;
}
else
assert(0);
case FLgot:
if (config.exe & (EX_OSX | EX_OSX64))
{
funcsym_p.Slocalgotoffset = pbuf.getOffset();
ad = 0;
goto L1;
}
else if (config.exe & EX_posix)
{
pbuf.flush();
s = uev.Vsym; /* symbol pointer */
objmod.reftoident(pbuf.seg,pbuf.offset,s,uev.Voffset,CFoffset64 | flags);
break;
}
else
assert(0);
case FLfunc: /* function call */
s = uev.Vsym; /* symbol pointer */
assert(TARGET_SEGMENTED || !tyfarfunc(s.ty()));
pbuf.flush();
objmod.reftoident(pbuf.seg,pbuf.offset,s,0,CFoffset64 | flags);
break;
case FLblock: /* displacement to another block */
ad = uev.Vblock.Boffset - pbuf.getOffset() - 4;
//printf("FLblock: funcoffset = %x, pbuf.getOffset = %x, Boffset = %x, ad = %x\n", funcoffset, pbuf.getOffset(), uev.Vblock.Boffset, ad);
goto L1;
case FLblockoff:
pbuf.flush();
assert(uev.Vblock);
//printf("FLblockoff: offset = %x, Boffset = %x, funcoffset = %x\n", pbuf.offset, uev.Vblock.Boffset, funcoffset);
objmod.reftocodeseg(pbuf.seg,pbuf.offset,uev.Vblock.Boffset);
break;
default:
WRFL(fl);
assert(0);
}
pbuf.offset += 8;
}
@trusted
private void do32bit(MiniCodeBuf *pbuf, FL fl, evc *uev,int flags, int val)
{
char *p;
Symbol *s;
targ_size_t ad;
//printf("do32bit(flags = x%x)\n", flags);
switch (fl)
{
case FLconst:
assert(targ_size_t.sizeof == 4 || targ_size_t.sizeof == 8);
ad = * cast(targ_size_t *) uev;
L1:
pbuf.genp(4,&ad);
return;
case FLdatseg:
pbuf.flush();
objmod.reftodatseg(pbuf.seg,pbuf.offset,uev.Vpointer,uev.Vseg,flags);
break;
case FLframehandler:
framehandleroffset = pbuf.getOffset();
ad = 0;
goto L1;
case FLswitch:
pbuf.flush();
ad = uev.Vswitch.Btableoffset;
if (config.flags & CFGromable)
{
if (config.exe & (EX_OSX | EX_OSX64))
{
// These are magic values based on the exact code generated for the switch jump
if (I64)
uev.Vswitch.Btablebase = pbuf.getOffset() + 4;
else
uev.Vswitch.Btablebase = pbuf.getOffset() + 4 - 8;
ad -= uev.Vswitch.Btablebase;
goto L1;
}
else if (config.exe & EX_windos)
{
if (I64)
{
uev.Vswitch.Btablebase = pbuf.getOffset() + 4;
ad -= uev.Vswitch.Btablebase;
goto L1;
}
else
objmod.reftocodeseg(pbuf.seg,pbuf.offset,ad);
}
else
{
objmod.reftocodeseg(pbuf.seg,pbuf.offset,ad);
}
}
else
objmod.reftodatseg(pbuf.seg,pbuf.offset,ad,objmod.jmpTableSegment(funcsym_p),CFoff);
break;
case FLcode:
//assert(JMPJMPTABLE); // the only use case
pbuf.flush();
ad = *cast(targ_size_t *) uev + pbuf.getOffset();
objmod.reftocodeseg(pbuf.seg,pbuf.offset,ad);
break;
case FLcsdata:
case FLfardata:
//symbol_print(uev.Vsym);
// NOTE: In ELFOBJ all symbol refs have been tagged FLextern
// strings and statics are treated like offsets from a
// un-named external with is the start of .rodata or .data
case FLextern: /* external data symbol */
case FLtlsdata:
pbuf.flush();
s = uev.Vsym; /* symbol pointer */
if (config.exe & EX_windos && I64 && (flags & CFpc32))
{
/* This is for those funky fixups where the location to be fixed up
* is a 'val' amount back from the current RIP, biased by adding 4.
*/
assert(val >= -5 && val <= 0);
flags |= (-val & 7) << 24; // set CFREL value
assert(CFREL == (7 << 24));
objmod.reftoident(pbuf.seg,pbuf.offset,s,uev.Voffset,flags);
}
else
objmod.reftoident(pbuf.seg,pbuf.offset,s,uev.Voffset + val,flags);
break;
case FLgotoff:
if (config.exe & (EX_OSX | EX_OSX64))
{
assert(0);
}
else if (config.exe & EX_posix)
{
pbuf.flush();
s = uev.Vsym; /* symbol pointer */
objmod.reftoident(pbuf.seg,pbuf.offset,s,uev.Voffset + val,flags);
break;
}
else
assert(0);
case FLgot:
if (config.exe & (EX_OSX | EX_OSX64))
{
funcsym_p.Slocalgotoffset = pbuf.getOffset();
ad = 0;
goto L1;
}
else if (config.exe & EX_posix)
{
pbuf.flush();
s = uev.Vsym; /* symbol pointer */
objmod.reftoident(pbuf.seg,pbuf.offset,s,uev.Voffset + val,flags);
break;
}
else
assert(0);
case FLfunc: /* function call */
s = uev.Vsym; /* symbol pointer */
if (tyfarfunc(s.ty()))
{ /* Large code references are always absolute */
pbuf.flush();
pbuf.offset += objmod.reftoident(pbuf.seg,pbuf.offset,s,0,flags) - 4;
}
else if (s.Sseg == pbuf.seg &&
(s.Sclass == SCstatic || s.Sclass == SCglobal) &&
s.Sxtrnnum == 0 && flags & CFselfrel)
{ /* if we know it's relative address */
ad = s.Soffset - pbuf.getOffset() - 4;
goto L1;
}
else
{
assert(TARGET_SEGMENTED || !tyfarfunc(s.ty()));
pbuf.flush();
objmod.reftoident(pbuf.seg,pbuf.offset,s,val,flags);
}
break;
case FLblock: /* displacement to another block */
ad = uev.Vblock.Boffset - pbuf.getOffset() - 4;
//printf("FLblock: funcoffset = %x, pbuf.getOffset = %x, Boffset = %x, ad = %x\n", funcoffset, pbuf.getOffset(), uev.Vblock.Boffset, ad);
goto L1;
case FLblockoff:
pbuf.flush();
assert(uev.Vblock);
//printf("FLblockoff: offset = %x, Boffset = %x, funcoffset = %x\n", pbuf.offset, uev.Vblock.Boffset, funcoffset);
objmod.reftocodeseg(pbuf.seg,pbuf.offset,uev.Vblock.Boffset);
break;
default:
WRFL(fl);
assert(0);
}
pbuf.offset += 4;
}
@trusted
private void do16bit(MiniCodeBuf *pbuf, FL fl, evc *uev,int flags)
{
char *p;
Symbol *s;
targ_size_t ad;
switch (fl)
{
case FLconst:
pbuf.genp(2,cast(char *) uev);
return;
case FLdatseg:
pbuf.flush();
objmod.reftodatseg(pbuf.seg,pbuf.offset,uev.Vpointer,uev.Vseg,flags);
break;
case FLswitch:
pbuf.flush();
ad = uev.Vswitch.Btableoffset;
if (config.flags & CFGromable)
objmod.reftocodeseg(pbuf.seg,pbuf.offset,ad);
else
objmod.reftodatseg(pbuf.seg,pbuf.offset,ad,objmod.jmpTableSegment(funcsym_p),CFoff);
break;
case FLcsdata:
case FLfardata:
case FLextern: /* external data symbol */
case FLtlsdata:
//assert(SIXTEENBIT || TARGET_SEGMENTED);
pbuf.flush();
s = uev.Vsym; /* symbol pointer */
objmod.reftoident(pbuf.seg,pbuf.offset,s,uev.Voffset,flags);
break;
case FLfunc: /* function call */
//assert(SIXTEENBIT || TARGET_SEGMENTED);
s = uev.Vsym; /* symbol pointer */
if (tyfarfunc(s.ty()))
{ /* Large code references are always absolute */
pbuf.flush();
pbuf.offset += objmod.reftoident(pbuf.seg,pbuf.offset,s,0,flags) - 2;
}
else if (s.Sseg == pbuf.seg &&
(s.Sclass == SCstatic || s.Sclass == SCglobal) &&
s.Sxtrnnum == 0 && flags & CFselfrel)
{ /* if we know it's relative address */
ad = s.Soffset - pbuf.getOffset() - 2;
goto L1;
}
else
{
pbuf.flush();
objmod.reftoident(pbuf.seg,pbuf.offset,s,0,flags);
}
break;
case FLblock: /* displacement to another block */
ad = uev.Vblock.Boffset - pbuf.getOffset() - 2;
debug
{
targ_ptrdiff_t delta = uev.Vblock.Boffset - pbuf.getOffset() - 2;
assert(cast(short)delta == delta);
}
L1:
pbuf.genp(2,&ad); // displacement
return;
case FLblockoff:
pbuf.flush();
objmod.reftocodeseg(pbuf.seg,pbuf.offset,uev.Vblock.Boffset);
break;
default:
WRFL(fl);
assert(0);
}
pbuf.offset += 2;
}
@trusted
private void do8bit(MiniCodeBuf *pbuf, FL fl, evc *uev)
{
char c;
targ_ptrdiff_t delta;
switch (fl)
{
case FLconst:
c = cast(char)uev.Vuns;
break;
case FLblock:
delta = uev.Vblock.Boffset - pbuf.getOffset() - 1;
if (cast(byte)delta != delta)
{
version (MARS)
{
if (uev.Vblock.Bsrcpos.Slinnum)
printf("%s(%d): ", uev.Vblock.Bsrcpos.Sfilename, uev.Vblock.Bsrcpos.Slinnum);
}
printf("block displacement of %lld exceeds the maximum offset of -128 to 127.\n", cast(long)delta);
err_exit();
}
c = cast(char)delta;
debug assert(uev.Vblock.Boffset > pbuf.getOffset() || c != 0x7F);
break;
default:
debug printf("fl = %d\n",fl);
assert(0);
}
pbuf.gen(c);
}
/**********************************
*/
version (SCPP)
{
static if (HYDRATE)
{
@trusted
void code_hydrate(code **pc)
{
code *c;
ubyte ins,rm;
FL fl;
assert(pc);
while (*pc)
{
c = cast(code *) ph_hydrate(cast(void**)pc);
if (c.Iflags & CFvex && c.Ivex.pfx == 0xC4)
ins = vex_inssize(c);
else if ((c.Iop & 0xFFFD00) == 0x0F3800)
ins = inssize2[(c.Iop >> 8) & 0xFF];
else if ((c.Iop & 0xFF00) == 0x0F00)
ins = inssize2[c.Iop & 0xFF];
else
ins = inssize[c.Iop & 0xFF];
switch (c.Iop)
{
default:
break;
case ESCAPE | ESClinnum:
srcpos_hydrate(&c.IEV1.Vsrcpos);
goto done;
case ESCAPE | ESCctor:
case ESCAPE | ESCdtor:
el_hydrate(&c.IEV1.Vtor);
goto done;
case ASM:
ph_hydrate(cast(void**)&c.IEV1.bytes);
goto done;
}
if (!(ins & M) ||
((rm = c.Irm) & 0xC0) == 0xC0)
goto do2; /* if no first operand */
if (is32bitaddr(I32,c.Iflags))
{
if (
((rm & 0xC0) == 0 && !((rm & 7) == 4 && (c.Isib & 7) == 5 || (rm & 7) == 5))
)
goto do2; /* if no first operand */
}
else
{
if (
((rm & 0xC0) == 0 && !((rm & 7) == 6))
)
goto do2; /* if no first operand */
}
fl = cast(FL) c.IFL1;
switch (fl)
{
case FLudata:
case FLdata:
case FLreg:
case FLauto:
case FLfast:
case FLbprel:
case FLpara:
case FLcsdata:
case FLfardata:
case FLtlsdata:
case FLfunc:
case FLpseudo:
case FLextern:
assert(flinsymtab[fl]);
symbol_hydrate(&c.IEV1.Vsym);
symbol_debug(c.IEV1.Vsym);
break;
case FLdatseg:
case FLfltreg:
case FLallocatmp:
case FLcs:
case FLndp:
case FLoffset:
case FLlocalsize:
case FLconst:
case FLframehandler:
assert(!flinsymtab[fl]);
break;
case FLcode:
ph_hydrate(cast(void**)&c.IEV1.Vcode);
break;
case FLblock:
case FLblockoff:
ph_hydrate(cast(void**)&c.IEV1.Vblock);
break;
version (SCPP)
{
case FLctor:
case FLdtor:
el_hydrate(cast(elem**)&c.IEV1.Vtor);
break;
}
case FLasm:
ph_hydrate(cast(void**)&c.IEV1.bytes);
break;
default:
WRFL(fl);
assert(0);
}
do2:
/* Ignore TEST (F6 and F7) opcodes */
if (!(ins & T))
goto done; /* if no second operand */
fl = cast(FL) c.IFL2;
switch (fl)
{
case FLudata:
case FLdata:
case FLreg:
case FLauto:
case FLfast:
case FLbprel:
case FLpara:
case FLcsdata:
case FLfardata:
case FLtlsdata:
case FLfunc:
case FLpseudo:
case FLextern:
assert(flinsymtab[fl]);
symbol_hydrate(&c.IEV2.Vsym);
symbol_debug(c.IEV2.Vsym);
break;
case FLdatseg:
case FLfltreg:
case FLallocatmp:
case FLcs:
case FLndp:
case FLoffset:
case FLlocalsize:
case FLconst:
case FLframehandler:
assert(!flinsymtab[fl]);
break;
case FLcode:
ph_hydrate(cast(void**)&c.IEV2.Vcode);
break;
case FLblock:
case FLblockoff:
ph_hydrate(cast(void**)&c.IEV2.Vblock);
break;
default:
WRFL(fl);
assert(0);
}
done:
{ }
pc = &c.next;
}
}
}
/**********************************
*/
static if (DEHYDRATE)
{
@trusted
void code_dehydrate(code **pc)
{
code *c;
ubyte ins,rm;
FL fl;
while ((c = *pc) != null)
{
ph_dehydrate(pc);
if (c.Iflags & CFvex && c.Ivex.pfx == 0xC4)
ins = vex_inssize(c);
else if ((c.Iop & 0xFFFD00) == 0x0F3800)
ins = inssize2[(c.Iop >> 8) & 0xFF];
else if ((c.Iop & 0xFF00) == 0x0F00)
ins = inssize2[c.Iop & 0xFF];
else
ins = inssize[c.Iop & 0xFF];
switch (c.Iop)
{
default:
break;
case ESCAPE | ESClinnum:
srcpos_dehydrate(&c.IEV1.Vsrcpos);
goto done;
case ESCAPE | ESCctor:
case ESCAPE | ESCdtor:
el_dehydrate(&c.IEV1.Vtor);
goto done;
case ASM:
ph_dehydrate(&c.IEV1.bytes);
goto done;
}
if (!(ins & M) ||
((rm = c.Irm) & 0xC0) == 0xC0)
goto do2; /* if no first operand */
if (is32bitaddr(I32,c.Iflags))
{
if (
((rm & 0xC0) == 0 && !((rm & 7) == 4 && (c.Isib & 7) == 5 || (rm & 7) == 5))
)
goto do2; /* if no first operand */
}
else
{
if (
((rm & 0xC0) == 0 && !((rm & 7) == 6))
)
goto do2; /* if no first operand */
}
fl = cast(FL) c.IFL1;
switch (fl)
{
case FLudata:
case FLdata:
case FLreg:
case FLauto:
case FLfast:
case FLbprel:
case FLpara:
case FLcsdata:
case FLfardata:
case FLtlsdata:
case FLfunc:
case FLpseudo:
case FLextern:
assert(flinsymtab[fl]);
symbol_dehydrate(&c.IEV1.Vsym);
break;
case FLdatseg:
case FLfltreg:
case FLallocatmp:
case FLcs:
case FLndp:
case FLoffset:
case FLlocalsize:
case FLconst:
case FLframehandler:
assert(!flinsymtab[fl]);
break;
case FLcode:
ph_dehydrate(&c.IEV1.Vcode);
break;
case FLblock:
case FLblockoff:
ph_dehydrate(&c.IEV1.Vblock);
break;
version (SCPP)
{
case FLctor:
case FLdtor:
el_dehydrate(&c.IEV1.Vtor);
break;
}
case FLasm:
ph_dehydrate(&c.IEV1.bytes);
break;
default:
WRFL(fl);
assert(0);
break;
}
do2:
/* Ignore TEST (F6 and F7) opcodes */
if (!(ins & T))
goto done; /* if no second operand */
fl = cast(FL) c.IFL2;
switch (fl)
{
case FLudata:
case FLdata:
case FLreg:
case FLauto:
case FLfast:
case FLbprel:
case FLpara:
case FLcsdata:
case FLfardata:
case FLtlsdata:
case FLfunc:
case FLpseudo:
case FLextern:
assert(flinsymtab[fl]);
symbol_dehydrate(&c.IEV2.Vsym);
break;
case FLdatseg:
case FLfltreg:
case FLallocatmp:
case FLcs:
case FLndp:
case FLoffset:
case FLlocalsize:
case FLconst:
case FLframehandler:
assert(!flinsymtab[fl]);
break;
case FLcode:
ph_dehydrate(&c.IEV2.Vcode);
break;
case FLblock:
case FLblockoff:
ph_dehydrate(&c.IEV2.Vblock);
break;
default:
WRFL(fl);
assert(0);
break;
}
done:
pc = &code_next(c);
}
}
}
}
/***************************
* Debug code to dump code structure.
*/
void WRcodlst(code *c)
{
for (; c; c = code_next(c))
code_print(c);
}
@trusted
extern (C) void code_print(code* c)
{
ubyte ins;
ubyte rexb;
if (c == null)
{
printf("code 0\n");
return;
}
const op = c.Iop;
if (c.Iflags & CFvex && c.Ivex.pfx == 0xC4)
ins = vex_inssize(c);
else if ((c.Iop & 0xFFFD00) == 0x0F3800)
ins = inssize2[(op >> 8) & 0xFF];
else if ((c.Iop & 0xFF00) == 0x0F00)
ins = inssize2[op & 0xFF];
else
ins = inssize[op & 0xFF];
printf("code %p: nxt=%p ",c,code_next(c));
if (c.Iflags & CFvex)
{
if (c.Iflags & CFvex3)
{
printf("vex=0xC4");
printf(" 0x%02X", VEX3_B1(c.Ivex));
printf(" 0x%02X", VEX3_B2(c.Ivex));
rexb =
( c.Ivex.w ? REX_W : 0) |
(!c.Ivex.r ? REX_R : 0) |
(!c.Ivex.x ? REX_X : 0) |
(!c.Ivex.b ? REX_B : 0);
}
else
{
printf("vex=0xC5");
printf(" 0x%02X", VEX2_B1(c.Ivex));
rexb = !c.Ivex.r ? REX_R : 0;
}
printf(" ");
}
else
rexb = c.Irex;
if (rexb)
{
printf("rex=0x%02X ", c.Irex);
if (rexb & REX_W)
printf("W");
if (rexb & REX_R)
printf("R");
if (rexb & REX_X)
printf("X");
if (rexb & REX_B)
printf("B");
printf(" ");
}
printf("op=0x%02X",op);
if ((op & 0xFF) == ESCAPE)
{
if ((op & 0xFF00) == ESClinnum)
{
printf(" linnum = %d\n",c.IEV1.Vsrcpos.Slinnum);
return;
}
printf(" ESCAPE %d",c.Iop >> 8);
}
if (c.Iflags)
printf(" flg=%x",c.Iflags);
if (ins & M)
{
uint rm = c.Irm;
printf(" rm=0x%02X=%d,%d,%d",rm,(rm>>6)&3,(rm>>3)&7,rm&7);
if (!I16 && issib(rm))
{
ubyte sib = c.Isib;
printf(" sib=%02x=%d,%d,%d",sib,(sib>>6)&3,(sib>>3)&7,sib&7);
}
if ((rm & 0xC7) == BPRM || (rm & 0xC0) == 0x80 || (rm & 0xC0) == 0x40)
{
switch (c.IFL1)
{
case FLconst:
case FLoffset:
printf(" int = %4d",c.IEV1.Vuns);
break;
case FLblock:
printf(" block = %p",c.IEV1.Vblock);
break;
case FLswitch:
case FLblockoff:
case FLlocalsize:
case FLframehandler:
case 0:
break;
case FLdatseg:
printf(" FLdatseg %d.%llx",c.IEV1.Vseg,cast(ulong)c.IEV1.Vpointer);
break;
case FLauto:
case FLfast:
case FLreg:
case FLdata:
case FLudata:
case FLpara:
case FLbprel:
case FLtlsdata:
case FLextern:
printf(" ");
WRFL(cast(FL)c.IFL1);
printf(" sym='%s'",c.IEV1.Vsym.Sident.ptr);
if (c.IEV1.Voffset)
printf(".%d", cast(int)c.IEV1.Voffset);
break;
default:
WRFL(cast(FL)c.IFL1);
break;
}
}
}
if (ins & T)
{
printf(" ");
WRFL(cast(FL)c.IFL2);
switch (c.IFL2)
{
case FLconst:
printf(" int = %4d",c.IEV2.Vuns);
break;
case FLblock:
printf(" block = %p",c.IEV2.Vblock);
break;
case FLswitch:
case FLblockoff:
case 0:
case FLlocalsize:
case FLframehandler:
break;
case FLdatseg:
printf(" %d.%llx",c.IEV2.Vseg,cast(ulong)c.IEV2.Vpointer);
break;
case FLauto:
case FLfast:
case FLreg:
case FLpara:
case FLbprel:
case FLfunc:
case FLdata:
case FLudata:
case FLtlsdata:
printf(" sym='%s'",c.IEV2.Vsym.Sident.ptr);
break;
case FLcode:
printf(" code = %p",c.IEV2.Vcode);
break;
default:
WRFL(cast(FL)c.IFL2);
break;
}
}
printf("\n");
}
}
|
D
|
/Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/CombineLatest.o : /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Deprecated.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Cancelable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObserverType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Reactive.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Date+Dispatch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/RecursiveLock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CompactMap.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Errors.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/AtomicInt.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Event.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/First.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/Platform.Linux.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/CombineLatest~partial.swiftmodule : /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Deprecated.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Cancelable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObserverType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Reactive.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Date+Dispatch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/RecursiveLock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CompactMap.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Errors.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/AtomicInt.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Event.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/First.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/Platform.Linux.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/CombineLatest~partial.swiftdoc : /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Deprecated.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Cancelable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObserverType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Reactive.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Date+Dispatch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/RecursiveLock.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CompactMap.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Errors.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/AtomicInt.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Event.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/First.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Rx.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/Platform/Platform.Linux.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/ameeradamsika/Desktop/IOS/Demo/LoginWithRxSwift/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
// Copyright Michael D. Parker 2018.
// 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 bindbc.lua.v51.binddynamic;
version(BindBC_Static) version = BindLua_Static;
version(BindLua_Static) {}
else version = BindLua_Dynamic;
version(LUA_51) {
version(BindLua_Dynamic) version = LUA_51_DYNAMIC;
}
version(LUA_51_DYNAMIC):
import core.stdc.stdarg : va_list;
import bindbc.loader;
import bindbc.lua.config;
import bindbc.lua.v51.types;
extern(C) @nogc nothrow {
// lauxlib.h
alias pluaI_openlib = void function(lua_State*,const(char)*,const(luaL_Reg)*,int);
alias pluaL_register = void function(lua_State*,const(char)*,const(luaL_Reg)*);
alias pluaL_getmetafield = int function(lua_State*,int,const(char)*);
alias pluaL_callmeta = int function(lua_State*, int,const(char)*);
alias pluaL_typerror = int function(lua_State*,int,const(char)*);
alias pluaL_argerror = int function(lua_State*,int,const(char)*);
alias pluaL_checklstring = const(char)* function(lua_State*,int,size_t*);
alias pluaL_optlstring = const(char)* function(lua_State*,int,const(char)*,size_t*);
alias pluaL_checknumber = lua_Number function(lua_State*,int);
alias pluaL_optnumber = lua_Number function(lua_State*,int,lua_Number);
alias pluaL_checkinteger = lua_Integer function(lua_State*,int);
alias pluaL_optinteger = lua_Integer function(lua_State*,int,lua_Integer);
alias pluaL_checkstack = void function(lua_State*,int,const(char)*);
alias pluaL_checktype = void function(lua_State*,int,int);
alias pluaL_checkany = void function(lua_State*,int);
alias pluaL_newmetatable = int function(lua_State*,const(char)*);
alias pluaL_checkudata = void* function(lua_State*,int,const(char)*);
alias pluaL_where = void function(lua_State*,int);
alias pluaL_error = int function(lua_State*,const(char)*,...);
alias pluaL_checkoption = int function(lua_State*,int,const(char)*);
alias pluaL_ref = int function(lua_State*,int);
alias pluaL_unref = void function(lua_State*,int,int);
alias pluaL_loadfile = int function(lua_State*,const(char)*);
alias pluaL_loadbuffer = int function(lua_State*,const(char)*,size_t,const(char)*);
alias pluaL_loadstring = int function(lua_State*,const(char)*);
alias pluaL_newstate = lua_State* function();
alias pluaL_gsub = const(char)* function(lua_State*,const(char)*,const(char)*,const(char)*);
alias pluaL_findtable = const(char)* function(lua_State*,int,const(char)*,int);
alias pluaL_buffinit = void function(lua_State*,luaL_Buffer*);
alias pluaL_prepbuffer = char* function(luaL_Buffer*);
alias pluaL_addlstring = void function(luaL_Buffer*,const(char)*,size_t);
alias pluaL_addstring = void function(luaL_Buffer*, const(char)*);
alias pluaL_addvalue = void function(luaL_Buffer*);
alias pluaL_pushresult = void function(luaL_Buffer*);
// lua.h
alias plua_newstate = lua_State* function(lua_Alloc,void*);
alias plua_close = void function(lua_State*);
alias plua_newthread = lua_State* function(lua_State*);
alias plua_atpanic = lua_CFunction function(lua_State*,lua_CFunction);
alias plua_gettop = int function(lua_State*);
alias plua_settop = void function(lua_State*,int);
alias plua_pushvalue = void function(lua_State*,int);
alias plua_remove = void function(lua_State*,int);
alias plua_insert = void function(lua_State*,int);
alias plua_replace = void function(lua_State*,int);
alias plua_checkstack = int function(lua_State*,int);
alias plua_xmove = void function(lua_State*,lua_State*,int);
alias plua_isnumber = int function(lua_State*,int);
alias plua_isstring = int function(lua_State*,int);
alias plua_iscfunction = int function(lua_State*,int);
alias plua_isuserdata = int function(lua_State*,int);
alias plua_type = int function(lua_State*,int);
alias plua_typename = const(char)* function(lua_State*,int);
alias plua_equal = int function(lua_State*,int,int);
alias plua_rawequal = int function(lua_State*,int,int);
alias plua_lessthan = int function(lua_State*,int,int);
alias plua_tonumber = lua_Number function(lua_State*,int);
alias plua_tointeger = lua_Integer function(lua_State*,int);
alias plua_toboolean = int function(lua_State*,int);
alias plua_tolstring = const(char)* function(lua_State*,int,size_t*);
alias plua_objlen = size_t function(lua_State*,int);
alias plua_tocfunction = lua_CFunction function(lua_State*,int);
alias plua_touserdata = void* function(lua_State*,int);
alias plua_tothread = lua_State* function(lua_State*,int);
alias plua_topointer = const(void)* function(lua_State*,int);
alias plua_pushnil = void function(lua_State*);
alias plua_pushnumber = void function(lua_State*,lua_Number);
alias plua_pushinteger = void function(lua_State*,lua_Integer);
alias plua_pushlstring = void function(lua_State*,const(char)*,size_t);
alias plua_pushstring = void function(lua_State*,const(char)*);
alias plua_pushvfstring = const(char)* function(lua_State*,const(char)*,va_list);
alias plua_pushfstring = const(char)* function(lua_State*,const(char)*,...);
alias plua_pushcclosure = void function(lua_State*,lua_CFunction,int);
alias plua_pushboolean = void function(lua_State*,int);
alias plua_pushlightuserdata = void function(lua_State*,void*);
alias plua_pushthread = int function(lua_State*);
alias plua_gettable = void function(lua_State*,int);
alias plua_getfield = void function(lua_State*,int,const(char)*);
alias plua_rawget = void function(lua_State*,int);
alias plua_rawgeti = void function(lua_State*,int,int);
alias plua_createtable = void function(lua_State*,int,int);
alias plua_newuserdata = void* function(lua_State*,size_t);
alias plua_getmetatable = int function(lua_State*,int);
alias plua_getfenv = void function(lua_State*,int);
alias plua_settable = void function(lua_State*,int);
alias plua_setfield = void function(lua_State*,int,const(char)*);
alias plua_rawset = void function(lua_State*,int);
alias plua_rawseti = void function(lua_State*,int,int);
alias plua_setmetatable = int function(lua_State*,int);
alias plua_setfenv = int function(lua_State*,int);
alias plua_call = void function(lua_State*,int,int);
alias plua_pcall = int function(lua_State*,int,int,int);
alias plua_cpcall = int function(lua_State*,lua_CFunction,void*);
alias plua_load = int function(lua_State*,lua_Reader,void*,const(char)*);
alias plua_dump = int function(lua_State*,lua_Writer,void*);
alias plua_yield = int function(lua_State*,int);
alias plua_resume = int function(lua_State*,int);
alias plua_status = int function(lua_State*);
alias plua_gc = int function(lua_State*,int,int);
alias plua_error = int function(lua_State*);
alias plua_next = int function(lua_State*,int);
alias plua_concat = void function(lua_State*,int);
alias plua_getallocf = lua_Alloc function(lua_State*,void**);
alias plua_setallocf = void function(lua_State*,lua_Alloc,void*);
alias plua_setlevel = void function(lua_State*, lua_State*);
alias plua_getstack = int function(lua_State*,int,lua_Debug*);
alias plua_getinfo = int function(lua_State*,const(char)*,lua_Debug*);
alias plua_getlocal = const(char)* function(lua_State*,const(lua_Debug)*,int);
alias plua_setlocal = const(char)* function(lua_State*,const(lua_Debug)*,int);
alias plua_getupvalue = const(char)* function(lua_State*,int,int);
alias plua_setupvalue = const(char)* function(lua_State*,int,int);
alias plua_sethook = int function(lua_State*,lua_Hook,int,int);
alias plua_gethook = lua_Hook function(lua_State*);
alias plua_gethookmask = int function(lua_State*);
alias plua_gethookcount = int function(lua_State*);
// lualib.h
alias pluaopen_base = int function(lua_State*);
alias pluaopen_table = int function(lua_State*);
alias pluaopen_io = int function(lua_State*);
alias pluaopen_os = int function(lua_State*);
alias pluaopen_string = int function(lua_State*);
alias pluaopen_math = int function(lua_State*);
alias pluaopen_debug = int function(lua_State*);
alias pluaopen_package = int function(lua_State*);
alias pluaL_openlibs = void function(lua_State*);
}
__gshared {
// lauxlib.h
pluaI_openlib luaI_openlib;
pluaL_register luaL_register;
pluaL_getmetafield luaL_getmetafield;
pluaL_callmeta luaL_callmeta;
pluaL_typerror luaL_typerror;
pluaL_argerror luaL_argerror;
pluaL_checklstring luaL_checklstring;
pluaL_optlstring luaL_optlstring;
pluaL_checknumber luaL_checknumber;
pluaL_optnumber luaL_optnumber;
pluaL_checkinteger luaL_checkinteger;
pluaL_optinteger luaL_optinteger;
pluaL_checkstack luaL_checkstack;
pluaL_checktype luaL_checktype;
pluaL_checkany luaL_checkany;
pluaL_newmetatable luaL_newmetatable;
pluaL_checkudata luaL_checkudata;
pluaL_where luaL_where;
pluaL_error luaL_error;
pluaL_checkoption luaL_checkoption;
pluaL_ref luaL_ref;
pluaL_unref luaL_unref;
pluaL_loadfile luaL_loadfile;
pluaL_loadbuffer luaL_loadbuffer;
pluaL_loadstring luaL_loadstring;
pluaL_newstate luaL_newstate;
pluaL_gsub luaL_gsub;
pluaL_findtable luaL_findtable;
pluaL_buffinit luaL_buffinit;
pluaL_prepbuffer luaL_prepbuffer;
pluaL_addlstring luaL_addlstring;
pluaL_addstring luaL_addstring;
pluaL_addvalue luaL_addvalue;
pluaL_pushresult luaL_pushresult;
// lua.h
plua_newstate lua_newstate;
plua_close lua_close;
plua_newthread lua_newthread;
plua_atpanic lua_atpanic;
plua_gettop lua_gettop;
plua_settop lua_settop;
plua_pushvalue lua_pushvalue;
plua_remove lua_remove;
plua_insert lua_insert;
plua_replace lua_replace;
plua_checkstack lua_checkstack;
plua_xmove lua_xmove;
plua_isnumber lua_isnumber;
plua_isstring lua_isstring;
plua_iscfunction lua_iscfunction;
plua_isuserdata lua_isuserdata;
plua_type lua_type;
plua_typename lua_typename;
plua_equal lua_equal;
plua_rawequal lua_rawequal;
plua_lessthan lua_lessthan;
plua_tonumber lua_tonumber;
plua_tointeger lua_tointeger;
plua_toboolean lua_toboolean;
plua_tolstring lua_tolstring;
plua_objlen lua_objlen;
plua_tocfunction lua_tocfunction;
plua_touserdata lua_touserdata;
plua_tothread lua_tothread;
plua_topointer lua_topointer;
plua_pushnil lua_pushnil;
plua_pushnumber lua_pushnumber;
plua_pushinteger lua_pushinteger;
plua_pushlstring lua_pushlstring;
plua_pushstring lua_pushstring;
plua_pushvfstring lua_pushvfstring;
plua_pushfstring lua_pushfstring;
plua_pushcclosure lua_pushcclosure;
plua_pushboolean lua_pushboolean;
plua_pushlightuserdata lua_pushlightuserdata;
plua_pushthread lua_pushthread;
plua_gettable lua_gettable;
plua_getfield lua_getfield;
plua_rawget lua_rawget;
plua_rawgeti lua_rawgeti;
plua_createtable lua_createtable;
plua_newuserdata lua_newuserdata;
plua_getmetatable lua_getmetatable;
plua_getfenv lua_getfenv;
plua_settable lua_settable;
plua_setfield lua_setfield;
plua_rawset lua_rawset;
plua_rawseti lua_rawseti;
plua_setmetatable lua_setmetatable;
plua_setfenv lua_setfenv;
plua_call lua_call;
plua_pcall lua_pcall;
plua_cpcall lua_cpcall;
plua_load lua_load;
plua_dump lua_dump;
plua_yield lua_yield;
plua_resume lua_resume;
plua_status lua_status;
plua_gc lua_gc;
plua_error lua_error;
plua_next lua_next;
plua_concat lua_concat;
plua_getallocf lua_getallocf;
plua_setallocf lua_setallocf;
plua_setlevel lua_setlevel;
plua_getstack lua_getstack;
plua_getinfo lua_getinfo;
plua_getlocal lua_getlocal;
plua_setlocal lua_setlocal;
plua_getupvalue lua_getupvalue;
plua_setupvalue lua_setupvalue;
plua_sethook lua_sethook;
plua_gethook lua_gethook;
plua_gethookmask lua_gethookmask;
plua_gethookcount lua_gethookcount;
// lualib.h
pluaopen_base luaopen_base;
pluaopen_table luaopen_table;
pluaopen_io luaopen_io;
pluaopen_os luaopen_os;
pluaopen_string luaopen_string;
pluaopen_math luaopen_math;
pluaopen_debug luaopen_debug;
pluaopen_package luaopen_package;
pluaL_openlibs luaL_openlibs;
}
private {
SharedLib lib;
LuaSupport loadedVersion;
}
@nogc nothrow:
void unloadLua()
{
if(lib != invalidHandle) {
lib.unload;
}
}
LuaSupport loadedLuaVersion() @safe { return loadedVersion; }
bool isLuaLoaded() @safe { return lib != invalidHandle; }
LuaSupport loadLua()
{
version(Windows) {
const(char)[][3] libNames = ["lua5.1.dll", "lua51.dll", "lua5.1.5.dll"];
}
else version(OSX) {
const(char)[][1] libNames = "liblua.5.1.dylib";
}
else version(Posix) {
const(char)[][1] libNames = "liblua.so.5.1";
}
else static assert(0, "bindbc-lua support for Lua 5.1 is not implemented on this platform.");
LuaSupport ret;
foreach(name; libNames) {
ret = loadLua(name.ptr);
if(ret != LuaSupport.noLibrary) break;
}
return ret;
}
LuaSupport loadLua(const(char)* libName)
{
lib = load(libName);
if(lib == invalidHandle) {
return LuaSupport.noLibrary;
}
auto errCount = errorCount();
loadedVersion = LuaSupport.badLibrary;
// lauxlib.h
lib.bindSymbol(cast(void**)&luaI_openlib, "luaI_openlib");
lib.bindSymbol(cast(void**)&luaL_register, "luaL_register");
lib.bindSymbol(cast(void**)&luaL_getmetafield,"luaL_getmetafield");
lib.bindSymbol(cast(void**)&luaL_callmeta, "luaL_callmeta");
lib.bindSymbol(cast(void**)&luaL_typerror, "luaL_typerror");
lib.bindSymbol(cast(void**)&luaL_checklstring, "luaL_checklstring");
lib.bindSymbol(cast(void**)&luaL_argerror, "luaL_argerror");
lib.bindSymbol(cast(void**)&luaL_optlstring, "luaL_optlstring");
lib.bindSymbol(cast(void**)&luaL_checknumber, "luaL_checknumber");
lib.bindSymbol(cast(void**)&luaL_optnumber, "luaL_optnumber");
lib.bindSymbol(cast(void**)&luaL_checkinteger, "luaL_checkinteger");
lib.bindSymbol(cast(void**)&luaL_optinteger, "luaL_optinteger");
lib.bindSymbol(cast(void**)&luaL_checkstack, "luaL_checkstack");
lib.bindSymbol(cast(void**)&luaL_checktype, "luaL_checktype");
lib.bindSymbol(cast(void**)&luaL_checkany, "luaL_checkany");
lib.bindSymbol(cast(void**)&luaL_newmetatable, "luaL_newmetatable");
lib.bindSymbol(cast(void**)&luaL_checkudata, "luaL_checkudata");
lib.bindSymbol(cast(void**)&luaL_where, "luaL_where");
lib.bindSymbol(cast(void**)&luaL_error, "luaL_error");
lib.bindSymbol(cast(void**)&luaL_checkoption, "luaL_checkoption");
lib.bindSymbol(cast(void**)&luaL_ref, "luaL_ref");
lib.bindSymbol(cast(void**)&luaL_unref, "luaL_unref");
lib.bindSymbol(cast(void**)&luaL_loadfile, "luaL_loadfile");
lib.bindSymbol(cast(void**)&luaL_loadbuffer, "luaL_loadbuffer");
lib.bindSymbol(cast(void**)&luaL_loadstring, "luaL_loadstring");
lib.bindSymbol(cast(void**)&luaL_newstate, "luaL_newstate");
lib.bindSymbol(cast(void**)&luaL_gsub, "luaL_gsub");
lib.bindSymbol(cast(void**)&luaL_findtable, "luaL_findtable");
lib.bindSymbol(cast(void**)&luaL_buffinit, "luaL_buffinit");
lib.bindSymbol(cast(void**)&luaL_prepbuffer, "luaL_prepbuffer");
lib.bindSymbol(cast(void**)&luaL_addlstring, "luaL_addlstring");
lib.bindSymbol(cast(void**)&luaL_addstring, "luaL_addstring");
lib.bindSymbol(cast(void**)&luaL_addvalue, "luaL_addvalue");
lib.bindSymbol(cast(void**)&luaL_pushresult, "luaL_pushresult");
// lua.h
lib.bindSymbol(cast(void**)&lua_newstate, "lua_newstate");
lib.bindSymbol(cast(void**)&lua_close, "lua_close");
lib.bindSymbol(cast(void**)&lua_newthread, "lua_newthread");
lib.bindSymbol(cast(void**)&lua_atpanic, "lua_atpanic");
lib.bindSymbol(cast(void**)&lua_gettop, "lua_gettop");
lib.bindSymbol(cast(void**)&lua_settop, "lua_settop");
lib.bindSymbol(cast(void**)&lua_pushvalue, "lua_pushvalue");
lib.bindSymbol(cast(void**)&lua_remove, "lua_remove");
lib.bindSymbol(cast(void**)&lua_insert, "lua_insert");
lib.bindSymbol(cast(void**)&lua_replace, "lua_replace");
lib.bindSymbol(cast(void**)&lua_checkstack, "lua_checkstack");
lib.bindSymbol(cast(void**)&lua_xmove, "lua_xmove");
lib.bindSymbol(cast(void**)&lua_isnumber, "lua_isnumber");
lib.bindSymbol(cast(void**)&lua_isstring, "lua_isstring");
lib.bindSymbol(cast(void**)&lua_iscfunction, "lua_iscfunction");
lib.bindSymbol(cast(void**)&lua_isuserdata, "lua_isuserdata");
lib.bindSymbol(cast(void**)&lua_type, "lua_type");
lib.bindSymbol(cast(void**)&lua_typename, "lua_typename");
lib.bindSymbol(cast(void**)&lua_equal, "lua_equal");
lib.bindSymbol(cast(void**)&lua_rawequal, "lua_rawequal");
lib.bindSymbol(cast(void**)&lua_lessthan, "lua_lessthan");
lib.bindSymbol(cast(void**)&lua_tonumber, "lua_tonumber");
lib.bindSymbol(cast(void**)&lua_tointeger, "lua_tointeger");
lib.bindSymbol(cast(void**)&lua_toboolean, "lua_toboolean");
lib.bindSymbol(cast(void**)&lua_tolstring, "lua_tolstring");
lib.bindSymbol(cast(void**)&lua_objlen, "lua_objlen");
lib.bindSymbol(cast(void**)&lua_tocfunction, "lua_tocfunction");
lib.bindSymbol(cast(void**)&lua_touserdata, "lua_touserdata");
lib.bindSymbol(cast(void**)&lua_tothread, "lua_tothread");
lib.bindSymbol(cast(void**)&lua_topointer, "lua_topointer");
lib.bindSymbol(cast(void**)&lua_pushnil, "lua_pushnil");
lib.bindSymbol(cast(void**)&lua_pushnumber, "lua_pushnumber");
lib.bindSymbol(cast(void**)&lua_pushinteger, "lua_pushinteger");
lib.bindSymbol(cast(void**)&lua_pushlstring, "lua_pushlstring");
lib.bindSymbol(cast(void**)&lua_pushstring, "lua_pushstring");
lib.bindSymbol(cast(void**)&lua_pushvfstring, "lua_pushvfstring");
lib.bindSymbol(cast(void**)&lua_pushfstring, "lua_pushfstring");
lib.bindSymbol(cast(void**)&lua_pushcclosure, "lua_pushcclosure");
lib.bindSymbol(cast(void**)&lua_pushboolean, "lua_pushboolean");
lib.bindSymbol(cast(void**)&lua_pushlightuserdata, "lua_pushlightuserdata");
lib.bindSymbol(cast(void**)&lua_pushthread, "lua_pushthread");
lib.bindSymbol(cast(void**)&lua_gettable, "lua_gettable");
lib.bindSymbol(cast(void**)&lua_getfield, "lua_getfield");
lib.bindSymbol(cast(void**)&lua_rawget, "lua_rawget");
lib.bindSymbol(cast(void**)&lua_rawgeti, "lua_rawgeti");
lib.bindSymbol(cast(void**)&lua_createtable, "lua_createtable");
lib.bindSymbol(cast(void**)&lua_newuserdata, "lua_newuserdata");
lib.bindSymbol(cast(void**)&lua_getmetatable, "lua_getmetatable");
lib.bindSymbol(cast(void**)&lua_getfenv, "lua_getfenv");
lib.bindSymbol(cast(void**)&lua_settable, "lua_settable");
lib.bindSymbol(cast(void**)&lua_setfield, "lua_setfield");
lib.bindSymbol(cast(void**)&lua_rawset, "lua_rawset");
lib.bindSymbol(cast(void**)&lua_rawseti, "lua_rawseti");
lib.bindSymbol(cast(void**)&lua_setmetatable, "lua_setmetatable");
lib.bindSymbol(cast(void**)&lua_setfenv, "lua_setfenv");
lib.bindSymbol(cast(void**)&lua_call, "lua_call");
lib.bindSymbol(cast(void**)&lua_pcall, "lua_pcall");
lib.bindSymbol(cast(void**)&lua_cpcall, "lua_cpcall");
lib.bindSymbol(cast(void**)&lua_load, "lua_load");
lib.bindSymbol(cast(void**)&lua_dump, "lua_dump");
lib.bindSymbol(cast(void**)&lua_yield, "lua_yield");
lib.bindSymbol(cast(void**)&lua_resume, "lua_resume");
lib.bindSymbol(cast(void**)&lua_status, "lua_status");
lib.bindSymbol(cast(void**)&lua_gc, "lua_gc");
lib.bindSymbol(cast(void**)&lua_error, "lua_error");
lib.bindSymbol(cast(void**)&lua_next, "lua_next");
lib.bindSymbol(cast(void**)&lua_concat, "lua_concat");
lib.bindSymbol(cast(void**)&lua_getallocf, "lua_getallocf");
lib.bindSymbol(cast(void**)&lua_setallocf, "lua_setallocf");
lib.bindSymbol(cast(void**)&lua_setlevel, "lua_setlevel");
lib.bindSymbol(cast(void**)&lua_getstack, "lua_getstack");
lib.bindSymbol(cast(void**)&lua_getinfo, "lua_getinfo");
lib.bindSymbol(cast(void**)&lua_getlocal, "lua_getlocal");
lib.bindSymbol(cast(void**)&lua_setlocal, "lua_setlocal");
lib.bindSymbol(cast(void**)&lua_getupvalue, "lua_getupvalue");
lib.bindSymbol(cast(void**)&lua_setupvalue, "lua_setupvalue");
lib.bindSymbol(cast(void**)&lua_sethook, "lua_sethook");
lib.bindSymbol(cast(void**)&lua_gethook, "lua_gethook");
lib.bindSymbol(cast(void**)&lua_gethookmask, "lua_gethookmask");
lib.bindSymbol(cast(void**)&lua_gethookcount, "lua_gethookcount");
// lualib.h
lib.bindSymbol(cast(void**)&luaopen_base, "luaopen_base");
lib.bindSymbol(cast(void**)&luaopen_table, "luaopen_table");
lib.bindSymbol(cast(void**)&luaopen_io, "luaopen_io");
lib.bindSymbol(cast(void**)&luaopen_os, "luaopen_os");
lib.bindSymbol(cast(void**)&luaopen_string, "luaopen_string");
lib.bindSymbol(cast(void**)&luaopen_math, "luaopen_math");
lib.bindSymbol(cast(void**)&luaopen_debug, "luaopen_debug");
lib.bindSymbol(cast(void**)&luaopen_package, "luaopen_package");
lib.bindSymbol(cast(void**)&luaL_openlibs, "luaL_openlibs");
return LuaSupport.lua51;
}
|
D
|
func void B_AssessPlayer()
{
var C_Npc pcl;
var C_Npc joe;
pcl = Hlp_GetNpc(PC_Levelinspektor);
if(Hlp_GetInstanceID(other) == Hlp_GetInstanceID(pcl))
{
return;
};
if(other.aivar[AIV_INVINCIBLE] == TRUE)
{
return;
};
if(C_NpcIsDown(other))
{
return;
};
if(other.guild > GIL_SEPERATOR_HUM)
{
if(C_NpcIsGateGuard(self))
{
AI_StandupQuick(self);
B_Attack(self,other,AR_MonsterCloseToGate,0);
return;
}
else if(Wld_GetGuildAttitude(self.guild,other.guild) == ATT_HOSTILE)
{
if((self.aivar[AIV_PARTYMEMBER] == FALSE) && (self.npcType != NPCTYPE_FRIEND))
{
B_Attack(self,other,AR_GuildEnemy,0);
return;
};
};
};
if(B_AssessEnemy())
{
return;
};
if(C_PlayerIsFakeBandit(self,other) && (self.guild != GIL_BDT))
{
B_Attack(self,other,AR_GuildEnemy,0);
};
if((B_GetPlayerCrime(self) == CRIME_MURDER) && C_WantToAttackMurder(self,other) && (Npc_GetDistToNpc(self,other) <= PERC_DIST_INTERMEDIAT))
{
B_Attack(self,other,AR_HumanMurderedHuman,0);
return;
};
if(B_AssessEnterRoom())
{
return;
};
if(B_AssessDrawWeapon())
{
return;
}
else
{
Player_DrawWeaponComment = FALSE;
};
if(C_BodyStateContains(other,BS_SNEAK))
{
if(!Npc_IsInState(self,ZS_ObservePlayer) && C_WantToReactToSneaker(self,other))
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,ZS_ObservePlayer,1,"");
return;
};
}
else if(!C_BodyStateContains(other,BS_STAND))
{
Player_SneakerComment = FALSE;
};
if(!C_BodyStateContains(other,BS_LIE))
{
Player_GetOutOfMyBedComment = FALSE;
};
//17.05.2013, Redleha
//Добавлена функция C_Npc_GetDistToNpc_4DIA() для определения расстояния диалога
if(C_Npc_GetDistToNpc_4DIA() && Npc_CheckInfo(self,1))
{
if(C_NpcIsGateGuard(self))
{
self.aivar[AIV_NpcStartedTalk] = TRUE;
B_AssessTalk();
return;
}
else if(!C_BodyStateContains(other,BS_FALL) && !C_BodyStateContains(other,BS_SWIM) && !C_BodyStateContains(other,BS_DIVE)
&& (B_GetPlayerCrime(self) == CRIME_NONE) && (C_RefuseTalk(self,other) == FALSE))
{
self.aivar[AIV_NpcStartedTalk] = TRUE;
B_AssessTalk();
return;
};
};
if(C_BodyStateContains(self,BS_WALK) && (Npc_GetDistToNpc(self,other) <= PERC_DIST_DIALOG) && (Npc_RefuseTalk(other) == FALSE)
&& !C_NpcIsGateGuard(self))
{
B_LookAtNpc(self,other);
B_Say_GuildGreetings(self,other);
B_StopLookAt(self);
Npc_SetRefuseTalk(other,20);
};
if(C_NpcIsGateGuard(self) && (Npc_GetDistToNpc(self,other) > (PERC_DIST_DIALOG_DS + 150)))
{
self.aivar[AIV_Guardpassage_Status] = GP_NONE;
};
};
|
D
|
module scanner;
import std.stdio;
public string[] lex( string program ){
string[] arr = [];
string munch = "";
foreach( i, ch ; program ){
if( ch == '(' ){
arr ~= [ ch ];
}
else if( ch == ')' ){
if( munch != "" ){
arr ~= munch;
munch = "";
}
arr ~= [ ch ];
}
else if( (ch == ' ' ) && munch != "" ){
arr ~= munch;
munch = "";
}
else{
munch = munch ~ [ch];
}
}
return arr;
}
unittest{
string[] s = lex( "(hello)" );
assert( s == ["(", "hello", ")"] );
}
unittest{
string[] s = lex("(+ 3 4)");
assert( s == ["(", "+", "3", "4", ")"] );
}
|
D
|
/Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKSop.build/Model/GetSecurityTokenInfo.swift.o : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerificationCodeInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/GetSecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerifySecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSensitiveOpSettingExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSecurityTokenExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/SopClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenRequest.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKSop.build/GetSecurityTokenInfo~partial.swiftmodule : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerificationCodeInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/GetSecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerifySecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSensitiveOpSettingExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSecurityTokenExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/SopClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenRequest.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKSop.build/GetSecurityTokenInfo~partial.swiftdoc : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerificationCodeInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/GetSecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerifySecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSensitiveOpSettingExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSecurityTokenExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/SopClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenRequest.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/**
* libvector.d
* tower
* June 1, 2013
* Brandon Surmanski
*/
module lua.lib.libvector;
import std.stdio;
import c.lua;
import math.vector;
import entity.luaEntity;
import entity.entity;
import lua.api;
import lua.luah;
immutable Api libvector = {
"Vector",
[
{"new", &libvector_new},
{"x", &libvector_x},
{"y", &libvector_y},
{"z", &libvector_z},
/*{"w", &libvector_w},*/
{"data", &libvector_data},
],
[]
};
extern (C):
int libvector_new(lua_State *l)
{
//Vec3 vector = new Vec3(0,0,0);
//TODO
return 0;
}
int libvector_x(lua_State *l)
{
Vec3 *vector = cast(Vec3*) lua_touserdata(l, 1);
if(lua_isnumber(l,2))
{
vector.x = lua_tonumber(l, 2);
lua_pop(l, 1);
}
lua_pushnumber(l, vector.x);
return 1;
}
int libvector_y(lua_State *l)
{
Vec3 *vector = cast(Vec3*) lua_touserdata(l, 1);
if(lua_isnumber(l,2))
{
vector.y = lua_tonumber(l, 2);
lua_pop(l, 1);
}
lua_pushnumber(l, vector.y);
return 1;
}
int libvector_z(lua_State *l)
{
Vec3 *vector = cast(Vec3*) lua_touserdata(l, 1);
if(lua_isnumber(l,2))
{
vector.z = lua_tonumber(l, 2);
lua_pop(l, 1);
}
lua_pushnumber(l, vector.z);
return 1;
}
/*
int libvector_w(lua_State *l)
{
Vec3 *vector = cast(Vec3*) lua_touserdata(l, 1);
if(lua_isnumber(l,2))
{
vector.w = lua_tonumber(l, 2);
lua_pop(l, 1);
}
lua_pushnumber(l, vector.w);
return 1;
}*/
int libvector_data(lua_State *l)
{
Vec3 *vector = cast(Vec3*) lua_touserdata(l, 1);
if(lua_istable(l,2))
{
float data[3] = [
table_get(l, 2, 0, 0.0),
table_get(l, 2, 1, 0.0),
table_get(l, 2, 2, 0.0)];
vector.data = data;
lua_pop(l, 1);
}
lua_newtable(l);
table_set(l, -1, 0, vector.x);
table_set(l, -1, 1, vector.y);
table_set(l, -1, 2, vector.z);
return 1;
}
|
D
|
/home/iroha/rust/rust_othello/target/debug/deps/othello-2c3c89a47bbcb89b: src/main.rs
/home/iroha/rust/rust_othello/target/debug/deps/othello-2c3c89a47bbcb89b.d: src/main.rs
src/main.rs:
|
D
|
module android.java.android.widget.ActionMenuView_OnMenuItemClickListener;
public import android.java.android.widget.ActionMenuView_OnMenuItemClickListener_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!ActionMenuView_OnMenuItemClickListener;
import import1 = android.java.java.lang.Class;
|
D
|
// Written in the D programming language.
/**
This module defines the notion of a range. Ranges generalize the concept of
arrays, lists, or anything that involves sequential access. This abstraction
enables the same set of algorithms (see $(LINK2 std_algorithm.html,
std.algorithm)) to be used with a vast variety of different concrete types. For
example, a linear search algorithm such as $(LINK2 std_algorithm.html#find,
std.algorithm.find) works not just for arrays, but for linked-lists, input
files, incoming network data, etc. See also Ali Çehreli's
$(WEB ddili.org/ders/d.en/ranges.html, tutorial on ranges) for the basics
of working with and creating range-based code.
For more detailed information about the conceptual aspect of ranges and the
motivation behind them, see Andrei Alexandrescu's article
$(LINK2 http://www.informit.com/articles/printerfriendly.aspx?p=1407357$(AMP)rll=1,
$(I On Iteration)).
Submodules:
This module has two submodules:
The $(LINK2 std_range_primitives.html, $(D std._range.primitives)) submodule
provides basic _range functionality. It defines several templates for testing
whether a given object is a _range, what kind of _range it is, and provides
some common _range operations.
The $(LINK2 std_range_interfaces.html, $(D std._range.interfaces)) submodule
provides object-based interfaces for working with ranges via runtime
polymorphism.
The remainder of this module provides a rich set of _range creation and
composition templates that let you construct new ranges out of existing ranges:
$(BOOKTABLE ,
$(TR $(TD $(D $(LREF chain)))
$(TD Concatenates several ranges into a single _range.
))
$(TR $(TD $(D $(LREF choose)))
$(TD Chooses one of two ranges at runtime based on a boolean condition.
))
$(TR $(TD $(D $(LREF chooseAmong)))
$(TD Chooses one of several ranges at runtime based on an index.
))
$(TR $(TD $(D $(LREF chunks)))
$(TD Creates a _range that returns fixed-size chunks of the original
_range.
))
$(TR $(TD $(D $(LREF cycle)))
$(TD Creates an infinite _range that repeats the given forward _range
indefinitely. Good for implementing circular buffers.
))
$(TR $(TD $(D $(LREF drop)))
$(TD Creates the _range that results from discarding the first $(I n)
elements from the given _range.
))
$(TR $(TD $(D $(LREF dropExactly)))
$(TD Creates the _range that results from discarding exactly $(I n)
of the first elements from the given _range.
))
$(TR $(TD $(D $(LREF dropOne)))
$(TD Creates the _range that results from discarding
the first elements from the given _range.
))
$(TR $(TD $(D $(LREF enumerate)))
$(TD Iterates a _range with an attached index variable.
))
$(TR $(TD $(D $(LREF evenChunks)))
$(TD Creates a _range that returns a number of chunks of
approximately equal length from the original _range.
))
$(TR $(TD $(D $(LREF frontTransversal)))
$(TD Creates a _range that iterates over the first elements of the
given ranges.
))
$(TR $(TD $(D $(LREF indexed)))
$(TD Creates a _range that offers a view of a given _range as though
its elements were reordered according to a given _range of indices.
))
$(TR $(TD $(D $(LREF iota)))
$(TD Creates a _range consisting of numbers between a starting point
and ending point, spaced apart by a given interval.
))
$(TR $(TD $(D $(LREF lockstep)))
$(TD Iterates $(I n) _ranges in lockstep, for use in a $(D foreach)
loop. Similar to $(D zip), except that $(D lockstep) is designed
especially for $(D foreach) loops.
))
$(TR $(TD $(D $(LREF NullSink)))
$(TD An output _range that discards the data it receives.
))
$(TR $(TD $(D $(LREF only)))
$(TD Creates a _range that iterates over the given arguments.
))
$(TR $(TD $(D $(LREF radial)))
$(TD Given a random-access _range and a starting point, creates a
_range that alternately returns the next left and next right element to
the starting point.
))
$(TR $(TD $(D $(LREF recurrence)))
$(TD Creates a forward _range whose values are defined by a
mathematical recurrence relation.
))
$(TR $(TD $(D $(LREF repeat)))
$(TD Creates a _range that consists of a single element repeated $(I n)
times, or an infinite _range repeating that element indefinitely.
))
$(TR $(TD $(D $(LREF retro)))
$(TD Iterates a bidirectional _range backwards.
))
$(TR $(TD $(D $(LREF roundRobin)))
$(TD Given $(I n) ranges, creates a new _range that return the $(I n)
first elements of each _range, in turn, then the second element of each
_range, and so on, in a round-robin fashion.
))
$(TR $(TD $(D $(LREF sequence)))
$(TD Similar to $(D recurrence), except that a random-access _range is
created.
))
$(TR $(TD $(D $(LREF stride)))
$(TD Iterates a _range with stride $(I n).
))
$(TR $(TD $(D $(LREF tail)))
$(TD Return a _range advanced to within $(D n) elements of the end of
the given _range.
))
$(TR $(TD $(D $(LREF take)))
$(TD Creates a sub-_range consisting of only up to the first $(I n)
elements of the given _range.
))
$(TR $(TD $(D $(LREF takeExactly)))
$(TD Like $(D take), but assumes the given _range actually has $(I n)
elements, and therefore also defines the $(D length) property.
))
$(TR $(TD $(D $(LREF takeNone)))
$(TD Creates a random-access _range consisting of zero elements of the
given _range.
))
$(TR $(TD $(D $(LREF takeOne)))
$(TD Creates a random-access _range consisting of exactly the first
element of the given _range.
))
$(TR $(TD $(D $(LREF tee)))
$(TD Creates a _range that wraps a given _range, forwarding along
its elements while also calling a provided function with each element.
))
$(TR $(TD $(D $(LREF transposed)))
$(TD Transposes a _range of ranges.
))
$(TR $(TD $(D $(LREF transversal)))
$(TD Creates a _range that iterates over the $(I n)'th elements of the
given random-access ranges.
))
$(TR $(TD $(D $(LREF zip)))
$(TD Given $(I n) _ranges, creates a _range that successively returns a
tuple of all the first elements, a tuple of all the second elements,
etc.
))
)
Ranges whose elements are sorted afford better efficiency with certain
operations. For this, the $(D $(LREF assumeSorted)) function can be used to
construct a $(D $(LREF SortedRange)) from a pre-sorted _range. The $(LINK2
std_algorithm.html#sort, $(D std.algorithm.sort)) function also conveniently
returns a $(D SortedRange). $(D SortedRange) objects provide some additional
_range operations that take advantage of the fact that the _range is sorted.
Source: $(PHOBOSSRC std/_range/_package.d)
Macros:
WIKI = Phobos/StdRange
Copyright: Copyright by authors 2008-.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB erdani.com, Andrei Alexandrescu), David Simcha,
and Jonathan M Davis. Credit for some of the ideas in building this module goes
to $(WEB fantascienza.net/leonardo/so/, Leonardo Maffi).
*/
module std.range;
public import std.range.primitives;
public import std.range.interfaces;
public import std.array;
public import std.typecons : Flag, Yes, No;
import std.meta;
import std.traits;
/**
Iterates a bidirectional range backwards. The original range can be
accessed by using the $(D source) property. Applying retro twice to
the same range yields the original range.
*/
auto retro(Range)(Range r)
if (isBidirectionalRange!(Unqual!Range))
{
// Check for retro(retro(r)) and just return r in that case
static if (is(typeof(retro(r.source)) == Range))
{
return r.source;
}
else
{
static struct Result()
{
private alias R = Unqual!Range;
// User code can get and set source, too
R source;
static if (hasLength!R)
{
private alias IndexType = CommonType!(size_t, typeof(source.length));
IndexType retroIndex(IndexType n)
{
return source.length - n - 1;
}
}
public:
alias Source = R;
@property bool empty() { return source.empty; }
@property auto save()
{
return Result(source.save);
}
@property auto ref front() { return source.back; }
void popFront() { source.popBack(); }
@property auto ref back() { return source.front; }
void popBack() { source.popFront(); }
static if(is(typeof(.moveBack(source))))
{
ElementType!R moveFront()
{
return .moveBack(source);
}
}
static if(is(typeof(.moveFront(source))))
{
ElementType!R moveBack()
{
return .moveFront(source);
}
}
static if (hasAssignableElements!R)
{
@property auto front(ElementType!R val)
{
source.back = val;
}
@property auto back(ElementType!R val)
{
source.front = val;
}
}
static if (isRandomAccessRange!(R) && hasLength!(R))
{
auto ref opIndex(IndexType n) { return source[retroIndex(n)]; }
static if (hasAssignableElements!R)
{
void opIndexAssign(ElementType!R val, IndexType n)
{
source[retroIndex(n)] = val;
}
}
static if (is(typeof(.moveAt(source, 0))))
{
ElementType!R moveAt(IndexType index)
{
return .moveAt(source, retroIndex(index));
}
}
static if (hasSlicing!R)
typeof(this) opSlice(IndexType a, IndexType b)
{
return typeof(this)(source[source.length - b .. source.length - a]);
}
}
static if (hasLength!R)
{
@property auto length()
{
return source.length;
}
alias opDollar = length;
}
}
return Result!()(r);
}
}
///
@safe unittest
{
import std.algorithm : equal;
int[] a = [ 1, 2, 3, 4, 5 ];
assert(equal(retro(a), [ 5, 4, 3, 2, 1 ][]));
assert(retro(a).source is a);
assert(retro(retro(a)) is a);
}
@safe unittest
{
import std.algorithm : equal;
static assert(isBidirectionalRange!(typeof(retro("hello"))));
int[] a;
static assert(is(typeof(a) == typeof(retro(retro(a)))));
assert(retro(retro(a)) is a);
static assert(isRandomAccessRange!(typeof(retro([1, 2, 3]))));
void test(int[] input, int[] witness)
{
auto r = retro(input);
assert(r.front == witness.front);
assert(r.back == witness.back);
assert(equal(r, witness));
}
test([ 1 ], [ 1 ]);
test([ 1, 2 ], [ 2, 1 ]);
test([ 1, 2, 3 ], [ 3, 2, 1 ]);
test([ 1, 2, 3, 4 ], [ 4, 3, 2, 1 ]);
test([ 1, 2, 3, 4, 5 ], [ 5, 4, 3, 2, 1 ]);
test([ 1, 2, 3, 4, 5, 6 ], [ 6, 5, 4, 3, 2, 1 ]);
immutable foo = [1,2,3].idup;
auto r = retro(foo);
}
@safe unittest
{
import std.internal.test.dummyrange;
foreach(DummyType; AllDummyRanges) {
static if (!isBidirectionalRange!DummyType) {
static assert(!__traits(compiles, Retro!DummyType));
} else {
DummyType dummyRange;
dummyRange.reinit();
auto myRetro = retro(dummyRange);
static assert(propagatesRangeType!(typeof(myRetro), DummyType));
assert(myRetro.front == 10);
assert(myRetro.back == 1);
assert(myRetro.moveFront() == 10);
assert(myRetro.moveBack() == 1);
static if (isRandomAccessRange!DummyType && hasLength!DummyType) {
assert(myRetro[0] == myRetro.front);
assert(myRetro.moveAt(2) == 8);
static if (DummyType.r == ReturnBy.Reference) {
{
myRetro[9]++;
scope(exit) myRetro[9]--;
assert(dummyRange[0] == 2);
myRetro.front++;
scope(exit) myRetro.front--;
assert(myRetro.front == 11);
myRetro.back++;
scope(exit) myRetro.back--;
assert(myRetro.back == 3);
}
{
myRetro.front = 0xFF;
scope(exit) myRetro.front = 10;
assert(dummyRange.back == 0xFF);
myRetro.back = 0xBB;
scope(exit) myRetro.back = 1;
assert(dummyRange.front == 0xBB);
myRetro[1] = 11;
scope(exit) myRetro[1] = 8;
assert(dummyRange[8] == 11);
}
}
}
}
}
}
@safe unittest
{
import std.algorithm : equal;
auto LL = iota(1L, 4L);
auto r = retro(LL);
assert(equal(r, [3L, 2L, 1L]));
}
// Issue 12662
@safe @nogc unittest
{
int[3] src = [1,2,3];
int[] data = src[];
foreach_reverse (x; data) {}
foreach (x; data.retro) {}
}
/**
Iterates range $(D r) with stride $(D n). If the range is a
random-access range, moves by indexing into the range; otherwise,
moves by successive calls to $(D popFront). Applying stride twice to
the same range results in a stride with a step that is the
product of the two applications. It is an error for $(D n) to be 0.
*/
auto stride(Range)(Range r, size_t n)
if (isInputRange!(Unqual!Range))
in
{
assert(n != 0, "stride cannot have step zero.");
}
body
{
import std.algorithm : min;
static if (is(typeof(stride(r.source, n)) == Range))
{
// stride(stride(r, n1), n2) is stride(r, n1 * n2)
return stride(r.source, r._n * n);
}
else
{
static struct Result
{
private alias R = Unqual!Range;
public R source;
private size_t _n;
// Chop off the slack elements at the end
static if (hasLength!R &&
(isRandomAccessRange!R && hasSlicing!R
|| isBidirectionalRange!R))
private void eliminateSlackElements()
{
auto slack = source.length % _n;
if (slack)
{
slack--;
}
else if (!source.empty)
{
slack = min(_n, source.length) - 1;
}
else
{
slack = 0;
}
if (!slack) return;
static if (isRandomAccessRange!R && hasSlicing!R)
{
source = source[0 .. source.length - slack];
}
else static if (isBidirectionalRange!R)
{
foreach (i; 0 .. slack)
{
source.popBack();
}
}
}
static if (isForwardRange!R)
{
@property auto save()
{
return Result(source.save, _n);
}
}
static if (isInfinite!R)
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return source.empty;
}
}
@property auto ref front()
{
return source.front;
}
static if (is(typeof(.moveFront(source))))
{
ElementType!R moveFront()
{
return .moveFront(source);
}
}
static if (hasAssignableElements!R)
{
@property auto front(ElementType!R val)
{
source.front = val;
}
}
void popFront()
{
static if (isRandomAccessRange!R && hasLength!R && hasSlicing!R)
{
source = source[min(_n, source.length) .. source.length];
}
else
{
static if (hasLength!R)
{
foreach (i; 0 .. min(source.length, _n))
{
source.popFront();
}
}
else
{
foreach (i; 0 .. _n)
{
source.popFront();
if (source.empty) break;
}
}
}
}
static if (isBidirectionalRange!R && hasLength!R)
{
void popBack()
{
popBackN(source, _n);
}
@property auto ref back()
{
eliminateSlackElements();
return source.back;
}
static if (is(typeof(.moveBack(source))))
{
ElementType!R moveBack()
{
eliminateSlackElements();
return .moveBack(source);
}
}
static if (hasAssignableElements!R)
{
@property auto back(ElementType!R val)
{
eliminateSlackElements();
source.back = val;
}
}
}
static if (isRandomAccessRange!R && hasLength!R)
{
auto ref opIndex(size_t n)
{
return source[_n * n];
}
/**
Forwards to $(D moveAt(source, n)).
*/
static if (is(typeof(.moveAt(source, 0))))
{
ElementType!R moveAt(size_t n)
{
return .moveAt(source, _n * n);
}
}
static if (hasAssignableElements!R)
{
void opIndexAssign(ElementType!R val, size_t n)
{
source[_n * n] = val;
}
}
}
static if (hasSlicing!R && hasLength!R)
typeof(this) opSlice(size_t lower, size_t upper)
{
assert(upper >= lower && upper <= length);
immutable translatedUpper = (upper == 0) ? 0 :
(upper * _n - (_n - 1));
immutable translatedLower = min(lower * _n, translatedUpper);
assert(translatedLower <= translatedUpper);
return typeof(this)(source[translatedLower..translatedUpper], _n);
}
static if (hasLength!R)
{
@property auto length()
{
return (source.length + _n - 1) / _n;
}
alias opDollar = length;
}
}
return Result(r, n);
}
}
///
unittest
{
import std.algorithm : equal;
int[] a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ];
assert(equal(stride(a, 3), [ 1, 4, 7, 10 ][]));
assert(stride(stride(a, 2), 3) == stride(a, 6));
}
nothrow @nogc unittest
{
int[4] testArr = [1,2,3,4];
//just checking it compiles
auto s = testArr[].stride(2);
}
debug unittest
{//check the contract
int[4] testArr = [1,2,3,4];
import std.exception : assertThrown;
import core.exception : AssertError;
assertThrown!AssertError(testArr[].stride(0));
}
@safe unittest
{
import std.internal.test.dummyrange;
import std.algorithm : equal;
static assert(isRandomAccessRange!(typeof(stride([1, 2, 3], 2))));
void test(size_t n, int[] input, int[] witness)
{
assert(equal(stride(input, n), witness));
}
test(1, [], []);
int[] arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
assert(stride(stride(arr, 2), 3) is stride(arr, 6));
test(1, arr, arr);
test(2, arr, [1, 3, 5, 7, 9]);
test(3, arr, [1, 4, 7, 10]);
test(4, arr, [1, 5, 9]);
// Test slicing.
auto s1 = stride(arr, 1);
assert(equal(s1[1..4], [2, 3, 4]));
assert(s1[1..4].length == 3);
assert(equal(s1[1..5], [2, 3, 4, 5]));
assert(s1[1..5].length == 4);
assert(s1[0..0].empty);
assert(s1[3..3].empty);
// assert(s1[$ .. $].empty);
assert(s1[s1.opDollar .. s1.opDollar].empty);
auto s2 = stride(arr, 2);
assert(equal(s2[0..2], [1,3]));
assert(s2[0..2].length == 2);
assert(equal(s2[1..5], [3, 5, 7, 9]));
assert(s2[1..5].length == 4);
assert(s2[0..0].empty);
assert(s2[3..3].empty);
// assert(s2[$ .. $].empty);
assert(s2[s2.opDollar .. s2.opDollar].empty);
// Test fix for Bug 5035
auto m = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]; // 3 rows, 4 columns
auto col = stride(m, 4);
assert(equal(col, [1, 1, 1]));
assert(equal(retro(col), [1, 1, 1]));
immutable int[] immi = [ 1, 2, 3 ];
static assert(isRandomAccessRange!(typeof(stride(immi, 1))));
// Check for infiniteness propagation.
static assert(isInfinite!(typeof(stride(repeat(1), 3))));
foreach(DummyType; AllDummyRanges) {
DummyType dummyRange;
dummyRange.reinit();
auto myStride = stride(dummyRange, 4);
// Should fail if no length and bidirectional b/c there's no way
// to know how much slack we have.
static if (hasLength!DummyType || !isBidirectionalRange!DummyType) {
static assert(propagatesRangeType!(typeof(myStride), DummyType));
}
assert(myStride.front == 1);
assert(myStride.moveFront() == 1);
assert(equal(myStride, [1, 5, 9]));
static if (hasLength!DummyType) {
assert(myStride.length == 3);
}
static if (isBidirectionalRange!DummyType && hasLength!DummyType) {
assert(myStride.back == 9);
assert(myStride.moveBack() == 9);
}
static if (isRandomAccessRange!DummyType && hasLength!DummyType) {
assert(myStride[0] == 1);
assert(myStride[1] == 5);
assert(myStride.moveAt(1) == 5);
assert(myStride[2] == 9);
static assert(hasSlicing!(typeof(myStride)));
}
static if (DummyType.r == ReturnBy.Reference) {
// Make sure reference is propagated.
{
myStride.front++;
scope(exit) myStride.front--;
assert(dummyRange.front == 2);
}
{
myStride.front = 4;
scope(exit) myStride.front = 1;
assert(dummyRange.front == 4);
}
static if (isBidirectionalRange!DummyType && hasLength!DummyType) {
{
myStride.back++;
scope(exit) myStride.back--;
assert(myStride.back == 10);
}
{
myStride.back = 111;
scope(exit) myStride.back = 9;
assert(myStride.back == 111);
}
static if (isRandomAccessRange!DummyType) {
{
myStride[1]++;
scope(exit) myStride[1]--;
assert(dummyRange[4] == 6);
}
{
myStride[1] = 55;
scope(exit) myStride[1] = 5;
assert(dummyRange[4] == 55);
}
}
}
}
}
}
@safe unittest
{
import std.algorithm : equal;
auto LL = iota(1L, 10L);
auto s = stride(LL, 3);
assert(equal(s, [1L, 4L, 7L]));
}
/**
Spans multiple ranges in sequence. The function $(D chain) takes any
number of ranges and returns a $(D Chain!(R1, R2,...)) object. The
ranges may be different, but they must have the same element type. The
result is a range that offers the $(D front), $(D popFront), and $(D
empty) primitives. If all input ranges offer random access and $(D
length), $(D Chain) offers them as well.
If only one range is offered to $(D Chain) or $(D chain), the $(D
Chain) type exits the picture by aliasing itself directly to that
range's type.
*/
auto chain(Ranges...)(Ranges rs)
if (Ranges.length > 0 &&
allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) &&
!is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == void))
{
static if (Ranges.length == 1)
{
return rs[0];
}
else
{
static struct Result
{
private:
alias R = staticMap!(Unqual, Ranges);
alias RvalueElementType = CommonType!(staticMap!(.ElementType, R));
private template sameET(A)
{
enum sameET = is(.ElementType!A == RvalueElementType);
}
enum bool allSameType = allSatisfy!(sameET, R);
// This doesn't work yet
static if (allSameType)
{
alias ref RvalueElementType ElementType;
}
else
{
alias ElementType = RvalueElementType;
}
static if (allSameType && allSatisfy!(hasLvalueElements, R))
{
static ref RvalueElementType fixRef(ref RvalueElementType val)
{
return val;
}
}
else
{
static RvalueElementType fixRef(RvalueElementType val)
{
return val;
}
}
// This is the entire state
R source;
// TODO: use a vtable (or more) instead of linear iteration
public:
this(R input)
{
foreach (i, v; input)
{
source[i] = v;
}
}
import std.meta : anySatisfy;
static if (anySatisfy!(isInfinite, R))
{
// Propagate infiniteness.
enum bool empty = false;
}
else
{
@property bool empty()
{
foreach (i, Unused; R)
{
if (!source[i].empty) return false;
}
return true;
}
}
static if (allSatisfy!(isForwardRange, R))
@property auto save()
{
typeof(this) result = this;
foreach (i, Unused; R)
{
result.source[i] = result.source[i].save;
}
return result;
}
void popFront()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
source[i].popFront();
return;
}
}
@property auto ref front()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
return fixRef(source[i].front);
}
assert(false);
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
{
// @@@BUG@@@
//@property void front(T)(T v) if (is(T : RvalueElementType))
@property void front(RvalueElementType v)
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
source[i].front = v;
return;
}
assert(false);
}
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveFront()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
return .moveFront(source[i]);
}
assert(false);
}
}
static if (allSatisfy!(isBidirectionalRange, R))
{
@property auto ref back()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
return fixRef(source[i].back);
}
assert(false);
}
void popBack()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
source[i].popBack();
return;
}
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveBack()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
return .moveBack(source[i]);
}
assert(false);
}
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
{
@property void back(RvalueElementType v)
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
source[i].back = v;
return;
}
assert(false);
}
}
}
static if (allSatisfy!(hasLength, R))
{
@property size_t length()
{
size_t result;
foreach (i, Unused; R)
{
result += source[i].length;
}
return result;
}
alias opDollar = length;
}
static if (allSatisfy!(isRandomAccessRange, R))
{
auto ref opIndex(size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
return source[i][index];
}
else
{
immutable length = source[i].length;
if (index < length) return fixRef(source[i][index]);
index -= length;
}
}
assert(false);
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveAt(size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
return .moveAt(source[i], index);
}
else
{
immutable length = source[i].length;
if (index < length) return .moveAt(source[i], index);
index -= length;
}
}
assert(false);
}
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
void opIndexAssign(ElementType v, size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
source[i][index] = v;
}
else
{
immutable length = source[i].length;
if (index < length)
{
source[i][index] = v;
return;
}
index -= length;
}
}
assert(false);
}
}
static if (allSatisfy!(hasLength, R) && allSatisfy!(hasSlicing, R))
auto opSlice(size_t begin, size_t end)
{
auto result = this;
foreach (i, Unused; R)
{
immutable len = result.source[i].length;
if (len < begin)
{
result.source[i] = result.source[i]
[len .. len];
begin -= len;
}
else
{
result.source[i] = result.source[i]
[begin .. len];
break;
}
}
auto cut = length;
cut = cut <= end ? 0 : cut - end;
foreach_reverse (i, Unused; R)
{
immutable len = result.source[i].length;
if (cut > len)
{
result.source[i] = result.source[i]
[0 .. 0];
cut -= len;
}
else
{
result.source[i] = result.source[i]
[0 .. len - cut];
break;
}
}
return result;
}
}
return Result(rs);
}
}
///
unittest
{
import std.algorithm : equal;
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
int[] arr3 = [ 7 ];
auto s = chain(arr1, arr2, arr3);
assert(s.length == 7);
assert(s[5] == 6);
assert(equal(s, [1, 2, 3, 4, 5, 6, 7][]));
}
@safe unittest
{
import std.internal.test.dummyrange;
import std.algorithm : equal;
{
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
int[] arr3 = [ 7 ];
int[] witness = [ 1, 2, 3, 4, 5, 6, 7 ];
auto s1 = chain(arr1);
static assert(isRandomAccessRange!(typeof(s1)));
auto s2 = chain(arr1, arr2);
static assert(isBidirectionalRange!(typeof(s2)));
static assert(isRandomAccessRange!(typeof(s2)));
s2.front = 1;
auto s = chain(arr1, arr2, arr3);
assert(s[5] == 6);
assert(equal(s, witness));
assert(s[5] == 6);
}
{
int[] arr1 = [ 1, 2, 3, 4 ];
int[] witness = [ 1, 2, 3, 4 ];
assert(equal(chain(arr1), witness));
}
{
uint[] foo = [1,2,3,4,5];
uint[] bar = [1,2,3,4,5];
auto c = chain(foo, bar);
c[3] = 42;
assert(c[3] == 42);
assert(c.moveFront() == 1);
assert(c.moveBack() == 5);
assert(c.moveAt(4) == 5);
assert(c.moveAt(5) == 1);
}
// Make sure bug 3311 is fixed. ChainImpl should compile even if not all
// elements are mutable.
auto c = chain( iota(0, 10), iota(0, 10) );
// Test the case where infinite ranges are present.
auto inf = chain([0,1,2][], cycle([4,5,6][]), [7,8,9][]); // infinite range
assert(inf[0] == 0);
assert(inf[3] == 4);
assert(inf[6] == 4);
assert(inf[7] == 5);
static assert(isInfinite!(typeof(inf)));
immutable int[] immi = [ 1, 2, 3 ];
immutable float[] immf = [ 1, 2, 3 ];
static assert(is(typeof(chain(immi, immf))));
// Check that chain at least instantiates and compiles with every possible
// pair of DummyRange types, in either order.
foreach(DummyType1; AllDummyRanges) {
DummyType1 dummy1;
foreach(DummyType2; AllDummyRanges) {
DummyType2 dummy2;
auto myChain = chain(dummy1, dummy2);
static assert(
propagatesRangeType!(typeof(myChain), DummyType1, DummyType2)
);
assert(myChain.front == 1);
foreach(i; 0..dummyLength) {
myChain.popFront();
}
assert(myChain.front == 1);
static if (isBidirectionalRange!DummyType1 &&
isBidirectionalRange!DummyType2) {
assert(myChain.back == 10);
}
static if (isRandomAccessRange!DummyType1 &&
isRandomAccessRange!DummyType2) {
assert(myChain[0] == 1);
}
static if (hasLvalueElements!DummyType1 && hasLvalueElements!DummyType2)
{
static assert(hasLvalueElements!(typeof(myChain)));
}
else
{
static assert(!hasLvalueElements!(typeof(myChain)));
}
}
}
}
@safe unittest
{
class Foo{}
immutable(Foo)[] a;
immutable(Foo)[] b;
auto c = chain(a, b);
}
/**
Choose one of two ranges at runtime depending on a Boolean condition.
The ranges may be different, but they must have compatible element types (i.e.
$(D CommonType) must exist for the two element types). The result is a range
that offers the weakest capabilities of the two (e.g. $(D ForwardRange) if $(D
R1) is a random-access range and $(D R2) is a forward range).
Params:
condition = which range to choose: $(D r1) if $(D true), $(D r2) otherwise
r1 = the "true" range
r2 = the "false" range
Returns:
A range type dependent on $(D R1) and $(D R2).
Bugs:
$(BUGZILLA 14660)
*/
auto choose(R1, R2)(bool condition, R1 r1, R2 r2)
if (isInputRange!(Unqual!R1) && isInputRange!(Unqual!R2) &&
!is(CommonType!(ElementType!(Unqual!R1), ElementType!(Unqual!R2)) == void))
{
static struct Result
{
import std.algorithm : max;
import std.algorithm.internal : addressOf;
private union
{
void[max(R1.sizeof, R2.sizeof)] buffer = void;
void* forAlignmentOnly = void;
}
private bool condition;
private @property ref R1 r1()
{
assert(condition);
return *cast(R1*) buffer.ptr;
}
private @property ref R2 r2()
{
assert(!condition);
return *cast(R2*) buffer.ptr;
}
this(bool condition, R1 r1, R2 r2)
{
this.condition = condition;
import std.conv : emplace;
if (condition) emplace(addressOf(this.r1), r1);
else emplace(addressOf(this.r2), r2);
}
// Carefully defined postblit to postblit the appropriate range
static if (hasElaborateCopyConstructor!R1
|| hasElaborateCopyConstructor!R2)
this(this)
{
if (condition)
{
static if (hasElaborateCopyConstructor!R1) r1.__postblit();
}
else
{
static if (hasElaborateCopyConstructor!R2) r2.__postblit();
}
}
static if (hasElaborateDestructor!R1 || hasElaborateDestructor!R2)
~this()
{
if (condition) destroy(r1);
else destroy(r2);
}
static if (isInfinite!R1 && isInfinite!R2)
// Propagate infiniteness.
enum bool empty = false;
else
@property bool empty()
{
return condition ? r1.empty : r2.empty;
}
@property auto ref front()
{
return condition ? r1.front : r2.front;
}
void popFront()
{
return condition ? r1.popFront : r2.popFront;
}
static if (isForwardRange!R1 && isForwardRange!R2)
@property auto save()
{
auto result = this;
if (condition) r1 = r1.save;
else r2 = r2.save;
return result;
}
@property void front(T)(T v)
if (is(typeof({ r1.front = v; r2.front = v; })))
{
if (condition) r1.front = v; else r2.front = v;
}
static if (hasMobileElements!R1 && hasMobileElements!R2)
auto moveFront()
{
return condition ? r1.moveFront : r2.moveFront;
}
static if (isBidirectionalRange!R1 && isBidirectionalRange!R2)
{
@property auto ref back()
{
return condition ? r1.back : r2.back;
}
void popBack()
{
return condition ? r1.popBack : r2.popBack;
}
static if (hasMobileElements!R1 && hasMobileElements!R2)
auto moveBack()
{
return condition ? r1.moveBack : r2.moveBack;
}
@property void back(T)(T v)
if (is(typeof({ r1.back = v; r2.back = v; })))
{
if (condition) r1.back = v; else r2.back = v;
}
}
static if (hasLength!R1 && hasLength!R2)
{
@property size_t length()
{
return condition ? r1.length : r2.length;
}
alias opDollar = length;
}
static if (isRandomAccessRange!R1 && isRandomAccessRange!R2)
{
auto ref opIndex(size_t index)
{
return condition ? r1[index] : r2[index];
}
static if (hasMobileElements!R1 && hasMobileElements!R2)
auto moveAt(size_t index)
{
return condition ? r1.moveAt(index) : r2.moveAt(index);
}
void opIndexAssign(T)(T v, size_t index)
if (is(typeof({ r1[1] = v; r2[1] = v; })))
{
if (condition) r1[index] = v; else r2[index] = v;
}
}
// BUG: this should work for infinite ranges, too
static if (hasSlicing!R1 && hasSlicing!R2 &&
!isInfinite!R2 && !isInfinite!R2)
auto opSlice(size_t begin, size_t end)
{
auto result = this;
if (condition) result.r1 = result.r1[begin .. end];
else result.r2 = result.r2[begin .. end];
return result;
}
}
return Result(condition, r1, r2);
}
///
unittest
{
import std.algorithm.iteration : filter, map;
import std.algorithm.comparison : equal;
auto data1 = [ 1, 2, 3, 4 ].filter!(a => a != 3);
auto data2 = [ 5, 6, 7, 8 ].map!(a => a + 1);
// choose() is primarily useful when you need to select one of two ranges
// with different types at runtime.
static assert(!is(typeof(data1) == typeof(data2)));
auto chooseRange(bool pickFirst)
{
// The returned range is a common wrapper type that can be used for
// returning or storing either range without running into a type error.
return choose(pickFirst, data1, data2);
// Simply returning the chosen range without using choose() does not
// work, because map() and filter() return different types.
//return pickFirst ? data1 : data2; // does not compile
}
auto result = chooseRange(true);
assert(result.equal([ 1, 2, 4 ]));
result = chooseRange(false);
assert(result.equal([ 6, 7, 8, 9 ]));
}
/**
Choose one of multiple ranges at runtime.
The ranges may be different, but they must have compatible element types. The
result is a range that offers the weakest capabilities of all $(D Ranges).
Params:
index = which range to choose, must be less than the number of ranges
rs = two or more ranges
Returns:
The indexed range. If rs consists of only one range, the return type is an
alias of that range's type.
*/
auto chooseAmong(Ranges...)(size_t index, Ranges rs)
if (Ranges.length > 2
&& is(typeof(choose(true, rs[0], rs[1])))
&& is(typeof(chooseAmong(0, rs[1 .. $]))))
{
return choose(index == 0, rs[0], chooseAmong(index - 1, rs[1 .. $]));
}
/// ditto
auto chooseAmong(Ranges...)(size_t index, Ranges rs)
if (Ranges.length == 2 && is(typeof(choose(true, rs[0], rs[1]))))
{
return choose(index == 0, rs[0], rs[1]);
}
///
unittest
{
import std.algorithm : equal;
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
int[] arr3 = [ 7 ];
{
auto s = chooseAmong(0, arr1, arr2, arr3);
auto t = s.save;
assert(s.length == 4);
assert(s[2] == 3);
s.popFront();
assert(equal(t, [1, 2, 3, 4][]));
}
{
auto s = chooseAmong(1, arr1, arr2, arr3);
assert(s.length == 2);
s.front = 8;
assert(equal(s, [8, 6][]));
}
{
auto s = chooseAmong(1, arr1, arr2, arr3);
assert(s.length == 2);
s[1] = 9;
assert(equal(s, [8, 9][]));
}
{
auto s = chooseAmong(1, arr2, arr1, arr3)[1..3];
assert(s.length == 2);
assert(equal(s, [2, 3][]));
}
{
auto s = chooseAmong(0, arr1, arr2, arr3);
assert(s.length == 4);
assert(s.back == 4);
s.popBack();
s.back = 5;
assert(equal(s, [1, 2, 5][]));
s.back = 3;
assert(equal(s, [1, 2, 3][]));
}
{
uint[] foo = [1,2,3,4,5];
uint[] bar = [6,7,8,9,10];
auto c = chooseAmong(1,foo, bar);
assert(c[3] == 9);
c[3] = 42;
assert(c[3] == 42);
assert(c.moveFront() == 6);
assert(c.moveBack() == 10);
assert(c.moveAt(4) == 10);
}
{
import std.range : cycle;
auto s = chooseAmong(1, cycle(arr2), cycle(arr3));
assert(isInfinite!(typeof(s)));
assert(!s.empty);
assert(s[100] == 7);
}
}
unittest
{
int[] a = [1, 2, 3];
long[] b = [4, 5, 6];
auto c = chooseAmong(0, a, b);
c[0] = 42;
assert(c[0] == 42);
}
/**
$(D roundRobin(r1, r2, r3)) yields $(D r1.front), then $(D r2.front),
then $(D r3.front), after which it pops off one element from each and
continues again from $(D r1). For example, if two ranges are involved,
it alternately yields elements off the two ranges. $(D roundRobin)
stops after it has consumed all ranges (skipping over the ones that
finish early).
*/
auto roundRobin(Rs...)(Rs rs)
if (Rs.length > 1 && allSatisfy!(isInputRange, staticMap!(Unqual, Rs)))
{
struct Result
{
import std.conv : to;
public Rs source;
private size_t _current = size_t.max;
@property bool empty()
{
foreach (i, Unused; Rs)
{
if (!source[i].empty) return false;
}
return true;
}
@property auto ref front()
{
final switch (_current)
{
foreach (i, R; Rs)
{
case i:
assert(!source[i].empty);
return source[i].front;
}
}
assert(0);
}
void popFront()
{
final switch (_current)
{
foreach (i, R; Rs)
{
case i:
source[i].popFront();
break;
}
}
auto next = _current == (Rs.length - 1) ? 0 : (_current + 1);
final switch (next)
{
foreach (i, R; Rs)
{
case i:
if (!source[i].empty)
{
_current = i;
return;
}
if (i == _current)
{
_current = _current.max;
return;
}
goto case (i + 1) % Rs.length;
}
}
}
static if (allSatisfy!(isForwardRange, staticMap!(Unqual, Rs)))
@property auto save()
{
Result result = this;
foreach (i, Unused; Rs)
{
result.source[i] = result.source[i].save;
}
return result;
}
static if (allSatisfy!(hasLength, Rs))
{
@property size_t length()
{
size_t result;
foreach (i, R; Rs)
{
result += source[i].length;
}
return result;
}
alias opDollar = length;
}
}
return Result(rs, 0);
}
///
@safe unittest
{
import std.algorithm : equal;
int[] a = [ 1, 2, 3 ];
int[] b = [ 10, 20, 30, 40 ];
auto r = roundRobin(a, b);
assert(equal(r, [ 1, 10, 2, 20, 3, 30, 40 ]));
}
/**
Iterates a random-access range starting from a given point and
progressively extending left and right from that point. If no initial
point is given, iteration starts from the middle of the
range. Iteration spans the entire range.
*/
auto radial(Range, I)(Range r, I startingIndex)
if (isRandomAccessRange!(Unqual!Range) && hasLength!(Unqual!Range) && isIntegral!I)
{
if (!r.empty) ++startingIndex;
return roundRobin(retro(r[0 .. startingIndex]), r[startingIndex .. r.length]);
}
/// Ditto
auto radial(R)(R r)
if (isRandomAccessRange!(Unqual!R) && hasLength!(Unqual!R))
{
return .radial(r, (r.length - !r.empty) / 2);
}
///
@safe unittest
{
import std.algorithm : equal;
int[] a = [ 1, 2, 3, 4, 5 ];
assert(equal(radial(a), [ 3, 4, 2, 5, 1 ]));
a = [ 1, 2, 3, 4 ];
assert(equal(radial(a), [ 2, 3, 1, 4 ]));
// If the left end is reached first, the remaining elements on the right
// are concatenated in order:
a = [ 0, 1, 2, 3, 4, 5 ];
assert(equal(radial(a, 1), [ 1, 2, 0, 3, 4, 5 ]));
// If the right end is reached first, the remaining elements on the left
// are concatenated in reverse order:
assert(equal(radial(a, 4), [ 4, 5, 3, 2, 1, 0 ]));
}
@safe unittest
{
import std.conv : text;
import std.exception : enforce;
import std.algorithm : equal;
import std.internal.test.dummyrange;
void test(int[] input, int[] witness)
{
enforce(equal(radial(input), witness),
text(radial(input), " vs. ", witness));
}
test([], []);
test([ 1 ], [ 1 ]);
test([ 1, 2 ], [ 1, 2 ]);
test([ 1, 2, 3 ], [ 2, 3, 1 ]);
test([ 1, 2, 3, 4 ], [ 2, 3, 1, 4 ]);
test([ 1, 2, 3, 4, 5 ], [ 3, 4, 2, 5, 1 ]);
test([ 1, 2, 3, 4, 5, 6 ], [ 3, 4, 2, 5, 1, 6 ]);
int[] a = [ 1, 2, 3, 4, 5 ];
assert(equal(radial(a, 1), [ 2, 3, 1, 4, 5 ][]));
static assert(isForwardRange!(typeof(radial(a, 1))));
auto r = radial([1,2,3,4,5]);
for(auto rr = r.save; !rr.empty; rr.popFront())
{
assert(rr.front == moveFront(rr));
}
r.front = 5;
assert(r.front == 5);
// Test instantiation without lvalue elements.
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random) dummy;
assert(equal(radial(dummy, 4), [5, 6, 4, 7, 3, 8, 2, 9, 1, 10]));
// immutable int[] immi = [ 1, 2 ];
// static assert(is(typeof(radial(immi))));
}
@safe unittest
{
import std.algorithm : equal;
auto LL = iota(1L, 6L);
auto r = radial(LL);
assert(equal(r, [3L, 4L, 2L, 5L, 1L]));
}
/**
Lazily takes only up to $(D n) elements of a range. This is
particularly useful when using with infinite ranges. If the range
offers random access and $(D length), $(D Take) offers them as well.
*/
struct Take(Range)
if (isInputRange!(Unqual!Range) &&
//take _cannot_ test hasSlicing on infinite ranges, because hasSlicing uses
//take for slicing infinite ranges.
!((!isInfinite!(Unqual!Range) && hasSlicing!(Unqual!Range)) || is(Range T == Take!T)))
{
private alias R = Unqual!Range;
// User accessible in read and write
public R source;
private size_t _maxAvailable;
alias Source = R;
@property bool empty()
{
return _maxAvailable == 0 || source.empty;
}
@property auto ref front()
{
assert(!empty,
"Attempting to fetch the front of an empty "
~ Take.stringof);
return source.front;
}
void popFront()
{
assert(!empty,
"Attempting to popFront() past the end of a "
~ Take.stringof);
source.popFront();
--_maxAvailable;
}
static if (isForwardRange!R)
@property Take save()
{
return Take(source.save, _maxAvailable);
}
static if (hasAssignableElements!R)
@property auto front(ElementType!R v)
{
assert(!empty,
"Attempting to assign to the front of an empty "
~ Take.stringof);
// This has to return auto instead of void because of Bug 4706.
source.front = v;
}
static if (hasMobileElements!R)
{
auto moveFront()
{
assert(!empty,
"Attempting to move the front of an empty "
~ Take.stringof);
return .moveFront(source);
}
}
static if (isInfinite!R)
{
@property size_t length() const
{
return _maxAvailable;
}
alias opDollar = length;
//Note: Due to Take/hasSlicing circular dependency,
//This needs to be a restrained template.
auto opSlice()(size_t i, size_t j)
if (hasSlicing!R)
{
assert(i <= j, "Invalid slice bounds");
assert(j - i <= length, "Attempting to slice past the end of a "
~ Take.stringof);
return source[i .. j - i];
}
}
else static if (hasLength!R)
{
@property size_t length()
{
import std.algorithm : min;
return min(_maxAvailable, source.length);
}
alias opDollar = length;
}
static if (isRandomAccessRange!R)
{
void popBack()
{
assert(!empty,
"Attempting to popBack() past the beginning of a "
~ Take.stringof);
--_maxAvailable;
}
@property auto ref back()
{
assert(!empty,
"Attempting to fetch the back of an empty "
~ Take.stringof);
return source[this.length - 1];
}
auto ref opIndex(size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
return source[index];
}
static if (hasAssignableElements!R)
{
@property auto back(ElementType!R v)
{
// This has to return auto instead of void because of Bug 4706.
assert(!empty,
"Attempting to assign to the back of an empty "
~ Take.stringof);
source[this.length - 1] = v;
}
void opIndexAssign(ElementType!R v, size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
source[index] = v;
}
}
static if (hasMobileElements!R)
{
auto moveBack()
{
assert(!empty,
"Attempting to move the back of an empty "
~ Take.stringof);
return .moveAt(source, this.length - 1);
}
auto moveAt(size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
return .moveAt(source, index);
}
}
}
// Nonstandard
@property size_t maxLength() const
{
return _maxAvailable;
}
}
// This template simply aliases itself to R and is useful for consistency in
// generic code.
template Take(R)
if (isInputRange!(Unqual!R) &&
((!isInfinite!(Unqual!R) && hasSlicing!(Unqual!R)) || is(R T == Take!T)))
{
alias Take = R;
}
// take for finite ranges with slicing
/// ditto
Take!R take(R)(R input, size_t n)
if (isInputRange!(Unqual!R) && !isInfinite!(Unqual!R) && hasSlicing!(Unqual!R) &&
!is(R T == Take!T))
{
// @@@BUG@@@
//return input[0 .. min(n, $)];
import std.algorithm : min;
return input[0 .. min(n, input.length)];
}
///
@safe unittest
{
import std.algorithm : equal;
int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
auto s = take(arr1, 5);
assert(s.length == 5);
assert(s[4] == 5);
assert(equal(s, [ 1, 2, 3, 4, 5 ][]));
}
/**
* If the range runs out before `n` elements, `take` simply returns the entire
* range (unlike $(LREF takeExactly), which will cause an assertion failure if
* the range ends prematurely):
*/
@safe unittest
{
import std.algorithm : equal;
int[] arr2 = [ 1, 2, 3 ];
auto t = take(arr2, 5);
assert(t.length == 3);
assert(equal(t, [ 1, 2, 3 ]));
}
// take(take(r, n1), n2)
Take!R take(R)(R input, size_t n)
if (is(R T == Take!T))
{
import std.algorithm : min;
return R(input.source, min(n, input._maxAvailable));
}
// Regular take for input ranges
Take!(R) take(R)(R input, size_t n)
if (isInputRange!(Unqual!R) && (isInfinite!(Unqual!R) || !hasSlicing!(Unqual!R) && !is(R T == Take!T)))
{
return Take!R(input, n);
}
@safe unittest
{
import std.internal.test.dummyrange;
import std.algorithm : equal;
int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
auto s = take(arr1, 5);
assert(s.length == 5);
assert(s[4] == 5);
assert(equal(s, [ 1, 2, 3, 4, 5 ][]));
assert(equal(retro(s), [ 5, 4, 3, 2, 1 ][]));
// Test fix for bug 4464.
static assert(is(typeof(s) == Take!(int[])));
static assert(is(typeof(s) == int[]));
// Test using narrow strings.
auto myStr = "This is a string.";
auto takeMyStr = take(myStr, 7);
assert(equal(takeMyStr, "This is"));
// Test fix for bug 5052.
auto takeMyStrAgain = take(takeMyStr, 4);
assert(equal(takeMyStrAgain, "This"));
static assert (is (typeof(takeMyStrAgain) == typeof(takeMyStr)));
takeMyStrAgain = take(takeMyStr, 10);
assert(equal(takeMyStrAgain, "This is"));
foreach(DummyType; AllDummyRanges) {
DummyType dummy;
auto t = take(dummy, 5);
alias T = typeof(t);
static if (isRandomAccessRange!DummyType) {
static assert(isRandomAccessRange!T);
assert(t[4] == 5);
assert(moveAt(t, 1) == t[1]);
assert(t.back == moveBack(t));
} else static if (isForwardRange!DummyType) {
static assert(isForwardRange!T);
}
for(auto tt = t; !tt.empty; tt.popFront())
{
assert(tt.front == moveFront(tt));
}
// Bidirectional ranges can't be propagated properly if they don't
// also have random access.
assert(equal(t, [1,2,3,4,5]));
//Test that take doesn't wrap the result of take.
assert(take(t, 4) == take(dummy, 4));
}
immutable myRepeat = repeat(1);
static assert(is(Take!(typeof(myRepeat))));
}
@safe unittest
{
// Check that one can declare variables of all Take types,
// and that they match the return type of the corresponding
// take(). (See issue 4464.)
int[] r1;
Take!(int[]) t1;
t1 = take(r1, 1);
string r2;
Take!string t2;
t2 = take(r2, 1);
Take!(Take!string) t3;
t3 = take(t2, 1);
}
@safe unittest
{
alias R1 = typeof(repeat(1));
alias R2 = typeof(cycle([1]));
alias TR1 = Take!R1;
alias TR2 = Take!R2;
static assert(isBidirectionalRange!TR1);
static assert(isBidirectionalRange!TR2);
}
@safe unittest //12731
{
auto a = repeat(1);
auto s = a[1 .. 5];
s = s[1 .. 3];
}
@safe unittest //13151
{
import std.algorithm : equal;
auto r = take(repeat(1, 4), 3);
assert(r.take(2).equal(repeat(1, 2)));
}
/**
Similar to $(LREF take), but assumes that $(D range) has at least $(D
n) elements. Consequently, the result of $(D takeExactly(range, n))
always defines the $(D length) property (and initializes it to $(D n))
even when $(D range) itself does not define $(D length).
The result of $(D takeExactly) is identical to that of $(LREF take) in
cases where the original range defines $(D length) or is infinite.
Unlike $(LREF take), however, it is illegal to pass a range with less than
$(D n) elements to $(D takeExactly); this will cause an assertion failure.
*/
auto takeExactly(R)(R range, size_t n)
if (isInputRange!R)
{
static if (is(typeof(takeExactly(range._input, n)) == R))
{
assert(n <= range._n,
"Attempted to take more than the length of the range with takeExactly.");
// takeExactly(takeExactly(r, n1), n2) has the same type as
// takeExactly(r, n1) and simply returns takeExactly(r, n2)
range._n = n;
return range;
}
//Also covers hasSlicing!R for finite ranges.
else static if (hasLength!R)
{
assert(n <= range.length,
"Attempted to take more than the length of the range with takeExactly.");
return take(range, n);
}
else static if (isInfinite!R)
return Take!R(range, n);
else
{
static struct Result
{
R _input;
private size_t _n;
@property bool empty() const { return !_n; }
@property auto ref front()
{
assert(_n > 0, "front() on an empty " ~ Result.stringof);
return _input.front;
}
void popFront() { _input.popFront(); --_n; }
@property size_t length() const { return _n; }
alias opDollar = length;
@property Take!R _takeExactly_Result_asTake()
{
return typeof(return)(_input, _n);
}
alias _takeExactly_Result_asTake this;
static if (isForwardRange!R)
@property auto save()
{
return Result(_input.save, _n);
}
static if (hasMobileElements!R)
{
auto moveFront()
{
assert(!empty,
"Attempting to move the front of an empty "
~ typeof(this).stringof);
return .moveFront(_input);
}
}
static if (hasAssignableElements!R)
{
@property auto ref front(ElementType!R v)
{
assert(!empty,
"Attempting to assign to the front of an empty "
~ typeof(this).stringof);
return _input.front = v;
}
}
}
return Result(range, n);
}
}
///
@safe unittest
{
import std.algorithm : equal;
auto a = [ 1, 2, 3, 4, 5 ];
auto b = takeExactly(a, 3);
assert(equal(b, [1, 2, 3]));
static assert(is(typeof(b.length) == size_t));
assert(b.length == 3);
assert(b.front == 1);
assert(b.back == 3);
}
@safe unittest
{
import std.algorithm : equal, filter;
auto a = [ 1, 2, 3, 4, 5 ];
auto b = takeExactly(a, 3);
auto c = takeExactly(b, 2);
auto d = filter!"a > 0"(a);
auto e = takeExactly(d, 3);
assert(equal(e, [1, 2, 3]));
static assert(is(typeof(e.length) == size_t));
assert(e.length == 3);
assert(e.front == 1);
assert(equal(takeExactly(e, 3), [1, 2, 3]));
}
@safe unittest
{
import std.algorithm : equal;
import std.internal.test.dummyrange;
auto a = [ 1, 2, 3, 4, 5 ];
//Test that take and takeExactly are the same for ranges which define length
//but aren't sliceable.
struct L
{
@property auto front() { return _arr[0]; }
@property bool empty() { return _arr.empty; }
void popFront() { _arr.popFront(); }
@property size_t length() { return _arr.length; }
int[] _arr;
}
static assert(is(typeof(take(L(a), 3)) == typeof(takeExactly(L(a), 3))));
assert(take(L(a), 3) == takeExactly(L(a), 3));
//Test that take and takeExactly are the same for ranges which are sliceable.
static assert(is(typeof(take(a, 3)) == typeof(takeExactly(a, 3))));
assert(take(a, 3) == takeExactly(a, 3));
//Test that take and takeExactly are the same for infinite ranges.
auto inf = repeat(1);
static assert(is(typeof(take(inf, 5)) == Take!(typeof(inf))));
assert(take(inf, 5) == takeExactly(inf, 5));
//Test that take and takeExactly are _not_ the same for ranges which don't
//define length.
static assert(!is(typeof(take(filter!"true"(a), 3)) == typeof(takeExactly(filter!"true"(a), 3))));
foreach(DummyType; AllDummyRanges)
{
{
DummyType dummy;
auto t = takeExactly(dummy, 5);
//Test that takeExactly doesn't wrap the result of takeExactly.
assert(takeExactly(t, 4) == takeExactly(dummy, 4));
}
static if(hasMobileElements!DummyType)
{
{
auto t = takeExactly(DummyType.init, 4);
assert(t.moveFront() == 1);
assert(equal(t, [1, 2, 3, 4]));
}
}
static if(hasAssignableElements!DummyType)
{
{
auto t = takeExactly(DummyType.init, 4);
t.front = 9;
assert(equal(t, [9, 2, 3, 4]));
}
}
}
}
@safe unittest
{
import std.algorithm : equal;
import std.internal.test.dummyrange;
alias DummyType = DummyRange!(ReturnBy.Value, Length.No, RangeType.Forward);
auto te = takeExactly(DummyType(), 5);
Take!DummyType t = te;
assert(equal(t, [1, 2, 3, 4, 5]));
assert(equal(t, te));
}
/**
Returns a range with at most one element; for example, $(D
takeOne([42, 43, 44])) returns a range consisting of the integer $(D
42). Calling $(D popFront()) off that range renders it empty.
In effect $(D takeOne(r)) is somewhat equivalent to $(D take(r, 1)) but in
certain interfaces it is important to know statically that the range may only
have at most one element.
The type returned by $(D takeOne) is a random-access range with length
regardless of $(D R)'s capabilities (another feature that distinguishes
$(D takeOne) from $(D take)).
*/
auto takeOne(R)(R source) if (isInputRange!R)
{
static if (hasSlicing!R)
{
return source[0 .. !source.empty];
}
else
{
static struct Result
{
private R _source;
private bool _empty = true;
@property bool empty() const { return _empty; }
@property auto ref front() { assert(!empty); return _source.front; }
void popFront() { assert(!empty); _empty = true; }
void popBack() { assert(!empty); _empty = true; }
static if (isForwardRange!(Unqual!R))
{
@property auto save() { return Result(_source.save, empty); }
}
@property auto ref back() { assert(!empty); return _source.front; }
@property size_t length() const { return !empty; }
alias opDollar = length;
auto ref opIndex(size_t n) { assert(n < length); return _source.front; }
auto opSlice(size_t m, size_t n)
{
assert(m <= n && n < length);
return n > m ? this : Result(_source, false);
}
// Non-standard property
@property R source() { return _source; }
}
return Result(source, source.empty);
}
}
///
@safe unittest
{
auto s = takeOne([42, 43, 44]);
static assert(isRandomAccessRange!(typeof(s)));
assert(s.length == 1);
assert(!s.empty);
assert(s.front == 42);
s.front = 43;
assert(s.front == 43);
assert(s.back == 43);
assert(s[0] == 43);
s.popFront();
assert(s.length == 0);
assert(s.empty);
}
unittest
{
struct NonForwardRange
{
enum empty = false;
int front() { return 42; }
void popFront() {}
}
static assert(!isForwardRange!NonForwardRange);
auto s = takeOne(NonForwardRange());
assert(s.front == 42);
}
/++
Returns an empty range which is statically known to be empty and is
guaranteed to have $(D length) and be random access regardless of $(D R)'s
capabilities.
+/
auto takeNone(R)()
if(isInputRange!R)
{
return typeof(takeOne(R.init)).init;
}
///
@safe unittest
{
auto range = takeNone!(int[])();
assert(range.length == 0);
assert(range.empty);
}
@safe unittest
{
enum ctfe = takeNone!(int[])();
static assert(ctfe.length == 0);
static assert(ctfe.empty);
}
/++
Creates an empty range from the given range in $(BIGOH 1). If it can, it
will return the same range type. If not, it will return
$(D takeExactly(range, 0)).
+/
auto takeNone(R)(R range)
if(isInputRange!R)
{
//Makes it so that calls to takeNone which don't use UFCS still work with a
//member version if it's defined.
static if(is(typeof(R.takeNone)))
auto retval = range.takeNone();
//@@@BUG@@@ 8339
else static if(isDynamicArray!R)/+ ||
(is(R == struct) && __traits(compiles, {auto r = R.init;}) && R.init.empty))+/
{
auto retval = R.init;
}
//An infinite range sliced at [0 .. 0] would likely still not be empty...
else static if(hasSlicing!R && !isInfinite!R)
auto retval = range[0 .. 0];
else
auto retval = takeExactly(range, 0);
//@@@BUG@@@ 7892 prevents this from being done in an out block.
assert(retval.empty);
return retval;
}
///
@safe unittest
{
import std.algorithm : filter;
assert(takeNone([42, 27, 19]).empty);
assert(takeNone("dlang.org").empty);
assert(takeNone(filter!"true"([42, 27, 19])).empty);
}
@safe unittest
{
import std.algorithm : filter;
struct Dummy
{
mixin template genInput()
{
@property bool empty() { return _arr.empty; }
@property auto front() { return _arr.front; }
void popFront() { _arr.popFront(); }
static assert(isInputRange!(typeof(this)));
}
}
alias genInput = Dummy.genInput;
static struct NormalStruct
{
//Disabled to make sure that the takeExactly version is used.
@disable this();
this(int[] arr) { _arr = arr; }
mixin genInput;
int[] _arr;
}
static struct SliceStruct
{
@disable this();
this(int[] arr) { _arr = arr; }
mixin genInput;
@property auto save() { return this; }
auto opSlice(size_t i, size_t j) { return typeof(this)(_arr[i .. j]); }
@property size_t length() { return _arr.length; }
int[] _arr;
}
static struct InitStruct
{
mixin genInput;
int[] _arr;
}
static struct TakeNoneStruct
{
this(int[] arr) { _arr = arr; }
@disable this();
mixin genInput;
auto takeNone() { return typeof(this)(null); }
int[] _arr;
}
static class NormalClass
{
this(int[] arr) {_arr = arr;}
mixin genInput;
int[] _arr;
}
static class SliceClass
{
this(int[] arr) { _arr = arr; }
mixin genInput;
@property auto save() { return new typeof(this)(_arr); }
auto opSlice(size_t i, size_t j) { return new typeof(this)(_arr[i .. j]); }
@property size_t length() { return _arr.length; }
int[] _arr;
}
static class TakeNoneClass
{
this(int[] arr) { _arr = arr; }
mixin genInput;
auto takeNone() { return new typeof(this)(null); }
int[] _arr;
}
import std.format : format;
foreach(range; AliasSeq!([1, 2, 3, 4, 5],
"hello world",
"hello world"w,
"hello world"d,
SliceStruct([1, 2, 3]),
//@@@BUG@@@ 8339 forces this to be takeExactly
//`InitStruct([1, 2, 3]),
TakeNoneStruct([1, 2, 3])))
{
static assert(takeNone(range).empty, typeof(range).stringof);
assert(takeNone(range).empty);
static assert(is(typeof(range) == typeof(takeNone(range))), typeof(range).stringof);
}
foreach(range; AliasSeq!(NormalStruct([1, 2, 3]),
InitStruct([1, 2, 3])))
{
static assert(takeNone(range).empty, typeof(range).stringof);
assert(takeNone(range).empty);
static assert(is(typeof(takeExactly(range, 0)) == typeof(takeNone(range))), typeof(range).stringof);
}
//Don't work in CTFE.
auto normal = new NormalClass([1, 2, 3]);
assert(takeNone(normal).empty);
static assert(is(typeof(takeExactly(normal, 0)) == typeof(takeNone(normal))), typeof(normal).stringof);
auto slice = new SliceClass([1, 2, 3]);
assert(takeNone(slice).empty);
static assert(is(SliceClass == typeof(takeNone(slice))), typeof(slice).stringof);
auto taken = new TakeNoneClass([1, 2, 3]);
assert(takeNone(taken).empty);
static assert(is(TakeNoneClass == typeof(takeNone(taken))), typeof(taken).stringof);
auto filtered = filter!"true"([1, 2, 3, 4, 5]);
assert(takeNone(filtered).empty);
//@@@BUG@@@ 8339 and 5941 force this to be takeExactly
//static assert(is(typeof(filtered) == typeof(takeNone(filtered))), typeof(filtered).stringof);
}
/++
+ Return a _range advanced to within $(D _n) elements of the end of
+ $(D _range).
+
+ Intended as the _range equivalent of the Unix
+ $(WEB en.wikipedia.org/wiki/Tail_%28Unix%29, _tail) utility. When the length
+ of $(D _range) is less than or equal to $(D _n), $(D _range) is returned
+ as-is.
+
+ Completes in $(BIGOH 1) steps for ranges that support slicing and have
+ length. Completes in $(BIGOH _range.length) time for all other ranges.
+
+ Params:
+ range = _range to get _tail of
+ n = maximum number of elements to include in _tail
+
+ Returns:
+ Returns the _tail of $(D _range) augmented with length information
+/
auto tail(Range)(Range range, size_t n)
if (isInputRange!Range && !isInfinite!Range &&
(hasLength!Range || isForwardRange!Range))
{
static if (hasLength!Range)
{
immutable length = range.length;
if (n >= length)
return range.takeExactly(length);
else
return range.drop(length - n).takeExactly(n);
}
else
{
Range scout = range.save;
foreach (immutable i; 0 .. n)
{
if (scout.empty)
return range.takeExactly(i);
scout.popFront();
}
auto tail = range.save;
while (!scout.empty)
{
assert(!tail.empty);
scout.popFront();
tail.popFront();
}
return tail.takeExactly(n);
}
}
///
pure @safe unittest
{
// tail -c n
assert([1, 2, 3].tail(1) == [3]);
assert([1, 2, 3].tail(2) == [2, 3]);
assert([1, 2, 3].tail(3) == [1, 2, 3]);
assert([1, 2, 3].tail(4) == [1, 2, 3]);
assert([1, 2, 3].tail(0).length == 0);
// tail --lines=n
import std.algorithm.comparison : equal;
import std.algorithm.iteration : joiner;
import std.string : lineSplitter;
assert("one\ntwo\nthree"
.lineSplitter
.tail(2)
.joiner("\n")
.equal("two\nthree"));
}
// @nogc prevented by @@@BUG@@@ 15408
pure nothrow @safe /+@nogc+/ unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange;
static immutable cheatsheet = [6, 7, 8, 9, 10];
foreach (R; AllDummyRanges)
{
static if (isInputRange!R && !isInfinite!R &&
(hasLength!R || isForwardRange!R))
{
assert(R.init.tail(5).equal(cheatsheet));
static assert(R.init.tail(5).equal(cheatsheet));
assert(R.init.tail(0).length == 0);
assert(R.init.tail(10).equal(R.init));
assert(R.init.tail(11).equal(R.init));
}
}
// Infinite ranges are not supported
static assert(!__traits(compiles, repeat(0).tail(0)));
// Neither are non-forward ranges without length
static assert(!__traits(compiles, DummyRange!(ReturnBy.Value, Length.No,
RangeType.Input).init.tail(5)));
}
@nogc unittest
{
static immutable input = [1, 2, 3];
static immutable expectedOutput = [2, 3];
assert(input.tail(2) == expectedOutput);
}
/++
Convenience function which calls
$(D range.$(LREF popFrontN)(n)) and returns $(D range). $(D drop)
makes it easier to pop elements from a range
and then pass it to another function within a single expression,
whereas $(D popFrontN) would require multiple statements.
$(D dropBack) provides the same functionality but instead calls
$(D range.popBackN(n)).
Note: $(D drop) and $(D dropBack) will only pop $(I up to)
$(D n) elements but will stop if the range is empty first.
+/
R drop(R)(R range, size_t n)
if(isInputRange!R)
{
range.popFrontN(n);
return range;
}
/// ditto
R dropBack(R)(R range, size_t n)
if(isBidirectionalRange!R)
{
range.popBackN(n);
return range;
}
///
@safe unittest
{
import std.algorithm : equal;
assert([0, 2, 1, 5, 0, 3].drop(3) == [5, 0, 3]);
assert("hello world".drop(6) == "world");
assert("hello world".drop(50).empty);
assert("hello world".take(6).drop(3).equal("lo "));
}
@safe unittest
{
import std.algorithm : equal;
assert([0, 2, 1, 5, 0, 3].dropBack(3) == [0, 2, 1]);
assert("hello world".dropBack(6) == "hello");
assert("hello world".dropBack(50).empty);
assert("hello world".drop(4).dropBack(4).equal("o w"));
}
@safe unittest
{
import std.algorithm : equal;
import std.container.dlist;
//Remove all but the first two elements
auto a = DList!int(0, 1, 9, 9, 9, 9);
a.remove(a[].drop(2));
assert(a[].equal(a[].take(2)));
}
@safe unittest
{
import std.algorithm : equal, filter;
assert(drop("", 5).empty);
assert(equal(drop(filter!"true"([0, 2, 1, 5, 0, 3]), 3), [5, 0, 3]));
}
@safe unittest
{
import std.algorithm : equal;
import std.container.dlist;
//insert before the last two elements
auto a = DList!int(0, 1, 2, 5, 6);
a.insertAfter(a[].dropBack(2), [3, 4]);
assert(a[].equal(iota(0, 7)));
}
/++
Similar to $(LREF drop) and $(D dropBack) but they call
$(D range.$(LREF popFrontExactly)(n)) and $(D range.popBackExactly(n))
instead.
Note: Unlike $(D drop), $(D dropExactly) will assume that the
range holds at least $(D n) elements. This makes $(D dropExactly)
faster than $(D drop), but it also means that if $(D range) does
not contain at least $(D n) elements, it will attempt to call $(D popFront)
on an empty range, which is undefined behavior. So, only use
$(D popFrontExactly) when it is guaranteed that $(D range) holds at least
$(D n) elements.
+/
R dropExactly(R)(R range, size_t n)
if(isInputRange!R)
{
popFrontExactly(range, n);
return range;
}
/// ditto
R dropBackExactly(R)(R range, size_t n)
if(isBidirectionalRange!R)
{
popBackExactly(range, n);
return range;
}
///
@safe unittest
{
import std.algorithm : equal, filterBidirectional;
auto a = [1, 2, 3];
assert(a.dropExactly(2) == [3]);
assert(a.dropBackExactly(2) == [1]);
string s = "日本語";
assert(s.dropExactly(2) == "語");
assert(s.dropBackExactly(2) == "日");
auto bd = filterBidirectional!"true"([1, 2, 3]);
assert(bd.dropExactly(2).equal([3]));
assert(bd.dropBackExactly(2).equal([1]));
}
/++
Convenience function which calls
$(D range.popFront()) and returns $(D range). $(D dropOne)
makes it easier to pop an element from a range
and then pass it to another function within a single expression,
whereas $(D popFront) would require multiple statements.
$(D dropBackOne) provides the same functionality but instead calls
$(D range.popBack()).
+/
R dropOne(R)(R range)
if (isInputRange!R)
{
range.popFront();
return range;
}
/// ditto
R dropBackOne(R)(R range)
if (isBidirectionalRange!R)
{
range.popBack();
return range;
}
///
@safe unittest
{
import std.algorithm : equal, filterBidirectional;
import std.container.dlist;
auto dl = DList!int(9, 1, 2, 3, 9);
assert(dl[].dropOne().dropBackOne().equal([1, 2, 3]));
auto a = [1, 2, 3];
assert(a.dropOne() == [2, 3]);
assert(a.dropBackOne() == [1, 2]);
string s = "日本語";
assert(s.dropOne() == "本語");
assert(s.dropBackOne() == "日本");
auto bd = filterBidirectional!"true"([1, 2, 3]);
assert(bd.dropOne().equal([2, 3]));
assert(bd.dropBackOne().equal([1, 2]));
}
/**
Repeats one value forever.
Models an infinite bidirectional and random access range, with slicing.
*/
struct Repeat(T)
{
private:
//Store a non-qualified T when possible: This is to make Repeat assignable
static if ((is(T == class) || is(T == interface)) && (is(T == const) || is(T == immutable)))
{
import std.typecons;
alias UT = Rebindable!T;
}
else static if (is(T : Unqual!T) && is(Unqual!T : T))
alias UT = Unqual!T;
else
alias UT = T;
UT _value;
public:
@property inout(T) front() inout { return _value; }
@property inout(T) back() inout { return _value; }
enum bool empty = false;
void popFront() {}
void popBack() {}
@property auto save() inout { return this; }
inout(T) opIndex(size_t) inout { return _value; }
auto opSlice(size_t i, size_t j)
in
{
assert(i <= j);
}
body
{
return this.takeExactly(j - i);
}
private static struct DollarToken {}
enum opDollar = DollarToken.init;
auto opSlice(size_t, DollarToken) inout { return this; }
}
/// Ditto
Repeat!T repeat(T)(T value) { return Repeat!T(value); }
///
@safe unittest
{
import std.algorithm : equal;
assert(equal(5.repeat().take(4), [ 5, 5, 5, 5 ]));
}
@safe unittest
{
import std.algorithm : equal;
auto r = repeat(5);
alias R = typeof(r);
static assert(isBidirectionalRange!R);
static assert(isForwardRange!R);
static assert(isInfinite!R);
static assert(hasSlicing!R);
assert(r.back == 5);
assert(r.front == 5);
assert(r.take(4).equal([ 5, 5, 5, 5 ]));
assert(r[0 .. 4].equal([ 5, 5, 5, 5 ]));
R r2 = r[5 .. $];
}
/**
Repeats $(D value) exactly $(D n) times. Equivalent to $(D
take(repeat(value), n)).
*/
Take!(Repeat!T) repeat(T)(T value, size_t n)
{
return take(repeat(value), n);
}
///
@safe unittest
{
import std.algorithm : equal;
assert(equal(5.repeat(4), 5.repeat().take(4)));
}
@safe unittest //12007
{
static class C{}
Repeat!(immutable int) ri;
ri = ri.save;
Repeat!(immutable C) rc;
rc = rc.save;
import std.algorithm;
immutable int[] A = [1,2,3];
immutable int[] B = [4,5,6];
auto AB = cartesianProduct(A,B);
}
/**
Given callable ($(XREF traits, isCallable)) $(D fun), create as a range
whose front is defined by successive calls to $(D fun()).
This is especially useful to call function with global side effects (random
functions), or to create ranges expressed as a single delegate, rather than
an entire $(D front)/$(D popFront)/$(D empty) structure.
$(D fun) maybe be passed either a template alias parameter (existing
function, delegate, struct type defining static $(D opCall)... ) or
a run-time value argument (delegate, function object... ).
The result range models an InputRange
($(XREF_PACK range,primitives,isInputRange)).
The resulting range will call $(D fun()) on every call to $(D front),
and only when $(D front) is called, regardless of how the range is
iterated.
It is advised to compose generate with either
$(XREF_PACK algorithm,iteration,cache) or $(XREF array,array), or to use it in a
foreach loop.
A by-value foreach loop means that the loop value is not $(D ref).
Params:
fun = is the $(D isCallable) that gets called on every call to front.
Returns: an $(D inputRange) that returns a new value generated by $(D Fun) on
any call to $(D front).
*/
auto generate(Fun)(Fun fun)
if (isCallable!fun)
{
return Generator!(Fun)(fun);
}
/// ditto
auto generate(alias fun)()
if (isCallable!fun)
{
return Generator!(fun)();
}
///
@safe pure unittest
{
import std.algorithm : equal, map;
int i = 1;
auto powersOfTwo = generate!(() => i *= 2)().take(10);
assert(equal(powersOfTwo, iota(1, 11).map!"2^^a"()));
}
///
@safe pure unittest
{
import std.algorithm : equal;
//Returns a run-time delegate
auto infiniteIota(T)(T low, T high)
{
T i = high;
return (){if (i == high) i = low; return i++;};
}
//adapted as a range.
assert(equal(generate(infiniteIota(1, 4)).take(10), [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]));
}
///
unittest
{
import std.format, std.random;
auto r = generate!(() => uniform(0, 6)).take(10);
format("%(%s %)", r);
}
//private struct Generator(bool onPopFront, bool runtime, Fun...)
private struct Generator(Fun...)
{
static assert(Fun.length == 1);
static assert(isInputRange!Generator);
private:
static if (is(Fun[0]))
Fun[0] fun;
else
alias fun = Fun[0];
public:
enum empty = false;
auto ref front() @property
{
return fun();
}
void popFront() { }
}
@safe unittest
{
import std.algorithm : equal;
struct StaticOpCall
{
static ubyte opCall() { return 5 ; }
}
assert(equal(generate!StaticOpCall().take(10), repeat(5).take(10)));
}
@safe pure unittest
{
import std.algorithm : equal;
struct OpCall
{
ubyte opCall() @safe pure { return 5 ; }
}
OpCall op;
assert(equal(generate(op).take(10), repeat(5).take(10)));
}
/**
Repeats the given forward range ad infinitum. If the original range is
infinite (fact that would make $(D Cycle) the identity application),
$(D Cycle) detects that and aliases itself to the range type
itself. If the original range has random access, $(D Cycle) offers
random access and also offers a constructor taking an initial position
$(D index). $(D Cycle) works with static arrays in addition to ranges,
mostly for performance reasons.
Note: The input range must not be empty.
Tip: This is a great way to implement simple circular buffers.
*/
struct Cycle(R)
if (isForwardRange!R && !isInfinite!R)
{
static if (isRandomAccessRange!R && hasLength!R)
{
private R _original;
private size_t _index;
this(R input, size_t index = 0)
{
_original = input;
_index = index % _original.length;
}
@property auto ref front()
{
return _original[_index];
}
static if (is(typeof((cast(const R)_original)[_index])))
{
@property auto ref front() const
{
return _original[_index];
}
}
static if (hasAssignableElements!R)
{
@property auto front(ElementType!R val)
{
_original[_index] = val;
}
}
enum bool empty = false;
void popFront()
{
++_index;
if (_index >= _original.length)
_index = 0;
}
auto ref opIndex(size_t n)
{
return _original[(n + _index) % _original.length];
}
static if (is(typeof((cast(const R)_original)[_index])) &&
is(typeof((cast(const R)_original).length)))
{
auto ref opIndex(size_t n) const
{
return _original[(n + _index) % _original.length];
}
}
static if (hasAssignableElements!R)
{
auto opIndexAssign(ElementType!R val, size_t n)
{
_original[(n + _index) % _original.length] = val;
}
}
@property Cycle save()
{
//No need to call _original.save, because Cycle never actually modifies _original
return Cycle(_original, _index);
}
private static struct DollarToken {}
enum opDollar = DollarToken.init;
auto opSlice(size_t i, size_t j)
in
{
assert(i <= j);
}
body
{
return this[i .. $].takeExactly(j - i);
}
auto opSlice(size_t i, DollarToken)
{
return typeof(this)(_original, _index + i);
}
}
else
{
private R _original;
private R _current;
this(R input)
{
_original = input;
_current = input.save;
}
@property auto ref front()
{
return _current.front;
}
static if (is(typeof((cast(const R)_current).front)))
{
@property auto ref front() const
{
return _current.front;
}
}
static if (hasAssignableElements!R)
{
@property auto front(ElementType!R val)
{
return _current.front = val;
}
}
enum bool empty = false;
void popFront()
{
_current.popFront();
if (_current.empty)
_current = _original.save;
}
@property Cycle save()
{
//No need to call _original.save, because Cycle never actually modifies _original
Cycle ret = this;
ret._original = _original;
ret._current = _current.save;
return ret;
}
}
}
template Cycle(R)
if (isInfinite!R)
{
alias Cycle = R;
}
struct Cycle(R)
if (isStaticArray!R)
{
private alias ElementType = typeof(R.init[0]);
private ElementType* _ptr;
private size_t _index;
nothrow:
this(ref R input, size_t index = 0) @system
{
_ptr = input.ptr;
_index = index % R.length;
}
@property ref inout(ElementType) front() inout @safe
{
static ref auto trustedPtrIdx(typeof(_ptr) p, size_t idx) @trusted
{
return p[idx];
}
return trustedPtrIdx(_ptr, _index);
}
enum bool empty = false;
void popFront() @safe
{
++_index;
if (_index >= R.length)
_index = 0;
}
ref inout(ElementType) opIndex(size_t n) inout @safe
{
static ref auto trustedPtrIdx(typeof(_ptr) p, size_t idx) @trusted
{
return p[idx % R.length];
}
return trustedPtrIdx(_ptr, n + _index);
}
@property inout(Cycle) save() inout @safe
{
return this;
}
private static struct DollarToken {}
enum opDollar = DollarToken.init;
auto opSlice(size_t i, size_t j) @safe
in
{
assert(i <= j);
}
body
{
return this[i .. $].takeExactly(j - i);
}
inout(typeof(this)) opSlice(size_t i, DollarToken) inout @safe
{
static auto trustedCtor(typeof(_ptr) p, size_t idx) @trusted
{
return cast(inout)Cycle(*cast(R*)(p), idx);
}
return trustedCtor(_ptr, _index + i);
}
}
/// Ditto
Cycle!R cycle(R)(R input)
if (isForwardRange!R && !isInfinite!R)
{
assert(!input.empty);
return Cycle!R(input);
}
///
@safe unittest
{
import std.algorithm : equal;
import std.range : cycle, take;
// Here we create an infinitive cyclic sequence from [1, 2]
// (i.e. get here [1, 2, 1, 2, 1, 2 and so on]) then
// take 5 elements of this sequence (so we have [1, 2, 1, 2, 1])
// and compare them with the expected values for equality.
assert(cycle([1, 2]).take(5).equal([ 1, 2, 1, 2, 1 ]));
}
/// Ditto
Cycle!R cycle(R)(R input, size_t index = 0)
if (isRandomAccessRange!R && !isInfinite!R)
{
assert(!input.empty);
return Cycle!R(input, index);
}
Cycle!R cycle(R)(R input)
if (isInfinite!R)
{
return input;
}
Cycle!R cycle(R)(ref R input, size_t index = 0) @system
if (isStaticArray!R)
{
return Cycle!R(input, index);
}
@safe unittest
{
import std.internal.test.dummyrange;
import std.algorithm : equal;
static assert(isForwardRange!(Cycle!(uint[])));
// Make sure ref is getting propagated properly.
int[] nums = [1,2,3];
auto c2 = cycle(nums);
c2[3]++;
assert(nums[0] == 2);
immutable int[] immarr = [1, 2, 3];
auto cycleimm = cycle(immarr);
foreach(DummyType; AllDummyRanges)
{
static if (isForwardRange!DummyType)
{
DummyType dummy;
auto cy = cycle(dummy);
static assert(isForwardRange!(typeof(cy)));
auto t = take(cy, 20);
assert(equal(t, [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10]));
const cRange = cy;
assert(cRange.front == 1);
static if (hasAssignableElements!DummyType)
{
{
cy.front = 66;
scope(exit) cy.front = 1;
assert(dummy.front == 66);
}
static if (isRandomAccessRange!DummyType)
{
{
cy[10] = 66;
scope(exit) cy[10] = 1;
assert(dummy.front == 66);
}
assert(cRange[10] == 1);
}
}
static if(hasSlicing!DummyType)
{
auto slice = cy[5 .. 15];
assert(equal(slice, [6, 7, 8, 9, 10, 1, 2, 3, 4, 5]));
static assert(is(typeof(slice) == typeof(takeExactly(cy, 5))));
auto infSlice = cy[7 .. $];
assert(equal(take(infSlice, 5), [8, 9, 10, 1, 2]));
static assert(isInfinite!(typeof(infSlice)));
}
}
}
}
@system unittest // For static arrays.
{
import std.algorithm : equal;
int[3] a = [ 1, 2, 3 ];
static assert(isStaticArray!(typeof(a)));
auto c = cycle(a);
assert(a.ptr == c._ptr);
assert(equal(take(cycle(a), 5), [ 1, 2, 3, 1, 2 ][]));
static assert(isForwardRange!(typeof(c)));
// Test qualifiers on slicing.
alias C = typeof(c);
static assert(is(typeof(c[1 .. $]) == C));
const cConst = c;
static assert(is(typeof(cConst[1 .. $]) == const(C)));
}
@safe unittest // For infinite ranges
{
struct InfRange
{
void popFront() { }
@property int front() { return 0; }
enum empty = false;
}
InfRange i;
auto c = cycle(i);
assert (c == i);
}
@safe unittest
{
import std.algorithm : equal;
int[5] arr = [0, 1, 2, 3, 4];
auto cleD = cycle(arr[]); //Dynamic
assert(equal(cleD[5 .. 10], arr[]));
//n is a multiple of 5 worth about 3/4 of size_t.max
auto n = size_t.max/4 + size_t.max/2;
n -= n % 5;
//Test index overflow
foreach (_ ; 0 .. 10)
{
cleD = cleD[n .. $];
assert(equal(cleD[5 .. 10], arr[]));
}
}
@system unittest
{
import std.algorithm : equal;
int[5] arr = [0, 1, 2, 3, 4];
auto cleS = cycle(arr); //Static
assert(equal(cleS[5 .. 10], arr[]));
//n is a multiple of 5 worth about 3/4 of size_t.max
auto n = size_t.max/4 + size_t.max/2;
n -= n % 5;
//Test index overflow
foreach (_ ; 0 .. 10)
{
cleS = cleS[n .. $];
assert(equal(cleS[5 .. 10], arr[]));
}
}
@system unittest
{
import std.algorithm : equal;
int[1] arr = [0];
auto cleS = cycle(arr);
cleS = cleS[10 .. $];
assert(equal(cleS[5 .. 10], 0.repeat(5)));
assert(cleS.front == 0);
}
unittest //10845
{
import std.algorithm : equal, filter;
auto a = inputRangeObject(iota(3).filter!"true");
assert(equal(cycle(a).take(10), [0, 1, 2, 0, 1, 2, 0, 1, 2, 0]));
}
@safe unittest // 12177
{
auto a = recurrence!q{a[n - 1] ~ a[n - 2]}("1", "0");
}
// Issue 13390
unittest
{
import std.exception;
import core.exception : AssertError;
assertThrown!AssertError(cycle([0, 1, 2][0..0]));
}
private alias lengthType(R) = typeof(R.init.length.init);
/**
Iterate several ranges in lockstep. The element type is a proxy tuple
that allows accessing the current element in the $(D n)th range by
using $(D e[n]).
$(D Zip) offers the lowest range facilities of all components, e.g. it
offers random access iff all ranges offer random access, and also
offers mutation and swapping if all ranges offer it. Due to this, $(D
Zip) is extremely powerful because it allows manipulating several
ranges in lockstep. For example, the following code sorts two arrays
in parallel:
*/
struct Zip(Ranges...)
if (Ranges.length && allSatisfy!(isInputRange, Ranges))
{
import std.format : format; //for generic mixins
import std.typecons : Tuple;
alias R = Ranges;
R ranges;
alias ElementType = Tuple!(staticMap!(.ElementType, R));
StoppingPolicy stoppingPolicy = StoppingPolicy.shortest;
/**
Builds an object. Usually this is invoked indirectly by using the
$(LREF zip) function.
*/
this(R rs, StoppingPolicy s = StoppingPolicy.shortest)
{
ranges[] = rs[];
stoppingPolicy = s;
}
/**
Returns $(D true) if the range is at end. The test depends on the
stopping policy.
*/
static if (allSatisfy!(isInfinite, R))
{
// BUG: Doesn't propagate infiniteness if only some ranges are infinite
// and s == StoppingPolicy.longest. This isn't fixable in the
// current design since StoppingPolicy is known only at runtime.
enum bool empty = false;
}
else
{
@property bool empty()
{
import std.exception : enforce;
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
if (ranges[i].empty) return true;
}
return false;
case StoppingPolicy.longest:
static if (anySatisfy!(isInfinite, R))
{
return false;
}
else
{
foreach (i, Unused; R)
{
if (!ranges[i].empty) return false;
}
return true;
}
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R[1 .. $])
{
enforce(ranges[0].empty ==
ranges[i + 1].empty,
"Inequal-length ranges passed to Zip");
}
return ranges[0].empty;
}
assert(false);
}
}
static if (allSatisfy!(isForwardRange, R))
{
@property Zip save()
{
//Zip(ranges[0].save, ranges[1].save, ..., stoppingPolicy)
return mixin (q{Zip(%(ranges[%s]%|, %), stoppingPolicy)}.format(iota(0, R.length)));
}
}
private .ElementType!(R[i]) tryGetInit(size_t i)()
{
alias E = .ElementType!(R[i]);
static if (!is(typeof({static E i;})))
throw new Exception("Range with non-default constructable elements exhausted.");
else
return E.init;
}
/**
Returns the current iterated element.
*/
@property ElementType front()
{
@property tryGetFront(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].front;}
//ElementType(tryGetFront!0, tryGetFront!1, ...)
return mixin(q{ElementType(%(tryGetFront!%s, %))}.format(iota(0, R.length)));
}
/**
Sets the front of all iterated ranges.
*/
static if (allSatisfy!(hasAssignableElements, R))
{
@property void front(ElementType v)
{
foreach (i, Unused; R)
{
if (!ranges[i].empty)
{
ranges[i].front = v[i];
}
}
}
}
/**
Moves out the front.
*/
static if (allSatisfy!(hasMobileElements, R))
{
ElementType moveFront()
{
@property tryMoveFront(size_t i)(){return ranges[i].empty ? tryGetInit!i() : .moveFront(ranges[i]);}
//ElementType(tryMoveFront!0, tryMoveFront!1, ...)
return mixin(q{ElementType(%(tryMoveFront!%s, %))}.format(iota(0, R.length)));
}
}
/**
Returns the rightmost element.
*/
static if (allSatisfy!(isBidirectionalRange, R))
{
@property ElementType back()
{
//TODO: Fixme! BackElement != back of all ranges in case of jagged-ness
@property tryGetBack(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].back;}
//ElementType(tryGetBack!0, tryGetBack!1, ...)
return mixin(q{ElementType(%(tryGetBack!%s, %))}.format(iota(0, R.length)));
}
/**
Moves out the back.
*/
static if (allSatisfy!(hasMobileElements, R))
{
ElementType moveBack()
{
//TODO: Fixme! BackElement != back of all ranges in case of jagged-ness
@property tryMoveBack(size_t i)(){return ranges[i].empty ? tryGetInit!i() : .moveFront(ranges[i]);}
//ElementType(tryMoveBack!0, tryMoveBack!1, ...)
return mixin(q{ElementType(%(tryMoveBack!%s, %))}.format(iota(0, R.length)));
}
}
/**
Returns the current iterated element.
*/
static if (allSatisfy!(hasAssignableElements, R))
{
@property void back(ElementType v)
{
//TODO: Fixme! BackElement != back of all ranges in case of jagged-ness.
//Not sure the call is even legal for StoppingPolicy.longest
foreach (i, Unused; R)
{
if (!ranges[i].empty)
{
ranges[i].back = v[i];
}
}
}
}
}
/**
Advances to the next element in all controlled ranges.
*/
void popFront()
{
import std.exception : enforce;
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
assert(!ranges[i].empty);
ranges[i].popFront();
}
break;
case StoppingPolicy.longest:
foreach (i, Unused; R)
{
if (!ranges[i].empty) ranges[i].popFront();
}
break;
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R)
{
enforce(!ranges[i].empty, "Invalid Zip object");
ranges[i].popFront();
}
break;
}
}
/**
Calls $(D popBack) for all controlled ranges.
*/
static if (allSatisfy!(isBidirectionalRange, R))
{
void popBack()
{
//TODO: Fixme! In case of jaggedness, this is wrong.
import std.exception : enforce;
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
assert(!ranges[i].empty);
ranges[i].popBack();
}
break;
case StoppingPolicy.longest:
foreach (i, Unused; R)
{
if (!ranges[i].empty) ranges[i].popBack();
}
break;
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R)
{
enforce(!ranges[i].empty, "Invalid Zip object");
ranges[i].popBack();
}
break;
}
}
}
/**
Returns the length of this range. Defined only if all ranges define
$(D length).
*/
static if (allSatisfy!(hasLength, R))
{
@property auto length()
{
static if (Ranges.length == 1)
return ranges[0].length;
else
{
if (stoppingPolicy == StoppingPolicy.requireSameLength)
return ranges[0].length;
//[min|max](ranges[0].length, ranges[1].length, ...)
import std.algorithm : min, max;
if (stoppingPolicy == StoppingPolicy.shortest)
return mixin(q{min(%(ranges[%s].length%|, %))}.format(iota(0, R.length)));
else
return mixin(q{max(%(ranges[%s].length%|, %))}.format(iota(0, R.length)));
}
}
alias opDollar = length;
}
/**
Returns a slice of the range. Defined only if all range define
slicing.
*/
static if (allSatisfy!(hasSlicing, R))
{
auto opSlice(size_t from, size_t to)
{
//Slicing an infinite range yields the type Take!R
//For finite ranges, the type Take!R aliases to R
alias ZipResult = Zip!(staticMap!(Take, R));
//ZipResult(ranges[0][from .. to], ranges[1][from .. to], ..., stoppingPolicy)
return mixin (q{ZipResult(%(ranges[%s][from .. to]%|, %), stoppingPolicy)}.format(iota(0, R.length)));
}
}
/**
Returns the $(D n)th element in the composite range. Defined if all
ranges offer random access.
*/
static if (allSatisfy!(isRandomAccessRange, R))
{
ElementType opIndex(size_t n)
{
//TODO: Fixme! This may create an out of bounds access
//for StoppingPolicy.longest
//ElementType(ranges[0][n], ranges[1][n], ...)
return mixin (q{ElementType(%(ranges[%s][n]%|, %))}.format(iota(0, R.length)));
}
/**
Assigns to the $(D n)th element in the composite range. Defined if
all ranges offer random access.
*/
static if (allSatisfy!(hasAssignableElements, R))
{
void opIndexAssign(ElementType v, size_t n)
{
//TODO: Fixme! Not sure the call is even legal for StoppingPolicy.longest
foreach (i, Range; R)
{
ranges[i][n] = v[i];
}
}
}
/**
Destructively reads the $(D n)th element in the composite
range. Defined if all ranges offer random access.
*/
static if (allSatisfy!(hasMobileElements, R))
{
ElementType moveAt(size_t n)
{
//TODO: Fixme! This may create an out of bounds access
//for StoppingPolicy.longest
//ElementType(.moveAt(ranges[0], n), .moveAt(ranges[1], n), ..., )
return mixin (q{ElementType(%(.moveAt(ranges[%s], n)%|, %))}.format(iota(0, R.length)));
}
}
}
}
/// Ditto
auto zip(Ranges...)(Ranges ranges)
if (Ranges.length && allSatisfy!(isInputRange, Ranges))
{
return Zip!Ranges(ranges);
}
///
pure unittest
{
import std.algorithm : sort;
int[] a = [ 1, 2, 3 ];
string[] b = [ "a", "b", "c" ];
sort!((c, d) => c[0] > d[0])(zip(a, b));
assert(a == [ 3, 2, 1 ]);
assert(b == [ "c", "b", "a" ]);
}
///
unittest
{
int[] a = [ 1, 2, 3 ];
string[] b = [ "a", "b", "c" ];
size_t idx = 0;
foreach (e; zip(a, b))
{
assert(e[0] == a[idx]);
assert(e[1] == b[idx]);
++idx;
}
}
/// Ditto
auto zip(Ranges...)(StoppingPolicy sp, Ranges ranges)
if (Ranges.length && allSatisfy!(isInputRange, Ranges))
{
return Zip!Ranges(ranges, sp);
}
/**
Dictates how iteration in a $(D Zip) should stop. By default stop at
the end of the shortest of all ranges.
*/
enum StoppingPolicy
{
/// Stop when the shortest range is exhausted
shortest,
/// Stop when the longest range is exhausted
longest,
/// Require that all ranges are equal
requireSameLength,
}
unittest
{
import std.internal.test.dummyrange;
import std.algorithm : swap, sort, filter, equal, map;
import std.exception : assertThrown, assertNotThrown;
import std.typecons : tuple;
int[] a = [ 1, 2, 3 ];
float[] b = [ 1.0, 2.0, 3.0 ];
foreach (e; zip(a, b))
{
assert(e[0] == e[1]);
}
swap(a[0], a[1]);
auto z = zip(a, b);
//swap(z.front(), z.back());
sort!("a[0] < b[0]")(zip(a, b));
assert(a == [1, 2, 3]);
assert(b == [2.0, 1.0, 3.0]);
z = zip(StoppingPolicy.requireSameLength, a, b);
assertNotThrown(z.popBack());
assertNotThrown(z.popBack());
assertNotThrown(z.popBack());
assert(z.empty);
assertThrown(z.popBack());
a = [ 1, 2, 3 ];
b = [ 1.0, 2.0, 3.0 ];
sort!("a[0] > b[0]")(zip(StoppingPolicy.requireSameLength, a, b));
assert(a == [3, 2, 1]);
assert(b == [3.0, 2.0, 1.0]);
a = [];
b = [];
assert(zip(StoppingPolicy.requireSameLength, a, b).empty);
// Test infiniteness propagation.
static assert(isInfinite!(typeof(zip(repeat(1), repeat(1)))));
// Test stopping policies with both value and reference.
auto a1 = [1, 2];
auto a2 = [1, 2, 3];
auto stuff = tuple(tuple(a1, a2),
tuple(filter!"a"(a1), filter!"a"(a2)));
alias FOO = Zip!(immutable(int)[], immutable(float)[]);
foreach(t; stuff.expand) {
auto arr1 = t[0];
auto arr2 = t[1];
auto zShortest = zip(arr1, arr2);
assert(equal(map!"a[0]"(zShortest), [1, 2]));
assert(equal(map!"a[1]"(zShortest), [1, 2]));
try {
auto zSame = zip(StoppingPolicy.requireSameLength, arr1, arr2);
foreach(elem; zSame) {}
assert(0);
} catch (Throwable) { /* It's supposed to throw.*/ }
auto zLongest = zip(StoppingPolicy.longest, arr1, arr2);
assert(!zLongest.ranges[0].empty);
assert(!zLongest.ranges[1].empty);
zLongest.popFront();
zLongest.popFront();
assert(!zLongest.empty);
assert(zLongest.ranges[0].empty);
assert(!zLongest.ranges[1].empty);
zLongest.popFront();
assert(zLongest.empty);
}
// BUG 8900
assert(zip([1, 2], repeat('a')).array == [tuple(1, 'a'), tuple(2, 'a')]);
assert(zip(repeat('a'), [1, 2]).array == [tuple('a', 1), tuple('a', 2)]);
// Doesn't work yet. Issues w/ emplace.
// static assert(is(Zip!(immutable int[], immutable float[])));
// These unittests pass, but make the compiler consume an absurd amount
// of RAM and time. Therefore, they should only be run if explicitly
// uncommented when making changes to Zip. Also, running them using
// make -fwin32.mak unittest makes the compiler completely run out of RAM.
// You need to test just this module.
/+
foreach(DummyType1; AllDummyRanges) {
DummyType1 d1;
foreach(DummyType2; AllDummyRanges) {
DummyType2 d2;
auto r = zip(d1, d2);
assert(equal(map!"a[0]"(r), [1,2,3,4,5,6,7,8,9,10]));
assert(equal(map!"a[1]"(r), [1,2,3,4,5,6,7,8,9,10]));
static if (isForwardRange!DummyType1 && isForwardRange!DummyType2) {
static assert(isForwardRange!(typeof(r)));
}
static if (isBidirectionalRange!DummyType1 &&
isBidirectionalRange!DummyType2) {
static assert(isBidirectionalRange!(typeof(r)));
}
static if (isRandomAccessRange!DummyType1 &&
isRandomAccessRange!DummyType2) {
static assert(isRandomAccessRange!(typeof(r)));
}
}
}
+/
}
pure unittest
{
import std.algorithm : sort;
auto a = [5,4,3,2,1];
auto b = [3,1,2,5,6];
auto z = zip(a, b);
sort!"a[0] < b[0]"(z);
assert(a == [1, 2, 3, 4, 5]);
assert(b == [6, 5, 2, 1, 3]);
}
@safe pure unittest
{
import std.typecons : tuple;
import std.algorithm : equal;
auto LL = iota(1L, 1000L);
auto z = zip(LL, [4]);
assert(equal(z, [tuple(1L,4)]));
auto LL2 = iota(0L, 500L);
auto z2 = zip([7], LL2);
assert(equal(z2, [tuple(7, 0L)]));
}
// Text for Issue 11196
@safe pure unittest
{
import std.exception : assertThrown;
static struct S { @disable this(); }
assert(zip((S[5]).init[]).length == 5);
assert(zip(StoppingPolicy.longest, cast(S[]) null, new int[1]).length == 1);
assertThrown(zip(StoppingPolicy.longest, cast(S[]) null, new int[1]).front);
}
@safe pure unittest //12007
{
static struct R
{
enum empty = false;
void popFront(){}
int front(){return 1;} @property
R save(){return this;} @property
void opAssign(R) @disable;
}
R r;
auto z = zip(r, r);
auto zz = z.save;
}
/*
Generate lockstep's opApply function as a mixin string.
If withIndex is true prepend a size_t index to the delegate.
*/
private string lockstepMixin(Ranges...)(bool withIndex)
{
import std.format : format;
string[] params;
string[] emptyChecks;
string[] dgArgs;
string[] popFronts;
if (withIndex)
{
params ~= "size_t";
dgArgs ~= "index";
}
foreach (idx, Range; Ranges)
{
params ~= format("%sElementType!(Ranges[%s])", hasLvalueElements!Range ? "ref " : "", idx);
emptyChecks ~= format("!ranges[%s].empty", idx);
dgArgs ~= format("ranges[%s].front", idx);
popFronts ~= format("ranges[%s].popFront();", idx);
}
return format(
q{
int opApply(scope int delegate(%s) dg)
{
import std.exception : enforce;
auto ranges = _ranges;
int res;
%s
while (%s)
{
res = dg(%s);
if (res) break;
%s
%s
}
if (_stoppingPolicy == StoppingPolicy.requireSameLength)
{
foreach(range; ranges)
enforce(range.empty);
}
return res;
}
}, params.join(", "), withIndex ? "size_t index = 0;" : "",
emptyChecks.join(" && "), dgArgs.join(", "),
popFronts.join("\n "),
withIndex ? "index++;" : "");
}
/**
Iterate multiple ranges in lockstep using a $(D foreach) loop. If only a single
range is passed in, the $(D Lockstep) aliases itself away. If the
ranges are of different lengths and $(D s) == $(D StoppingPolicy.shortest)
stop after the shortest range is empty. If the ranges are of different
lengths and $(D s) == $(D StoppingPolicy.requireSameLength), throw an
exception. $(D s) may not be $(D StoppingPolicy.longest), and passing this
will throw an exception.
By default $(D StoppingPolicy) is set to $(D StoppingPolicy.shortest).
Lockstep also supports iterating with an index variable:
-------
foreach (index, a, b; lockstep(arr1, arr2))
{
writefln("Index %s: a = %s, b = %s", index, a, b);
}
-------
*/
struct Lockstep(Ranges...)
if (Ranges.length > 1 && allSatisfy!(isInputRange, Ranges))
{
this(R ranges, StoppingPolicy sp = StoppingPolicy.shortest)
{
import std.exception : enforce;
_ranges = ranges;
enforce(sp != StoppingPolicy.longest,
"Can't use StoppingPolicy.Longest on Lockstep.");
_stoppingPolicy = sp;
}
mixin(lockstepMixin!Ranges(false));
mixin(lockstepMixin!Ranges(true));
private:
alias R = Ranges;
R _ranges;
StoppingPolicy _stoppingPolicy;
}
// For generic programming, make sure Lockstep!(Range) is well defined for a
// single range.
template Lockstep(Range)
{
alias Lockstep = Range;
}
/// Ditto
Lockstep!(Ranges) lockstep(Ranges...)(Ranges ranges)
if (allSatisfy!(isInputRange, Ranges))
{
return Lockstep!(Ranges)(ranges);
}
/// Ditto
Lockstep!(Ranges) lockstep(Ranges...)(Ranges ranges, StoppingPolicy s)
if (allSatisfy!(isInputRange, Ranges))
{
static if (Ranges.length > 1)
return Lockstep!Ranges(ranges, s);
else
return ranges[0];
}
///
unittest
{
auto arr1 = [1,2,3,4,5];
auto arr2 = [6,7,8,9,10];
foreach (ref a, ref b; lockstep(arr1, arr2))
{
a += b;
}
assert(arr1 == [7,9,11,13,15]);
}
unittest
{
import std.conv : to;
import std.algorithm : filter;
// The filters are to make these the lowest common forward denominator ranges,
// i.e. w/o ref return, random access, length, etc.
auto foo = filter!"a"([1,2,3,4,5]);
immutable bar = [6f,7f,8f,9f,10f].idup;
auto l = lockstep(foo, bar);
// Should work twice. These are forward ranges with implicit save.
foreach(i; 0..2)
{
uint[] res1;
float[] res2;
foreach(a, ref b; l) {
res1 ~= a;
res2 ~= b;
}
assert(res1 == [1,2,3,4,5]);
assert(res2 == [6,7,8,9,10]);
assert(bar == [6f,7f,8f,9f,10f]);
}
// Doc example.
auto arr1 = [1,2,3,4,5];
auto arr2 = [6,7,8,9,10];
foreach(ref a, ref b; lockstep(arr1, arr2))
{
a += b;
}
assert(arr1 == [7,9,11,13,15]);
// Make sure StoppingPolicy.requireSameLength doesn't throw.
auto ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength);
foreach(a, b; ls) {}
// Make sure StoppingPolicy.requireSameLength throws.
arr2.popBack();
ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength);
try {
foreach(a, b; ls) {}
assert(0);
} catch (Exception) {}
// Just make sure 1-range case instantiates. This hangs the compiler
// when no explicit stopping policy is specified due to Bug 4652.
auto stuff = lockstep([1,2,3,4,5], StoppingPolicy.shortest);
// Test with indexing.
uint[] res1;
float[] res2;
size_t[] indices;
foreach(i, a, b; lockstep(foo, bar))
{
indices ~= i;
res1 ~= a;
res2 ~= b;
}
assert(indices == to!(size_t[])([0, 1, 2, 3, 4]));
assert(res1 == [1,2,3,4,5]);
assert(res2 == [6f,7f,8f,9f,10f]);
// Make sure we've worked around the relevant compiler bugs and this at least
// compiles w/ >2 ranges.
lockstep(foo, foo, foo);
// Make sure it works with const.
const(int[])[] foo2 = [[1, 2, 3]];
const(int[])[] bar2 = [[4, 5, 6]];
auto c = chain(foo2, bar2);
foreach(f, b; lockstep(c, c)) {}
// Regression 10468
foreach (x, y; lockstep(iota(0, 10), iota(0, 10))) { }
}
unittest
{
struct RvalueRange
{
int[] impl;
@property bool empty() { return impl.empty; }
@property int front() { return impl[0]; } // N.B. non-ref
void popFront() { impl.popFront(); }
}
auto data1 = [ 1, 2, 3, 4 ];
auto data2 = [ 5, 6, 7, 8 ];
auto r1 = RvalueRange(data1);
auto r2 = data2;
foreach (a, ref b; lockstep(r1, r2))
{
a++;
b++;
}
assert(data1 == [ 1, 2, 3, 4 ]); // changes to a do not propagate to data
assert(data2 == [ 6, 7, 8, 9 ]); // but changes to b do.
// Since r1 is by-value only, the compiler should reject attempts to
// foreach over it with ref.
static assert(!__traits(compiles, {
foreach (ref a, ref b; lockstep(r1, r2)) { a++; }
}));
}
/**
Creates a mathematical sequence given the initial values and a
recurrence function that computes the next value from the existing
values. The sequence comes in the form of an infinite forward
range. The type $(D Recurrence) itself is seldom used directly; most
often, recurrences are obtained by calling the function $(D
recurrence).
When calling $(D recurrence), the function that computes the next
value is specified as a template argument, and the initial values in
the recurrence are passed as regular arguments. For example, in a
Fibonacci sequence, there are two initial values (and therefore a
state size of 2) because computing the next Fibonacci value needs the
past two values.
The signature of this function should be:
----
auto fun(R)(R state, size_t n)
----
where $(D n) will be the index of the current value, and $(D state) will be an
opaque state vector that can be indexed with array-indexing notation
$(D state[i]), where valid values of $(D i) range from $(D (n - 1)) to
$(D (n - State.length)).
If the function is passed in string form, the state has name $(D "a")
and the zero-based index in the recurrence has name $(D "n"). The
given string must return the desired value for $(D a[n]) given $(D a[n
- 1]), $(D a[n - 2]), $(D a[n - 3]),..., $(D a[n - stateSize]). The
state size is dictated by the number of arguments passed to the call
to $(D recurrence). The $(D Recurrence) struct itself takes care of
managing the recurrence's state and shifting it appropriately.
*/
struct Recurrence(alias fun, StateType, size_t stateSize)
{
private import std.functional : binaryFun;
StateType[stateSize] _state;
size_t _n;
this(StateType[stateSize] initial) { _state = initial; }
void popFront()
{
static auto trustedCycle(ref typeof(_state) s) @trusted
{
return cycle(s);
}
// The cast here is reasonable because fun may cause integer
// promotion, but needs to return a StateType to make its operation
// closed. Therefore, we have no other choice.
_state[_n % stateSize] = cast(StateType) binaryFun!(fun, "a", "n")(
trustedCycle(_state), _n + stateSize);
++_n;
}
@property StateType front()
{
return _state[_n % stateSize];
}
@property typeof(this) save()
{
return this;
}
enum bool empty = false;
}
///
@safe unittest
{
import std.algorithm : equal;
// The Fibonacci numbers, using function in string form:
// a[0] = 1, a[1] = 1, and compute a[n+1] = a[n-1] + a[n]
auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1);
assert(fib.take(10).equal([1, 1, 2, 3, 5, 8, 13, 21, 34, 55]));
// The factorials, using function in lambda form:
auto fac = recurrence!((a,n) => a[n-1] * n)(1);
assert(take(fac, 10).equal([
1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880
]));
// The triangular numbers, using function in explicit form:
static size_t genTriangular(R)(R state, size_t n)
{
return state[n-1] + n;
}
auto tri = recurrence!genTriangular(0);
assert(take(tri, 10).equal([0, 1, 3, 6, 10, 15, 21, 28, 36, 45]));
}
/// Ditto
Recurrence!(fun, CommonType!(State), State.length)
recurrence(alias fun, State...)(State initial)
{
CommonType!(State)[State.length] state;
foreach (i, Unused; State)
{
state[i] = initial[i];
}
return typeof(return)(state);
}
@safe unittest
{
import std.algorithm : equal;
auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1);
static assert(isForwardRange!(typeof(fib)));
int[] witness = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55 ];
assert(equal(take(fib, 10), witness));
foreach (e; take(fib, 10)) {}
auto fact = recurrence!("n * a[n-1]")(1);
assert( equal(take(fact, 10), [1, 1, 2, 2*3, 2*3*4, 2*3*4*5, 2*3*4*5*6,
2*3*4*5*6*7, 2*3*4*5*6*7*8, 2*3*4*5*6*7*8*9][]) );
auto piapprox = recurrence!("a[n] + (n & 1 ? 4.0 : -4.0) / (2 * n + 3)")(4.0);
foreach (e; take(piapprox, 20)) {}
// Thanks to yebblies for this test and the associated fix
auto r = recurrence!"a[n-2]"(1, 2);
witness = [1, 2, 1, 2, 1];
assert(equal(take(r, 5), witness));
}
/**
$(D Sequence) is similar to $(D Recurrence) except that iteration is
presented in the so-called $(WEB en.wikipedia.org/wiki/Closed_form,
closed form). This means that the $(D n)th element in the series is
computable directly from the initial values and $(D n) itself. This
implies that the interface offered by $(D Sequence) is a random-access
range, as opposed to the regular $(D Recurrence), which only offers
forward iteration.
The state of the sequence is stored as a $(D Tuple) so it can be
heterogeneous.
*/
struct Sequence(alias fun, State)
{
private:
import std.functional : binaryFun;
alias compute = binaryFun!(fun, "a", "n");
alias ElementType = typeof(compute(State.init, cast(size_t) 1));
State _state;
size_t _n;
static struct DollarToken{}
public:
this(State initial, size_t n = 0)
{
_state = initial;
_n = n;
}
@property ElementType front()
{
return compute(_state, _n);
}
void popFront()
{
++_n;
}
enum opDollar = DollarToken();
auto opSlice(size_t lower, size_t upper)
in
{
assert(upper >= lower);
}
body
{
return typeof(this)(_state, _n + lower).take(upper - lower);
}
auto opSlice(size_t lower, DollarToken)
{
return typeof(this)(_state, _n + lower);
}
ElementType opIndex(size_t n)
{
return compute(_state, n + _n);
}
enum bool empty = false;
@property Sequence save() { return this; }
}
/// Ditto
auto sequence(alias fun, State...)(State args)
{
import std.typecons : Tuple, tuple;
alias Return = Sequence!(fun, Tuple!State);
return Return(tuple(args));
}
/// Odd numbers, using function in string form:
@safe unittest
{
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
assert(odds.front == 1);
odds.popFront();
assert(odds.front == 3);
odds.popFront();
assert(odds.front == 5);
}
/// Triangular numbers, using function in lambda form:
@safe unittest
{
auto tri = sequence!((a,n) => n*(n+1)/2)();
// Note random access
assert(tri[0] == 0);
assert(tri[3] == 6);
assert(tri[1] == 1);
assert(tri[4] == 10);
assert(tri[2] == 3);
}
/// Fibonacci numbers, using function in explicit form:
@safe unittest
{
import std.math : pow, round, sqrt;
static ulong computeFib(S)(S state, size_t n)
{
// Binet's formula
return cast(ulong)(round((pow(state[0], n+1) - pow(state[1], n+1)) /
state[2]));
}
auto fib = sequence!computeFib(
(1.0 + sqrt(5.0)) / 2.0, // Golden Ratio
(1.0 - sqrt(5.0)) / 2.0, // Conjugate of Golden Ratio
sqrt(5.0));
// Note random access with [] operator
assert(fib[1] == 1);
assert(fib[4] == 5);
assert(fib[3] == 3);
assert(fib[2] == 2);
assert(fib[9] == 55);
}
@safe unittest
{
import std.typecons : Tuple, tuple;
auto y = Sequence!("a[0] + n * a[1]", Tuple!(int, int))(tuple(0, 4));
static assert(isForwardRange!(typeof(y)));
//@@BUG
//auto y = sequence!("a[0] + n * a[1]")(0, 4);
//foreach (e; take(y, 15))
{} //writeln(e);
auto odds = Sequence!("a[0] + n * a[1]", Tuple!(int, int))(
tuple(1, 2));
for(int currentOdd = 1; currentOdd <= 21; currentOdd += 2) {
assert(odds.front == odds[0]);
assert(odds[0] == currentOdd);
odds.popFront();
}
}
@safe unittest
{
import std.algorithm : equal;
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
static assert(hasSlicing!(typeof(odds)));
//Note: don't use drop or take as the target of an equal,
//since they'll both just forward to opSlice, making the tests irrelevant
// static slicing tests
assert(equal(odds[0 .. 5], [1, 3, 5, 7, 9]));
assert(equal(odds[3 .. 7], [7, 9, 11, 13]));
// relative slicing test, testing slicing is NOT agnostic of state
auto odds_less5 = odds.drop(5); //this should actually call odds[5 .. $]
assert(equal(odds_less5[0 .. 3], [11, 13, 15]));
assert(equal(odds_less5[0 .. 10], odds[5 .. 15]));
//Infinite slicing tests
odds = odds[10 .. $];
assert(equal(odds.take(3), [21, 23, 25]));
}
// Issue 5036
unittest
{
auto s = sequence!((a, n) => new int)(0);
assert(s.front != s.front); // no caching
}
/**
Construct a range of values that span the given starting and stopping
values.
Params:
begin = The starting value.
end = The value that serves as the stopping criterion. This value is not
included in the range.
step = The value to add to the current value at each iteration.
Returns:
A range that goes through the numbers $(D begin), $(D begin + step),
$(D begin + 2 * step), $(D ...), up to and excluding $(D end).
The two-argument overloads have $(D step = 1). If $(D begin < end && step <
0) or $(D begin > end && step > 0) or $(D begin == end), then an empty range
is returned. If $(D step == 0) then $(D begin == end) is an error.
For built-in types, the range returned is a random access range. For
user-defined types that support $(D ++), the range is an input
range.
Example:
---
void main()
{
import std.stdio;
// The following groups all produce the same output of:
// 0 1 2 3 4
foreach (i; 0..5)
writef("%s ", i);
writeln();
import std.range : iota;
foreach (i; iota(0, 5))
writef("%s ", i);
writeln();
writefln("%(%s %|%)", iota(0, 5));
import std.algorithm : map, copy;
import std.format;
iota(0, 5).map!(i => format("%s ", i)).copy(stdout.lockingTextWriter());
writeln();
}
---
*/
auto iota(B, E, S)(B begin, E end, S step)
if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E)))
&& isIntegral!S)
in
{
assert(!(step == 0 && begin != end));
}
body
{
import std.conv : unsigned;
alias Value = CommonType!(Unqual!B, Unqual!E);
alias StepType = Unqual!S;
alias IndexType = typeof(unsigned((end - begin) / step));
static struct Result
{
private Value current, pastLast;
private StepType step;
this(Value current, Value pastLast, StepType step)
{
if ((current < pastLast && step >= 0) ||
(current > pastLast && step <= 0))
{
this.step = step;
this.current = current;
if (step > 0)
{
this.pastLast = pastLast - 1;
this.pastLast -= (this.pastLast - current) % step;
}
else
{
this.pastLast = pastLast + 1;
this.pastLast += (current - this.pastLast) % -step;
}
this.pastLast += step;
}
else
{
// Initialize an empty range
this.current = this.pastLast = current;
this.step = 1;
}
}
@property bool empty() const { return current == pastLast; }
@property inout(Value) front() inout { assert(!empty); return current; }
void popFront() { assert(!empty); current += step; }
@property inout(Value) back() inout { assert(!empty); return pastLast - step; }
void popBack() { assert(!empty); pastLast -= step; }
@property auto save() { return this; }
inout(Value) opIndex(ulong n) inout
{
assert(n < this.length);
// Just cast to Value here because doing so gives overflow behavior
// consistent with calling popFront() n times.
return cast(inout Value) (current + step * n);
}
inout(Result) opSlice() inout { return this; }
inout(Result) opSlice(ulong lower, ulong upper) inout
{
assert(upper >= lower && upper <= this.length);
return cast(inout Result)Result(cast(Value)(current + lower * step),
cast(Value)(pastLast - (length - upper) * step),
step);
}
@property IndexType length() const
{
if (step > 0)
{
return unsigned((pastLast - current) / step);
}
else
{
return unsigned((current - pastLast) / -step);
}
}
alias opDollar = length;
}
return Result(begin, end, step);
}
/// Ditto
auto iota(B, E)(B begin, E end)
if (isFloatingPoint!(CommonType!(B, E)))
{
return iota(begin, end, CommonType!(B, E)(1));
}
/// Ditto
auto iota(B, E)(B begin, E end)
if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E)))
{
import std.conv : unsigned;
alias Value = CommonType!(Unqual!B, Unqual!E);
alias IndexType = typeof(unsigned(end - begin));
static struct Result
{
private Value current, pastLast;
this(Value current, Value pastLast)
{
if (current < pastLast)
{
this.current = current;
this.pastLast = pastLast;
}
else
{
// Initialize an empty range
this.current = this.pastLast = current;
}
}
@property bool empty() const { return current == pastLast; }
@property inout(Value) front() inout { assert(!empty); return current; }
void popFront() { assert(!empty); ++current; }
@property inout(Value) back() inout { assert(!empty); return cast(inout(Value))(pastLast - 1); }
void popBack() { assert(!empty); --pastLast; }
@property auto save() { return this; }
inout(Value) opIndex(ulong n) inout
{
assert(n < this.length);
// Just cast to Value here because doing so gives overflow behavior
// consistent with calling popFront() n times.
return cast(inout Value) (current + n);
}
inout(Result) opSlice() inout { return this; }
inout(Result) opSlice(ulong lower, ulong upper) inout
{
assert(upper >= lower && upper <= this.length);
return cast(inout Result)Result(cast(Value)(current + lower),
cast(Value)(pastLast - (length - upper)));
}
@property IndexType length() const
{
return unsigned(pastLast - current);
}
alias opDollar = length;
}
return Result(begin, end);
}
/// Ditto
auto iota(E)(E end)
{
E begin = 0;
return iota(begin, end);
}
/// Ditto
// Specialization for floating-point types
auto iota(B, E, S)(B begin, E end, S step)
if (isFloatingPoint!(CommonType!(B, E, S)))
in
{
assert(step != 0, "iota: step must not be 0");
assert((end - begin) / step >= 0, "iota: incorrect startup parameters");
}
body
{
alias Value = Unqual!(CommonType!(B, E, S));
static struct Result
{
private Value start, step;
private size_t index, count;
this(Value start, Value end, Value step)
{
import std.conv : to;
this.start = start;
this.step = step;
immutable fcount = (end - start) / step;
count = to!size_t(fcount);
auto pastEnd = start + count * step;
if (step > 0)
{
if (pastEnd < end) ++count;
assert(start + count * step >= end);
}
else
{
if (pastEnd > end) ++count;
assert(start + count * step <= end);
}
}
@property bool empty() const { return index == count; }
@property Value front() const { assert(!empty); return start + step * index; }
void popFront()
{
assert(!empty);
++index;
}
@property Value back() const
{
assert(!empty);
return start + step * (count - 1);
}
void popBack()
{
assert(!empty);
--count;
}
@property auto save() { return this; }
Value opIndex(size_t n) const
{
assert(n < count);
return start + step * (n + index);
}
inout(Result) opSlice() inout
{
return this;
}
inout(Result) opSlice(size_t lower, size_t upper) inout
{
assert(upper >= lower && upper <= count);
Result ret = this;
ret.index += lower;
ret.count = upper - lower + ret.index;
return cast(inout Result)ret;
}
@property size_t length() const
{
return count - index;
}
alias opDollar = length;
}
return Result(begin, end, step);
}
///
@safe unittest
{
import std.algorithm : equal;
import std.math : approxEqual;
auto r = iota(0, 10, 1);
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
r = iota(0, 11, 3);
assert(equal(r, [0, 3, 6, 9][]));
assert(r[2] == 6);
auto rf = iota(0.0, 0.5, 0.1);
assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4]));
}
nothrow @nogc unittest
{
auto t0 = iota(0, 10);
auto t1 = iota(0, 10, 2);
auto t2 = iota(1, 1, 0);
//float overloads use std.conv.to so can't be @nogc or nothrow
}
debug unittest
{//check the contracts
import std.exception : assertThrown;
import core.exception : AssertError;
assertThrown!AssertError(iota(1,2,0));
assertThrown!AssertError(iota(0f,1f,0f));
assertThrown!AssertError(iota(1f,0f,0.1f));
assertThrown!AssertError(iota(0f,1f,-0.1f));
}
unittest
{
int[] a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
auto r1 = iota(a.ptr, a.ptr + a.length, 1);
assert(r1.front == a.ptr);
assert(r1.back == a.ptr + a.length - 1);
}
@safe unittest
{
import std.math : approxEqual, nextUp, nextDown;
import std.algorithm : count, equal;
static assert(is(ElementType!(typeof(iota(0f))) == float));
static assert(hasLength!(typeof(iota(0, 2))));
auto r = iota(0, 10, 1);
assert(r[$ - 1] == 9);
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
auto rSlice = r[2..8];
assert(equal(rSlice, [2, 3, 4, 5, 6, 7]));
rSlice.popFront();
assert(rSlice[0] == rSlice.front);
assert(rSlice.front == 3);
rSlice.popBack();
assert(rSlice[rSlice.length - 1] == rSlice.back);
assert(rSlice.back == 6);
rSlice = r[0..4];
assert(equal(rSlice, [0, 1, 2, 3]));
auto rr = iota(10);
assert(equal(rr, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
r = iota(0, -10, -1);
assert(equal(r, [0, -1, -2, -3, -4, -5, -6, -7, -8, -9][]));
rSlice = r[3..9];
assert(equal(rSlice, [-3, -4, -5, -6, -7, -8]));
r = iota(0, -6, -3);
assert(equal(r, [0, -3][]));
rSlice = r[1..2];
assert(equal(rSlice, [-3]));
r = iota(0, -7, -3);
assert(equal(r, [0, -3, -6][]));
rSlice = r[1..3];
assert(equal(rSlice, [-3, -6]));
r = iota(0, 11, 3);
assert(equal(r, [0, 3, 6, 9][]));
assert(r[2] == 6);
rSlice = r[1..3];
assert(equal(rSlice, [3, 6]));
auto rf = iota(0.0, 0.5, 0.1);
assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4][]));
assert(rf.length == 5);
rf.popFront();
assert(rf.length == 4);
auto rfSlice = rf[1..4];
assert(rfSlice.length == 3);
assert(approxEqual(rfSlice, [0.2, 0.3, 0.4]));
rfSlice.popFront();
assert(approxEqual(rfSlice[0], 0.3));
rf.popFront();
assert(rf.length == 3);
rfSlice = rf[1..3];
assert(rfSlice.length == 2);
assert(approxEqual(rfSlice, [0.3, 0.4]));
assert(approxEqual(rfSlice[0], 0.3));
// With something just above 0.5
rf = iota(0.0, nextUp(0.5), 0.1);
assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4, 0.5][]));
rf.popBack();
assert(rf[rf.length - 1] == rf.back);
assert(approxEqual(rf.back, 0.4));
assert(rf.length == 5);
// going down
rf = iota(0.0, -0.5, -0.1);
assert(approxEqual(rf, [0.0, -0.1, -0.2, -0.3, -0.4][]));
rfSlice = rf[2..5];
assert(approxEqual(rfSlice, [-0.2, -0.3, -0.4]));
rf = iota(0.0, nextDown(-0.5), -0.1);
assert(approxEqual(rf, [0.0, -0.1, -0.2, -0.3, -0.4, -0.5][]));
// iota of longs
auto rl = iota(5_000_000L);
assert(rl.length == 5_000_000L);
// iota of longs with steps
auto iota_of_longs_with_steps = iota(50L, 101L, 10);
assert(iota_of_longs_with_steps.length == 6);
assert(equal(iota_of_longs_with_steps, [50L, 60L, 70L, 80L, 90L, 100L]));
// iota of unsigned zero length (issue 6222, actually trying to consume it
// is the only way to find something is wrong because the public
// properties are all correct)
auto iota_zero_unsigned = iota(0, 0u, 3);
assert(count(iota_zero_unsigned) == 0);
// unsigned reverse iota can be buggy if .length doesn't take them into
// account (issue 7982).
assert(iota(10u, 0u, -1).length == 10);
assert(iota(10u, 0u, -2).length == 5);
assert(iota(uint.max, uint.max-10, -1).length == 10);
assert(iota(uint.max, uint.max-10, -2).length == 5);
assert(iota(uint.max, 0u, -1).length == uint.max);
// Issue 8920
foreach (Type; AliasSeq!(byte, ubyte, short, ushort,
int, uint, long, ulong))
{
Type val;
foreach (i; iota(cast(Type)0, cast(Type)10)) { val++; }
assert(val == 10);
}
}
@safe unittest
{
import std.algorithm : copy;
auto idx = new size_t[100];
copy(iota(0, idx.length), idx);
}
@safe unittest
{
foreach(range; AliasSeq!(iota(2, 27, 4),
iota(3, 9),
iota(2.7, 12.3, .1),
iota(3.2, 9.7)))
{
const cRange = range;
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}
}
unittest
{
//The ptr stuff can't be done at compile time, so we unfortunately end
//up with some code duplication here.
auto arr = [0, 5, 3, 5, 5, 7, 9, 2, 0, 42, 7, 6];
{
const cRange = iota(arr.ptr, arr.ptr + arr.length, 3);
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}
{
const cRange = iota(arr.ptr, arr.ptr + arr.length);
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}
}
/* Generic overload that handles arbitrary types that support arithmetic
* operations.
*/
/// ditto
auto iota(B, E)(B begin, E end)
if (!isIntegral!(CommonType!(B, E)) &&
!isFloatingPoint!(CommonType!(B, E)) &&
!isPointer!(CommonType!(B, E)) &&
is(typeof((ref B b) { ++b; })) &&
(is(typeof(B.init < E.init)) || is(typeof(B.init == E.init))) )
{
static struct Result
{
B current;
E end;
@property bool empty()
{
static if (is(typeof(B.init < E.init)))
return !(current < end);
else static if (is(typeof(B.init != E.init)))
return current == end;
else
static assert(0);
}
@property auto front() { return current; }
void popFront()
{
assert(!empty);
++current;
}
}
return Result(begin, end);
}
/**
User-defined types such as $(XREF bigint, BigInt) are also supported, as long
as they can be incremented with $(D ++) and compared with $(D <) or $(D ==).
*/
// Issue 6447
unittest
{
import std.algorithm.comparison : equal;
import std.bigint;
auto s = BigInt(1_000_000_000_000);
auto e = BigInt(1_000_000_000_003);
auto r = iota(s, e);
assert(r.equal([
BigInt(1_000_000_000_000),
BigInt(1_000_000_000_001),
BigInt(1_000_000_000_002)
]));
}
unittest
{
import std.algorithm.comparison : equal;
// Test iota() for a type that only supports ++ and != but does not have
// '<'-ordering.
struct Cyclic(int wrapAround)
{
int current;
this(int start) { current = start % wrapAround; }
bool opEquals(Cyclic c) { return current == c.current; }
bool opEquals(int i) { return current == i; }
void opUnary(string op)() if (op == "++")
{
current = (current + 1) % wrapAround;
}
}
alias Cycle5 = Cyclic!5;
// Easy case
auto i1 = iota(Cycle5(1), Cycle5(4));
assert(i1.equal([1, 2, 3]));
// Wraparound case
auto i2 = iota(Cycle5(3), Cycle5(2));
assert(i2.equal([3, 4, 0, 1 ]));
}
/**
Options for the $(LREF FrontTransversal) and $(LREF Transversal) ranges
(below).
*/
enum TransverseOptions
{
/**
When transversed, the elements of a range of ranges are assumed to
have different lengths (e.g. a jagged array).
*/
assumeJagged, //default
/**
The transversal enforces that the elements of a range of ranges have
all the same length (e.g. an array of arrays, all having the same
length). Checking is done once upon construction of the transversal
range.
*/
enforceNotJagged,
/**
The transversal assumes, without verifying, that the elements of a
range of ranges have all the same length. This option is useful if
checking was already done from the outside of the range.
*/
assumeNotJagged,
}
/**
Given a range of ranges, iterate transversally through the first
elements of each of the enclosed ranges.
*/
struct FrontTransversal(Ror,
TransverseOptions opt = TransverseOptions.assumeJagged)
{
alias RangeOfRanges = Unqual!(Ror);
alias RangeType = .ElementType!RangeOfRanges;
alias ElementType = .ElementType!RangeType;
private void prime()
{
static if (opt == TransverseOptions.assumeJagged)
{
while (!_input.empty && _input.front.empty)
{
_input.popFront();
}
static if (isBidirectionalRange!RangeOfRanges)
{
while (!_input.empty && _input.back.empty)
{
_input.popBack();
}
}
}
}
/**
Construction from an input.
*/
this(RangeOfRanges input)
{
_input = input;
prime();
static if (opt == TransverseOptions.enforceNotJagged)
// (isRandomAccessRange!RangeOfRanges
// && hasLength!RangeType)
{
import std.exception : enforce;
if (empty) return;
immutable commonLength = _input.front.length;
foreach (e; _input)
{
enforce(e.length == commonLength);
}
}
}
/**
Forward range primitives.
*/
static if (isInfinite!RangeOfRanges)
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return _input.empty;
}
}
/// Ditto
@property auto ref front()
{
assert(!empty);
return _input.front.front;
}
/// Ditto
static if (hasMobileElements!RangeType)
{
ElementType moveFront()
{
return .moveFront(_input.front);
}
}
static if (hasAssignableElements!RangeType)
{
@property auto front(ElementType val)
{
_input.front.front = val;
}
}
/// Ditto
void popFront()
{
assert(!empty);
_input.popFront();
prime();
}
/**
Duplicates this $(D frontTransversal). Note that only the encapsulating
range of range will be duplicated. Underlying ranges will not be
duplicated.
*/
static if (isForwardRange!RangeOfRanges)
{
@property FrontTransversal save()
{
return FrontTransversal(_input.save);
}
}
static if (isBidirectionalRange!RangeOfRanges)
{
/**
Bidirectional primitives. They are offered if $(D
isBidirectionalRange!RangeOfRanges).
*/
@property auto ref back()
{
assert(!empty);
return _input.back.front;
}
/// Ditto
void popBack()
{
assert(!empty);
_input.popBack();
prime();
}
/// Ditto
static if (hasMobileElements!RangeType)
{
ElementType moveBack()
{
return .moveFront(_input.back);
}
}
static if (hasAssignableElements!RangeType)
{
@property auto back(ElementType val)
{
_input.back.front = val;
}
}
}
static if (isRandomAccessRange!RangeOfRanges &&
(opt == TransverseOptions.assumeNotJagged ||
opt == TransverseOptions.enforceNotJagged))
{
/**
Random-access primitive. It is offered if $(D
isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions.assumeNotJagged || opt ==
TransverseOptions.enforceNotJagged)).
*/
auto ref opIndex(size_t n)
{
return _input[n].front;
}
/// Ditto
static if (hasMobileElements!RangeType)
{
ElementType moveAt(size_t n)
{
return .moveFront(_input[n]);
}
}
/// Ditto
static if (hasAssignableElements!RangeType)
{
void opIndexAssign(ElementType val, size_t n)
{
_input[n].front = val;
}
}
/**
Slicing if offered if $(D RangeOfRanges) supports slicing and all the
conditions for supporting indexing are met.
*/
static if (hasSlicing!RangeOfRanges)
{
typeof(this) opSlice(size_t lower, size_t upper)
{
return typeof(this)(_input[lower..upper]);
}
}
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
}
/// Ditto
FrontTransversal!(RangeOfRanges, opt) frontTransversal(
TransverseOptions opt = TransverseOptions.assumeJagged,
RangeOfRanges)
(RangeOfRanges rr)
{
return typeof(return)(rr);
}
///
@safe unittest
{
import std.algorithm : equal;
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto ror = frontTransversal(x);
assert(equal(ror, [ 1, 3 ][]));
}
@safe unittest
{
import std.internal.test.dummyrange;
import std.algorithm : equal;
static assert(is(FrontTransversal!(immutable int[][])));
foreach(DummyType; AllDummyRanges) {
auto dummies =
[DummyType.init, DummyType.init, DummyType.init, DummyType.init];
foreach(i, ref elem; dummies) {
// Just violate the DummyRange abstraction to get what I want.
elem.arr = elem.arr[i..$ - (3 - i)];
}
auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(dummies);
static if (isForwardRange!DummyType) {
static assert(isForwardRange!(typeof(ft)));
}
assert(equal(ft, [1, 2, 3, 4]));
// Test slicing.
assert(equal(ft[0..2], [1, 2]));
assert(equal(ft[1..3], [2, 3]));
assert(ft.front == ft.moveFront());
assert(ft.back == ft.moveBack());
assert(ft.moveAt(1) == ft[1]);
// Test infiniteness propagation.
static assert(isInfinite!(typeof(frontTransversal(repeat("foo")))));
static if (DummyType.r == ReturnBy.Reference) {
{
ft.front++;
scope(exit) ft.front--;
assert(dummies.front.front == 2);
}
{
ft.front = 5;
scope(exit) ft.front = 1;
assert(dummies[0].front == 5);
}
{
ft.back = 88;
scope(exit) ft.back = 4;
assert(dummies.back.front == 88);
}
{
ft[1] = 99;
scope(exit) ft[1] = 2;
assert(dummies[1].front == 99);
}
}
}
}
/**
Given a range of ranges, iterate transversally through the the $(D
n)th element of each of the enclosed ranges. All elements of the
enclosing range must offer random access.
*/
struct Transversal(Ror,
TransverseOptions opt = TransverseOptions.assumeJagged)
{
private alias RangeOfRanges = Unqual!Ror;
private alias InnerRange = ElementType!RangeOfRanges;
private alias E = ElementType!InnerRange;
private void prime()
{
static if (opt == TransverseOptions.assumeJagged)
{
while (!_input.empty && _input.front.length <= _n)
{
_input.popFront();
}
static if (isBidirectionalRange!RangeOfRanges)
{
while (!_input.empty && _input.back.length <= _n)
{
_input.popBack();
}
}
}
}
/**
Construction from an input and an index.
*/
this(RangeOfRanges input, size_t n)
{
_input = input;
_n = n;
prime();
static if (opt == TransverseOptions.enforceNotJagged)
{
import std.exception : enforce;
if (empty) return;
immutable commonLength = _input.front.length;
foreach (e; _input)
{
enforce(e.length == commonLength);
}
}
}
/**
Forward range primitives.
*/
static if (isInfinite!(RangeOfRanges))
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return _input.empty;
}
}
/// Ditto
@property auto ref front()
{
assert(!empty);
return _input.front[_n];
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveFront()
{
return .moveAt(_input.front, _n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
@property auto front(E val)
{
_input.front[_n] = val;
}
}
/// Ditto
void popFront()
{
assert(!empty);
_input.popFront();
prime();
}
/// Ditto
static if (isForwardRange!RangeOfRanges)
{
@property typeof(this) save()
{
auto ret = this;
ret._input = _input.save;
return ret;
}
}
static if (isBidirectionalRange!RangeOfRanges)
{
/**
Bidirectional primitives. They are offered if $(D
isBidirectionalRange!RangeOfRanges).
*/
@property auto ref back()
{
return _input.back[_n];
}
/// Ditto
void popBack()
{
assert(!empty);
_input.popBack();
prime();
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveBack()
{
return .moveAt(_input.back, _n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
@property auto back(E val)
{
_input.back[_n] = val;
}
}
}
static if (isRandomAccessRange!RangeOfRanges &&
(opt == TransverseOptions.assumeNotJagged ||
opt == TransverseOptions.enforceNotJagged))
{
/**
Random-access primitive. It is offered if $(D
isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions.assumeNotJagged || opt ==
TransverseOptions.enforceNotJagged)).
*/
auto ref opIndex(size_t n)
{
return _input[n][_n];
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveAt(size_t n)
{
return .moveAt(_input[n], _n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
void opIndexAssign(E val, size_t n)
{
_input[n][_n] = val;
}
}
/// Ditto
static if(hasLength!RangeOfRanges)
{
@property size_t length()
{
return _input.length;
}
alias opDollar = length;
}
/**
Slicing if offered if $(D RangeOfRanges) supports slicing and all the
conditions for supporting indexing are met.
*/
static if (hasSlicing!RangeOfRanges)
{
typeof(this) opSlice(size_t lower, size_t upper)
{
return typeof(this)(_input[lower..upper], _n);
}
}
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
size_t _n;
}
/// Ditto
Transversal!(RangeOfRanges, opt) transversal
(TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges)
(RangeOfRanges rr, size_t n)
{
return typeof(return)(rr, n);
}
///
@safe unittest
{
import std.algorithm : equal;
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto ror = transversal(x, 1);
assert(equal(ror, [ 2, 4 ][]));
}
@safe unittest
{
import std.internal.test.dummyrange;
int[][] x = new int[][2];
x[0] = [ 1, 2 ];
x[1] = [3, 4];
auto ror = transversal!(TransverseOptions.assumeNotJagged)(x, 1);
auto witness = [ 2, 4 ];
uint i;
foreach (e; ror) assert(e == witness[i++]);
assert(i == 2);
assert(ror.length == 2);
static assert(is(Transversal!(immutable int[][])));
// Make sure ref, assign is being propagated.
{
ror.front++;
scope(exit) ror.front--;
assert(x[0][1] == 3);
}
{
ror.front = 5;
scope(exit) ror.front = 2;
assert(x[0][1] == 5);
assert(ror.moveFront() == 5);
}
{
ror.back = 999;
scope(exit) ror.back = 4;
assert(x[1][1] == 999);
assert(ror.moveBack() == 999);
}
{
ror[0] = 999;
scope(exit) ror[0] = 2;
assert(x[0][1] == 999);
assert(ror.moveAt(0) == 999);
}
// Test w/o ref return.
alias D = DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random);
auto drs = [D.init, D.init];
foreach(num; 0..10) {
auto t = transversal!(TransverseOptions.enforceNotJagged)(drs, num);
assert(t[0] == t[1]);
assert(t[1] == num + 1);
}
static assert(isInfinite!(typeof(transversal(repeat([1,2,3]), 1))));
// Test slicing.
auto mat = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]];
auto mat1 = transversal!(TransverseOptions.assumeNotJagged)(mat, 1)[1..3];
assert(mat1[0] == 6);
assert(mat1[1] == 10);
}
struct Transposed(RangeOfRanges)
if (isForwardRange!RangeOfRanges &&
isInputRange!(ElementType!RangeOfRanges) &&
hasAssignableElements!RangeOfRanges)
{
//alias ElementType = typeof(map!"a.front"(RangeOfRanges.init));
this(RangeOfRanges input)
{
this._input = input;
}
@property auto front()
{
import std.algorithm : filter, map;
return _input.save
.filter!(a => !a.empty)
.map!(a => a.front);
}
void popFront()
{
// Advance the position of each subrange.
auto r = _input.save;
while (!r.empty)
{
auto e = r.front;
if (!e.empty)
{
e.popFront();
r.front = e;
}
r.popFront();
}
}
// ElementType opIndex(size_t n)
// {
// return _input[n].front;
// }
@property bool empty()
{
if (_input.empty) return true;
foreach (e; _input.save)
{
if (!e.empty) return false;
}
return true;
}
@property Transposed save()
{
return Transposed(_input.save);
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
}
@safe unittest
{
// Boundary case: transpose of empty range should be empty
int[][] ror = [];
assert(transposed(ror).empty);
}
// Issue 9507
unittest
{
import std.algorithm : equal;
auto r = [[1,2], [3], [4,5], [], [6]];
assert(r.transposed.equal!equal([
[1, 3, 4, 6],
[2, 5]
]));
}
/**
Given a range of ranges, returns a range of ranges where the $(I i)'th subrange
contains the $(I i)'th elements of the original subranges.
*/
Transposed!RangeOfRanges transposed(RangeOfRanges)(RangeOfRanges rr)
if (isForwardRange!RangeOfRanges &&
isInputRange!(ElementType!RangeOfRanges) &&
hasAssignableElements!RangeOfRanges)
{
return Transposed!RangeOfRanges(rr);
}
///
@safe unittest
{
import std.algorithm : equal;
int[][] ror = [
[1, 2, 3],
[4, 5, 6]
];
auto xp = transposed(ror);
assert(equal!"a.equal(b)"(xp, [
[1, 4],
[2, 5],
[3, 6]
]));
}
///
@safe unittest
{
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto tr = transposed(x);
int[][] witness = [ [ 1, 3 ], [ 2, 4 ] ];
uint i;
foreach (e; tr)
{
assert(array(e) == witness[i++]);
}
}
// Issue 8764
@safe unittest
{
import std.algorithm : equal;
ulong[1] t0 = [ 123 ];
assert(!hasAssignableElements!(typeof(t0[].chunks(1))));
assert(!is(typeof(transposed(t0[].chunks(1)))));
assert(is(typeof(transposed(t0[].chunks(1).array()))));
auto t1 = transposed(t0[].chunks(1).array());
assert(equal!"a.equal(b)"(t1, [[123]]));
}
/**
This struct takes two ranges, $(D source) and $(D indices), and creates a view
of $(D source) as if its elements were reordered according to $(D indices).
$(D indices) may include only a subset of the elements of $(D source) and
may also repeat elements.
$(D Source) must be a random access range. The returned range will be
bidirectional or random-access if $(D Indices) is bidirectional or
random-access, respectively.
*/
struct Indexed(Source, Indices)
if(isRandomAccessRange!Source && isInputRange!Indices &&
is(typeof(Source.init[ElementType!(Indices).init])))
{
this(Source source, Indices indices)
{
this._source = source;
this._indices = indices;
}
/// Range primitives
@property auto ref front()
{
assert(!empty);
return _source[_indices.front];
}
/// Ditto
void popFront()
{
assert(!empty);
_indices.popFront();
}
static if(isInfinite!Indices)
{
enum bool empty = false;
}
else
{
/// Ditto
@property bool empty()
{
return _indices.empty;
}
}
static if(isForwardRange!Indices)
{
/// Ditto
@property typeof(this) save()
{
// Don't need to save _source because it's never consumed.
return typeof(this)(_source, _indices.save);
}
}
/// Ditto
static if(hasAssignableElements!Source)
{
@property auto ref front(ElementType!Source newVal)
{
assert(!empty);
return _source[_indices.front] = newVal;
}
}
static if(hasMobileElements!Source)
{
/// Ditto
auto moveFront()
{
assert(!empty);
return .moveAt(_source, _indices.front);
}
}
static if(isBidirectionalRange!Indices)
{
/// Ditto
@property auto ref back()
{
assert(!empty);
return _source[_indices.back];
}
/// Ditto
void popBack()
{
assert(!empty);
_indices.popBack();
}
/// Ditto
static if(hasAssignableElements!Source)
{
@property auto ref back(ElementType!Source newVal)
{
assert(!empty);
return _source[_indices.back] = newVal;
}
}
static if(hasMobileElements!Source)
{
/// Ditto
auto moveBack()
{
assert(!empty);
return .moveAt(_source, _indices.back);
}
}
}
static if(hasLength!Indices)
{
/// Ditto
@property size_t length()
{
return _indices.length;
}
alias opDollar = length;
}
static if(isRandomAccessRange!Indices)
{
/// Ditto
auto ref opIndex(size_t index)
{
return _source[_indices[index]];
}
/// Ditto
typeof(this) opSlice(size_t a, size_t b)
{
return typeof(this)(_source, _indices[a..b]);
}
static if(hasAssignableElements!Source)
{
/// Ditto
auto opIndexAssign(ElementType!Source newVal, size_t index)
{
return _source[_indices[index]] = newVal;
}
}
static if(hasMobileElements!Source)
{
/// Ditto
auto moveAt(size_t index)
{
return .moveAt(_source, _indices[index]);
}
}
}
// All this stuff is useful if someone wants to index an Indexed
// without adding a layer of indirection.
/**
Returns the source range.
*/
@property Source source()
{
return _source;
}
/**
Returns the indices range.
*/
@property Indices indices()
{
return _indices;
}
static if(isRandomAccessRange!Indices)
{
/**
Returns the physical index into the source range corresponding to a
given logical index. This is useful, for example, when indexing
an $(D Indexed) without adding another layer of indirection.
*/
size_t physicalIndex(size_t logicalIndex)
{
return _indices[logicalIndex];
}
///
unittest
{
auto ind = indexed([1, 2, 3, 4, 5], [1, 3, 4]);
assert(ind.physicalIndex(0) == 1);
}
}
private:
Source _source;
Indices _indices;
}
/// Ditto
Indexed!(Source, Indices) indexed(Source, Indices)(Source source, Indices indices)
{
return typeof(return)(source, indices);
}
///
@safe unittest
{
import std.algorithm : equal;
auto source = [1, 2, 3, 4, 5];
auto indices = [4, 3, 1, 2, 0, 4];
auto ind = indexed(source, indices);
assert(equal(ind, [5, 4, 2, 3, 1, 5]));
assert(equal(retro(ind), [5, 1, 3, 2, 4, 5]));
}
@safe unittest
{
{
auto ind = indexed([1, 2, 3, 4, 5], [1, 3, 4]);
assert(ind.physicalIndex(0) == 1);
}
auto source = [1, 2, 3, 4, 5];
auto indices = [4, 3, 1, 2, 0, 4];
auto ind = indexed(source, indices);
// When elements of indices are duplicated and Source has lvalue elements,
// these are aliased in ind.
ind[0]++;
assert(ind[0] == 6);
assert(ind[5] == 6);
}
@safe unittest
{
import std.internal.test.dummyrange;
foreach(DummyType; AllDummyRanges)
{
auto d = DummyType.init;
auto r = indexed([1, 2, 3, 4, 5], d);
static assert(propagatesRangeType!(DummyType, typeof(r)));
static assert(propagatesLength!(DummyType, typeof(r)));
}
}
/**
This range iterates over fixed-sized chunks of size $(D chunkSize) of a
$(D source) range. $(D Source) must be a forward range. $(D chunkSize) must be
greater than zero.
If $(D !isInfinite!Source) and $(D source.walkLength) is not evenly
divisible by $(D chunkSize), the back element of this range will contain
fewer than $(D chunkSize) elements.
*/
struct Chunks(Source)
if (isForwardRange!Source)
{
/// Standard constructor
this(Source source, size_t chunkSize)
{
assert(chunkSize != 0, "Cannot create a Chunk with an empty chunkSize");
_source = source;
_chunkSize = chunkSize;
}
/// Forward range primitives. Always present.
@property auto front()
{
assert(!empty);
return _source.save.take(_chunkSize);
}
/// Ditto
void popFront()
{
assert(!empty);
_source.popFrontN(_chunkSize);
}
static if (!isInfinite!Source)
/// Ditto
@property bool empty()
{
return _source.empty;
}
else
// undocumented
enum empty = false;
/// Ditto
@property typeof(this) save()
{
return typeof(this)(_source.save, _chunkSize);
}
static if (hasLength!Source)
{
/// Length. Only if $(D hasLength!Source) is $(D true)
@property size_t length()
{
// Note: _source.length + _chunkSize may actually overflow.
// We cast to ulong to mitigate the problem on x86 machines.
// For x64 machines, we just suppose we'll never overflow.
// The "safe" code would require either an extra branch, or a
// modulo operation, which is too expensive for such a rare case
return cast(size_t)((cast(ulong)(_source.length) + _chunkSize - 1) / _chunkSize);
}
//Note: No point in defining opDollar here without slicing.
//opDollar is defined below in the hasSlicing!Source section
}
static if (hasSlicing!Source)
{
//Used for various purposes
private enum hasSliceToEnd = is(typeof(Source.init[_chunkSize .. $]) == Source);
/**
Indexing and slicing operations. Provided only if
$(D hasSlicing!Source) is $(D true).
*/
auto opIndex(size_t index)
{
immutable start = index * _chunkSize;
immutable end = start + _chunkSize;
static if (isInfinite!Source)
return _source[start .. end];
else
{
import std.algorithm : min;
immutable len = _source.length;
assert(start < len, "chunks index out of bounds");
return _source[start .. min(end, len)];
}
}
/// Ditto
static if (hasLength!Source)
typeof(this) opSlice(size_t lower, size_t upper)
{
import std.algorithm : min;
assert(lower <= upper && upper <= length, "chunks slicing index out of bounds");
immutable len = _source.length;
return chunks(_source[min(lower * _chunkSize, len) .. min(upper * _chunkSize, len)], _chunkSize);
}
else static if (hasSliceToEnd)
//For slicing an infinite chunk, we need to slice the source to the end.
typeof(takeExactly(this, 0)) opSlice(size_t lower, size_t upper)
{
assert(lower <= upper, "chunks slicing index out of bounds");
return chunks(_source[lower * _chunkSize .. $], _chunkSize).takeExactly(upper - lower);
}
static if (isInfinite!Source)
{
static if (hasSliceToEnd)
{
private static struct DollarToken{}
DollarToken opDollar()
{
return DollarToken();
}
//Slice to dollar
typeof(this) opSlice(size_t lower, DollarToken)
{
return typeof(this)(_source[lower * _chunkSize .. $], _chunkSize);
}
}
}
else
{
//Dollar token carries a static type, with no extra information.
//It can lazily transform into _source.length on algorithmic
//operations such as : chunks[$/2, $-1];
private static struct DollarToken
{
Chunks!Source* mom;
@property size_t momLength()
{
return mom.length;
}
alias momLength this;
}
DollarToken opDollar()
{
return DollarToken(&this);
}
//Slice overloads optimized for using dollar. Without this, to slice to end, we would...
//1. Evaluate chunks.length
//2. Multiply by _chunksSize
//3. To finally just compare it (with min) to the original length of source (!)
//These overloads avoid that.
typeof(this) opSlice(DollarToken, DollarToken)
{
static if (hasSliceToEnd)
return chunks(_source[$ .. $], _chunkSize);
else
{
immutable len = _source.length;
return chunks(_source[len .. len], _chunkSize);
}
}
typeof(this) opSlice(size_t lower, DollarToken)
{
import std.algorithm : min;
assert(lower <= length, "chunks slicing index out of bounds");
static if (hasSliceToEnd)
return chunks(_source[min(lower * _chunkSize, _source.length) .. $], _chunkSize);
else
{
immutable len = _source.length;
return chunks(_source[min(lower * _chunkSize, len) .. len], _chunkSize);
}
}
typeof(this) opSlice(DollarToken, size_t upper)
{
assert(upper == length, "chunks slicing index out of bounds");
return this[$ .. $];
}
}
}
//Bidirectional range primitives
static if (hasSlicing!Source && hasLength!Source)
{
/**
Bidirectional range primitives. Provided only if both
$(D hasSlicing!Source) and $(D hasLength!Source) are $(D true).
*/
@property auto back()
{
assert(!empty, "back called on empty chunks");
immutable len = _source.length;
immutable start = (len - 1) / _chunkSize * _chunkSize;
return _source[start .. len];
}
/// Ditto
void popBack()
{
assert(!empty, "popBack() called on empty chunks");
immutable end = (_source.length - 1) / _chunkSize * _chunkSize;
_source = _source[0 .. end];
}
}
private:
Source _source;
size_t _chunkSize;
}
/// Ditto
Chunks!Source chunks(Source)(Source source, size_t chunkSize)
if (isForwardRange!Source)
{
return typeof(return)(source, chunkSize);
}
///
@safe unittest
{
import std.algorithm : equal;
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = chunks(source, 4);
assert(chunks[0] == [1, 2, 3, 4]);
assert(chunks[1] == [5, 6, 7, 8]);
assert(chunks[2] == [9, 10]);
assert(chunks.back == chunks[2]);
assert(chunks.front == chunks[0]);
assert(chunks.length == 3);
assert(equal(retro(array(chunks)), array(retro(chunks))));
}
@safe unittest
{
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = chunks(source, 4);
auto chunks2 = chunks.save;
chunks.popFront();
assert(chunks[0] == [5, 6, 7, 8]);
assert(chunks[1] == [9, 10]);
chunks2.popBack();
assert(chunks2[1] == [5, 6, 7, 8]);
assert(chunks2.length == 2);
static assert(isRandomAccessRange!(typeof(chunks)));
}
@safe unittest
{
import std.algorithm : equal;
//Extra toying with slicing and indexing.
auto chunks1 = [0, 0, 1, 1, 2, 2, 3, 3, 4].chunks(2);
auto chunks2 = [0, 0, 1, 1, 2, 2, 3, 3, 4, 4].chunks(2);
assert (chunks1.length == 5);
assert (chunks2.length == 5);
assert (chunks1[4] == [4]);
assert (chunks2[4] == [4, 4]);
assert (chunks1.back == [4]);
assert (chunks2.back == [4, 4]);
assert (chunks1[0 .. 1].equal([[0, 0]]));
assert (chunks1[0 .. 2].equal([[0, 0], [1, 1]]));
assert (chunks1[4 .. 5].equal([[4]]));
assert (chunks2[4 .. 5].equal([[4, 4]]));
assert (chunks1[0 .. 0].equal((int[][]).init));
assert (chunks1[5 .. 5].equal((int[][]).init));
assert (chunks2[5 .. 5].equal((int[][]).init));
//Fun with opDollar
assert (chunks1[$ .. $].equal((int[][]).init)); //Quick
assert (chunks2[$ .. $].equal((int[][]).init)); //Quick
assert (chunks1[$ - 1 .. $].equal([[4]])); //Semiquick
assert (chunks2[$ - 1 .. $].equal([[4, 4]])); //Semiquick
assert (chunks1[$ .. 5].equal((int[][]).init)); //Semiquick
assert (chunks2[$ .. 5].equal((int[][]).init)); //Semiquick
assert (chunks1[$ / 2 .. $ - 1].equal([[2, 2], [3, 3]])); //Slow
}
unittest
{
import std.algorithm : equal, filter;
//ForwardRange
auto r = filter!"true"([1, 2, 3, 4, 5]).chunks(2);
assert(equal!"equal(a, b)"(r, [[1, 2], [3, 4], [5]]));
//InfiniteRange w/o RA
auto fibsByPairs = recurrence!"a[n-1] + a[n-2]"(1, 1).chunks(2);
assert(equal!`equal(a, b)`(fibsByPairs.take(2), [[ 1, 1], [ 2, 3]]));
//InfiniteRange w/ RA and slicing
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
auto oddsByPairs = odds.chunks(2);
assert(equal!`equal(a, b)`(oddsByPairs.take(2), [[ 1, 3], [ 5, 7]]));
//Requires phobos#991 for Sequence to have slice to end
static assert(hasSlicing!(typeof(odds)));
assert(equal!`equal(a, b)`(oddsByPairs[3 .. 5], [[13, 15], [17, 19]]));
assert(equal!`equal(a, b)`(oddsByPairs[3 .. $].take(2), [[13, 15], [17, 19]]));
}
/**
This range splits a $(D source) range into $(D chunkCount) chunks of
approximately equal length. $(D Source) must be a forward range with
known length.
Unlike $(LREF chunks), $(D evenChunks) takes a chunk count (not size).
The returned range will contain zero or more $(D source.length /
chunkCount + 1) elements followed by $(D source.length / chunkCount)
elements. If $(D source.length < chunkCount), some chunks will be empty.
$(D chunkCount) must not be zero, unless $(D source) is also empty.
*/
struct EvenChunks(Source)
if (isForwardRange!Source && hasLength!Source)
{
/// Standard constructor
this(Source source, size_t chunkCount)
{
assert(chunkCount != 0 || source.empty, "Cannot create EvenChunks with a zero chunkCount");
_source = source;
_chunkCount = chunkCount;
}
/// Forward range primitives. Always present.
@property auto front()
{
assert(!empty);
return _source.save.take(_chunkPos(1));
}
/// Ditto
void popFront()
{
assert(!empty);
_source.popFrontN(_chunkPos(1));
_chunkCount--;
}
/// Ditto
@property bool empty()
{
return _source.empty;
}
/// Ditto
@property typeof(this) save()
{
return typeof(this)(_source.save, _chunkCount);
}
/// Length
@property size_t length()
{
return _chunkCount;
}
//Note: No point in defining opDollar here without slicing.
//opDollar is defined below in the hasSlicing!Source section
static if (hasSlicing!Source)
{
/**
Indexing, slicing and bidirectional operations and range primitives.
Provided only if $(D hasSlicing!Source) is $(D true).
*/
auto opIndex(size_t index)
{
assert(index < _chunkCount, "evenChunks index out of bounds");
return _source[_chunkPos(index) .. _chunkPos(index+1)];
}
/// Ditto
typeof(this) opSlice(size_t lower, size_t upper)
{
assert(lower <= upper && upper <= length, "evenChunks slicing index out of bounds");
return evenChunks(_source[_chunkPos(lower) .. _chunkPos(upper)], upper - lower);
}
/// Ditto
@property auto back()
{
assert(!empty, "back called on empty evenChunks");
return _source[_chunkPos(_chunkCount - 1) .. $];
}
/// Ditto
void popBack()
{
assert(!empty, "popBack() called on empty evenChunks");
_source = _source[0 .. _chunkPos(_chunkCount - 1)];
_chunkCount--;
}
}
private:
Source _source;
size_t _chunkCount;
size_t _chunkPos(size_t i)
{
/*
_chunkCount = 5, _source.length = 13:
chunk0
| chunk3
| |
v v
+-+-+-+-+-+ ^
|0|3|.| | | |
+-+-+-+-+-+ | div
|1|4|.| | | |
+-+-+-+-+-+ v
|2|5|.|
+-+-+-+
<----->
mod
<--------->
_chunkCount
One column is one chunk.
popFront and popBack pop the left-most
and right-most column, respectively.
*/
auto div = _source.length / _chunkCount;
auto mod = _source.length % _chunkCount;
auto pos = i <= mod
? i * (div+1)
: mod * (div+1) + (i-mod) * div
;
//auto len = i < mod
// ? div+1
// : div
//;
return pos;
}
}
/// Ditto
EvenChunks!Source evenChunks(Source)(Source source, size_t chunkCount)
if (isForwardRange!Source && hasLength!Source)
{
return typeof(return)(source, chunkCount);
}
///
@safe unittest
{
import std.algorithm : equal;
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = evenChunks(source, 3);
assert(chunks[0] == [1, 2, 3, 4]);
assert(chunks[1] == [5, 6, 7]);
assert(chunks[2] == [8, 9, 10]);
}
@safe unittest
{
import std.algorithm : equal;
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = evenChunks(source, 3);
assert(chunks.back == chunks[2]);
assert(chunks.front == chunks[0]);
assert(chunks.length == 3);
assert(equal(retro(array(chunks)), array(retro(chunks))));
auto chunks2 = chunks.save;
chunks.popFront();
assert(chunks[0] == [5, 6, 7]);
assert(chunks[1] == [8, 9, 10]);
chunks2.popBack();
assert(chunks2[1] == [5, 6, 7]);
assert(chunks2.length == 2);
static assert(isRandomAccessRange!(typeof(chunks)));
}
@safe unittest
{
import std.algorithm : equal;
int[] source = [];
auto chunks = source.evenChunks(0);
assert(chunks.length == 0);
chunks = source.evenChunks(3);
assert(equal(chunks, [[], [], []]));
chunks = [1, 2, 3].evenChunks(5);
assert(equal(chunks, [[1], [2], [3], [], []]));
}
private struct OnlyResult(T, size_t arity)
{
private this(Values...)(auto ref Values values)
{
this.data = [values];
this.backIndex = arity;
}
bool empty() @property
{
return frontIndex >= backIndex;
}
T front() @property
{
assert(!empty);
return data[frontIndex];
}
void popFront()
{
assert(!empty);
++frontIndex;
}
T back() @property
{
assert(!empty);
return data[backIndex - 1];
}
void popBack()
{
assert(!empty);
--backIndex;
}
OnlyResult save() @property
{
return this;
}
size_t length() @property
{
return backIndex - frontIndex;
}
alias opDollar = length;
T opIndex(size_t idx)
{
// when i + idx points to elements popped
// with popBack
assert(idx < length);
return data[frontIndex + idx];
}
OnlyResult opSlice()
{
return this;
}
OnlyResult opSlice(size_t from, size_t to)
{
OnlyResult result = this;
result.frontIndex += from;
result.backIndex = this.frontIndex + to;
assert(from <= to && to <= length);
return result;
}
private size_t frontIndex = 0;
private size_t backIndex = 0;
// @@@BUG@@@ 10643
version(none)
{
static if(hasElaborateAssign!T)
private T[arity] data;
else
private T[arity] data = void;
}
else
private T[arity] data;
}
// Specialize for single-element results
private struct OnlyResult(T, size_t arity : 1)
{
@property T front() { assert(!_empty); return _value; }
@property T back() { assert(!_empty); return _value; }
@property bool empty() const { return _empty; }
@property size_t length() const { return !_empty; }
@property auto save() { return this; }
void popFront() { assert(!_empty); _empty = true; }
void popBack() { assert(!_empty); _empty = true; }
alias opDollar = length;
private this()(auto ref T value)
{
this._value = value;
this._empty = false;
}
T opIndex(size_t i)
{
assert(!_empty && i == 0);
return _value;
}
OnlyResult opSlice()
{
return this;
}
OnlyResult opSlice(size_t from, size_t to)
{
assert(from <= to && to <= length);
OnlyResult copy = this;
copy._empty = _empty || from == to;
return copy;
}
private Unqual!T _value;
private bool _empty = true;
}
// Specialize for the empty range
private struct OnlyResult(T, size_t arity : 0)
{
private static struct EmptyElementType {}
bool empty() @property { return true; }
size_t length() @property { return 0; }
alias opDollar = length;
EmptyElementType front() @property { assert(false); }
void popFront() { assert(false); }
EmptyElementType back() @property { assert(false); }
void popBack() { assert(false); }
OnlyResult save() @property { return this; }
EmptyElementType opIndex(size_t i)
{
assert(false);
}
OnlyResult opSlice() { return this; }
OnlyResult opSlice(size_t from, size_t to)
{
assert(from == 0 && to == 0);
return this;
}
}
/**
Assemble $(D values) into a range that carries all its
elements in-situ.
Useful when a single value or multiple disconnected values
must be passed to an algorithm expecting a range, without
having to perform dynamic memory allocation.
As copying the range means copying all elements, it can be
safely returned from functions. For the same reason, copying
the returned range may be expensive for a large number of arguments.
*/
auto only(Values...)(auto ref Values values)
if(!is(CommonType!Values == void) || Values.length == 0)
{
return OnlyResult!(CommonType!Values, Values.length)(values);
}
///
@safe unittest
{
import std.algorithm;
import std.uni;
assert(equal(only('♡'), "♡"));
assert([1, 2, 3, 4].findSplitBefore(only(3))[0] == [1, 2]);
assert(only("one", "two", "three").joiner(" ").equal("one two three"));
string title = "The D Programming Language";
assert(filter!isUpper(title).map!only().join(".") == "T.D.P.L");
}
unittest
{
// Verify that the same common type and same arity
// results in the same template instantiation
static assert(is(typeof(only(byte.init, int.init)) ==
typeof(only(int.init, byte.init))));
static assert(is(typeof(only((const(char)[]).init, string.init)) ==
typeof(only((const(char)[]).init, (const(char)[]).init))));
}
// Tests the zero-element result
@safe unittest
{
import std.algorithm : equal;
auto emptyRange = only();
alias EmptyRange = typeof(emptyRange);
static assert(isInputRange!EmptyRange);
static assert(isForwardRange!EmptyRange);
static assert(isBidirectionalRange!EmptyRange);
static assert(isRandomAccessRange!EmptyRange);
static assert(hasLength!EmptyRange);
static assert(hasSlicing!EmptyRange);
assert(emptyRange.empty);
assert(emptyRange.length == 0);
assert(emptyRange.equal(emptyRange[]));
assert(emptyRange.equal(emptyRange.save));
assert(emptyRange[0 .. 0].equal(emptyRange));
}
// Tests the single-element result
@safe unittest
{
import std.algorithm : equal;
import std.typecons : tuple;
foreach (x; tuple(1, '1', 1.0, "1", [1]))
{
auto a = only(x);
typeof(x)[] e = [];
assert(a.front == x);
assert(a.back == x);
assert(!a.empty);
assert(a.length == 1);
assert(equal(a, a[]));
assert(equal(a, a[0..1]));
assert(equal(a[0..0], e));
assert(equal(a[1..1], e));
assert(a[0] == x);
auto b = a.save;
assert(equal(a, b));
a.popFront();
assert(a.empty && a.length == 0 && a[].empty);
b.popBack();
assert(b.empty && b.length == 0 && b[].empty);
alias A = typeof(a);
static assert(isInputRange!A);
static assert(isForwardRange!A);
static assert(isBidirectionalRange!A);
static assert(isRandomAccessRange!A);
static assert(hasLength!A);
static assert(hasSlicing!A);
}
auto imm = only!(immutable int)(1);
immutable int[] imme = [];
assert(imm.front == 1);
assert(imm.back == 1);
assert(!imm.empty);
assert(imm.init.empty); // Issue 13441
assert(imm.length == 1);
assert(equal(imm, imm[]));
assert(equal(imm, imm[0..1]));
assert(equal(imm[0..0], imme));
assert(equal(imm[1..1], imme));
assert(imm[0] == 1);
}
// Tests multiple-element results
@safe unittest
{
import std.algorithm : equal, joiner;
static assert(!__traits(compiles, only(1, "1")));
auto nums = only!(byte, uint, long)(1, 2, 3);
static assert(is(ElementType!(typeof(nums)) == long));
assert(nums.length == 3);
foreach(i; 0 .. 3)
assert(nums[i] == i + 1);
auto saved = nums.save;
foreach(i; 1 .. 4)
{
assert(nums.front == nums[0]);
assert(nums.front == i);
nums.popFront();
assert(nums.length == 3 - i);
}
assert(nums.empty);
assert(saved.equal(only(1, 2, 3)));
assert(saved.equal(saved[]));
assert(saved[0 .. 1].equal(only(1)));
assert(saved[0 .. 2].equal(only(1, 2)));
assert(saved[0 .. 3].equal(saved));
assert(saved[1 .. 3].equal(only(2, 3)));
assert(saved[2 .. 3].equal(only(3)));
assert(saved[0 .. 0].empty);
assert(saved[3 .. 3].empty);
alias data = AliasSeq!("one", "two", "three", "four");
static joined =
["one two", "one two three", "one two three four"];
string[] joinedRange = joined;
foreach(argCount; AliasSeq!(2, 3, 4))
{
auto values = only(data[0 .. argCount]);
alias Values = typeof(values);
static assert(is(ElementType!Values == string));
static assert(isInputRange!Values);
static assert(isForwardRange!Values);
static assert(isBidirectionalRange!Values);
static assert(isRandomAccessRange!Values);
static assert(hasSlicing!Values);
static assert(hasLength!Values);
assert(values.length == argCount);
assert(values[0 .. $].equal(values[0 .. values.length]));
assert(values.joiner(" ").equal(joinedRange.front));
joinedRange.popFront();
}
assert(saved.retro.equal(only(3, 2, 1)));
assert(saved.length == 3);
assert(saved.back == 3);
saved.popBack();
assert(saved.length == 2);
assert(saved.back == 2);
assert(saved.front == 1);
saved.popFront();
assert(saved.length == 1);
assert(saved.front == 2);
saved.popBack();
assert(saved.empty);
auto imm = only!(immutable int, immutable int)(42, 24);
alias Imm = typeof(imm);
static assert(is(ElementType!Imm == immutable(int)));
assert(!imm.empty);
assert(imm.init.empty); // Issue 13441
assert(imm.front == 42);
imm.popFront();
assert(imm.front == 24);
imm.popFront();
assert(imm.empty);
static struct Test { int* a; }
immutable(Test) test;
cast(void)only(test, test); // Works with mutable indirection
}
/**
Iterate over $(D range) with an attached index variable.
Each element is a $(XREF typecons, Tuple) containing the index
and the element, in that order, where the index member is named $(D index)
and the element member is named $(D value).
The index starts at $(D start) and is incremented by one on every iteration.
Bidirectionality is propagated only if $(D range) has length.
Overflow:
If $(D range) has length, then it is an error to pass a value for $(D start)
so that $(D start + range.length) is bigger than $(D Enumerator.max), thus it is
ensured that overflow cannot happen.
If $(D range) does not have length, and $(D popFront) is called when
$(D front.index == Enumerator.max), the index will overflow and
continue from $(D Enumerator.min).
Example:
Useful for using $(D foreach) with an index loop variable:
----
import std.stdio : stdin, stdout;
import std.range : enumerate;
foreach (lineNum, line; stdin.byLine().enumerate(1))
stdout.writefln("line #%s: %s", lineNum, line);
----
*/
auto enumerate(Enumerator = size_t, Range)(Range range, Enumerator start = 0)
if (isIntegral!Enumerator && isInputRange!Range)
in
{
static if (hasLength!Range)
{
// TODO: core.checkedint supports mixed signedness yet?
import core.checkedint : adds, addu;
import std.conv : ConvException, to;
alias LengthType = typeof(range.length);
bool overflow;
static if(isSigned!Enumerator && isSigned!LengthType)
auto result = adds(start, range.length, overflow);
else static if(isSigned!Enumerator)
{
Largest!(Enumerator, Signed!LengthType) signedLength;
try signedLength = to!(typeof(signedLength))(range.length);
catch(ConvException)
overflow = true;
catch(Exception)
assert(false);
auto result = adds(start, signedLength, overflow);
}
else
{
static if(isSigned!LengthType)
assert(range.length >= 0);
auto result = addu(start, range.length, overflow);
}
assert(!overflow && result <= Enumerator.max);
}
}
body
{
// TODO: Relax isIntegral!Enumerator to allow user-defined integral types
static struct Result
{
import std.typecons : Tuple;
private:
alias ElemType = Tuple!(Enumerator, "index", ElementType!Range, "value");
Range range;
Enumerator index;
public:
ElemType front() @property
{
assert(!range.empty);
return typeof(return)(index, range.front);
}
static if (isInfinite!Range)
enum bool empty = false;
else
{
bool empty() @property
{
return range.empty;
}
}
void popFront()
{
assert(!range.empty);
range.popFront();
++index; // When !hasLength!Range, overflow is expected
}
static if (isForwardRange!Range)
{
Result save() @property
{
return typeof(return)(range.save, index);
}
}
static if (hasLength!Range)
{
size_t length() @property
{
return range.length;
}
alias opDollar = length;
static if (isBidirectionalRange!Range)
{
ElemType back() @property
{
assert(!range.empty);
return typeof(return)(cast(Enumerator)(index + range.length - 1), range.back);
}
void popBack()
{
assert(!range.empty);
range.popBack();
}
}
}
static if (isRandomAccessRange!Range)
{
ElemType opIndex(size_t i)
{
return typeof(return)(cast(Enumerator)(index + i), range[i]);
}
}
static if (hasSlicing!Range)
{
static if (hasLength!Range)
{
Result opSlice(size_t i, size_t j)
{
return typeof(return)(range[i .. j], cast(Enumerator)(index + i));
}
}
else
{
static struct DollarToken {}
enum opDollar = DollarToken.init;
Result opSlice(size_t i, DollarToken)
{
return typeof(return)(range[i .. $], cast(Enumerator)(index + i));
}
auto opSlice(size_t i, size_t j)
{
return this[i .. $].takeExactly(j - 1);
}
}
}
}
return Result(range, start);
}
/// Can start enumeration from a negative position:
pure @safe nothrow unittest
{
import std.array : assocArray;
import std.range : enumerate;
bool[int] aa = true.repeat(3).enumerate(-1).assocArray();
assert(aa[-1]);
assert(aa[0]);
assert(aa[1]);
}
pure @safe nothrow unittest
{
import std.internal.test.dummyrange;
import std.typecons : tuple;
static struct HasSlicing
{
typeof(this) front() @property { return typeof(this).init; }
bool empty() @property { return true; }
void popFront() {}
typeof(this) opSlice(size_t, size_t)
{
return typeof(this)();
}
}
foreach (DummyType; AliasSeq!(AllDummyRanges, HasSlicing))
{
alias R = typeof(enumerate(DummyType.init));
static assert(isInputRange!R);
static assert(isForwardRange!R == isForwardRange!DummyType);
static assert(isRandomAccessRange!R == isRandomAccessRange!DummyType);
static assert(!hasAssignableElements!R);
static if (hasLength!DummyType)
{
static assert(hasLength!R);
static assert(isBidirectionalRange!R ==
isBidirectionalRange!DummyType);
}
static assert(hasSlicing!R == hasSlicing!DummyType);
}
static immutable values = ["zero", "one", "two", "three"];
auto enumerated = values[].enumerate();
assert(!enumerated.empty);
assert(enumerated.front == tuple(0, "zero"));
assert(enumerated.back == tuple(3, "three"));
typeof(enumerated) saved = enumerated.save;
saved.popFront();
assert(enumerated.front == tuple(0, "zero"));
assert(saved.front == tuple(1, "one"));
assert(saved.length == enumerated.length - 1);
saved.popBack();
assert(enumerated.back == tuple(3, "three"));
assert(saved.back == tuple(2, "two"));
saved.popFront();
assert(saved.front == tuple(2, "two"));
assert(saved.back == tuple(2, "two"));
saved.popFront();
assert(saved.empty);
size_t control = 0;
foreach (i, v; enumerated)
{
static assert(is(typeof(i) == size_t));
static assert(is(typeof(v) == typeof(values[0])));
assert(i == control);
assert(v == values[i]);
assert(tuple(i, v) == enumerated[i]);
++control;
}
assert(enumerated[0 .. $].front == tuple(0, "zero"));
assert(enumerated[$ - 1 .. $].front == tuple(3, "three"));
foreach(i; 0 .. 10)
{
auto shifted = values[0 .. 2].enumerate(i);
assert(shifted.front == tuple(i, "zero"));
assert(shifted[0] == shifted.front);
auto next = tuple(i + 1, "one");
assert(shifted[1] == next);
shifted.popFront();
assert(shifted.front == next);
shifted.popFront();
assert(shifted.empty);
}
foreach(T; AliasSeq!(ubyte, byte, uint, int))
{
auto inf = 42.repeat().enumerate(T.max);
alias Inf = typeof(inf);
static assert(isInfinite!Inf);
static assert(hasSlicing!Inf);
// test overflow
assert(inf.front == tuple(T.max, 42));
inf.popFront();
assert(inf.front == tuple(T.min, 42));
// test slicing
inf = inf[42 .. $];
assert(inf.front == tuple(T.min + 42, 42));
auto window = inf[0 .. 2];
assert(window.length == 1);
assert(window.front == inf.front);
window.popFront();
assert(window.empty);
}
}
pure @safe unittest
{
import std.algorithm : equal;
static immutable int[] values = [0, 1, 2, 3, 4];
foreach(T; AliasSeq!(ubyte, ushort, uint, ulong))
{
auto enumerated = values.enumerate!T();
static assert(is(typeof(enumerated.front.index) == T));
assert(enumerated.equal(values[].zip(values)));
foreach(T i; 0 .. 5)
{
auto subset = values[cast(size_t)i .. $];
auto offsetEnumerated = subset.enumerate(i);
static assert(is(typeof(enumerated.front.index) == T));
assert(offsetEnumerated.equal(subset.zip(subset)));
}
}
}
version(none) // @@@BUG@@@ 10939
{
// Re-enable (or remove) if 10939 is resolved.
/+pure+/ unittest // Impure because of std.conv.to
{
import std.exception : assertNotThrown, assertThrown;
import core.exception : RangeError;
static immutable values = [42];
static struct SignedLengthRange
{
immutable(int)[] _values = values;
int front() @property { assert(false); }
bool empty() @property { assert(false); }
void popFront() { assert(false); }
int length() @property
{
return cast(int)_values.length;
}
}
SignedLengthRange svalues;
foreach(Enumerator; AliasSeq!(ubyte, byte, ushort, short, uint, int, ulong, long))
{
assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max));
assertNotThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length));
assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length + 1));
assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max));
assertNotThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length));
assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length + 1));
}
foreach(Enumerator; AliasSeq!(byte, short, int))
{
assertThrown!RangeError(repeat(0, uint.max).enumerate!Enumerator());
}
assertNotThrown!RangeError(repeat(0, uint.max).enumerate!long());
}
}
/**
Returns true if $(D fn) accepts variables of type T1 and T2 in any order.
The following code should compile:
---
T1 foo();
T2 bar();
fn(foo(), bar());
fn(bar(), foo());
---
*/
template isTwoWayCompatible(alias fn, T1, T2)
{
enum isTwoWayCompatible = is(typeof( (){
T1 foo();
T2 bar();
fn(foo(), bar());
fn(bar(), foo());
}
));
}
/**
Policy used with the searching primitives $(D lowerBound), $(D
upperBound), and $(D equalRange) of $(LREF SortedRange) below.
*/
enum SearchPolicy
{
/**
Searches in a linear fashion.
*/
linear,
/**
Searches with a step that is grows linearly (1, 2, 3,...)
leading to a quadratic search schedule (indexes tried are 0, 1,
3, 6, 10, 15, 21, 28,...) Once the search overshoots its target,
the remaining interval is searched using binary search. The
search is completed in $(BIGOH sqrt(n)) time. Use it when you
are reasonably confident that the value is around the beginning
of the range.
*/
trot,
/**
Performs a $(LUCKY galloping search algorithm), i.e. searches
with a step that doubles every time, (1, 2, 4, 8, ...) leading
to an exponential search schedule (indexes tried are 0, 1, 3,
7, 15, 31, 63,...) Once the search overshoots its target, the
remaining interval is searched using binary search. A value is
found in $(BIGOH log(n)) time.
*/
gallop,
/**
Searches using a classic interval halving policy. The search
starts in the middle of the range, and each search step cuts
the range in half. This policy finds a value in $(BIGOH log(n))
time but is less cache friendly than $(D gallop) for large
ranges. The $(D binarySearch) policy is used as the last step
of $(D trot), $(D gallop), $(D trotBackwards), and $(D
gallopBackwards) strategies.
*/
binarySearch,
/**
Similar to $(D trot) but starts backwards. Use it when
confident that the value is around the end of the range.
*/
trotBackwards,
/**
Similar to $(D gallop) but starts backwards. Use it when
confident that the value is around the end of the range.
*/
gallopBackwards
}
/**
Represents a sorted range. In addition to the regular range
primitives, supports additional operations that take advantage of the
ordering, such as merge and binary search. To obtain a $(D
SortedRange) from an unsorted range $(D r), use
$(XREF_PACK algorithm,sorting,sort) which sorts $(D r) in place and returns the
corresponding $(D SortedRange). To construct a $(D SortedRange) from a range
$(D r) that is known to be already sorted, use $(LREF assumeSorted) described
below.
*/
struct SortedRange(Range, alias pred = "a < b")
if (isInputRange!Range)
{
private import std.functional : binaryFun;
private alias predFun = binaryFun!pred;
private bool geq(L, R)(L lhs, R rhs)
{
return !predFun(lhs, rhs);
}
private bool gt(L, R)(L lhs, R rhs)
{
return predFun(rhs, lhs);
}
private Range _input;
// Undocummented because a clearer way to invoke is by calling
// assumeSorted.
this(Range input)
out
{
// moved out of the body as a workaround for Issue 12661
dbgVerifySorted();
}
body
{
this._input = input;
}
// Assertion only.
private void dbgVerifySorted()
{
if(!__ctfe)
debug
{
static if (isRandomAccessRange!Range)
{
import core.bitop : bsr;
import std.algorithm : isSorted;
// Check the sortedness of the input
if (this._input.length < 2) return;
immutable size_t msb = bsr(this._input.length) + 1;
assert(msb > 0 && msb <= this._input.length);
immutable step = this._input.length / msb;
auto st = stride(this._input, step);
assert(isSorted!pred(st), "Range is not sorted");
}
}
}
/// Range primitives.
@property bool empty() //const
{
return this._input.empty;
}
/// Ditto
static if (isForwardRange!Range)
@property auto save()
{
// Avoid the constructor
typeof(this) result = this;
result._input = _input.save;
return result;
}
/// Ditto
@property auto ref front()
{
return _input.front;
}
/// Ditto
void popFront()
{
_input.popFront();
}
/// Ditto
static if (isBidirectionalRange!Range)
{
@property auto ref back()
{
return _input.back;
}
/// Ditto
void popBack()
{
_input.popBack();
}
}
/// Ditto
static if (isRandomAccessRange!Range)
auto ref opIndex(size_t i)
{
return _input[i];
}
/// Ditto
static if (hasSlicing!Range)
auto opSlice(size_t a, size_t b)
{
assert(a <= b);
typeof(this) result = this;
result._input = _input[a .. b];// skip checking
return result;
}
/// Ditto
static if (hasLength!Range)
{
@property size_t length() //const
{
return _input.length;
}
alias opDollar = length;
}
/**
Releases the controlled range and returns it.
*/
auto release()
{
import std.algorithm : move;
return move(_input);
}
// Assuming a predicate "test" that returns 0 for a left portion
// of the range and then 1 for the rest, returns the index at
// which the first 1 appears. Used internally by the search routines.
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if (sp == SearchPolicy.binarySearch && isRandomAccessRange!Range)
{
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2, it = first + step;
if (!test(_input[it], v))
{
first = it + 1;
count -= step + 1;
}
else
{
count = step;
}
}
return first;
}
// Specialization for trot and gallop
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if ((sp == SearchPolicy.trot || sp == SearchPolicy.gallop)
&& isRandomAccessRange!Range)
{
if (empty || test(front, v)) return 0;
immutable count = length;
if (count == 1) return 1;
size_t below = 0, above = 1, step = 2;
while (!test(_input[above], v))
{
// Still too small, update below and increase gait
below = above;
immutable next = above + step;
if (next >= count)
{
// Overshot - the next step took us beyond the end. So
// now adjust next and simply exit the loop to do the
// binary search thingie.
above = count;
break;
}
// Still in business, increase step and continue
above = next;
static if (sp == SearchPolicy.trot)
++step;
else
step <<= 1;
}
return below + this[below .. above].getTransitionIndex!(
SearchPolicy.binarySearch, test, V)(v);
}
// Specialization for trotBackwards and gallopBackwards
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if ((sp == SearchPolicy.trotBackwards || sp == SearchPolicy.gallopBackwards)
&& isRandomAccessRange!Range)
{
immutable count = length;
if (empty || !test(back, v)) return count;
if (count == 1) return 0;
size_t below = count - 2, above = count - 1, step = 2;
while (test(_input[below], v))
{
// Still too large, update above and increase gait
above = below;
if (below < step)
{
// Overshot - the next step took us beyond the end. So
// now adjust next and simply fall through to do the
// binary search thingie.
below = 0;
break;
}
// Still in business, increase step and continue
below -= step;
static if (sp == SearchPolicy.trot)
++step;
else
step <<= 1;
}
return below + this[below .. above].getTransitionIndex!(
SearchPolicy.binarySearch, test, V)(v);
}
// lowerBound
/**
This function uses a search with policy $(D sp) to find the
largest left subrange on which $(D pred(x, value)) is $(D true) for
all $(D x) (e.g., if $(D pred) is "less than", returns the portion of
the range with elements strictly smaller than $(D value)). The search
schedule and its complexity are documented in
$(LREF SearchPolicy). See also STL's
$(WEB sgi.com/tech/stl/lower_bound.html, lower_bound).
*/
auto lowerBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V)
&& hasSlicing!Range)
{
return this[0 .. getTransitionIndex!(sp, geq)(value)];
}
///
unittest
{
import std.algorithm: equal;
auto a = assumeSorted([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]);
auto p = a.lowerBound(4);
assert(equal(p, [ 0, 1, 2, 3 ]));
}
// upperBound
/**
This function searches with policy $(D sp) to find the largest right
subrange on which $(D pred(value, x)) is $(D true) for all $(D x)
(e.g., if $(D pred) is "less than", returns the portion of the range
with elements strictly greater than $(D value)). The search schedule
and its complexity are documented in $(LREF SearchPolicy).
For ranges that do not offer random access, $(D SearchPolicy.linear)
is the only policy allowed (and it must be specified explicitly lest it exposes
user code to unexpected inefficiencies). For random-access searches, all
policies are allowed, and $(D SearchPolicy.binarySearch) is the default.
See_Also: STL's $(WEB sgi.com/tech/stl/lower_bound.html,upper_bound).
*/
auto upperBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V))
{
static assert(hasSlicing!Range || sp == SearchPolicy.linear,
"Specify SearchPolicy.linear explicitly for "
~ typeof(this).stringof);
static if (sp == SearchPolicy.linear)
{
for (; !_input.empty && !predFun(value, _input.front);
_input.popFront())
{
}
return this;
}
else
{
return this[getTransitionIndex!(sp, gt)(value) .. length];
}
}
///
unittest
{
import std.algorithm: equal;
auto a = assumeSorted([ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]);
auto p = a.upperBound(3);
assert(equal(p, [4, 4, 5, 6]));
}
// equalRange
/**
Returns the subrange containing all elements $(D e) for which both $(D
pred(e, value)) and $(D pred(value, e)) evaluate to $(D false) (e.g.,
if $(D pred) is "less than", returns the portion of the range with
elements equal to $(D value)). Uses a classic binary search with
interval halving until it finds a value that satisfies the condition,
then uses $(D SearchPolicy.gallopBackwards) to find the left boundary
and $(D SearchPolicy.gallop) to find the right boundary. These
policies are justified by the fact that the two boundaries are likely
to be near the first found value (i.e., equal ranges are relatively
small). Completes the entire search in $(BIGOH log(n)) time. See also
STL's $(WEB sgi.com/tech/stl/equal_range.html, equal_range).
*/
auto equalRange(V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V)
&& isRandomAccessRange!Range)
{
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2;
auto it = first + step;
if (predFun(_input[it], value))
{
// Less than value, bump left bound up
first = it + 1;
count -= step + 1;
}
else if (predFun(value, _input[it]))
{
// Greater than value, chop count
count = step;
}
else
{
// Equal to value, do binary searches in the
// leftover portions
// Gallop towards the left end as it's likely nearby
immutable left = first
+ this[first .. it]
.lowerBound!(SearchPolicy.gallopBackwards)(value).length;
first += count;
// Gallop towards the right end as it's likely nearby
immutable right = first
- this[it + 1 .. first]
.upperBound!(SearchPolicy.gallop)(value).length;
return this[left .. right];
}
}
return this.init;
}
///
unittest
{
import std.algorithm: equal;
auto a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto r = a.assumeSorted.equalRange(3);
assert(equal(r, [ 3, 3, 3 ]));
}
// trisect
/**
Returns a tuple $(D r) such that $(D r[0]) is the same as the result
of $(D lowerBound(value)), $(D r[1]) is the same as the result of $(D
equalRange(value)), and $(D r[2]) is the same as the result of $(D
upperBound(value)). The call is faster than computing all three
separately. Uses a search schedule similar to $(D
equalRange). Completes the entire search in $(BIGOH log(n)) time.
*/
auto trisect(V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V)
&& isRandomAccessRange!Range)
{
import std.typecons : tuple;
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2;
auto it = first + step;
if (predFun(_input[it], value))
{
// Less than value, bump left bound up
first = it + 1;
count -= step + 1;
}
else if (predFun(value, _input[it]))
{
// Greater than value, chop count
count = step;
}
else
{
// Equal to value, do binary searches in the
// leftover portions
// Gallop towards the left end as it's likely nearby
immutable left = first
+ this[first .. it]
.lowerBound!(SearchPolicy.gallopBackwards)(value).length;
first += count;
// Gallop towards the right end as it's likely nearby
immutable right = first
- this[it + 1 .. first]
.upperBound!(SearchPolicy.gallop)(value).length;
return tuple(this[0 .. left], this[left .. right],
this[right .. length]);
}
}
// No equal element was found
return tuple(this[0 .. first], this.init, this[first .. length]);
}
///
unittest
{
import std.algorithm: equal;
auto a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto r = assumeSorted(a).trisect(3);
assert(equal(r[0], [ 1, 2 ]));
assert(equal(r[1], [ 3, 3, 3 ]));
assert(equal(r[2], [ 4, 4, 5, 6 ]));
}
// contains
/**
Returns $(D true) if and only if $(D value) can be found in $(D
range), which is assumed to be sorted. Performs $(BIGOH log(r.length))
evaluations of $(D pred). See also STL's $(WEB
sgi.com/tech/stl/binary_search.html, binary_search).
*/
bool contains(V)(V value)
if (isRandomAccessRange!Range)
{
if(empty) return false;
immutable i = getTransitionIndex!(SearchPolicy.binarySearch, geq)(value);
if(i >= length) return false;
return !predFun(value, _input[i]);
}
// groupBy
/**
Returns a range of subranges of elements that are equivalent according to the
sorting relation.
*/
auto groupBy()()
{
import std.algorithm.iteration : chunkBy;
return _input.chunkBy!((a, b) => !predFun(a, b) && !predFun(b, a));
}
}
///
unittest
{
import std.algorithm : sort;
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(3));
assert(!r.contains(32));
auto r1 = sort!"a > b"(a);
assert(r1.contains(3));
assert(!r1.contains(32));
assert(r1.release() == [ 64, 52, 42, 3, 2, 1 ]);
}
/**
$(D SortedRange) could accept ranges weaker than random-access, but it
is unable to provide interesting functionality for them. Therefore,
$(D SortedRange) is currently restricted to random-access ranges.
No copy of the original range is ever made. If the underlying range is
changed concurrently with its corresponding $(D SortedRange) in ways
that break its sortedness, $(D SortedRange) will work erratically.
*/
@safe unittest
{
import std.algorithm : swap;
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(42));
swap(a[3], a[5]); // illegal to break sortedness of original range
assert(!r.contains(42)); // passes although it shouldn't
}
@safe unittest
{
import std.algorithm : equal;
auto a = [ 10, 20, 30, 30, 30, 40, 40, 50, 60 ];
auto r = assumeSorted(a).trisect(30);
assert(equal(r[0], [ 10, 20 ]));
assert(equal(r[1], [ 30, 30, 30 ]));
assert(equal(r[2], [ 40, 40, 50, 60 ]));
r = assumeSorted(a).trisect(35);
assert(equal(r[0], [ 10, 20, 30, 30, 30 ]));
assert(r[1].empty);
assert(equal(r[2], [ 40, 40, 50, 60 ]));
}
@safe unittest
{
import std.algorithm : equal;
auto a = [ "A", "AG", "B", "E", "F" ];
auto r = assumeSorted!"cmp(a,b) < 0"(a).trisect("B"w);
assert(equal(r[0], [ "A", "AG" ]));
assert(equal(r[1], [ "B" ]));
assert(equal(r[2], [ "E", "F" ]));
r = assumeSorted!"cmp(a,b) < 0"(a).trisect("A"d);
assert(r[0].empty);
assert(equal(r[1], [ "A" ]));
assert(equal(r[2], [ "AG", "B", "E", "F" ]));
}
@safe unittest
{
import std.algorithm : equal;
static void test(SearchPolicy pol)()
{
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(equal(r.lowerBound(42), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(42), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(41), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(43), [1, 2, 3, 42]));
assert(equal(r.lowerBound!(pol)(51), [1, 2, 3, 42]));
assert(equal(r.lowerBound!(pol)(3), [1, 2]));
assert(equal(r.lowerBound!(pol)(55), [1, 2, 3, 42, 52]));
assert(equal(r.lowerBound!(pol)(420), a));
assert(equal(r.lowerBound!(pol)(0), a[0 .. 0]));
assert(equal(r.upperBound!(pol)(42), [52, 64]));
assert(equal(r.upperBound!(pol)(41), [42, 52, 64]));
assert(equal(r.upperBound!(pol)(43), [52, 64]));
assert(equal(r.upperBound!(pol)(51), [52, 64]));
assert(equal(r.upperBound!(pol)(53), [64]));
assert(equal(r.upperBound!(pol)(55), [64]));
assert(equal(r.upperBound!(pol)(420), a[0 .. 0]));
assert(equal(r.upperBound!(pol)(0), a));
}
test!(SearchPolicy.trot)();
test!(SearchPolicy.gallop)();
test!(SearchPolicy.trotBackwards)();
test!(SearchPolicy.gallopBackwards)();
test!(SearchPolicy.binarySearch)();
}
@safe unittest
{
// Check for small arrays
int[] a;
auto r = assumeSorted(a);
a = [ 1 ];
r = assumeSorted(a);
a = [ 1, 2 ];
r = assumeSorted(a);
a = [ 1, 2, 3 ];
r = assumeSorted(a);
}
@safe unittest
{
import std.algorithm : swap;
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(42));
swap(a[3], a[5]); // illegal to break sortedness of original range
assert(!r.contains(42)); // passes although it shouldn't
}
@safe unittest
{
immutable(int)[] arr = [ 1, 2, 3 ];
auto s = assumeSorted(arr);
}
unittest
{
import std.algorithm.comparison : equal;
int[] arr = [100, 101, 102, 200, 201, 300];
auto s = assumeSorted!((a, b) => a / 100 < b / 100)(arr);
assert(s.groupBy.equal!equal([[100, 101, 102], [200, 201], [300]]));
}
// Test on an input range
unittest
{
import std.stdio, std.file, std.path, std.conv, std.uuid;
auto name = buildPath(tempDir(), "test.std.range.line-" ~ text(__LINE__) ~
"." ~ randomUUID().toString());
auto f = File(name, "w");
scope(exit) if (exists(name)) remove(name);
// write a sorted range of lines to the file
f.write("abc\ndef\nghi\njkl");
f.close();
f.open(name, "r");
auto r = assumeSorted(f.byLine());
auto r1 = r.upperBound!(SearchPolicy.linear)("def");
assert(r1.front == "ghi", r1.front);
f.close();
}
/**
Assumes $(D r) is sorted by predicate $(D pred) and returns the
corresponding $(D SortedRange!(pred, R)) having $(D r) as support. To
keep the checking costs low, the cost is $(BIGOH 1) in release mode
(no checks for sortedness are performed). In debug mode, a few random
elements of $(D r) are checked for sortedness. The size of the sample
is proportional $(BIGOH log(r.length)). That way, checking has no
effect on the complexity of subsequent operations specific to sorted
ranges (such as binary search). The probability of an arbitrary
unsorted range failing the test is very high (however, an
almost-sorted range is likely to pass it). To check for sortedness at
cost $(BIGOH n), use $(XREF_PACK algorithm,sorting,isSorted).
*/
auto assumeSorted(alias pred = "a < b", R)(R r)
if (isInputRange!(Unqual!R))
{
return SortedRange!(Unqual!R, pred)(r);
}
@safe unittest
{
import std.algorithm : equal;
static assert(isRandomAccessRange!(SortedRange!(int[])));
int[] a = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ];
auto p = assumeSorted(a).lowerBound(4);
assert(equal(p, [0, 1, 2, 3]));
p = assumeSorted(a).lowerBound(5);
assert(equal(p, [0, 1, 2, 3, 4]));
p = assumeSorted(a).lowerBound(6);
assert(equal(p, [ 0, 1, 2, 3, 4, 5]));
p = assumeSorted(a).lowerBound(6.9);
assert(equal(p, [ 0, 1, 2, 3, 4, 5, 6]));
}
@safe unittest
{
import std.algorithm : equal;
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto p = assumeSorted(a).upperBound(3);
assert(equal(p, [4, 4, 5, 6 ]));
p = assumeSorted(a).upperBound(4.2);
assert(equal(p, [ 5, 6 ]));
}
@safe unittest
{
import std.conv : text;
import std.algorithm : equal;
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto p = assumeSorted(a).equalRange(3);
assert(equal(p, [ 3, 3, 3 ]), text(p));
p = assumeSorted(a).equalRange(4);
assert(equal(p, [ 4, 4 ]), text(p));
p = assumeSorted(a).equalRange(2);
assert(equal(p, [ 2 ]));
p = assumeSorted(a).equalRange(0);
assert(p.empty);
p = assumeSorted(a).equalRange(7);
assert(p.empty);
p = assumeSorted(a).equalRange(3.0);
assert(equal(p, [ 3, 3, 3]));
}
@safe unittest
{
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
if (a.length)
{
auto b = a[a.length / 2];
//auto r = sort(a);
//assert(r.contains(b));
}
}
@safe unittest
{
auto a = [ 5, 7, 34, 345, 677 ];
auto r = assumeSorted(a);
a = null;
r = assumeSorted(a);
a = [ 1 ];
r = assumeSorted(a);
}
unittest
{
bool ok = true;
try
{
auto r2 = assumeSorted([ 677, 345, 34, 7, 5 ]);
debug ok = false;
}
catch (Throwable)
{
}
assert(ok);
}
// issue 15003
@nogc unittest
{
static immutable a = [1, 2, 3, 4];
auto r = a.assumeSorted;
}
/++
Wrapper which effectively makes it possible to pass a range by reference.
Both the original range and the RefRange will always have the exact same
elements. Any operation done on one will affect the other. So, for instance,
if it's passed to a function which would implicitly copy the original range
if it were passed to it, the original range is $(I not) copied but is
consumed as if it were a reference type.
Note that $(D save) works as normal and operates on a new range, so if
$(D save) is ever called on the RefRange, then no operations on the saved
range will affect the original.
+/
struct RefRange(R)
if(isInputRange!R)
{
public:
/++ +/
this(R* range) @safe pure nothrow
{
_range = range;
}
/++
This does not assign the pointer of $(D rhs) to this $(D RefRange).
Rather it assigns the range pointed to by $(D rhs) to the range pointed
to by this $(D RefRange). This is because $(I any) operation on a
$(D RefRange) is the same is if it occurred to the original range. The
one exception is when a $(D RefRange) is assigned $(D null) either
directly or because $(D rhs) is $(D null). In that case, $(D RefRange)
no longer refers to the original range but is $(D null).
+/
auto opAssign(RefRange rhs)
{
if(_range && rhs._range)
*_range = *rhs._range;
else
_range = rhs._range;
return this;
}
/++ +/
auto opAssign(typeof(null) rhs)
{
_range = null;
}
/++
A pointer to the wrapped range.
+/
@property inout(R*) ptr() @safe inout pure nothrow
{
return _range;
}
version(StdDdoc)
{
/++ +/
@property auto front() {assert(0);}
/++ Ditto +/
@property auto front() const {assert(0);}
/++ Ditto +/
@property auto front(ElementType!R value) {assert(0);}
}
else
{
@property auto front()
{
return (*_range).front;
}
static if(is(typeof((*(cast(const R*)_range)).front))) @property auto front() const
{
return (*_range).front;
}
static if(is(typeof((*_range).front = (*_range).front))) @property auto front(ElementType!R value)
{
return (*_range).front = value;
}
}
version(StdDdoc)
{
@property bool empty(); ///
@property bool empty() const; ///Ditto
}
else static if(isInfinite!R)
enum empty = false;
else
{
@property bool empty()
{
return (*_range).empty;
}
static if(is(typeof((*cast(const R*)_range).empty))) @property bool empty() const
{
return (*_range).empty;
}
}
/++ +/
void popFront()
{
return (*_range).popFront();
}
version(StdDdoc)
{
/++
Only defined if $(D isForwardRange!R) is $(D true).
+/
@property auto save() {assert(0);}
/++ Ditto +/
@property auto save() const {assert(0);}
/++ Ditto +/
auto opSlice() {assert(0);}
/++ Ditto +/
auto opSlice() const {assert(0);}
}
else static if(isForwardRange!R)
{
static if(isSafe!((R* r) => (*r).save))
{
@property auto save() @trusted
{
mixin(_genSave());
}
static if(is(typeof((*cast(const R*)_range).save))) @property auto save() @trusted const
{
mixin(_genSave());
}
}
else
{
@property auto save()
{
mixin(_genSave());
}
static if(is(typeof((*cast(const R*)_range).save))) @property auto save() const
{
mixin(_genSave());
}
}
auto opSlice()()
{
return save;
}
auto opSlice()() const
{
return save;
}
private static string _genSave() @safe pure nothrow
{
return `import std.conv;` ~
`alias S = typeof((*_range).save);` ~
`static assert(isForwardRange!S, S.stringof ~ " is not a forward range.");` ~
`auto mem = new void[S.sizeof];` ~
`emplace!S(mem, cast(S)(*_range).save);` ~
`return RefRange!S(cast(S*)mem.ptr);`;
}
static assert(isForwardRange!RefRange);
}
version(StdDdoc)
{
/++
Only defined if $(D isBidirectionalRange!R) is $(D true).
+/
@property auto back() {assert(0);}
/++ Ditto +/
@property auto back() const {assert(0);}
/++ Ditto +/
@property auto back(ElementType!R value) {assert(0);}
}
else static if(isBidirectionalRange!R)
{
@property auto back()
{
return (*_range).back;
}
static if(is(typeof((*(cast(const R*)_range)).back))) @property auto back() const
{
return (*_range).back;
}
static if(is(typeof((*_range).back = (*_range).back))) @property auto back(ElementType!R value)
{
return (*_range).back = value;
}
}
/++ Ditto +/
static if(isBidirectionalRange!R) void popBack()
{
return (*_range).popBack();
}
version(StdDdoc)
{
/++
Only defined if $(D isRandomAccesRange!R) is $(D true).
+/
auto ref opIndex(IndexType)(IndexType index) {assert(0);}
/++ Ditto +/
auto ref opIndex(IndexType)(IndexType index) const {assert(0);}
}
else static if(isRandomAccessRange!R)
{
auto ref opIndex(IndexType)(IndexType index)
if(is(typeof((*_range)[index])))
{
return (*_range)[index];
}
auto ref opIndex(IndexType)(IndexType index) const
if(is(typeof((*cast(const R*)_range)[index])))
{
return (*_range)[index];
}
}
/++
Only defined if $(D hasMobileElements!R) and $(D isForwardRange!R) are
$(D true).
+/
static if(hasMobileElements!R && isForwardRange!R) auto moveFront()
{
return (*_range).moveFront();
}
/++
Only defined if $(D hasMobileElements!R) and $(D isBidirectionalRange!R)
are $(D true).
+/
static if(hasMobileElements!R && isBidirectionalRange!R) auto moveBack()
{
return (*_range).moveBack();
}
/++
Only defined if $(D hasMobileElements!R) and $(D isRandomAccessRange!R)
are $(D true).
+/
static if(hasMobileElements!R && isRandomAccessRange!R) auto moveAt(IndexType)(IndexType index)
if(is(typeof((*_range).moveAt(index))))
{
return (*_range).moveAt(index);
}
version(StdDdoc)
{
/++
Only defined if $(D hasLength!R) is $(D true).
+/
@property auto length() {assert(0);}
/++ Ditto +/
@property auto length() const {assert(0);}
}
else static if(hasLength!R)
{
@property auto length()
{
return (*_range).length;
}
static if(is(typeof((*cast(const R*)_range).length))) @property auto length() const
{
return (*_range).length;
}
}
version(StdDdoc)
{
/++
Only defined if $(D hasSlicing!R) is $(D true).
+/
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) {assert(0);}
/++ Ditto +/
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) const {assert(0);}
}
else static if(hasSlicing!R)
{
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end)
if(is(typeof((*_range)[begin .. end])))
{
mixin(_genOpSlice());
}
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) const
if(is(typeof((*cast(const R*)_range)[begin .. end])))
{
mixin(_genOpSlice());
}
private static string _genOpSlice() @safe pure nothrow
{
return `import std.conv;` ~
`alias S = typeof((*_range)[begin .. end]);` ~
`static assert(hasSlicing!S, S.stringof ~ " is not sliceable.");` ~
`auto mem = new void[S.sizeof];` ~
`emplace!S(mem, cast(S)(*_range)[begin .. end]);` ~
`return RefRange!S(cast(S*)mem.ptr);`;
}
}
private:
R* _range;
}
/// Basic Example
unittest
{
import std.algorithm;
ubyte[] buffer = [1, 9, 45, 12, 22];
auto found1 = find(buffer, 45);
assert(found1 == [45, 12, 22]);
assert(buffer == [1, 9, 45, 12, 22]);
auto wrapped1 = refRange(&buffer);
auto found2 = find(wrapped1, 45);
assert(*found2.ptr == [45, 12, 22]);
assert(buffer == [45, 12, 22]);
auto found3 = find(wrapped1.save, 22);
assert(*found3.ptr == [22]);
assert(buffer == [45, 12, 22]);
string str = "hello world";
auto wrappedStr = refRange(&str);
assert(str.front == 'h');
str.popFrontN(5);
assert(str == " world");
assert(wrappedStr.front == ' ');
assert(*wrappedStr.ptr == " world");
}
/// opAssign Example.
unittest
{
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
auto wrapped1 = refRange(&buffer1);
auto wrapped2 = refRange(&buffer2);
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
assert(buffer1 != buffer2);
wrapped1 = wrapped2;
//Everything points to the same stuff as before.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
//But buffer1 has changed due to the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [6, 7, 8, 9, 10]);
buffer2 = [11, 12, 13, 14, 15];
//Everything points to the same stuff as before.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
//But buffer2 has changed due to the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [11, 12, 13, 14, 15]);
wrapped2 = null;
//The pointer changed for wrapped2 but not wrapped1.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is null);
assert(wrapped1.ptr !is wrapped2.ptr);
//buffer2 is not affected by the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [11, 12, 13, 14, 15]);
}
unittest
{
import std.algorithm;
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto wrapper = refRange(&buffer);
auto p = wrapper.ptr;
auto f = wrapper.front;
wrapper.front = f;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
auto b = wrapper.back;
wrapper.back = b;
wrapper.popBack();
auto i = wrapper[0];
wrapper.moveFront();
wrapper.moveBack();
wrapper.moveAt(0);
auto l = wrapper.length;
auto sl = wrapper[0 .. 1];
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
const wrapper = refRange(&buffer);
const p = wrapper.ptr;
const f = wrapper.front;
const e = wrapper.empty;
const s = wrapper.save;
const b = wrapper.back;
const i = wrapper[0];
const l = wrapper.length;
const sl = wrapper[0 .. 1];
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto filtered = filter!"true"(buffer);
auto wrapper = refRange(&filtered);
auto p = wrapper.ptr;
auto f = wrapper.front;
wrapper.front = f;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
wrapper.moveFront();
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto filtered = filter!"true"(buffer);
const wrapper = refRange(&filtered);
const p = wrapper.ptr;
//Cannot currently be const. filter needs to be updated to handle const.
/+
const f = wrapper.front;
const e = wrapper.empty;
const s = wrapper.save;
+/
}
{
string str = "hello world";
auto wrapper = refRange(&str);
auto p = wrapper.ptr;
auto f = wrapper.front;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
auto b = wrapper.back;
wrapper.popBack();
}
}
//Test assignment.
unittest
{
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
RefRange!(ubyte[]) wrapper1;
RefRange!(ubyte[]) wrapper2 = refRange(&buffer2);
assert(wrapper1.ptr is null);
assert(wrapper2.ptr is &buffer2);
wrapper1 = refRange(&buffer1);
assert(wrapper1.ptr is &buffer1);
wrapper1 = wrapper2;
assert(wrapper1.ptr is &buffer1);
assert(buffer1 == buffer2);
wrapper1 = RefRange!(ubyte[]).init;
assert(wrapper1.ptr is null);
assert(wrapper2.ptr is &buffer2);
assert(buffer1 == buffer2);
assert(buffer1 == [6, 7, 8, 9, 10]);
wrapper2 = null;
assert(wrapper2.ptr is null);
assert(buffer2 == [6, 7, 8, 9, 10]);
}
unittest
{
import std.algorithm;
//Test that ranges are properly consumed.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(*find(wrapper, 41).ptr == [41, 3, 40, 4, 42, 9]);
assert(arr == [41, 3, 40, 4, 42, 9]);
assert(*drop(wrapper, 2).ptr == [40, 4, 42, 9]);
assert(arr == [40, 4, 42, 9]);
assert(equal(until(wrapper, 42), [40, 4]));
assert(arr == [42, 9]);
assert(find(wrapper, 12).empty);
assert(arr.empty);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
assert(*find(wrapper, "l").ptr == "llo, world-like object.");
assert(str == "llo, world-like object.");
assert(equal(take(wrapper, 5), "llo, "));
assert(str == "world-like object.");
}
//Test that operating on saved ranges does not consume the original.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
auto saved = wrapper.save;
saved.popFrontN(3);
assert(*saved.ptr == [41, 3, 40, 4, 42, 9]);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
auto saved = wrapper.save;
saved.popFrontN(13);
assert(*saved.ptr == "like object.");
assert(str == "Hello, world-like object.");
}
//Test that functions which use save work properly.
{
int[] arr = [1, 42];
auto wrapper = refRange(&arr);
assert(equal(commonPrefix(wrapper, [1, 27]), [1]));
}
{
int[] arr = [4, 5, 6, 7, 1, 2, 3];
auto wrapper = refRange(&arr);
assert(bringToFront(wrapper[0 .. 4], wrapper[4 .. arr.length]) == 3);
assert(arr == [1, 2, 3, 4, 5, 6, 7]);
}
//Test bidirectional functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(wrapper.back == 9);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
wrapper.popBack();
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42]);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
assert(wrapper.back == '.');
assert(str == "Hello, world-like object.");
wrapper.popBack();
assert(str == "Hello, world-like object");
}
//Test random access functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(wrapper[2] == 2);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
assert(*wrapper[3 .. 6].ptr != null, [41, 3, 40]);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
}
//Test move functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
auto t1 = wrapper.moveFront();
auto t2 = wrapper.moveBack();
wrapper.front = t2;
wrapper.back = t1;
assert(arr == [9, 42, 2, 41, 3, 40, 4, 42, 1]);
sort(wrapper.save);
assert(arr == [1, 2, 3, 4, 9, 40, 41, 42, 42]);
}
}
unittest
{
struct S
{
@property int front() @safe const pure nothrow { return 0; }
enum bool empty = false;
void popFront() @safe pure nothrow { }
@property auto save() @safe pure nothrow { return this; }
}
S s;
auto wrapper = refRange(&s);
static assert(isInfinite!(typeof(wrapper)));
}
unittest
{
class C
{
@property int front() @safe const pure nothrow { return 0; }
@property bool empty() @safe const pure nothrow { return false; }
void popFront() @safe pure nothrow { }
@property auto save() @safe pure nothrow { return this; }
}
static assert(isForwardRange!C);
auto c = new C;
auto cWrapper = refRange(&c);
static assert(is(typeof(cWrapper) == C));
assert(cWrapper is c);
}
unittest // issue 14373
{
static struct R
{
@property int front() {return 0;}
void popFront() {empty = true;}
bool empty = false;
}
R r;
refRange(&r).popFront();
assert(r.empty);
}
unittest // issue 14575
{
struct R
{
Object front;
alias back = front;
bool empty = false;
void popFront() {empty = true;}
alias popBack = popFront;
@property R save() {return this;}
}
static assert(isBidirectionalRange!R);
R r;
auto rr = refRange(&r);
struct R2
{
@property Object front() {return null;}
@property const(Object) front() const {return null;}
alias back = front;
bool empty = false;
void popFront() {empty = true;}
alias popBack = popFront;
@property R2 save() {return this;}
}
static assert(isBidirectionalRange!R2);
R2 r2;
auto rr2 = refRange(&r2);
}
/++
Helper function for constructing a $(LREF RefRange).
If the given range is a class type (and thus is already a reference type),
then the original range is returned rather than a $(LREF RefRange).
+/
auto refRange(R)(R* range)
if(isInputRange!R && !is(R == class))
{
return RefRange!R(range);
}
/// ditto
auto refRange(R)(R* range)
if(isInputRange!R && is(R == class))
{
return *range;
}
/*****************************************************************************/
@safe unittest // bug 9060
{
import std.algorithm : map, joiner, group, until;
// fix for std.algorithm
auto r = map!(x => 0)([1]);
chain(r, r);
zip(r, r);
roundRobin(r, r);
struct NRAR {
typeof(r) input;
@property empty() { return input.empty; }
@property front() { return input.front; }
void popFront() { input.popFront(); }
@property save() { return NRAR(input.save); }
}
auto n1 = NRAR(r);
cycle(n1); // non random access range version
assumeSorted(r);
// fix for std.range
joiner([r], [9]);
struct NRAR2 {
NRAR input;
@property empty() { return true; }
@property front() { return input; }
void popFront() { }
@property save() { return NRAR2(input.save); }
}
auto n2 = NRAR2(n1);
joiner(n2);
group(r);
until(r, 7);
static void foo(R)(R r) { until!(x => x > 7)(r); }
foo(r);
}
/*********************************
* An OutputRange that discards the data it receives.
*/
struct NullSink
{
void put(E)(E){}
}
///
@safe unittest
{
import std.algorithm : map, copy;
[4, 5, 6].map!(x => x * 2).copy(NullSink()); // data is discarded
}
/++
Implements a "tee" style pipe, wrapping an input range so that elements of the
range can be passed to a provided function or $(LREF OutputRange) as they are
iterated over. This is useful for printing out intermediate values in a long
chain of range code, performing some operation with side-effects on each call
to $(D front) or $(D popFront), or diverting the elements of a range into an
auxiliary $(LREF OutputRange).
It is important to note that as the resultant range is evaluated lazily,
in the case of the version of $(D tee) that takes a function, the function
will not actually be executed until the range is "walked" using functions
that evaluate ranges, such as $(XREF array,array) or
$(XREF_PACK algorithm,iteration,fold).
Params:
pipeOnPop = If `Yes.pipeOnPop`, simply iterating the range without ever
calling `front` is enough to have `tee` mirror elements to `outputRange` (or,
respectively, `fun`). If `No.pipeOnPop`, only elements for which `front` does
get called will be also sent to `outputRange`/`fun`.
inputRange = The input range beeing passed through.
outputRange = This range will receive elements of `inputRange` progressively
as iteration proceeds.
fun = This function will be called with elements of `inputRange`
progressively as iteration proceeds.
Returns:
An input range that offers the elements of `inputRange`. Regardless of
whether `inputRange` is a more powerful range (forward, bidirectional etc),
the result is always an input range. Reading this causes `inputRange` to be
iterated and returns its elements in turn. In addition, the same elements
will be passed to `outputRange` or `fun` as well.
See_Also: $(XREF_PACK algorithm,iteration,each)
+/
auto tee(Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1, R2)(R1 inputRange, R2 outputRange)
if (isInputRange!R1 && isOutputRange!(R2, ElementType!R1))
{
static struct Result
{
private R1 _input;
private R2 _output;
static if (!pipeOnPop)
{
private bool _frontAccessed;
}
static if (hasLength!R1)
{
@property length()
{
return _input.length;
}
}
static if (isInfinite!R1)
{
enum bool empty = false;
}
else
{
@property bool empty() { return _input.empty; }
}
void popFront()
{
assert(!_input.empty);
static if (pipeOnPop)
{
put(_output, _input.front);
}
else
{
_frontAccessed = false;
}
_input.popFront();
}
@property auto ref front()
{
static if (!pipeOnPop)
{
if (!_frontAccessed)
{
_frontAccessed = true;
put(_output, _input.front);
}
}
return _input.front;
}
}
return Result(inputRange, outputRange);
}
/// Ditto
auto tee(alias fun, Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1)(R1 inputRange)
if (is(typeof(fun) == void) || isSomeFunction!fun)
{
/*
Distinguish between function literals and template lambdas
when using either as an $(LREF OutputRange). Since a template
has no type, typeof(template) will always return void.
If it's a template lambda, it's first necessary to instantiate
it with $(D ElementType!R1).
*/
static if (is(typeof(fun) == void))
alias _fun = fun!(ElementType!R1);
else
alias _fun = fun;
static if (isFunctionPointer!_fun || isDelegate!_fun)
{
return tee!pipeOnPop(inputRange, _fun);
}
else
{
return tee!pipeOnPop(inputRange, &_fun);
}
}
///
@safe unittest
{
import std.algorithm : equal, filter, map;
// Sum values while copying
int[] values = [1, 4, 9, 16, 25];
int sum = 0;
auto newValues = values.tee!(a => sum += a).array;
assert(equal(newValues, values));
assert(sum == 1 + 4 + 9 + 16 + 25);
// Count values that pass the first filter
int count = 0;
auto newValues4 = values.filter!(a => a < 10)
.tee!(a => count++)
.map!(a => a + 1)
.filter!(a => a < 10);
//Fine, equal also evaluates any lazy ranges passed to it.
//count is not 3 until equal evaluates newValues4
assert(equal(newValues4, [2, 5]));
assert(count == 3);
}
//
@safe unittest
{
import std.algorithm : equal, filter, map;
int[] values = [1, 4, 9, 16, 25];
int count = 0;
auto newValues = values.filter!(a => a < 10)
.tee!(a => count++, No.pipeOnPop)
.map!(a => a + 1)
.filter!(a => a < 10);
auto val = newValues.front;
assert(count == 1);
//front is only evaluated once per element
val = newValues.front;
assert(count == 1);
//popFront() called, fun will be called
//again on the next access to front
newValues.popFront();
newValues.front;
assert(count == 2);
int[] preMap = new int[](3), postMap = [];
auto mappedValues = values.filter!(a => a < 10)
//Note the two different ways of using tee
.tee(preMap)
.map!(a => a + 1)
.tee!(a => postMap ~= a)
.filter!(a => a < 10);
assert(equal(mappedValues, [2, 5]));
assert(equal(preMap, [1, 4, 9]));
assert(equal(postMap, [2, 5, 10]));
}
//
@safe unittest
{
import std.algorithm : filter, equal, map;
char[] txt = "Line one, Line 2".dup;
bool isVowel(dchar c)
{
import std.string : indexOf;
return "AaEeIiOoUu".indexOf(c) != -1;
}
int vowelCount = 0;
int shiftedCount = 0;
auto removeVowels = txt.tee!(c => isVowel(c) ? vowelCount++ : 0)
.filter!(c => !isVowel(c))
.map!(c => (c == ' ') ? c : c + 1)
.tee!(c => isVowel(c) ? shiftedCount++ : 0);
assert(equal(removeVowels, "Mo o- Mo 3"));
assert(vowelCount == 6);
assert(shiftedCount == 3);
}
@safe unittest
{
// Manually stride to test different pipe behavior.
void testRange(Range)(Range r)
{
const int strideLen = 3;
int i = 0;
ElementType!Range elem1;
ElementType!Range elem2;
while (!r.empty)
{
if (i % strideLen == 0)
{
//Make sure front is only
//evaluated once per item
elem1 = r.front;
elem2 = r.front;
assert(elem1 == elem2);
}
r.popFront();
i++;
}
}
string txt = "abcdefghijklmnopqrstuvwxyz";
int popCount = 0;
auto pipeOnPop = txt.tee!(a => popCount++);
testRange(pipeOnPop);
assert(popCount == 26);
int frontCount = 0;
auto pipeOnFront = txt.tee!(a => frontCount++, No.pipeOnPop);
testRange(pipeOnFront);
assert(frontCount == 9);
}
@safe unittest
{
import std.algorithm : equal;
//Test diverting elements to an OutputRange
string txt = "abcdefghijklmnopqrstuvwxyz";
dchar[] asink1 = [];
auto fsink = (dchar c) { asink1 ~= c; };
auto result1 = txt.tee(fsink).array;
assert(equal(txt, result1) && (equal(result1, asink1)));
dchar[] _asink1 = [];
auto _result1 = txt.tee!((dchar c) { _asink1 ~= c; })().array;
assert(equal(txt, _result1) && (equal(_result1, _asink1)));
dchar[] asink2 = new dchar[](txt.length);
void fsink2(dchar c) { static int i = 0; asink2[i] = c; i++; }
auto result2 = txt.tee(&fsink2).array;
assert(equal(txt, result2) && equal(result2, asink2));
dchar[] asink3 = new dchar[](txt.length);
auto result3 = txt.tee(asink3).array;
assert(equal(txt, result3) && equal(result3, asink3));
foreach (CharType; AliasSeq!(char, wchar, dchar))
{
auto appSink = appender!(CharType[])();
auto appResult = txt.tee(appSink).array;
assert(equal(txt, appResult) && equal(appResult, appSink.data));
}
foreach (StringType; AliasSeq!(string, wstring, dstring))
{
auto appSink = appender!StringType();
auto appResult = txt.tee(appSink).array;
assert(equal(txt, appResult) && equal(appResult, appSink.data));
}
}
@safe unittest
{
// Issue 13483
static void func1(T)(T x) {}
void func2(int x) {}
auto r = [1, 2, 3, 4].tee!func1.tee!func2;
}
|
D
|
/*******************************************************************************
D language bindings for libsodium's export_.h
License: ISC (see LICENSE.txt)
*******************************************************************************/
module libsodium.export_;
import libsodium.export_;
import core.stdc.stdint;
extern (C):
extern (D) auto SODIUM_MIN(T0, T1)(auto ref T0 A, auto ref T1 B)
{
return A < B ? A : B;
}
enum SODIUM_SIZE_MAX = SODIUM_MIN(UINT64_MAX, SIZE_MAX);
|
D
|
/Users/mprechner/vapor-demo/HelloWorld/.build/debug/JSON.build/JSON.swift.o : /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/File.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Bytes.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Equatable.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Node.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Parse.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Serialize.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONRepresentable.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/Sequence+Convertible.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Node.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/PathIndexable.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Polymorphic.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/CLibreSSL.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Users/mprechner/vapor-demo/HelloWorld/.build/debug/libc.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Jay.swiftmodule
/Users/mprechner/vapor-demo/HelloWorld/.build/debug/JSON.build/JSON~partial.swiftmodule : /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/File.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Bytes.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Equatable.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Node.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Parse.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Serialize.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONRepresentable.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/Sequence+Convertible.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Node.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/PathIndexable.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Polymorphic.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/CLibreSSL.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Users/mprechner/vapor-demo/HelloWorld/.build/debug/libc.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Jay.swiftmodule
/Users/mprechner/vapor-demo/HelloWorld/.build/debug/JSON.build/JSON~partial.swiftdoc : /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/File.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Bytes.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Equatable.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Node.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Parse.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Serialize.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONRepresentable.swift /Users/mprechner/vapor-demo/HelloWorld/.build/checkouts/json.git-9153249592855998091/Sources/JSON/Sequence+Convertible.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Node.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/PathIndexable.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Polymorphic.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/CLibreSSL.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Users/mprechner/vapor-demo/HelloWorld/.build/debug/libc.swiftmodule /Users/mprechner/vapor-demo/HelloWorld/.build/debug/Jay.swiftmodule
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.win32.OS;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.TypedListener;
import org.eclipse.swt.widgets.Event;
import java.lang.all;
/**
* Instances of this class represent a column in a tree widget.
* <p><dl>
* <dt><b>Styles:</b></dt>
* <dd>LEFT, RIGHT, CENTER</dd>
* <dt><b>Events:</b></dt>
* <dd> Move, Resize, Selection</dd>
* </dl>
* </p><p>
* Note: Only one of the styles LEFT, RIGHT and CENTER may be specified.
* </p><p>
* IMPORTANT: This class is <em>not</em> intended to be subclassed.
* </p>
*
* @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a>
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*
* @since 3.1
*/
public class TreeColumn : Item {
Tree parent;
bool resizable, moveable;
String toolTipText;
int id;
/**
* Constructs a new instance of this class given its parent
* (which must be a <code>Tree</code>) and a style value
* describing its behavior and appearance. The item is added
* to the end of the items maintained by its parent.
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
* class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
* Style bits are also inherited from superclasses.
* </p>
*
* @param parent a composite control which will be the parent of the new instance (cannot be null)
* @param style the style of control to construct
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
* <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
* </ul>
*
* @see SWT#LEFT
* @see SWT#RIGHT
* @see SWT#CENTER
* @see Widget#checkSubclass
* @see Widget#getStyle
*/
public this(Tree parent, int style) {
super(parent, checkStyle(style));
resizable = true;
this.parent = parent;
parent.createItem(this, parent.getColumnCount());
}
/**
* Constructs a new instance of this class given its parent
* (which must be a <code>Tree</code>), a style value
* describing its behavior and appearance, and the index
* at which to place it in the items maintained by its parent.
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
* class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
* Style bits are also inherited from superclasses.
* </p>
* <p>
* Note that due to a restriction on some platforms, the first column
* is always left aligned.
* </p>
* @param parent a composite control which will be the parent of the new instance (cannot be null)
* @param style the style of control to construct
* @param index the zero-relative index to store the receiver in its parent
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
* <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
* </ul>
*
* @see SWT#LEFT
* @see SWT#RIGHT
* @see SWT#CENTER
* @see Widget#checkSubclass
* @see Widget#getStyle
*/
public this(Tree parent, int style, int index) {
super(parent, checkStyle(style));
resizable = true;
this.parent = parent;
parent.createItem(this, index);
}
/**
* Adds the listener to the collection of listeners who will
* be notified when the control is moved or resized, by sending
* it one of the messages defined in the <code>ControlListener</code>
* interface.
*
* @param listener the listener which should be notified
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see ControlListener
* @see #removeControlListener
*/
public void addControlListener(ControlListener listener) {
checkWidget();
if (listener is null)
error(SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Resize, typedListener);
addListener(SWT.Move, typedListener);
}
/**
* Adds the listener to the collection of listeners who will
* be notified when the control is selected by the user, by sending
* it one of the messages defined in the <code>SelectionListener</code>
* interface.
* <p>
* <code>widgetSelected</code> is called when the column header is selected.
* <code>widgetDefaultSelected</code> is not called.
* </p>
*
* @param listener the listener which should be notified when the control is selected by the user
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see SelectionListener
* @see #removeSelectionListener
* @see SelectionEvent
*/
public void addSelectionListener(SelectionListener listener) {
checkWidget();
if (listener is null)
error(SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection, typedListener);
addListener(SWT.DefaultSelection, typedListener);
}
static int checkStyle(int style) {
return checkBits(style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
}
override protected void checkSubclass() {
if (!isValidSubclass())
error(SWT.ERROR_INVALID_SUBCLASS);
}
override void destroyWidget() {
parent.destroyItem(this);
releaseHandle();
}
/**
* Returns a value which describes the position of the
* text or image in the receiver. The value will be one of
* <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>.
*
* @return the alignment
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getAlignment() {
checkWidget();
if ((style & SWT.LEFT) !is 0)
return SWT.LEFT;
if ((style & SWT.CENTER) !is 0)
return SWT.CENTER;
if ((style & SWT.RIGHT) !is 0)
return SWT.RIGHT;
return SWT.LEFT;
}
/**
* Gets the moveable attribute. A column that is
* not moveable cannot be reordered by the user
* by dragging the header but may be reordered
* by the programmer.
*
* @return the moveable attribute
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#getColumnOrder()
* @see Tree#setColumnOrder(int[])
* @see TreeColumn#setMoveable(bool)
* @see SWT#Move
*
* @since 3.2
*/
public bool getMoveable() {
checkWidget();
return moveable;
}
override String getNameText() {
return getText();
}
/**
* Returns the receiver's parent, which must be a <code>Tree</code>.
*
* @return the receiver's parent
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public Tree getParent() {
checkWidget();
return parent;
}
/**
* Gets the resizable attribute. A column that is
* not resizable cannot be dragged by the user but
* may be resized by the programmer.
*
* @return the resizable attribute
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public bool getResizable() {
checkWidget();
return resizable;
}
/**
* Returns the receiver's tool tip text, or null if it has
* not been set.
*
* @return the receiver's tool tip text
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.2
*/
public String getToolTipText() {
checkWidget();
return toolTipText;
}
/**
* Gets the width of the receiver.
*
* @return the width
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getWidth() {
checkWidget();
int index = parent.indexOf(this);
if (index is -1)
return 0;
auto hwndHeader = parent.hwndHeader;
if (hwndHeader is null)
return 0;
HDITEM hdItem;
hdItem.mask = OS.HDI_WIDTH;
OS.SendMessage(hwndHeader, OS.HDM_GETITEM, index, &hdItem);
return hdItem.cxy;
}
/**
* Causes the receiver to be resized to its preferred size.
* For a composite, this involves computing the preferred size
* from its layout, if there is one.
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
*/
public void pack() {
checkWidget();
int index = parent.indexOf(this);
if (index is -1)
return;
int columnWidth = 0;
auto hwnd = parent.handle;
auto hwndHeader = parent.hwndHeader;
RECT headerRect;
OS.SendMessage(hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect);
auto hDC = OS.GetDC(hwnd);
HFONT oldFont, newFont = cast(HFONT) OS.SendMessage(hwnd, OS.WM_GETFONT, 0, 0);
if (newFont !is null)
oldFont = OS.SelectObject(hDC, newFont);
TVITEM tvItem;
tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM;
tvItem.hItem = cast(HTREEITEM) OS.SendMessage(hwnd, OS.TVM_GETNEXTITEM, OS.TVGN_ROOT, 0);
while (tvItem.hItem !is null) {
OS.SendMessage(hwnd, OS.TVM_GETITEM, 0, &tvItem);
TreeItem item = tvItem.lParam !is -1 ? parent.items[tvItem.lParam] : null;
if (item !is null) {
int itemRight = 0;
if (parent.hooks(SWT.MeasureItem)) {
Event event = parent.sendMeasureItemEvent(item, index, hDC);
if (isDisposed() || parent.isDisposed())
break;
itemRight = event.x + event.width;
}
else {
auto hFont = item.fontHandle(index);
if (hFont !is cast(HFONT)-1)
hFont = OS.SelectObject(hDC, hFont);
RECT* itemRect = item.getBounds(index, true, true, false, false, false, hDC);
if (hFont !is cast(HFONT)-1)
OS.SelectObject(hDC, hFont);
itemRight = itemRect.right;
}
columnWidth = Math.max(columnWidth, itemRight - headerRect.left);
}
tvItem.hItem = cast(HTREEITEM) OS.SendMessage(hwnd,
OS.TVM_GETNEXTITEM, OS.TVGN_NEXTVISIBLE, tvItem.hItem);
}
RECT rect;
int flags = OS.DT_CALCRECT | OS.DT_NOPREFIX;
StringT buffer = StrToTCHARs(parent.getCodePage(), text, false);
OS.DrawText(hDC, buffer.ptr, cast(int) /*64bit*/ buffer.length, &rect, flags);
int headerWidth = rect.right - rect.left + Tree.HEADER_MARGIN;
if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed())
headerWidth += Tree.HEADER_EXTRA;
if (image !is null || parent.sortColumn is this) {
Image headerImage = null;
if (parent.sortColumn is this && parent.sortDirection !is SWT.NONE) {
if (OS.COMCTL32_MAJOR < 6) {
headerImage = display.getSortImage(parent.sortDirection);
}
else {
headerWidth += Tree.SORT_WIDTH;
}
}
else {
headerImage = image;
}
if (headerImage !is null) {
Rectangle bounds = headerImage.getBounds();
headerWidth += bounds.width;
}
int margin = 0;
if (hwndHeader !is null && OS.COMCTL32_VERSION >= OS.VERSION(5, 80)) {
margin = cast(int) /*64bit*/ OS.SendMessage(hwndHeader,
OS.HDM_GETBITMAPMARGIN, 0, 0);
}
else {
margin = OS.GetSystemMetrics(OS.SM_CXEDGE) * 3;
}
headerWidth += margin * 2;
}
if (newFont !is null)
OS.SelectObject(hDC, oldFont);
OS.ReleaseDC(hwnd, hDC);
int gridWidth = parent.linesVisible ? Tree.GRID_WIDTH : 0;
setWidth(Math.max(headerWidth, columnWidth + gridWidth));
}
override void releaseHandle() {
super.releaseHandle();
parent = null;
}
override void releaseParent() {
super.releaseParent();
if (parent.sortColumn is this) {
parent.sortColumn = null;
}
}
/**
* Removes the listener from the collection of listeners who will
* be notified when the control is moved or resized.
*
* @param listener the listener which should no longer be notified
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see ControlListener
* @see #addControlListener
*/
public void removeControlListener(ControlListener listener) {
checkWidget();
if (listener is null)
error(SWT.ERROR_NULL_ARGUMENT);
if (eventTable is null)
return;
eventTable.unhook(SWT.Move, listener);
eventTable.unhook(SWT.Resize, listener);
}
/**
* Removes the listener from the collection of listeners who will
* be notified when the control is selected by the user.
*
* @param listener the listener which should no longer be notified
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see SelectionListener
* @see #addSelectionListener
*/
public void removeSelectionListener(SelectionListener listener) {
checkWidget();
if (listener is null)
error(SWT.ERROR_NULL_ARGUMENT);
if (eventTable is null)
return;
eventTable.unhook(SWT.Selection, listener);
eventTable.unhook(SWT.DefaultSelection, listener);
}
/**
* Controls how text and images will be displayed in the receiver.
* The argument should be one of <code>LEFT</code>, <code>RIGHT</code>
* or <code>CENTER</code>.
* <p>
* Note that due to a restriction on some platforms, the first column
* is always left aligned.
* </p>
* @param alignment the new alignment
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void setAlignment(int alignment) {
checkWidget();
if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) is 0)
return;
int index = parent.indexOf(this);
if (index is -1 || index is 0)
return;
style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
auto hwndHeader = parent.hwndHeader;
if (hwndHeader is null)
return;
HDITEM hdItem;
hdItem.mask = OS.HDI_FORMAT;
OS.SendMessage(hwndHeader, OS.HDM_GETITEM, index, &hdItem);
hdItem.fmt &= ~OS.HDF_JUSTIFYMASK;
if ((style & SWT.LEFT) is SWT.LEFT)
hdItem.fmt |= OS.HDF_LEFT;
if ((style & SWT.CENTER) is SWT.CENTER)
hdItem.fmt |= OS.HDF_CENTER;
if ((style & SWT.RIGHT) is SWT.RIGHT)
hdItem.fmt |= OS.HDF_RIGHT;
OS.SendMessage(hwndHeader, OS.HDM_SETITEM, index, &hdItem);
if (index !is 0) {
auto hwnd = parent.handle;
parent.forceResize();
RECT rect, headerRect;
OS.GetClientRect(hwnd, &rect);
OS.SendMessage(hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect);
rect.left = headerRect.left;
rect.right = headerRect.right;
OS.InvalidateRect(hwnd, &rect, true);
}
}
override public void setImage(Image image) {
checkWidget();
if (image !is null && image.isDisposed()) {
error(SWT.ERROR_INVALID_ARGUMENT);
}
super.setImage(image);
if (parent.sortColumn !is this || parent.sortDirection !is SWT.NONE) {
setImage(image, false, false);
}
}
void setImage(Image image, bool sort, bool right) {
int index = parent.indexOf(this);
if (index is -1)
return;
auto hwndHeader = parent.hwndHeader;
if (hwndHeader is null)
return;
HDITEM hdItem;
hdItem.mask = OS.HDI_FORMAT | OS.HDI_IMAGE | OS.HDI_BITMAP;
OS.SendMessage(hwndHeader, OS.HDM_GETITEM, index, &hdItem);
hdItem.fmt &= ~OS.HDF_BITMAP_ON_RIGHT;
if (image !is null) {
if (sort) {
hdItem.mask &= ~OS.HDI_IMAGE;
hdItem.fmt &= ~OS.HDF_IMAGE;
hdItem.fmt |= OS.HDF_BITMAP;
hdItem.hbm = image.handle;
}
else {
hdItem.mask &= ~OS.HDI_BITMAP;
hdItem.fmt &= ~OS.HDF_BITMAP;
hdItem.fmt |= OS.HDF_IMAGE;
hdItem.iImage = parent.imageIndexHeader(image);
}
if (right)
hdItem.fmt |= OS.HDF_BITMAP_ON_RIGHT;
}
else {
hdItem.mask &= ~(OS.HDI_IMAGE | OS.HDI_BITMAP);
hdItem.fmt &= ~(OS.HDF_IMAGE | OS.HDF_BITMAP);
}
OS.SendMessage(hwndHeader, OS.HDM_SETITEM, index, &hdItem);
}
/**
* Sets the moveable attribute. A column that is
* moveable can be reordered by the user by dragging
* the header. A column that is not moveable cannot be
* dragged by the user but may be reordered
* by the programmer.
*
* @param moveable the moveable attribute
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#setColumnOrder(int[])
* @see Tree#getColumnOrder()
* @see TreeColumn#getMoveable()
* @see SWT#Move
*
* @since 3.2
*/
public void setMoveable(bool moveable) {
checkWidget();
this.moveable = moveable;
}
/**
* Sets the resizable attribute. A column that is
* not resizable cannot be dragged by the user but
* may be resized by the programmer.
*
* @param resizable the resize attribute
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void setResizable(bool resizable) {
checkWidget();
this.resizable = resizable;
}
void setSortDirection(int direction) {
if (OS.COMCTL32_MAJOR >= 6) {
auto hwndHeader = parent.hwndHeader;
if (hwndHeader !is null) {
int index = parent.indexOf(this);
if (index is -1)
return;
HDITEM hdItem;
hdItem.mask = OS.HDI_FORMAT | OS.HDI_IMAGE;
OS.SendMessage(hwndHeader, OS.HDM_GETITEM, index, &hdItem);
switch (direction) {
case SWT.UP:
hdItem.fmt &= ~(OS.HDF_IMAGE | OS.HDF_SORTDOWN);
hdItem.fmt |= OS.HDF_SORTUP;
if (image is null)
hdItem.mask &= ~OS.HDI_IMAGE;
break;
case SWT.DOWN:
hdItem.fmt &= ~(OS.HDF_IMAGE | OS.HDF_SORTUP);
hdItem.fmt |= OS.HDF_SORTDOWN;
if (image is null)
hdItem.mask &= ~OS.HDI_IMAGE;
break;
case SWT.NONE:
hdItem.fmt &= ~(OS.HDF_SORTUP | OS.HDF_SORTDOWN);
if (image !is null) {
hdItem.fmt |= OS.HDF_IMAGE;
hdItem.iImage = parent.imageIndexHeader(image);
}
else {
hdItem.fmt &= ~OS.HDF_IMAGE;
hdItem.mask &= ~OS.HDI_IMAGE;
}
break;
default:
}
OS.SendMessage(hwndHeader, OS.HDM_SETITEM, index, &hdItem);
if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed()) {
auto hwnd = parent.handle;
parent.forceResize();
RECT rect, headerRect;
OS.GetClientRect(hwnd, &rect);
OS.SendMessage(hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect);
rect.left = headerRect.left;
rect.right = headerRect.right;
OS.InvalidateRect(hwnd, &rect, true);
}
}
}
else {
switch (direction) {
case SWT.UP:
case SWT.DOWN:
setImage(display.getSortImage(direction), true, true);
break;
case SWT.NONE:
setImage(image, false, false);
break;
default:
}
}
}
override public void setText(String string) {
checkWidget();
// SWT extension: allow null string
//if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
if (string.equals(text))
return;
int index = parent.indexOf(this);
if (index is -1)
return;
super.setText(string);
/*
* Bug in Windows. When a column header contains a
* mnemonic character, Windows does not measure the
* text properly. This causes '...' to always appear
* at the end of the text. The fix is to remove
* mnemonic characters and replace doubled mnemonics
* with spaces.
*/
auto hHeap = OS.GetProcessHeap();
StringT buffer = StrToTCHARs(parent.getCodePage(), fixMnemonic(string, true), true);
auto byteCount = buffer.length * TCHAR.sizeof;
auto pszText = cast(TCHAR*) OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
OS.MoveMemory(pszText, buffer.ptr, byteCount);
auto hwndHeader = parent.hwndHeader;
if (hwndHeader is null)
return;
HDITEM hdItem;
hdItem.mask = OS.HDI_TEXT;
hdItem.pszText = pszText;
auto result = OS.SendMessage(hwndHeader, OS.HDM_SETITEM, index, &hdItem);
if (pszText !is null)
OS.HeapFree(hHeap, 0, pszText);
if (result is 0)
error(SWT.ERROR_CANNOT_SET_TEXT);
}
/**
* Sets the receiver's tool tip text to the argument, which
* may be null indicating that no tool tip text should be shown.
*
* @param string the new tool tip text (or null)
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.2
*/
public void setToolTipText(String string) {
checkWidget();
toolTipText = string;
auto hwndHeaderToolTip = parent.headerToolTipHandle;
if (hwndHeaderToolTip is null) {
parent.createHeaderToolTips();
parent.updateHeaderToolTips();
}
}
/**
* Sets the width of the receiver.
*
* @param width the new width
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void setWidth(int width) {
checkWidget();
if (width < 0)
return;
int index = parent.indexOf(this);
if (index is -1)
return;
auto hwndHeader = parent.hwndHeader;
if (hwndHeader is null)
return;
HDITEM hdItem;
hdItem.mask = OS.HDI_WIDTH;
hdItem.cxy = width;
OS.SendMessage(hwndHeader, OS.HDM_SETITEM, index, &hdItem);
RECT headerRect;
OS.SendMessage(hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect);
parent.forceResize();
auto hwnd = parent.handle;
RECT rect;
OS.GetClientRect(hwnd, &rect);
rect.left = headerRect.left;
OS.InvalidateRect(hwnd, &rect, true);
parent.setScrollWidth();
}
void updateToolTip(int index) {
auto hwndHeaderToolTip = parent.headerToolTipHandle;
if (hwndHeaderToolTip !is null) {
auto hwndHeader = parent.hwndHeader;
RECT rect;
if (OS.SendMessage(hwndHeader, OS.HDM_GETITEMRECT, index, &rect) !is 0) {
TOOLINFO lpti;
lpti.cbSize = TOOLINFO.sizeof;
lpti.hwnd = hwndHeader;
lpti.uId = id;
lpti.rect.left = rect.left;
lpti.rect.top = rect.top;
lpti.rect.right = rect.right;
lpti.rect.bottom = rect.bottom;
OS.SendMessage(hwndHeaderToolTip, OS.TTM_NEWTOOLRECT, 0, &lpti);
}
}
}
}
|
D
|
/*******************************************************************************
copyright: Copyright (c) 2004 Kris Bell. все rights reserved
license: BSD стиль: $(LICENSE)
version: Initial release: May 2004
author: Kris
*******************************************************************************/
module util.log.Config;
public import util.log.Log : Журнал;
private import util.log.LayoutData,
util.log.AppendConsole;
/*******************************************************************************
Средство для инициализации базового поведения дефолтной иерархии
журналирования.
Вводит дефолтный консольный добавщик с генерной выкладкой в корневой
узел и устанавливает уровень активности для активирования всего
*******************************************************************************/
static this ()
{
Журнал.корень.добавь (new ДобВКонсоль (new ДанныеОВыкладке));
}
|
D
|
module sigod.codeforces.p291B;
import std.array;
import std.stdio;
import std.string;
void main()
{
auto result = solve(stdin.readln());
foreach (r; result) {
stdout.writeln(r);
}
}
string[] solve(string input)
{
input = input.strip();
auto result = appender!(string[])();
bool quote = false;
bool without = false;
int start;
foreach (index, c; input) {
if (quote) {
if (c == '"') {
result.put('<' ~ input[start + 1 .. index] ~ '>');
quote = false;
}
}
else if (without) {
if (c == ' ') {
result.put('<' ~ input[start .. index] ~ '>');
without = false;
}
}
else {
if (c == '"') {
quote = true;
start = index;
}
else if (c != ' ') {
without = true;
start = index;
}
}
}
if (without) {
result.put('<' ~ input[start .. $] ~ '>');
}
return result.data();
}
unittest {
assert(std.algorithm.equal(solve(`"RUn.exe O" "" " 2ne, " two! . " "`), [
"<RUn.exe O>",
"<>",
"< 2ne, >",
"<two!>",
"<.>",
"< >"
]));
assert(std.algorithm.equal(solve(` firstarg second "" `), [
"<firstarg>",
"<second>",
"<>"
]));
}
|
D
|
// **************************************************
// EXIT
// **************************************************
instance DIA_Herek_Exit(C_INFO)
{
npc = Vlk_511_Herek;
nr = 999;
condition = DIA_Herek_Exit_Condition;
information = DIA_Herek_Exit_Info;
permanent = 1;
description = DIALOG_ENDE;
};
func int DIA_Herek_Exit_Condition()
{
return 1;
};
func void DIA_Herek_Exit_Info()
{
AI_StopProcessInfos(self);
};
// **************************************************
// Schutzgeld-Bully
// **************************************************
instance DIA_Herek_Bully(C_INFO)
{
npc = Vlk_511_Herek;
nr = 2;
condition = DIA_Herek_Bully_Condition;
information = DIA_Herek_Bully_Info;
permanent = 0;
important = 1;
};
func int DIA_Herek_Bully_Condition()
{
if ((Npc_GetDistToNpc(self,other)<=ZivilAnquatschDist) && (Herek_ProtectionBully==TRUE))
{
return 1;
};
};
func void DIA_Herek_Bully_Info()
{
// AI_Output(self,other,"DIA_Herek_Bully_01_00"); //Hang on! I hear you've spoken to Bloodwyn?
// AI_Output(self,other,"DIA_Herek_Bully_01_00"); //Warte doch mal! Ich hab' gehört, du hast dich mit Bloodwyn unterhalten?
AI_Output(self,other,"DIA_Herek_Bully_01_00"); //Počkej chvilku! Slyšel jsem, že jsi mluvil s Bloodwynem?
// AI_Output(other,self,"DIA_Herek_Bully_15_01"); //Why? What do you want?
// AI_Output(other,self,"DIA_Herek_Bully_15_01"); //Warum? Was willst du?
AI_Output(other,self,"DIA_Herek_Bully_15_01"); //Proč? Co chceš?
// AI_Output(self,other,"DIA_Herek_Bully_01_02"); //It was real cool of ya to refuse to pay him protection money!
// AI_Output(self,other,"DIA_Herek_Bully_01_02"); //Fand ich echt gut von dir, dass du dich geweigert hast, ihm Schutzgeld zu zahlen!
AI_Output(self,other,"DIA_Herek_Bully_01_02"); //To bylo od tebe vážně hezké, odmítnout mu zaplatit peníze za ochranu!
// AI_Output(self,other,"DIA_Herek_Bully_01_03"); //It means we're all gonna have to pay your share as well!
// AI_Output(self,other,"DIA_Herek_Bully_01_03"); //Das heißt, wir anderen müssen deinen Teil mitbezahlen!
AI_Output(self,other,"DIA_Herek_Bully_01_03"); //To znamená, že my ostatní musíme platit tvůj podíl!
// AI_Output(self,other,"DIA_Herek_Bully_01_04"); //I'll make sure you remember next time he asks you.
// AI_Output(self,other,"DIA_Herek_Bully_01_04"); //Ich werde dafür sorgen, dass du dich daran erinnerst, wenn er dich das nächste Mal fragt ...
AI_Output(self,other,"DIA_Herek_Bully_01_04"); //Postarám se, aby sis na to vzpomněl, až se tě příště zeptá...
Npc_SetPermAttitude(self,ATT_ANGRY);
AI_StopProcessInfos(self);
Npc_SetTarget(self,other);
AI_StartState(self,ZS_ATTACK,1,"");
};
// **************************************************
// Motz
// **************************************************
instance DIA_Herek_Motz(C_INFO)
{
npc = Vlk_511_Herek;
nr = 2;
condition = DIA_Herek_Motz_Condition;
information = DIA_Herek_Motz_Info;
permanent = 0;
// description = "And, how's things?";
// description = "Na, wie sieht's aus?";
description = "A jak to jde?";
};
func int DIA_Herek_Motz_Condition()
{
if (Herek_ProtectionBully==FALSE)
{
return 1;
};
};
func void DIA_Herek_Motz_Info()
{
// AI_Output(other,self,"DIA_Herek_Motz_15_00"); //And, how's things?
// AI_Output(other,self,"DIA_Herek_Motz_15_00"); //Na, wie sieht's aus?
AI_Output(other,self,"DIA_Herek_Motz_15_00"); //A jak to jde?
// AI_Output(self,other,"DIA_Herek_Motz_01_01"); //There ain't enough room in this camp for the two of us!
// AI_Output(self,other,"DIA_Herek_Motz_01_01"); //In diesem Lager ist nicht genug Platz für uns beide!
AI_Output(self,other,"DIA_Herek_Motz_01_01"); //V tomhle táboře není pro nás dva dost místa!
// AI_Output(other,self,"DIA_Herek_Motz_15_02"); //Pardon me?
// AI_Output(other,self,"DIA_Herek_Motz_15_02"); //Bitte was?
AI_Output(other,self,"DIA_Herek_Motz_15_02"); //Prosím?
// AI_Output(self,other,"DIA_Herek_Motz_01_03"); //If it was up to me, you wouldn't last out here for long!
// AI_Output(self,other,"DIA_Herek_Motz_01_03"); //Wenn es nach mir ginge, würdest du hier nicht alt!
AI_Output(self,other,"DIA_Herek_Motz_01_03"); //Kdyby bylo po mém, už bys tu pěkně dlouho nebyl!
// AI_Output(self,other,"DIA_Herek_Motz_01_04"); //D'you know why I'm here? I killed a dozen people in one night, just like that... He he he!
// AI_Output(self,other,"DIA_Herek_Motz_01_04"); //Weißt du, warum ich hier bin? In einer Nacht habe ich ein Dutzend Leute umgebracht. Einfach nur so ... hä hä hä!
AI_Output(self,other,"DIA_Herek_Motz_01_04"); //Víš, proč jsem tady? Během jedné noci, jsem zabil tucet lidí. Prostě jen tak... hehehe!
Npc_SetPermAttitude(self,ATT_ANGRY);
AI_StopProcessInfos(self);
};
// **************************************************
// Anlegen!
// **************************************************
instance DIA_Herek_Anlegen(C_INFO)
{
npc = Vlk_511_Herek;
nr = 2;
condition = DIA_Herek_Anlegen_Condition;
information = DIA_Herek_Anlegen_Info;
permanent = 1;
// description = "So you think you're one of the wild boys, do you? Try it with me...";
// description = "Du denkst, du bist einer von den Harten? Versuch's doch nochmal bei mir.";
description = "Takže ty si myslíš, že jsi jeden z těch tvrďáků? No tak pojď to zkusit se mnou.";
};
func int DIA_Herek_Anlegen_Condition()
{
if ((Npc_KnowsInfo(hero,DIA_Herek_Motz)) || (Npc_KnowsInfo(hero,DIA_Herek_Bully)))
{
return 1;
};
};
func void DIA_Herek_Anlegen_Info()
{
// AI_Output(other,self,"DIA_Herek_Anlegen_15_00"); //So you think you're one of the wild boys, do you? Why don't you try it with me ...
// AI_Output(other,self,"DIA_Herek_Anlegen_15_00"); //So, du denkst also, du bist einer von den Harten? Versuch's doch mal bei mir ...
AI_Output(other,self,"DIA_Herek_Anlegen_15_00"); //Takže ty si myslíš, že jsi jeden z těch tvrďáků? No tak pojď to zkusit se mnou.
// AI_Output(self,other,"DIA_Herek_Anlegen_01_01"); //You wanna get whacked? Alright, if that's what you want!!
// AI_Output(self,other,"DIA_Herek_Anlegen_01_01"); //Du willst'n paar aufs Maul?! Kannst du haben!!
AI_Output(self,other,"DIA_Herek_Anlegen_01_01"); //Chceš dostat nakládačku? Dobře, máš to mít!
AI_StopProcessInfos(self);
Npc_SetTarget(self,other);
AI_StartState(self,ZS_ATTACK,1,"");
};
|
D
|
module net.DatagramConduit;
public import io.device.Conduit;
package import net.Socket,
net.SocketConduit;
class ДатаграммПровод : СокетПровод
{
this ();
override т_мера читай (проц[] ист);
т_мера читай (проц[] приёмн, Адрес из_);
override т_мера пиши (проц[] ист);
т_мера пиши (проц[] ист, Адрес в_);
}
|
D
|
module dnes.cpu.cpu;
import core.thread;
import std.format;
import std.signals;
import dnes.cpu.dma;
import dnes.cpu.instructions;
import dnes.cpu.memory;
import dnes.util;
/**
* The NES CPU - controls instruction execution, main memory, etc.
*/
class CPU
{
public:
/**
* Constructor
*/
this(bool logging)
{
memory = new Memory();
_cycles = 0;
_dma = false;
_interrupt = Interrupt.NONE;
// Initial register states
pc = concat(memory[0xfffd], memory[0xfffc]);
sp = 0xFD;
acc = 0;
x = 0;
y = 0;
status = 0x34;
_instructionsFiber = new Fiber(() => executeInstructions(this, logging));
_dmaFiber = new Fiber(() => oamdma(this));
}
/**
* Ticks the CPU along one clock cycle, performing whatever action carries
* on from the last clock cycle
*/
void tick()
{
_cycles++;
if (!_dma)
_instructionsFiber.call();
else
_dmaFiber.call();
}
/**
* Raise an interrupt - will be ignored if a higher priority
* interrupt is already queued.
*
* Params:
* i = The interrupt to raise
*/
nothrow @safe @nogc void raiseInterrupt(Interrupt i)
{
const auto isMasked = (cpu.getFlag(CPU.Flag.I) && i <= Interrupt.IRQ);
if ((i > _interrupt) && (!isMasked))
_interrupt = i;
}
/**
* Returns: The CPU state as a string
*/
override @safe string toString() const
{
return format(
"A:%02X X:%02X Y:%02X P:%02X SP:%02X",
acc, x, y, status, sp
);
}
/**
* Returns: The number of cycles the CPU has executed
*/
@property nothrow @safe @nogc uint cycles() const
{
return _cycles;
}
/// The CPU memory
Memory memory;
/// Registers
ushort pc; /// Program counter
ubyte sp; /// Stack pointer
ubyte acc; /// Accumulator
ubyte x; /// Index register X
ubyte y; /// Index register Y
ubyte status; /// Processor status flags
/// Enumeration of interrupt types
enum Interrupt
{
NONE = 0,
IRQ = 1,
BRK = 2,
NMI = 3,
RESET = 4,
}
/// Enumeration of event signals
enum Event
{
INSTRUCTION,
}
/// Signal to mark the end of an instruction, used to notify listeners in
/// unit tests
mixin Signal!(Event);
package:
/**
* Check if the given flag is set
*
* Params:
* flag = The flag to test for
*
* Returns: True if the flag is set, false if not
*/
nothrow @safe @nogc bool getFlag(Flag flag) const
{
return (status & flag) > 0;
}
/**
* Sets the given flag on or off
*
* Params:
* flag = The flag to set
* b = The position to set it to
*/
nothrow @safe @nogc void setFlag(Flag flag, bool b)
{
if (b)
status |= flag;
else
status &= ~flag;
}
/**
* Resets the current CPU interrupt
*/
nothrow @safe @nogc void resetInterrupt()
{
_interrupt = Interrupt.NONE;
}
/**
* Returns: The currently queued interrupt
*/
@property nothrow @safe @nogc Interrupt interrupt() const
{
return _interrupt;
}
/**
* Returns: If the CPU is performing DMA or not
*/
@property nothrow @safe @nogc bool dma() const
{
return _dma;
}
/**
* Property to set the DMA field - setting it to true enables DMA to begin
* on the next CPU tick
*/
@property nothrow @nogc void dma(bool value)
{
_dma = value;
if (_dma)
_dmaFiber.reset();
}
/// Enumeration of each CPU flag
enum Flag
{
C = 1 << 0, // Carry
Z = 1 << 1, // Zero
I = 1 << 2, // Interrupt disable
D = 1 << 3, // Decimal mode
B = 1 << 4, // Break
V = 1 << 6, // Overflow
N = 1 << 7, // Negative
}
private:
/// The number of clock cycles executed
uint _cycles;
Fiber _instructionsFiber;
Fiber _dmaFiber;
bool _dma;
Interrupt _interrupt;
}
// Export a global variable
CPU cpu = null;
|
D
|
module PerlinNoise;
import INoise;
import GenericNoise;
shared class PerlinNoise : INoise {
float frequency;
float lacunarity;
NoiseQuality quality;
int octaves;
float persistence;
int seed;
this(float frequency = 1.0, float lacunarity = 2.0, NoiseQuality quality = NoiseQuality.NORMAL, int octaves = 6, float persistence = 0.5, int seed = 0) {
this.frequency = frequency;
this.lacunarity = lacunarity;
this.quality = quality;
this.octaves = octaves;
this.persistence = persistence;
this.seed = seed;
}
float getValue(float x, float y, float z) {
float value = 0.0;
float signal = 0.0;
float curPersistence = 1.0;
float nx, ny, nz;
int seed;
x *= frequency;
y *= frequency;
z *= frequency;
for (int curOctave = 0; curOctave < octaves; curOctave++) {
// Get the coherent-noise value from the input value and add it to the
// final result.
seed = (this.seed + curOctave) & 0xffffffff;
value += (GenericNoise).GradientCoherentNoise3D (x, y, z, seed, quality) * curPersistence;
// Prepare the next octave.
x *= lacunarity;
y *= lacunarity;
z *= lacunarity;
curPersistence *= persistence;
}
return value;
}
void setFrequency(float frequency) {
this.frequency = frequency;
}
void setLacunarity(float lacunarity) {
this.lacunarity = lacunarity;
}
void setNoiseQuality(NoiseQuality quality) {
this.quality = quality;
}
void setOctaveCount(int octaves) {
this.octaves = octaves;
}
void setPersistence(float persistence) {
this.persistence = persistence;
}
void setSeed(int seed) {
this.seed = seed;
}
float getFrequency() {
return frequency;
}
float getLacunarity() {
return lacunarity;
}
NoiseQuality getNoiseQuality() {
return quality;
}
int getOctaveCount() {
return octaves;
}
float getPersistence() {
return persistence;
}
int getSeed() {
return seed;
}
}
|
D
|
/Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/CustomDateFormatTransform.o : /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/CustomDateFormatTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DataTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DateFormatterTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DateTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DictionaryTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/EnumOperators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/EnumTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/FromJSON.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/HexColorTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ImmutableMappable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ISO8601DateTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Map.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/MapError.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Mappable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Mapper.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/NSDecimalNumberTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Operators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ToJSON.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformOf.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformOperators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformType.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/URLTransform.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/ObjectMapper.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/QuartzCore.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/SwiftOnoneSupport.swiftmodule
/Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/CustomDateFormatTransform~partial.swiftmodule : /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/CustomDateFormatTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DataTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DateFormatterTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DateTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DictionaryTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/EnumOperators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/EnumTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/FromJSON.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/HexColorTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ImmutableMappable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ISO8601DateTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Map.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/MapError.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Mappable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Mapper.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/NSDecimalNumberTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Operators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ToJSON.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformOf.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformOperators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformType.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/URLTransform.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/ObjectMapper.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/QuartzCore.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/SwiftOnoneSupport.swiftmodule
/Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/CustomDateFormatTransform~partial.swiftdoc : /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/CustomDateFormatTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DataTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DateFormatterTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DateTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/DictionaryTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/EnumOperators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/EnumTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/FromJSON.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/HexColorTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ImmutableMappable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ISO8601DateTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Map.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/MapError.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Mappable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Mapper.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/NSDecimalNumberTransform.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/Operators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/ToJSON.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformOf.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformOperators.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/TransformType.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/ObjectMapper/Sources/URLTransform.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/ObjectMapper.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/QuartzCore.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/SwiftOnoneSupport.swiftmodule
|
D
|
drop a hint
|
D
|
an educational institution
a building where young people receive education
the process of being formally educated at a school
a body of creative artists or writers or thinkers linked by a similar style or by similar teachers
the period of instruction in a school
an educational institution's faculty and students
a large group of fish
educate in or as if in a school
teach or refine to be discriminative in taste or judgment
swim in or form a large group of fish
|
D
|
module denj.math.matrix;
import std.math;
import std.algorithm : min, max;
import denj.utility.general;
import denj.math.vector;
// Column major
// format
// xx yx zx tx
// xy yy zy ty
// xz yz zz tz
// 0 0 0 1
// http://www.gamedev.net/topic/425118-inverse--matrix/
template isMat(T){
enum isMat = is(T == Matrix!(C, R, sT), int C, int R, sT);
}
// TODO: implement right binary op for vector
struct Matrix(int _Columns, int _Rows, T = float) {
alias Matrix!(_Columns, _Rows, T) thisType;
alias Matrix!(_Rows, _Columns, T) transposeType;
enum Columns = _Columns;
enum Rows = _Rows;
alias BaseType = T;
public {
T[Columns * Rows] data;
ref T get(int x, int y)() {
static assert(x < Columns);
static assert(y < Rows);
return data[x + y * Columns];
}
ref T get(int x, int y) {
return data[x + y * Columns];
}
T get(int x, int y) const {
return data[x + y * Columns];
}
@property T* ptr(){
return data.ptr;
}
}
this(T[Columns * Rows] _data){
data[] = _data[];
}
this(T[Columns * Rows] _data...){
data[] = _data[];
}
// Available for every dimension
static thisType Scale(T s){
thisType ret = thisType.identity;
foreach(i; 0..min(min(Columns, Rows), 3)){
ret[i,i] = s;
}
return ret;
}
// Requires a fourth column and at least three rows
static if(Columns == 4 && Rows >= 3)
static auto Translation(vec3 t) {
thisType ret = thisType.identity;
ret[Columns-1, 0] = t.data[0];
ret[Columns-1, 1] = t.data[1];
ret[Columns-1, 2] = t.data[2];
return ret;
}
static if(Columns >= 3 && Rows == 4)
auto Translate(vec3 t) {
return transposeType.Translation(t) * this;
}
// Requires at least 2x2
// Rotations in lower dimensions don't make sense
static if(Columns >= 2 && Rows >= 2){
static auto ZRotation(float ang){
auto ret = thisType.identity;
float ca = cos(ang);
float sa = sin(ang);
ret[0, 0] = ca;
ret[1, 1] = ca;
ret[0, 1] = sa;
ret[1, 0] = -sa;
return ret;
}
auto RotateZ(float ang){
return transposeType.ZRotation(ang) * this;
}
}
// Requires three dimensions
static if(Columns >= 3 && Rows >= 3){
static auto YRotation(float ang){
auto ret = thisType.identity;
float ca = cos(ang);
float sa = sin(ang);
ret[0, 0] = ca;
ret[2, 2] = ca;
ret[0, 2] = -sa;
ret[2, 0] = sa;
return ret;
}
auto RotateY(float ang){
return transposeType.YRotation(ang) * this;
}
static auto XRotation(float ang){
auto ret = thisType.identity;
float ca = cos(ang);
float sa = sin(ang);
ret[1, 1] = ca;
ret[2, 2] = ca;
ret[1, 2] = sa;
ret[2, 1] = -sa;
return ret;
}
auto RotateX(float ang){
return transposeType.XRotation(ang) * this;
}
}
auto Transposed(){
transposeType ret = void;
foreach(uint x; 0..Columns)
foreach(uint y; 0..Rows){
ret[y,x] = get(x,y);
}
return ret;
}
ref T opIndex(size_t x, size_t y){
assert(x < Columns);
assert(y < Rows);
return data[x + y * Columns];
}
T opIndex(size_t x, size_t y) const {
assert(x < Columns);
assert(y < Rows);
return data[x + y * Columns];
}
auto opBinary(string op)(auto ref T rhs) const{
static if(op == "*"){
thisType ret;
ret.data[] = data[] * rhs;
return ret;
}else{
static assert(0, "matrix "~op~" operation not implemented");
}
}
auto opBinary(string op, int RHSColumns, int RHSRows, RHST)(auto ref Matrix!(RHSColumns, RHSRows, RHST) rhs) const{
alias typeof(T() * RHST()) ElType;
alias Matrix!(RHSColumns, Rows, ElType) RetType;
static if(op == "*"){
static assert(Columns == RHSRows, "Matrices not able to be multiplied");
RetType ret;
foreach(i; 0..Rows)
foreach(j; 0..RHSColumns){
ElType sum = 0;
foreach(k; 0..RHSRows){
sum += get(k, i) * rhs[j, k];
}
ret[j, i] = sum;
}
return ret;
}else{
static assert(0, "matrix "~op~" operation not implemented");
}
}
auto opBinary(string op, int RHSDim, RHST)(auto ref Vector!(RHSDim, RHST) rhs) const{
alias typeof(T() * RHST()) ElType;
alias typeof(rhs) RetType;
static if(op == "*"){
static assert(Columns == RHSDim, "Matrix and vector not able to be multiplied");
RetType ret;
foreach(i; 0..Rows){
ElType sum = 0;
foreach(k; 0..RHSDim){
sum += get(k, i) * rhs.data[k];
}
ret.data[i] = sum;
}
return ret;
}else{
static assert(0, "matrix-vector "~op~" operation not implemented");
}
}
string toString() const {
import std.string : format;
string s = format("[%(%s, %)", data[0..Columns]);
foreach(y; 1..Rows){
s ~= format(",\n %(%s, %)", data[y*Columns .. (y+1)*Columns]);
}
return s ~ "]";
}
static if(Columns == Rows){
static if(Columns == 2){
enum thisType identity = thisType(1, 0, 0, 1);
}else static if(Columns == 3){
enum thisType identity = thisType(1, 0, 0, 0, 1, 0, 0, 0, 1);
}else static if(Columns == 4){
enum thisType identity = thisType(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
}else static if(Columns >= 3 && Rows >= 3){
enum thisType identity = thisType(
TupleRepeat!(max(Rows, Columns)-1, 1, TupleRepeat!(Columns, 0))[0..Columns*Rows]);
}
}
alias Matrix!(2, 2) mat2;
alias Matrix!(3, 3) mat3;
alias Matrix!(4, 4) mat4;
|
D
|
import std.stdio;
int[10] w, s;
string[10] f;
int n, sum;
int[] ans;
double best;
void main(){
while (readf("%d\n", &n), n) {
sum = 0;
best = double.max;
foreach (i; 0..n) {
readf("%s %d %d\n", &f[i], &w[i], &s[i]);
sum += w[i];
}
solve(0, [], 0, sum, 1);
foreach (i; ans) writeln(f[i]);
}
}
void solve(int b, int[] order, double g, int weight, int pos){
foreach (i; 0..n) {
if (!((1<<i) & b) && s[i] >= weight-w[i]) {
solve(b | (1<<i), order ~ i, g+w[i]*pos, weight-w[i], pos+1);
}
}
if (b+1 == (1<<n) && best > g/sum) {
best = g/sum;
ans = order;
}
}
|
D
|
/**
This module defines the notion of an Image.
An Image is simply defined as a 2D array of elements, with
methods to set/get those elements.
The Image concept might be the basis of a generic software renderer.
*/
module gfm.image.image;
import gfm.math.vector;
// An image is a concept
/**
* Test if I is an Image.
*
* An image has the following features:
* $(UL
* $(LI defines element_t as the type of elements (eg. pixels).)
* $(LI has a dimension of type vec2i.)
* $(LI has getter/setter for individual elements.)
* )
*/
template isImage(I)
{
enum bool isImage = is(typeof(
{
I i; // can be defined
const I ci;
I.element_t e; // defined the type element_t
vec2i dim = ci.dimension; // has dimension
I.element_t f = ci.get(0, 0); // can get element
i.set(0, 0, f); // can set element
}()));
}
/// Returns: true if an image contains the given point.
bool contains(I)(I img, int x, int y) if (isImage!I)
{
return cast(uint)x < img.dimension.x && cast(uint)y < img.dimension.y;
}
/// EdgeMode defines how images are sampled beyond their boundaries.
enum EdgeMode
{
BLACK, /// Return black.
CLAMP, /// Clamp to edge.
REPEAT, /// Repeat from the other side of the image.
CRASH /// Crash.
}
/// Draws a single pixel.
void drawPixel(I, P)(I img, int x, int y, P p) if (isImage!I && is(P : I.element_t))
{
if (!img.contains(x, y))
return;
img.set(x, y, p);
}
/// Returns: pixel of an Image at position (x, y).
/// At boundaries, what happens depends on em.
I.element_t getPixel(I)(I img, int x, int y, EdgeMode em)
{
if (!img.contains(x, y))
{
final switch(em)
{
case EdgeMode.BLACK:
return I.element_t.init;
case EdgeMode.CLAMP:
{
if (x < 0) x = 0;
if (y < 0) y = 0;
if (x >= img.dimension.x) x = img.dimension.x - 1;
if (y >= img.dimension.y) y = img.dimension.y - 1;
break;
}
case EdgeMode.REPEAT:
{
x = moduloWrap!int(x, img.dimension.x);
y = moduloWrap!int(y, img.dimension.y);
break;
}
case EdgeMode.CRASH:
assert(false);
}
}
return img.get(x, y);
}
/// Fills an uniform rectangle area in an Image.
void fillRect(I, P)(I img, int x, int y, int width, int height, P e) if (isImage!I && is(P : I.element_t))
{
for (int j = 0; j < height; ++j)
for (int i = 0; i < width; ++i)
img.set(x + i, y + j, e);
}
/// Fills a whole image with a single element value.
void fillImage(I, P)(I img, P e) if (isImage!I && is(P : I.element_t))
{
immutable int width = img.dimension.x;
immutable int height = img.dimension.y;
for (int j = 0; j < height; ++j)
for (int i = 0; i < width; ++i)
img.set(i, j, e);
}
/// Performs an image blit from src to dest.
void copyRect(I)(I dest, I src) if (isImage!I)
{
// check same size
assert(dest.dimension == src.dimension);
immutable int width = dest.dimension.x;
immutable int height = dest.dimension.y;
for (int j = 0; j < height; ++j)
for (int i = 0; i < width; ++i)
{
auto p = src.get(i, j);
dest.set(i, j, p);
}
}
/// Draws an horizontal line on an Image.
void drawHorizontalLine(I, P)(I img, int x1, int x2, int y, P p) if (isImage!I && is(P : I.element_t))
{
for (int x = x1; x < x2; ++x)
img.drawPixel(x, y, p);
}
/// Draws a vertical line on an Image.
void drawVerticalLine(I, P)(I img, int x, int y1, int y2, P p) if (isImage!I && is(P : I.element_t))
{
for (int y = y1; y < y2; ++y)
img.drawPixel(x, y, p);
}
|
D
|
module crate.api.json.policy;
import crate.base;
import crate.api.json.serializer;
import crate.routing.jsonapi;
import crate.generator.openapi;
import crate.ctfe;
import vibe.data.json;
import vibe.http.common;
import openapi.definitions;
import std.string, std.stdio, std.algorithm, std.array, std.typecons;
struct JsonApi {
static immutable {
string name = "Json API";
string mime = "application/vnd.api+json";
}
alias Serializer = JsonApiSerializer;
alias Routing = JsonApiRouting;
static pure:
private CrateRule templateRule(FieldDefinition definition) {
auto serializer = new Serializer(definition);
CrateRule rule;
rule.request.serializer = serializer;
rule.response.mime = "application/vnd.api+json";
rule.response.serializer = serializer;
rule.schemas = definition.extractObjects.map!(a => tuple(a.type ~ "Model", a.toSchema(false))).assocArray;
rule.schemas[definition.type ~ "Attributes"] = definition.toSchema(false);
return rule;
}
CrateRule create(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule = templateRule(definition);
rule.request.path = routing.post;
rule.request.method = HTTPMethod.POST;
rule.response.statusCode = 201;
rule.response.headers["Location"] = ":base_uri" ~ routing.getList ~ "/:id";
return rule;
}
CrateRule replace(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule = templateRule(definition);
rule.request.path = routing.put;
rule.request.method = HTTPMethod.PUT;
rule.response.statusCode = 200;
return rule;
}
CrateRule delete_(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule = templateRule(definition);
rule.request.path = routing.delete_;
rule.request.method = HTTPMethod.DELETE;
rule.response.statusCode = 204;
return rule;
}
CrateRule getItem(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule = templateRule(definition);
rule.request.method = HTTPMethod.GET;
rule.request.path = routing.get;
rule.response.statusCode = 200;
return rule;
}
CrateRule patch(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule = templateRule(definition);
rule.request.method = HTTPMethod.PATCH;
rule.request.path = routing.get;
rule.response.statusCode = 200;
return rule;
}
CrateRule getList(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule = templateRule(definition);
rule.request.path = routing.getList;
rule.request.method = HTTPMethod.GET;
rule.response.statusCode = 200;
return rule;
}
CrateRule getResource(string path)(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule = templateRule(definition);
rule.request.path = routing.get ~ path;
rule.request.method = HTTPMethod.GET;
rule.response.statusCode = 200;
return rule;
}
CrateRule setResource(string path)(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule = templateRule(definition);
rule.request.path = routing.get ~ path;
rule.request.method = HTTPMethod.POST;
rule.response.statusCode = 201;
return rule;
}
CrateRule action(MethodReturnType, ParameterType, string actionName)(FieldDefinition definition) {
auto routing = new Routing(definition);
CrateRule rule;
rule.request.path = routing.get ~ "/" ~ actionName;
rule.request.method = HTTPMethod.GET;
rule.response.statusCode = 200;
return rule;
}
}
class CrateJsonApiPolicy : CratePolicy
{
private
{
CrateSerializer _serializer = new inout CrateJsonApiSerializer;
}
string name() inout pure nothrow
{
return "Json API";
}
string mime() inout pure nothrow
{
return "application/vnd.api+json";
}
inout(CrateSerializer) serializer() inout pure nothrow
{
return _serializer;
}
}
CrateRoutes defineRoutes(T)(const CrateJsonApiPolicy, const CrateConfig!T config)
{
CrateRoutes definedRoutes;
definedRoutes.schemas = schemas!T;
definedRoutes.paths = config.paths!T;
return definedRoutes;
}
string basePath(T)(const CrateConfig!T config) pure
{
return "/" ~ config.plural.toLower;
}
ModelDefinition definition(T)() pure
{
ModelDefinition model;
enum fields = getFields!T.fields;
static if (!is(typeof(fields) == void[]))
{
foreach (index, field; fields)
{
model.fields[field.name] = field;
if (field.isId)
{
model.idField = field.name;
}
}
}
return model;
}
private
{
PathDefinition[uint][HTTPMethod][string] paths(T)(const CrateConfig!T config)
{
PathDefinition[uint][HTTPMethod][string] selectedPaths;
if (config.getList)
{
selectedPaths[config.basePath][HTTPMethod.GET][200] = PathDefinition(T.stringof ~ "List",
"", CrateOperation.getList);
}
if (config.addItem)
{
selectedPaths[config.basePath][HTTPMethod.POST][200] = PathDefinition(T.stringof ~ "Response",
T.stringof ~ "Request", CrateOperation.addItem);
}
if (config.getItem)
{
selectedPaths[config.basePath ~ "/:id"][HTTPMethod.GET][200] = PathDefinition(T.stringof ~ "Response",
"", CrateOperation.getItem);
}
if (config.updateItem)
{
selectedPaths[config.basePath ~ "/:id"][HTTPMethod.PATCH][200] = PathDefinition(T.stringof ~ "Response",
T.stringof ~ "Request", CrateOperation.updateItem);
}
if (config.deleteItem)
{
selectedPaths[config.basePath ~ "/:id"][HTTPMethod.DELETE][201] = PathDefinition("",
"", CrateOperation.deleteItem);
}
return selectedPaths;
}
Json[string] schemas(T)()
{
Json[string] schemaList;
schemaList[T.stringof ~ "Item"] = schemaItem!T;
schemaList[T.stringof ~ "NewItem"] = schemaNewItem!T;
schemaList[T.stringof ~ "List"] = schemaGetList!T;
schemaList[T.stringof ~ "Response"] = schemaResponse!T;
schemaList[T.stringof ~ "Request"] = schemaRequest!T;
schemaList[T.stringof ~ "Attributes"] = schemaAttributes!T;
schemaList[T.stringof ~ "Relationships"] = schemaRelationships!T;
schemaList["StringResponse"] = schemaString;
addRelationshipDefinitions!T(schemaList);
addComposedDefinitions!T(schemaList);
return schemaList;
}
Json schemaString()
{
Json data = Json.emptyObject;
data["type"] = "string";
return data;
}
Json schemaGetList(T)()
{
Json data = Json.emptyObject;
data["type"] = "object";
data["properties"] = Json.emptyObject;
data["properties"]["data"] = Json.emptyObject;
data["properties"]["data"]["type"] = "array";
data["properties"]["data"]["items"] = Json.emptyObject;
data["properties"]["data"]["items"]["$ref"] = "#/components/schemas/" ~ T.stringof ~ "Item";
return data;
}
Json schemaItem(T)()
{
Json item = schemaNewItem!T;
item["properties"]["id"] = Json.emptyObject;
item["properties"]["id"]["type"] = "string";
return item;
}
Json schemaNewItem(T)()
{
Json item = Json.emptyObject;
item["type"] = "object";
item["properties"] = Json.emptyObject;
item["properties"]["type"] = Json.emptyObject;
item["properties"]["type"]["type"] = "string";
item["properties"]["attributes"] = Json.emptyObject;
item["properties"]["attributes"]["$ref"] = "#/components/schemas/" ~ T.stringof ~ "Attributes";
item["properties"]["relationships"] = Json.emptyObject;
item["properties"]["relationships"]["$ref"] = "#/components/schemas/"
~ T.stringof ~ "Relationships";
return item;
}
Json schemaResponse(T)()
{
Json item = Json.emptyObject;
item["type"] = "object";
item["properties"] = Json.emptyObject;
item["properties"]["data"] = Json.emptyObject;
item["properties"]["data"]["$ref"] = "#/components/schemas/" ~ T.stringof ~ "Item";
return item;
}
Json schemaRequest(T)()
{
Json item = Json.emptyObject;
item["type"] = "object";
item["properties"] = Json.emptyObject;
item["properties"]["data"] = Json.emptyObject;
item["properties"]["data"]["$ref"] = "#/components/schemas/" ~ T.stringof ~ "NewItem";
return item;
}
Json schemaAttributes(T)()
{
Json attributes = Json.emptyObject;
auto model = definition!T;
attributes["type"] = "object";
attributes["properties"] = Json.emptyObject;
foreach (field; model.fields)
{
if (!field.isId && !field.isRelation && !field.isArray)
{
attributes["properties"][field.name] = Json.emptyObject;
attributes["properties"][field.name]["type"] = field.type.asOpenApiType;
}
else if (field.isArray)
{
attributes["properties"][field.name] = Json.emptyObject;
attributes["properties"][field.name]["type"] = "array";
attributes["properties"][field.name]["items"] = Json.emptyObject;
if (field.fields[0].isBasicType)
{
attributes["properties"][field.name]["items"]["type"] = field.fields[0]
.type.asOpenApiType;
}
else
{
attributes["properties"][field.name]["items"]["$ref"] = "#/components/schemas/"
~ field.fields[0].type ~ "Model";
}
}
if (!field.isId && !field.isRelation && !field.isOptional)
{
if (attributes["required"].type == Json.Type.undefined)
{
attributes["required"] = Json.emptyArray;
}
attributes["required"] ~= field.name;
}
}
return attributes;
}
Json schemaRelationships(T)()
{
Json attributes = Json.emptyObject;
auto model = definition!T;
attributes["type"] = "object";
attributes["properties"] = Json.emptyObject;
void addRelationships(FieldDefinition[] fields)()
{
static if (fields.length == 1)
{
static if (fields[0].isRelation && !fields[0].isId)
{
attributes["properties"][fields[0].name] = Json.emptyObject;
attributes["properties"][fields[0].name]["$ref"] = "#/components/schemas/"
~ fields[0].type ~ "Relation";
static if (!fields[0].isOptional)
{
if (attributes["required"].type == Json.Type.undefined)
{
attributes["required"] = Json.emptyArray;
}
attributes["required"] ~= fields[0].name;
}
}
}
else static if (fields.length > 1)
{
addRelationships!([fields[0]])();
addRelationships!(fields[1 .. $])();
}
}
enum FieldDefinition[] fields = getFields!T.fields;
addRelationships!(fields);
return attributes;
}
void addRelationshipDefinitions(T)(ref Json[string] schemaList)
{
void addRelationships(FieldDefinition[] fields)()
{
static if (fields.length == 1)
{
static if (fields[0].isRelation && !fields[0].isId)
{
enum key = fields[0].type ~ "Relation";
schemaList[key] = Json.emptyObject;
schemaList[key]["required"] = [Json("data")];
schemaList[key]["properties"] = Json.emptyObject;
schemaList[key]["properties"]["data"] = Json.emptyObject;
schemaList[key]["properties"]["data"]["type"] = "object";
schemaList[key]["properties"]["data"]["required"] = [Json("type"),
Json("id")];
schemaList[key]["properties"]["data"]["properties"] = Json.emptyObject;
schemaList[key]["properties"]["data"]["properties"]["type"] = Json
.emptyObject;
schemaList[key]["properties"]["data"]["properties"]["type"]["type"] = "string";
schemaList[key]["properties"]["data"]["properties"]["id"] = Json
.emptyObject;
schemaList[key]["properties"]["data"]["properties"]["id"]["type"] = "string";
schemaList[key]["type"] = "object";
}
}
else static if (fields.length > 1)
{
addRelationships!([fields[0]])();
addRelationships!(fields[1 .. $])();
}
}
enum FieldDefinition[] fields = getFields!T.fields;
addRelationships!(fields);
}
void addComposedDefinitions(T)(ref Json[string] schemaList)
{
void describe(FieldDefinition[] fields, U)(ref Json schema)
{
static if (fields.length == 1)
{
if ("properties" !in schema)
{
schema["properties"] = Json.emptyObject;
}
enum key = fields[0].name;
static if (fields[0].isBasicType)
{
schema["properties"][key] = Json.emptyObject;
schema["properties"][key]["type"] = asOpenApiType(fields[0].type);
}
else static if (!fields[0].isRelation && !fields[0].isBasicType && fields[0].originalName != "")
{
alias Type = FieldType!(__traits(getMember, U, fields[0].originalName));
enum name = fields[0].type ~ "Model";
if (name !in schemaList)
{
schemaList[name] = Json.emptyObject;
}
schema["properties"][key] = Json.emptyObject;
schema["properties"][key]["$ref"] = "#/components/schemas/"
~ fields[0].type ~ "Model";
enum FieldDefinition[] fields = getFields!Type.fields;
describe!(fields, Type)(schemaList[name]);
}
}
else static if (fields.length > 1)
{
describe!([fields[0]], U)(schema);
describe!(fields[1 .. $], U)(schema);
}
}
void addComposed(FieldDefinition[] fields)()
{
static if (fields.length == 1)
{
static if (fields[0].isArray && !fields[0].fields[0].isBasicType) {
alias Type = ArrayType!(FieldType!(__traits(getMember, T, fields[0].originalName)));
enum key = fields[0].fields[0].type ~ "Model";
schemaList[key] = Json.emptyObject;
static if (fields[0].type == "BsonObjectID")
{
schemaList[key]["type"] = "string";
}
else
{
schemaList[key]["type"] = "object";
enum fields = Describe!Type.fields;
describe!(fields, Type)(schemaList[key]);
}
}
else static if (!fields[0].isRelation && !fields[0].isBasicType && !fields[0].isArray)
{
alias Type = FieldType!(__traits(getMember, T, fields[0].originalName));
enum key = fields[0].type ~ "Model";
schemaList[key] = Json.emptyObject;
static if (fields[0].type == "BsonObjectID")
{
schemaList[key]["type"] = "string";
}
else
{
schemaList[key]["type"] = "object";
enum fields = Describe!Type.fields;
describe!(fields, Type)(schemaList[key]);
}
}
}
else static if (fields.length > 1)
{
addComposed!([fields[0]])();
addComposed!(fields[1 .. $])();
}
}
enum FieldDefinition[] fields = getFields!T.fields;
addComposed!(fields);
}
}
version (unittest)
{
struct TestModel
{
string _id;
}
}
@("It should have the right mime")
unittest
{
auto policy = new const CrateJsonApiPolicy();
assert(policy.mime == "application/vnd.api+json");
}
@("Check Json api definition")
unittest
{
struct TestModel
{
string id;
string field1;
int field2;
@ignore int field3;
}
auto definition = definition!TestModel;
assert(definition.idField == "id");
assert(definition.fields["id"].type == "string");
assert(definition.fields["id"].isBasicType);
assert(definition.fields["id"].isOptional == false);
assert(definition.fields["field1"].type == "string");
assert(definition.fields["field1"].isBasicType);
assert(definition.fields["field1"].isOptional == false);
assert(definition.fields["field2"].type == "int");
assert(definition.fields["field2"].isBasicType);
assert(definition.fields["field2"].isOptional == false);
assert("field3" !in definition.fields);
}
@("Check optional field definition")
unittest
{
struct TestModel
{
string _id;
@optional string optionalField;
}
auto definition = definition!TestModel;
assert(definition.fields["optionalField"].isOptional);
}
@("Use the custom property names")
unittest
{
struct TestModel
{
string _id;
@name("optional-field")
string optionalField;
}
auto definition = definition!TestModel;
assert("optional-field" in definition.fields);
assert("optionalField" !in definition.fields);
}
@("Check for the id field")
unittest
{
import vibe.data.bson;
struct TestModel
{
ObjectId _id;
}
auto definition = definition!TestModel;
auto schema = schemas!TestModel.serializeToJson;
assert(definition.idField == "_id");
assert(schema["TestModelItem"]["properties"]["id"]["type"] == "string");
}
|
D
|
func void G_CanNotLern( var int nAttribute, var int nValue )
{
//
// DETERMINE ATTIBUTE
//
var int nAttributeValue ;
var string strAttribute ;
if ( nAttribute == ATR_HITPOINTS ) { strAttribute = _STR_ATTRIBUTE_HITPOINTS ; nAttributeValue = hero.attribute[ ATR_HITPOINTS ]-(hp_tp_bonus+hp_bonus); }
else if ( nAttribute == ATR_HITPOINTS_MAX ) { strAttribute = _STR_ATTRIBUTE_HITPOINTS_MAX ; nAttributeValue = hero.attribute[ ATR_HITPOINTS_MAX ]-(hp_tp_bonus+hp_bonus); }
else if ( nAttribute == ATR_MANA ) { strAttribute = _STR_ATTRIBUTE_MANA ; nAttributeValue = hero.attribute[ ATR_MANA ]-(mp_tp_bonus+mp_bonus); }
else if ( nAttribute == ATR_MANA_MAX ) { strAttribute = _STR_ATTRIBUTE_MANA_MAX ; nAttributeValue = hero.attribute[ ATR_MANA_MAX ]-(mp_tp_bonus+mp_bonus); }
else if ( nAttribute == ATR_STRENGTH ) { strAttribute = _STR_ATTRIBUTE_STRENGTH ; nAttributeValue = hero.attribute[ ATR_STRENGTH ]-(str_tp_bonus+str_bonus); }
else if ( nAttribute == ATR_DEXTERITY ) { strAttribute = _STR_ATTRIBUTE_DEXTERITY ; nAttributeValue = hero.attribute[ ATR_DEXTERITY ]-(dex_tp_bonus+dex_bonus); }
else { strAttribute = _STR_INVALID ; nAttributeValue = 0 ; };
//
// COMPOSE MESSAGE
//
var int nDifference ;
var string strDifference;
var string strMessage ;
nDifference = nValue - nAttributeValue;
strDifference = IntToString( nDifference );
strMessage = _STR_CANNOTUSE_PRE_PLAYER;
strMessage = ConcatStrings( strMessage, strDifference );
strMessage = ConcatStrings( strMessage, " punktów " );
strMessage = ConcatStrings( strMessage, strAttribute );
strMessage = ConcatStrings( strMessage, _STR_CANNOTUSE_POINTS );
strMessage = ConcatStrings( strMessage, _STR_CANNOTLERNSKILL_POST );
//
// PRINT MESSAGE
//
PutMsg(strMessage,"font_default.tga",RGBAToZColor(255,50,50,255),8*2,"");
};
func void G_CanNotLernMulti( var int nAttribute, var int nValue, var int nAttribute2, var int nValue2 )
{
//
// DETERMINE ATTIBUTE
//
var int nAttributeValue ;
var string strAttribute ;
var int nAttributeValue2 ;
var string strAttribute2 ;
if ( nAttribute == ATR_HITPOINTS ) { strAttribute = _STR_ATTRIBUTE_HITPOINTS ; nAttributeValue = hero.attribute[ ATR_HITPOINTS ]-(hp_tp_bonus+hp_bonus); }
else if ( nAttribute == ATR_HITPOINTS_MAX ) { strAttribute = _STR_ATTRIBUTE_HITPOINTS_MAX ; nAttributeValue = hero.attribute[ ATR_HITPOINTS_MAX ]-(hp_tp_bonus+hp_bonus); }
else if ( nAttribute == ATR_MANA ) { strAttribute = _STR_ATTRIBUTE_MANA ; nAttributeValue = hero.attribute[ ATR_MANA ]-(mp_tp_bonus+mp_bonus); }
else if ( nAttribute == ATR_MANA_MAX ) { strAttribute = _STR_ATTRIBUTE_MANA_MAX ; nAttributeValue = hero.attribute[ ATR_MANA_MAX ]-(mp_tp_bonus+mp_bonus); }
else if ( nAttribute == ATR_STRENGTH ) { strAttribute = _STR_ATTRIBUTE_STRENGTH ; nAttributeValue = hero.attribute[ ATR_STRENGTH ]-(str_tp_bonus+str_bonus); }
else if ( nAttribute == ATR_DEXTERITY ) { strAttribute = _STR_ATTRIBUTE_DEXTERITY ; nAttributeValue = hero.attribute[ ATR_DEXTERITY ]-(dex_tp_bonus+dex_bonus); }
else { strAttribute = _STR_INVALID ; nAttributeValue = 0 ; };
//#2
if ( nAttribute2 == ATR_HITPOINTS ) { strAttribute2 = _STR_ATTRIBUTE_HITPOINTS ; nAttributeValue2 = hero.attribute[ ATR_HITPOINTS ]-(hp_tp_bonus+hp_bonus); }
else if ( nAttribute2 == ATR_HITPOINTS_MAX ) { strAttribute2 = _STR_ATTRIBUTE_HITPOINTS_MAX ; nAttributeValue2 = hero.attribute[ ATR_HITPOINTS_MAX ]-(hp_tp_bonus+hp_bonus); }
else if ( nAttribute2 == ATR_MANA ) { strAttribute2 = _STR_ATTRIBUTE_MANA ; nAttributeValue2 = hero.attribute[ ATR_MANA ]-(mp_tp_bonus+mp_bonus); }
else if ( nAttribute2 == ATR_MANA_MAX ) { strAttribute2 = _STR_ATTRIBUTE_MANA_MAX ; nAttributeValue2 = hero.attribute[ ATR_MANA_MAX ]-(mp_tp_bonus+mp_bonus); }
else if ( nAttribute2 == ATR_STRENGTH ) { strAttribute2 = _STR_ATTRIBUTE_STRENGTH ; nAttributeValue2 = hero.attribute[ ATR_STRENGTH ]-(str_tp_bonus+str_bonus); }
else if ( nAttribute2 == ATR_DEXTERITY ) { strAttribute2 = _STR_ATTRIBUTE_DEXTERITY ; nAttributeValue2 = hero.attribute[ ATR_DEXTERITY ]-(dex_tp_bonus+dex_bonus); }
else { strAttribute2 = _STR_INVALID ; nAttributeValue2 = 0 ; };
//
// COMPOSE MESSAGE
//
var int nDifference ;
var string strDifference;
var string strMessage ;
//#2
var int nDifference2;
var string strDifference2;
nDifference = nValue - nAttributeValue;
strDifference = IntToString( nDifference );
nDifference2 = nValue2 - nAttributeValue2;
strDifference2 = IntToString( nDifference2 );
strMessage = _STR_CANNOTUSE_PRE_PLAYER;
strMessage = ConcatStrings( strMessage, strDifference );
strMessage = ConcatStrings( strMessage, " " );
strMessage = ConcatStrings( strMessage, strAttribute );
strMessage = ConcatStrings( strMessage, " " );
strMessage = ConcatStrings( strMessage, _STR_CANNOTUSE_POINTS );
strMessage = ConcatStrings( strMessage, _STR_CANNOTLERNSKILL_AND);
strMessage = ConcatStrings( strMessage, strDifference );
strMessage = ConcatStrings( strMessage, " " );
strMessage = ConcatStrings( strMessage, strAttribute2 );
strMessage = ConcatStrings( strMessage, " " );
strMessage = ConcatStrings( strMessage, _STR_CANNOTUSE_POINTS );
strMessage = ConcatStrings( strMessage, _STR_CANNOTLERNSKILL_POST );
//
// PRINT MESSAGE
//
PutMsg(strMessage,"font_default.tga",RGBAToZColor(255,50,50,255),8*2,"");
};
func void B_give_ore(var C_NPC typ, var int LP_Cost)
{
// Everything went fine, take ore and lp's from hero:
// 11:41 PM 10/15/2012 orc
// (bugfix: when hero don't match some conditions there is a risk
// of giving ore and lp to teacher and dont getting them back even
// if hero don't lerned skill)
if(!C_NpcTypeIsFriend(self,typ))
{
msg = ConcatStrings("Oddałeś bryłek: ",IntToString(ORECOST_LP*LP_cost));
PutMsg(msg,"font_default.tga",RGBAToZColor(255,160,100,255),_TIME_MESSAGE_GIVEN,"");
Npc_RemoveInvItems(typ,itminugget,10*LP_cost);
};
typ.lp = typ.lp - LP_cost;
};
func int B_GiveSkill(var C_NPC typ, var int TAL, var int NEW_Wert, var int LP_Cost, var int TEACHERMAX_WERT) //return 1
{
var int typ_tal;
typ_tal = Npc_GetTalentValue(typ, TAL);
var int tal_val;
tal_val = typ_tal+LP_Cost;
var int MAX_WERT;
// ---------- Umwandeln von var in const
var int TAL_Wert;
var string msg;
if (TAL == NPC_TALENT_1H) { MAX_WERT=100; TAL_Wert = Npc_GetTalentValue(typ, NPC_TALENT_1H ); }
else if (TAL == NPC_TALENT_2H) { MAX_WERT=100; TAL_Wert = Npc_GetTalentValue(typ, NPC_TALENT_2H ); }
else if (TAL == NPC_TALENT_BOW) { MAX_WERT=100; TAL_Wert = Npc_GetTalentValue(typ, NPC_TALENT_BOW ); }
else if (TAL == NPC_TALENT_CROSSBOW) { MAX_WERT=100; TAL_Wert = Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW ); }
else if (TAL == NPC_TALENT_PICKLOCK) { MAX_WERT=999; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_PICKLOCK ); }
else if (TAL == NPC_TALENT_PICKPOCKET) { MAX_WERT=999; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_PICKPOCKET); }
else if (TAL == NPC_TALENT_EVASION) { MAX_WERT=999; TAL_Wert =HERO_EVASION_LEVEL; }
else if (TAL == HACK_NPC_TALENT_MAGE) { MAX_WERT=999; TAL_Wert = Npc_GetAivar(typ,TALENT_MAGIC_CIRCLE); }
else if (TAL == NPC_TALENT_SMITH) { MAX_WERT=100; TAL_Wert = Npc_GetTalentValue(typ, NPC_TALENT_SMITH); }
else if (TAL == NPC_TALENT_REGEN_HP) { MAX_WERT=999; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_REGEN_HP); }
else if (TAL == NPC_TALENT_REGEN_MP) { MAX_WERT=999; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_REGEN_MP); }
else if (TAL == NPC_TALENT_ALCHEMY) { MAX_WERT=100; TAL_Wert = Npc_GetTalentValue(typ, NPC_TALENT_ALCHEMY ); };
if(TAL_Wert+LP_Cost>MAX_WERT)
{
B_Say (self, typ, "$NOLEARNOVERMAX");
return FALSE;
}
else if(TAL_Wert+LP_Cost>TEACHERMAX_WERT)
{
PutMsg(ConcatStrings (PRINT_NoLearnOverPersonalMAX, IntToString(TEACHERMAX_WERT)),"font_default.tga",RGBAToZColor(255,50,50,255),8*2,"");
B_Say (self, typ, "$NOLEARNYOUREBETTER");
return FALSE;
}
else
{
// ----------- Bedingungen/LP checken, dann ggf. vergeben
// if ((TAL_Wert) >= NEW_Wert)
// {
/*if (typ_tal+lp_cost > typ_tal)&&((TAL == NPC_TALENT_1H)||(TAL == NPC_TALENT_2H)||(TAL == NPC_TALENT_BOW)||(TAL == NPC_TALENT_CROSSBOW))
{
PrintScreen (ConcatStrings("Ten nauczyciel nie nauczy cie wiecej niż: ",IntToString(typ_tal)) , -1,35,"FONT_OLD_10_WHITE.TGA",3);
}
else */if (typ.lp >= LP_cost)
{
if(C_NpcTypeIsFriend(self,typ))||((!C_NpcTypeIsFriend(self,typ))&&(Npc_HasItems(typ,itminugget)>=10*LP_Cost))
{
if (tal == NPC_TALENT_1H)
{
if(Math_Round((tal_val)/2) <= typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))&&(tal_val <= typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))&&(Npc_GetTalentValue(typ, NPC_TALENT_1H)+LP_cost<=100)
{
if (LP_cost == 1)
{
if (Npc_GetTalentValue(typ, NPC_TALENT_1H) == 29)
{
//TODO This text won't refresh after reset of gothic (bugfixes add)
TXT_TALENTS_SKILLS [1] = " adept| adept| adept";
Npc_SetTalentSkill(typ, NPC_TALENT_1H, 1);
PutMsg("Zostałeś adeptem w posługiwaniu się bronią jednoręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (Npc_GetTalentValue(typ, NPC_TALENT_1H) == 59)
{
TXT_TALENTS_SKILLS [1] = " mistrz| mistrz| mistrz";
Npc_SetTalentSkill(typ, NPC_TALENT_1H, 2);
PutMsg("Zostałeś mistrzem w posługiwaniu się bronią jednoręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
PutMsg("Nauka walki bronią jednoręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
};
}
else if (LP_cost == 5)
{
if (Npc_GetTalentValue(typ, NPC_TALENT_1H) >= 25 )&&(Npc_GetTalentValue(typ, NPC_TALENT_1H) <= 29 )
{
TXT_TALENTS_SKILLS [1] = " adept| adept| adept";
Npc_SetTalentSkill(typ, NPC_TALENT_1H, 1);
PutMsg("Zostałeś adeptem w posługiwaniu się bronią jednoręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (Npc_GetTalentValue(typ, NPC_TALENT_1H) >= 55)&&(Npc_GetTalentValue(typ, NPC_TALENT_1H) <= 59 )
{
TXT_TALENTS_SKILLS [1] = " mistrz| mistrz| mistrz";
Npc_SetTalentSkill(typ, NPC_TALENT_1H, 2);
PutMsg("Zostałeś mistrzem w posługiwaniu się bronią jednoręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
PutMsg("Nauka walki bronią jednoręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
};
};
B_give_ore(typ, LP_Cost);
Npc_SetTalentValue(typ, NPC_TALENT_1H, tal_val);
}
else
{
if(tal_val > typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))
{
G_CanNotLern(ATR_STRENGTH,tal_val);
return 0;
}
else if(Math_Round((tal_val)/2) > typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))
{
G_CanNotLern(ATR_DEXTERITY,Math_Round((tal_val)/2));
return 0;
}
else
{
G_CanNotLernMulti(ATR_STRENGTH,tal_val,ATR_DEXTERITY,Math_Round((tal_val)/2));
return 0;
};
};
};
if (tal == NPC_TALENT_2H)
{
if(Math_Round((tal_val)/2) <= typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))&&(tal_val <= typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))&&(Npc_GetTalentValue(typ, NPC_TALENT_2h)+LP_cost<=100)
{
if (LP_cost == 1)
{
if (Npc_GetTalentValue(typ, NPC_TALENT_2h) == 29)
{
TXT_TALENTS_SKILLS [2] = " adept| adept| adept";
Npc_SetTalentSkill(typ, NPC_TALENT_2h, 1);
PutMsg("Zostałeś adeptem w posługiwaniu się bronią dwuręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (Npc_GetTalentValue(typ, NPC_TALENT_2h) == 59)
{
TXT_TALENTS_SKILLS [2] = " mistrz| mistrz| mistrz";
Npc_SetTalentSkill(typ, NPC_TALENT_2h, 2);
PutMsg("Zostałeś mistrzem w posługiwaniu się bronią dwuręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
PutMsg("Nauka walki bronią dwuręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
};
}
else if (LP_cost == 5)
{
if (Npc_GetTalentValue(typ, NPC_TALENT_2h) >= 25 )&&(Npc_GetTalentValue(typ, NPC_TALENT_2h) <= 29 )
{
TXT_TALENTS_SKILLS [2] = " adept| adept| adept";
Npc_SetTalentSkill(typ, NPC_TALENT_2h, 1);
PutMsg("Zostałeś adeptem w posługiwaniu się bronią dwuręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (Npc_GetTalentValue(typ, NPC_TALENT_2h) >= 55)&&(Npc_GetTalentValue(typ, NPC_TALENT_2h) <= 59 )
{
TXT_TALENTS_SKILLS [2] = " mistrz| mistrz| mistrz";
Npc_SetTalentSkill(typ, NPC_TALENT_2h, 2);
PutMsg("Zostałeś mistrzem w posługiwaniu się bronią dwuręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
PutMsg("Nauka walki bronią dwuręczną!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
};
};
B_give_ore(typ, LP_Cost);
Npc_SetTalentValue(typ, NPC_TALENT_2h, tal_val);
}
else
{
if(Npc_GetTalentValue(typ, NPC_TALENT_2h)+LP_cost>100)
{
B_Say (self, typ, "$NoLearnOverMax");
return 0;
}
else if(tal_val > typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))
{
G_CanNotLern(ATR_STRENGTH,tal_val);
return 0;
}
else if(Math_Round((tal_val)/2) > typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))
{
G_CanNotLern(ATR_DEXTERITY,Math_Round((tal_val)/2));
return 0;
}
else
{
G_CanNotLernMulti(ATR_STRENGTH,tal_val,ATR_DEXTERITY,Math_Round((tal_val)/2));
return 0;
};
};
};
if (tal == NPC_TALENT_BOW)
{
if(Math_Round((tal_val)/2) <= typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))&&(tal_val <= typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))&&(Npc_GetTalentValue(typ, NPC_TALENT_BOW)+LP_cost<=100)
{
if (LP_cost == 1)
{
if (Npc_GetTalentValue(typ, NPC_TALENT_BOW) == 29)
{
TXT_TALENTS_SKILLS [3] = " adept| adept| adept";
Npc_SetTalentSkill(typ, NPC_TALENT_BOW, 1);
PutMsg("Zostałeś adeptem w posługiwaniu się łukiem!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (Npc_GetTalentValue(typ, NPC_TALENT_BOW) == 59)
{
TXT_TALENTS_SKILLS [3] = " mistrz| mistrz| mistrz";
Npc_SetTalentSkill(typ, NPC_TALENT_BOW, 2);
PutMsg("Zostałeś mistrzem w posługiwaniu się łukiem!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
PutMsg("Nauka strzelania łukiem!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
};
}
else if (LP_cost == 5)
{
if (Npc_GetTalentValue(typ, NPC_TALENT_BOW) >= 25 )&&(Npc_GetTalentValue(typ, NPC_TALENT_BOW) <= 29 )
{
TXT_TALENTS_SKILLS [3] = " adept| adept| adept";
Npc_SetTalentSkill(typ, NPC_TALENT_BOW, 1);
PutMsg("Zostałeś adeptem w posługiwaniu się łukiem!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (Npc_GetTalentValue(typ, NPC_TALENT_BOW) >= 55)&&(Npc_GetTalentValue(typ, NPC_TALENT_BOW) <= 59 )
{
TXT_TALENTS_SKILLS [3] = " mistrz| mistrz| mistrz";
Npc_SetTalentSkill(typ, NPC_TALENT_BOW, 2);
PutMsg("Zostałeś mistrzem w posługiwaniu się łukiem!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
PutMsg("Nauka strzelania łukiem!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
};
};
B_give_ore(typ, LP_Cost);
Npc_SetTalentValue(typ, NPC_TALENT_BOW, tal_val);
}
else
{
if(Npc_GetTalentValue(typ, NPC_TALENT_BOW)+LP_cost>100)
{
B_Say (self, typ, "$NoLearnOverMax");
return 0;
}
else if(tal_val > typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))
{
G_CanNotLern(ATR_DEXTERITY,tal_val);
return 0;
}
else if(Math_Round((tal_val)/2) > typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))
{
G_CanNotLern(ATR_STRENGTH,Math_Round((tal_val)/2));
return 0;
}
else
{
G_CanNotLernMulti(ATR_DEXTERITY,tal_val,ATR_STRENGTH,Math_Round((tal_val)/2));
return 0;
};
};
};
//////////////////////////////////////////////////////////////////////
if (tal == NPC_TALENT_CROSSBOW)
{
if(Math_Round((tal_val)/2) <= typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))&&(tal_val <= typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))&&(Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW)+LP_cost<=100)
{
if (LP_cost == 1)
{
if (Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW) == 29)
{
TXT_TALENTS_SKILLS [4] = " adept| adept| adept";
Npc_SetTalentSkill(typ, NPC_TALENT_CROSSBOW, 1);
PutMsg("Zostałeś adeptem w posługiwaniu się kuszą!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW) == 59)
{
TXT_TALENTS_SKILLS [4] = " mistrz| mistrz| mistrz";
Npc_SetTalentSkill(typ, NPC_TALENT_CROSSBOW, 2);
PutMsg("Zostałeś mistrzem w posługiwaniu się kuszą!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
PutMsg("Nauka strzelania kuszą!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
};
}
else if (LP_cost == 5)
{
if (Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW) >= 25 )&&(Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW) <= 29 )
{
TXT_TALENTS_SKILLS [4] = " adept| adept| adept";
Npc_SetTalentSkill(typ, NPC_TALENT_CROSSBOW, 1);
PutMsg("Zostałeś adeptem w posługiwaniu się kuszą!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW) >= 55)&&(Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW) <= 59 )
{
TXT_TALENTS_SKILLS [4] = " mistrz| mistrz| mistrz";
Npc_SetTalentSkill(typ, NPC_TALENT_CROSSBOW, 2);
PutMsg("Zostałeś mistrzem w posługiwaniu się kuszą!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
PutMsg("Nauka strzelania kuszą!","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
};
};
B_give_ore(typ, LP_Cost);
Npc_SetTalentValue(typ, NPC_TALENT_CROSSBOW, tal_val);
}
else
{
if(Npc_GetTalentValue(typ, NPC_TALENT_CROSSBOW)+LP_cost>100)
{
B_Say (self, typ, "$NoLearnOverMax");
return 0;
}
else if(tal_val > typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))
{
G_CanNotLern(ATR_DEXTERITY,tal_val);
return 0;
}
else if(Math_Round((tal_val)/2) > typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))
{
G_CanNotLern(ATR_STRENGTH,Math_Round((tal_val)/2));
return 0;
}
else
{
G_CanNotLernMulti(ATR_DEXTERITY,tal_val,ATR_STRENGTH,Math_Round((tal_val)/2));
return 0;
};
};
};
if (tal == NPC_TALENT_PICKLOCK)
{
Npc_SetTalentSkill(typ, NPC_TALENT_PICKLOCK, NEW_Wert);
Npc_SetTalentValue(typ, NPC_TALENT_PICKLOCK, Npc_GetTalentValue(typ, NPC_TALENT_PICKLOCK)-40);
PutMsg("Nauka: otwieranie zamków","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
B_give_ore(typ, LP_Cost);
B_SetSkillValuesBasedOnAttribute(typ,ATR_DEXTERITY);
}
else if (tal == NPC_TALENT_PICKPOCKET)
{
Npc_SetTalentSkill(typ, NPC_TALENT_PICKPOCKET, NEW_Wert);
Npc_SetTalentValue(typ, NPC_TALENT_PICKPOCKET, Npc_GetTalentValue(typ, NPC_TALENT_PICKPOCKET)-40);
PutMsg("Nauka: kradzież kieszonkowa","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
B_give_ore(typ, LP_Cost);
B_SetSkillValuesBasedOnAttribute(typ,ATR_DEXTERITY);
}
else if (tal == NPC_TALENT_EVASION)
{
//Npc_SetTalentSkill(typ, NPC_TALENT_EVASION, 1);
HERO_EVASION_LEVEL=NEW_Wert;
if(NEW_Wert==1)
{
TXT_TALENTS_SKILLS [NPC_TALENT_EVASION] = " adept| adept| adept| adept| adept| adept| adept";
}
else
{
TXT_TALENTS_SKILLS [NPC_TALENT_EVASION] = " mistrz| mistrz| mistrz| mistrz| mistrz| mistrz| mistrz";
};
B_SetSkillValuesBasedOnAttribute(typ,ATR_DEXTERITY);
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: uniki","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else if (tal == NPC_TALENT_ALCHEMY)
{
if(Math_Round(tal_val) <= typ.attribute[ATR_MANA_MAX]-(mp_tp_bonus+mp_bonus))
{
// if(Npc_GetTalentValue(typ, NPC_TALENT_ALCHEMY)==0)
// {
TXT_TALENTS_SKILLS [NPC_TALENT_ALCHEMY] = " Tak| Tak";
// };
Npc_SetTalentValue(typ, NPC_TALENT_ALCHEMY, tal_val);
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: alchemia","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
G_CanNotLern(ATR_MANA_MAX,tal_val);
return 0;
};
}
else if (tal == NPC_TALENT_SMITH)
{
if(Math_Round((tal_val)/2) <= typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))&&(tal_val <= typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))
{
TXT_TALENTS_SKILLS [NPC_TALENT_SMITH] = " Tak| Tak";
Npc_SetTalentValue(typ, NPC_TALENT_SMITH, tal_val);
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: kowalstwo","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
}
else
{
if(tal_val > typ.attribute[ATR_STRENGTH]-(str_tp_bonus+str_bonus))
{
G_CanNotLern(ATR_STRENGTH,tal_val);
return 0;
}
else if(Math_Round((tal_val)/2) > typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus))
{
G_CanNotLern(ATR_DEXTERITY,Math_Round((tal_val)/2));
return 0;
}
else
{
G_CanNotLernMulti(ATR_STRENGTH,tal_val,ATR_DEXTERITY,Math_Round((tal_val)/2));
return 0;
};
};
}
else if (tal == NPC_TALENT_REGEN_MP)
{
Npc_SetTalentSkill(typ, NPC_TALENT_REGEN_MP, NEW_Wert);
PutMsg("Nauka: regeneracja many","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
B_give_ore(typ, LP_Cost);
B_SetSkillValuesBasedOnAttribute(typ,ATR_MANA_MAX);
}
else if (tal == NPC_TALENT_REGEN_HP)
{
Npc_SetTalentSkill(typ, NPC_TALENT_REGEN_HP, NEW_Wert);
PutMsg("Nauka: regeneracja życia","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
B_give_ore(typ, LP_Cost);
B_SetSkillValuesBasedOnAttribute(typ,ATR_STRENGTH);
}
else
{
return 0;
};
}
else
{
PutMsg("Nie masz wystarczającej ilości rudy!","font_default.tga",RGBAToZColor(255,100,100,255),_TIME_MESSAGE_GIVEN,"");
return FALSE;
};
}
else
{
PutMsg("Za mało punktów nauki!","font_default.tga",RGBAToZColor(255,50,50,255),8*2,"");
B_Say (self, typ, "$NOLEARNNOPOINTS");
return 0;
};
};
};
//-----------------------------
// HACK -- -- -- -- -- -- -- --
//tal set to NEW_Wert!!!!!!! --
//-----------------------------
func int Hack_B_GiveSkill(var C_NPC typ, var int TAL, var int NEW_Wert, var int LP_Cost, var int TEACHERMAX_WERT) //return 1
{
var int typ_tal;
typ_tal = Npc_GetTalentValue(typ, TAL);
// ---------- Umwandeln von var in const
var int TAL_Wert;
var int MAX_WERT;
if (TAL == HACK_NPC_TALENT_MAGE) {MAX_WERT = 6; TAL_Wert = Npc_GetAivar(typ,TALENT_MAGIC_CIRCLE); }
else if (TAL == HACK_NPC_TALENT_SNEAK) {MAX_WERT = 1+LP_COST; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_SMITH); }
else if (TAL == HACK_NPC_TALENT_ACROBAT) {MAX_WERT = 1+LP_COST; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_REGEN_MP); }
else if (TAL == HACK_NPC_TALENT_QUICK_LERNING) {MAX_WERT = 2+LP_COST; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_REGEN_MP); }
else if (TAL == HACK_NPC_TALENT_DUALUSING) {MAX_WERT = 1+LP_COST; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_REGEN_MP); }
else if (TAL == HACK_NPC_TALENT_RUNESWORDUSING) {MAX_WERT = 1+LP_COST; TAL_Wert = Npc_GetTalentSkill(typ, NPC_TALENT_REGEN_MP); }
else if (TAL == HACK_NPC_TALENT_ITEM_CHARMER) {MAX_WERT = 1+LP_COST; TAL_Wert = Npc_GetTalentValue(typ, NPC_TALENT_ALCHEMY ); };
if(TAL_Wert+1>MAX_WERT)
{
B_Say (self, typ, "$NOLEARNOVERMAX");
return FALSE;
}
else if(TAL_Wert+LP_Cost>TEACHERMAX_WERT)
{
PrintScreen (ConcatStrings (PRINT_NoLearnOverPersonalMAX, IntToString(TEACHERMAX_WERT)), -1, -1, _STR_FONT_ONSCREEN, 2);
B_Say (self, typ, "$NOLEARNYOUREBETTER");
return FALSE;
}
else
{
// ----------- Bedingungen/LP checken, dann ggf. vergeben
// if ((TAL_Wert) >= NEW_Wert)
// {
if (typ.lp >= LP_cost)
{
if(C_NpcTypeIsFriend(self,typ))||((!C_NpcTypeIsFriend(self,typ))&&(Npc_HasItems(typ,itminugget)>=10*LP_Cost))
{
if (tal == HACK_NPC_TALENT_MAGE)
{
if(typ.attribute[ATR_MANA_MAX]-(mp_tp_bonus+mp_bonus)>=NEW_Wert*20)
{
Npc_SetTalentSkill(typ, NPC_TALENT_EVASION, NEW_Wert);
Npc_SetAivar(typ,TALENT_MAGIC_CIRCLE, NEW_Wert);
//B_LogEntry(MANA_SKILLS,"");
B_give_ore(typ, LP_Cost);
PutMsg("Nauczyłeś się kolejnego kręgu magii","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
//return 1; //Return(break) when hero gives his magic ore to Teacher (return at end of function)
}
else
{
G_CanNotLern(ATR_MANA_MAX,NEW_Wert*20);
return 0;
};
}
else if (tal == HACK_NPC_TALENT_SNEAK)
{
if(typ.attribute[ATR_DEXTERITY]-(dex_tp_bonus+dex_bonus)>=40)
{
TALENT_SNEAK = TRUE;//Dialog Bugfix
Npc_SetTalentSkill(typ, NPC_TALENT_SMITH, 1);
//B_LogEntry(DEX_SKILLS,"");
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: skradanie","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
//return 1; //Return(break) when hero gives his magic ore to Teacher (return at end of function)
}
else
{
G_CanNotLern(ATR_DEXTERITY,40);
return 0;
};
}
else if (tal == HACK_NPC_TALENT_ACROBAT)
{
TALENT_ACROBAT = TRUE;
Npc_SetTalentSkill(typ, NPC_TALENT_ALCHEMY, 1);
//B_LogEntry(MISC_SKILLS,"");
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: akrobatyka","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
//return 1; //Return(break) when hero gives his magic ore to Teacher (return at end of function)
}
else if (tal == HACK_NPC_TALENT_QUICK_LERNING)
{
TALENT_QUICK_LERNING = New_Wert;
//B_LogEntry(MISC_SKILLS,"");
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: szybka nauka","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
//return 1; //Return(break) when hero gives his magic ore to Teacher (return at end of function)
}
else if (tal == HACK_NPC_TALENT_ITEM_CHARMER)
{
TALENT_ITEM_CHARMER = New_Wert;
//B_LogEntry(MISC_SKILLS,"");
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: zaklinanie","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
//return 1; //Return(break) when hero gives his magic ore to Teacher (return at end of function)
}
else if (tal == HACK_NPC_TALENT_DUALUSING)
{
if(Npc_GetTalentValue(typ, NPC_TALENT_1H)>=60)&&(Npc_GetTalentValue(typ,NPC_TALENT_1H)>=60)
{
TALENT_DUALUSING = TRUE;
//B_LogEntry(STR_SKILLS,"");
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: miecze oburęczne","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
//return 1; //Return(break) when hero gives his magic ore to Teacher (return at end of function)
}
else
{
if(Npc_GetTalentValue(typ, NPC_TALENT_2H)<=60)
{
msg = "Brakuje Ci ";
msg = concatstrings(msg,IntToString(60-Npc_GetTalentValue(typ, NPC_TALENT_2H)));
msg = concatstrings(msg,"% walki bronią dwuręczna, by nauczyć się tej umiejętności.");
PutMsg(msg,"font_default.tga",RGBAToZColor(255,100,100,255),_TIME_MESSAGE_GIVEN,"");
return 0;
};
if(Npc_GetTalentValue(typ, NPC_TALENT_1H)<=60)
{
msg = "Brakuje Ci ";
msg = concatstrings(msg,IntToString(60-Npc_GetTalentValue(typ, NPC_TALENT_1H)));
msg = concatstrings(msg,"% walki bronią jednoręczną, by nauczyć się tej umiejętności.");
PutMsg(msg,"font_default.tga",RGBAToZColor(255,100,100,255),_TIME_MESSAGE_GIVEN,"");
return 0;
};
};
}
else if (tal == HACK_NPC_TALENT_RUNESWORDUSING)
{
TALENT_RUNESWORDUSING = TRUE;
//B_LogEntry(MISC_SKILLS,"");
B_give_ore(typ, LP_Cost);
PutMsg("Nauka: miecz runiczny","font_default.tga",RGBAToZColor(255,255,255,255),2*8,"");
//return 1; //Return(break) when hero gives his magic ore to Teacher (return at end of function)
}
else
{
return 0;
};
}
else
{
PutMsg("Nie masz wystarczającej ilości rudy!","font_default.tga",RGBAToZColor(255,100,100,255),_TIME_MESSAGE_GIVEN,"");
return 0;
};
}
else
{
PutMsg("Za mało punktów nauki!","font_default.tga",RGBAToZColor(255,50,50,255),8*2,"");
B_Say (self, typ, "$NOLEARNNOPOINTS");
return 0;
};
};
return true;
};
|
D
|
module android.java.android.text.SpannedString;
public import android.java.android.text.SpannedString_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!SpannedString;
import import3 = android.java.java.util.stream.IntStream;
import import1 = android.java.android.text.SpannedString;
|
D
|
module android.java.org.xmlpull.v1.XmlSerializer;
public import android.java.org.xmlpull.v1.XmlSerializer_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!XmlSerializer;
import import4 = android.java.java.lang.Class;
import import3 = android.java.org.xmlpull.v1.XmlSerializer;
|
D
|
/Users/oyo02699/apps/easycrm/easycrm-api/target/rls/debug/deps/md5-bd3fe2cda08f69b9.rmeta: /Users/oyo02699/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/md5-0.7.0/src/lib.rs
/Users/oyo02699/apps/easycrm/easycrm-api/target/rls/debug/deps/md5-bd3fe2cda08f69b9.d: /Users/oyo02699/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/md5-0.7.0/src/lib.rs
/Users/oyo02699/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/md5-0.7.0/src/lib.rs:
|
D
|
module as.tinf;
import as.def;
import as.engine;
import as.mod;
import std.exception;
import std.string;
/**
Angelscript type info
*/
class Type {
private:
ScriptEngine engine;
Module mod;
~this() {
this.engine = null;
}
package(as):
asITypeInfo* info;
this(ScriptEngine engine, asITypeInfo* info) {
this.engine = engine;
this.mod = new Module(engine, asTypeInfo_GetModule(info));
this.info = info;
}
this(ScriptEngine engine, Module mod, asITypeInfo* info) {
this.engine = engine;
this.mod = mod;
this.info = info;
}
public:
/**
Gets the scripting engine this type belongs to
*/
ScriptEngine getEngine() {
return engine;
}
/**
Gets the config group this type belongs to
*/
string getConfigGroup() {
return cast(string)asTypeInfo_GetConfigGroup(info).fromStringz;
}
/**
Gets this type's access mask
*/
asDWORD getAccessMask() {
return asTypeInfo_GetAccessMask(info);
}
/**
Gets the module this type belongs to
*/
Module getModule() {
return mod;
}
/**
Add a reference to this type
*/
int addRef() {
return asTypeInfo_AddRef(info);
}
/**
Release a reference from this type
*/
int release() {
return asTypeInfo_Release(info);
}
/**
Gets the name of this type
*/
string getName() {
return cast(string)asTypeInfo_GetName(info).fromStringz;
}
/**
Gets this type's namespace
*/
string getNamespace() {
return cast(string)asTypeInfo_GetNamespace(info).fromStringz;
}
/**
Gets this type's base type
This method will return null if this type has no base type
*/
Type getBaseType() {
auto baseType = asTypeInfo_GetBaseType(info);
return baseType !is null ? new Type(engine, baseType) : null;
}
/**
Gets whether this type derives from the specified other type
*/
bool derivesFrom(Type other) {
return asTypeInfo_DerivesFrom(info, other.info);
}
/**
Gets this type's flags
*/
asDWORD getFlags() {
return asTypeInfo_GetFlags(info);
}
/**
Gets the size in bytes of this type
*/
asUINT getSize() {
return asTypeInfo_GetSize(info);
}
/**
Gets this type's type id
*/
int getTypeId() {
return asTypeInfo_GetTypeId(info);
}
/**
Gets the id the specified subtype
*/
int getSubTypeId(asUINT subtypeIndex) {
return asTypeInfo_GetSubTypeId(info, subtypeIndex);
}
/**
Gets the subtype by its index
Returns null if there's no subtype at that index
*/
Type getSubType(asUINT subtypeIndex) {
auto subType = asTypeInfo_GetSubType(info, subtypeIndex);
return subType !is null ? new Type(engine, subType) : null;
}
/**
Gets the amount of subtypes this type has
*/
asUINT getSubTypeCount() {
return asTypeInfo_GetSubTypeCount(info);
}
/**
Gets the amount of interfaces this type implements
*/
asUINT getInterfaceCount() {
return asTypeInfo_GetInterfaceCount(info);
}
/**
Gets the interface at the specified index
Returns null if there's no interface at that index
*/
Type getInterface(asUINT index) {
auto iface = asTypeInfo_GetInterface(info, index);
return iface !is null ? new Type(engine, iface) : null;
}
/**
Gets whether this type implements the specified interface
*/
bool implements(Type other) {
return asTypeInfo_Implements(info, other.info);
}
}
|
D
|
// Used only for testing -- imports all windows headers.
module win32.testall;
version(Windows):
import win32.core;
import win32.windows;
import win32.commctrl;
import win32.setupapi;
import win32.directx.dinput8;
import win32.directx.dsound8;
import win32.directx.d3d9;
import win32.directx.d3dx9;
import win32.directx.dxerr;
import win32.directx.dxerr8;
import win32.directx.dxerr9;
import win32.directx.d3d10;
import win32.directx.d3d10effect;
import win32.directx.d3d10shader;
import win32.directx.d3dx10;
import win32.directx.dxgi;
import win32.oleacc;
import win32.comcat;
import win32.cpl;
import win32.cplext;
import win32.custcntl;
import win32.ocidl;
import win32.olectl;
import win32.oledlg;
import win32.objsafe;
import win32.ole;
import win32.shldisp;
import win32.shlobj;
import win32.shlwapi;
import win32.regstr;
import win32.richole;
import win32.tmschema;
import win32.servprov;
import win32.exdisp;
import win32.exdispid;
import win32.idispids;
import win32.mshtml;
import win32.lm;
import win32.lmbrowsr;
import win32.sql;
import win32.sqlext;
import win32.sqlucode;
import win32.odbcinst;
import win32.imagehlp;
import win32.intshcut;
import win32.iphlpapi;
import win32.isguids;
import win32.subauth;
import win32.rasdlg;
import win32.rassapi;
import win32.mapi;
import win32.mciavi;
import win32.mcx;
import win32.mgmtapi;
import win32.nddeapi;
import win32.msacm;
import win32.nspapi;
import win32.ntdef;
import win32.ntldap;
import win32.ntsecapi;
import win32.pbt;
import win32.powrprof;
import win32.rapi;
import win32.wininet;
import win32.winioctl;
import win32.winldap;
import win32.dbt;
import win32.rpcdce2;
import win32.tlhelp32;
import win32.httpext;
import win32.lmwksta;
import win32.mswsock;
import win32.objidl;
import win32.ole2ver;
import win32.psapi;
import win32.raserror;
import win32.usp10;
import win32.vfw;
version (WindowsVista) {
version = WINDOWS_XP_UP;
} else version (Windows2003) {
version = WINDOWS_XP_UP;
} else version (WindowsXP) {
version = WINDOWS_XP_UP;
}
version (WINDOWS_XP_UP) {
import win32.errorrep;
import win32.lmmsg;
import win32.reason;
import win32.secext;
}
import win32.aclapi;
import win32.aclui;
import win32.dhcpcsdk;
import win32.lmserver;
import win32.ntdll;
version (Win32_Winsock1) {
import win32.winsock;
}
|
D
|
/**
An error class to handle errors with an integer code in different categories.
Copyright: Copyright Christophe Meessen.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Christophe Meessen
Source:
*/
import std.stdio;
import std.typecons;
/**
* An error category is derived from ErrorCategory and identified by a singleton retrieved by the `category()` method.
* Categories can be efficiently compared by comparing their singleton address, e.g.,
* `if (err1.category is err2.category)` or `if (err.category is MyError.category)`.
*/
class ErrorCategory
{
/**
* Return the category name.
*/
final string name() @safe pure nothrow immutable { return nameImpl(); }
protected abstract string nameImpl() @safe pure nothrow immutable;
/**
* Return the singleton instance identifying this category.
*/
final immutable(ErrorCategory) category() @safe pure nothrow immutable { return categoryImpl(); }
protected abstract immutable(ErrorCategory) categoryImpl() @safe pure nothrow immutable;
/**
* Return a human readable error code name for value.
*/
final string name(int value) @safe pure nothrow immutable { return nameImpl(value); }
protected abstract string nameImpl(int value) @safe pure nothrow immutable;
/**
* Return a tuple with the error code value associated to the name and hasValue set to true,
* or a tuple with hasValue set to false anv value to int.init if there is no such error name.
*/
final Nullable!int value(const(char)[] name) @safe pure nothrow immutable { return valueImpl(name); }
protected abstract Nullable!int valueImpl(const(char)[] name) @safe pure nothrow immutable;
/**
* Return a human readable description of the error associated to the specified error code value.
*/
final string message(int value) @safe pure nothrow immutable { return messageImpl(value); }
protected abstract string messageImpl(int value) @safe pure nothrow immutable;
/**
* Return a human readable description of the error associated to the specified error code value.
*/
final string toString(int value) @safe pure nothrow immutable { return toStringImpl(value); }
protected abstract string toStringImpl(int value) @safe pure nothrow immutable;
/**
* Return true if obj is this ErrorCategory
*/
final bool opEquals(immutable ErrorCategory category) { return category is this; }
}
/**
* An ErrorCode identifies a particular error. It is defined by a category and by a unique integer in
* in that category. Like ErrorCategories, ErrorCodes are immutable singleton objects for efficient comparison, e.g.,
* `if (err is MyError.badAddress)` or `if (err is MyError.byCode(3))`.
*/
struct ErrorCode
{
this(int value, immutable ErrorCategory category) @safe pure nothrow
{
category_ = category;
value_ = category ? value : 0;
}
this(T : ErrorCategory)(T.Value value) @safe pure nothrow
{
category_ = T.category;
value_ = cast(int)value;
}
ErrorCode opAssign(T : ErrorCategory)(T.Value value) @safe pure nothrow
{
category_ = T.category;
value_ = cast(int)value;
return this;
}
int value() @safe pure nothrow const { return value_; }
string name() @safe pure nothrow const { return category_ ? category_.name(value_) : "noError"; }
immutable(ErrorCategory) category() @safe pure nothrow const { return category_; }
string message() @safe pure nothrow const { return category_ ? category_.message(value_) : "no error"; }
string toString() @safe pure nothrow const { return category_ ? category_.toString(value_) : "noError"; }
bool opCast(T : bool)() @safe pure nothrow const { return category_ != null; }
bool opEquals(ErrorCode err) @safe pure nothrow const { return err.value == value_ && err.category is category_; }
bool opEquals(T : ErrorCategory)(T.Value value) @safe pure nothrow const { return value == value_ && T.category is category_; }
private:
Rebindable!(immutable ErrorCategory) category_ = null;
int value_ = 0;
}
/**
* Thrown ErrorCodeException .
*/
class ErrorCodeException : Exception
{
@safe pure nothrow
this(const ErrorCode err, string s = null, string fn = __FILE__, size_t ln = __LINE__)
{
super(s?s:err.toString(), fn, ln);
err_ = err;
}
@safe pure nothrow
this(T : ErrorCategory)(T.Value value, string s = null, string fn = __FILE__, size_t ln = __LINE__)
{
this(ErrorCode(value), s, fn, ln);
}
@property pure nothrow
ErrorCode error() const { return err_; }
private ErrorCode err_;
}
/**
* Template function to define the common ErrorCategory members of a user defined category
* The user needs only to define the `pulic enum Value {...}` and `private enum string[int] message_= [...]`
*/
string makeErrorCategory(Class, Enum, string categoryName)() {
enum string a0 = " @safe pure nothrow ";
enum string a1 = " @safe pure nothrow immutable ";
string members = "private this() immutable { assert(__ctfe); } \n"
~"static string name()"~a0~"{ return \""~categoryName~"\"; } \n"
~"protected override string nameImpl()"~a1~"{ return name(); } \n"
~"static immutable("~Class.stringof~") category()"~a0~"{ return singleton_; } \n"
~"protected override immutable(ErrorCategory) categoryImpl()"~a1~"{ return category(); } \n"
~"static string name(int value)"~a0~"{auto p = value in value2name_; \n"
~"return (p) ? *p : \""~categoryName~".unknown\";} \n"
~"protected override string nameImpl(int value)"~a1~"{ return name(value); } \n"
~"import std.typecons;"
~"static Nullable!int value(const(char)[] name)"~a0
~"{auto p = name in name2value_; return (p) ? Nullable!int(*p) : Nullable!int();} \n"
~"protected override Nullable!int valueImpl(const(char)[] name)"~a1~"{ return value(name);} \n"
~"static string message(int value)"~a0~"{ import std.conv; auto p = value in message_; "
~"return p ? *p : \"unknown error (\"~to!string(value)~\")\";} \n"
~"protected override string messageImpl(int value)"~a1~"{ return message(value); } \n"
~"static string toString(int value)"~a0~"{ return name(value)~\": \"~message(value); } \n"
~"protected override string toStringImpl(int value)"~a1~"{ return toString(value); } \n";
string trailer = "private static singleton_ = new immutable "~Class.stringof~"; \n";
string aliases;
string value2name = "private enum string[int] value2name_ = [";
string name2value = "private enum int[string] name2value_ = [";
foreach (m; __traits(allMembers, Enum)) {
import std.string : format;
aliases ~= format("public alias %s = %s.%s;", m, Enum.stringof, m);
value2name ~= format("%s : \"%s.%s\",", m, categoryName, m);
name2value ~= format("\"%s.%s\" : %s,", categoryName, m, m);
}
value2name ~= "];";
name2value ~= "];";
return members ~ "\n" ~ aliases ~ "\n" ~ value2name ~ "\n" ~ name2value ~ "\n" ~ trailer;
}
|
D
|
import std.stdio, std.algorithm;
T a(T)(T answer) {
writefln(" # Called function a(%s) -> %s", answer, answer);
return answer;
}
T b(T)(T answer) {
writefln(" # Called function b(%s) -> %s", answer, answer);
return answer;
}
void main() {
foreach (immutable x, immutable y;
[false, true].cartesianProduct([false, true])) {
writeln("\nCalculating: r1 = a(x) && b(y)");
immutable r1 = a(x) && b(y);
writeln("Calculating: r2 = a(x) || b(y)");
immutable r2 = a(x) || b(y);
}
}
|
D
|
/* Un programa sencillo con la definición de una constante. */
enum a = 3;
void main() {
/* itn x;
itn y;
$
$ */
}
|
D
|
import bamfile;
import samheader;
import reference;
import alignment;
import alignmentrange;
import tagvalue;
import validation.alignment;
import core.memory : GC;
import core.runtime : Runtime;
import std.c.stdlib;
import std.string;
import std.range;
import std.algorithm;
import core.stdc.string : memcpy;
import std.conv;
import std.traits;
extern(C) void libbam_init() {
Runtime.initialize();
GC.disable();
}
void main() {}
static string last_error;
extern(C) immutable(char)*
get_last_error() {
return last_error.ptr;
}
extern(C) void*
bamfile_new(const char* filename) {
try {
BamFile* f = cast(BamFile*)malloc(BamFile.sizeof);
scope(failure) free(f);
emplace(f, to!string(filename));
GC.addRange(f, BamFile.sizeof);
return f;
} catch (Throwable e) {
last_error = e.msg;
return null;
}
}
extern(C) bool
bamfile_has_index(BamFile* f) {
return f.has_index;
}
extern(C) void
bamfile_destroy(BamFile* f) {
f.close();
GC.removeRange(f);
free(cast(void*)f);
}
extern(C) SamHeader
bamfile_get_header(BamFile* f) {
return f.header;
}
struct Array(T) {
size_t length;
T* ptr;
}
extern(C) Array!ReferenceSequenceInfo
bamfile_get_reference_sequences(BamFile* f) {
typeof(return) arr;
arr.length = f.reference_sequences.length;
arr.ptr = f.reference_sequences.ptr;
return arr;
}
alias InputRange!Alignment AlignmentRange;
extern(C) AlignmentRange*
bamfile_get_alignments(BamFile* f) {
AlignmentRange* ar = cast(AlignmentRange*)malloc(AlignmentRange.sizeof);
AlignmentRange _ar = inputRangeObject(f.alignments);
memcpy(ar, &_ar, _ar.sizeof);
GC.addRange(ar, AlignmentRange.sizeof);
return ar;
}
extern(C) AlignmentRange*
bamfile_get_valid_alignments(BamFile* f) {
AlignmentRange* ar = cast(AlignmentRange*)malloc(AlignmentRange.sizeof);
auto range = filter!((Alignment a){return isValid(a);})(f.alignments);
AlignmentRange _ar = inputRangeObject(range);
memcpy(ar, &_ar, _ar.sizeof);
GC.addRange(ar, AlignmentRange.sizeof);
return ar;
}
extern(C) AlignmentRange*
bamfile_fetch_alignments(BamFile* f, const char* chr, int beg, int end) {
AlignmentRange* ar = cast(AlignmentRange*)malloc(AlignmentRange.sizeof);
auto range = (*f)[to!string(chr)][beg .. end];
AlignmentRange _ar = inputRangeObject(range);
memcpy(ar, &_ar, _ar.sizeof);
GC.addRange(ar, AlignmentRange.sizeof);
return ar;
}
extern(C) void
alignment_range_destroy(AlignmentRange* ar) {
GC.removeRange(ar);
free(cast(void*)ar);
}
extern(C) Alignment*
alignment_range_front(AlignmentRange* ar) {
Alignment* a = cast(Alignment*)malloc(Alignment.sizeof);
auto _a = ar.front;
memcpy(a, &_a, _a.sizeof);
GC.addRange(ar, Alignment.sizeof);
return a;
}
/// returns 1 if range is empty after popfront,
/// 0 if non-empty,
/// -1 if error occurred
extern(C) int
alignment_range_popfront(AlignmentRange* ar) {
try {
ar.popFront();
return ar.empty() ? 1 : 0;
} catch (Throwable e) {
last_error = e.msg;
return -1;
}
}
extern(C) bool
alignment_range_empty(AlignmentRange* ar) {
return ar.empty();
}
extern(C) void
alignment_destroy(Alignment* a) {
GC.removeRange(a);
free(cast(void*)a);
}
extern(C) bool
alignment_is_valid(Alignment* a) {
return isValid(*a);
}
extern(C) int
alignment_ref_id(Alignment* a) {
return a.ref_id;
}
extern(C) int
alignment_position(Alignment* a) {
return a.position;
}
extern(C) ushort
alignment_bin(Alignment* a) {
return a.bin;
}
extern(C) ubyte
alignment_mapping_quality(Alignment* a) {
return a.mapping_quality;
}
extern(C) ushort
alignment_flag(Alignment* a) {
return a.flag;
}
extern(C) int
alignment_sequence_length(Alignment* a) {
return a.sequence_length;
}
extern(C) int
alignment_next_ref_id(Alignment* a) {
return a.next_ref_id;
}
extern(C) int
alignment_next_pos(Alignment* a) {
return a.next_pos;
}
extern(C) int
alignment_template_length(Alignment* a) {
return a.template_length;
}
extern(C) Array!(immutable(char))
alignment_read_name(Alignment* a) {
typeof(return) arr;
arr.length = a.read_name.length;
arr.ptr = a.read_name.ptr;
return arr;
}
extern(C) immutable(char)*
alignment_cigar_string(Alignment* a) {
return toStringz(a.cigarString());
}
extern(C) immutable(char)*
alignment_sequence(Alignment* a) {
return toStringz(to!string(a.sequence()));
}
extern(C) Array!ubyte
alignment_phred_base_quality(Alignment* a) {
Array!ubyte arr;
arr.length = a.phred_base_quality.length;
arr.ptr = cast(ubyte*)(a.phred_base_quality.ptr);
return arr;
}
extern(C) Value*
alignment_get_tag_value(Alignment* a, char* str) {
Value* v = cast(Value*)malloc(Value.sizeof);
auto _v = a.tags[to!string(str)];
memcpy(v, &_v, _v.sizeof);
GC.addRange(v, Value.sizeof);
return v;
}
extern(C) void
tag_value_destroy(Value* v) {
GC.removeRange(v);
free(v);
}
struct DHash {
string[] keys = void;
Value[] values = void;
}
extern(C) void
dhash_destroy(DHash* hash) {
GC.removeRange(hash);
free(hash);
}
extern(C) DHash*
alignment_get_all_tags(Alignment* a) {
DHash* hash = cast(DHash*)malloc(DHash.sizeof);
GC.addRange(hash, DHash.sizeof);
hash.keys = new string[0];
hash.values = new Value[0];
foreach (k, v; a.tags) {
hash.keys ~= k;
hash.values ~= v;
}
return hash;
}
|
D
|
module org.serviio.util.ThreadExecutor;
import java.lang.Runnable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ThreadExecutor
{
private static ExecutorService executor;
static this()
{
executor = Executors.newFixedThreadPool(10);
}
public static void execute(Runnable r)
{
executor.execute(r);
}
}
/* Location: C:\Users\Main\Downloads\serviio.jar
* Qualified Name: org.serviio.util.ThreadExecutor
* JD-Core Version: 0.7.0.1
*/
|
D
|
/*******************************************************************************
Mixin for shared iteration code
copyright:
Copyright (c) 2015-2017 dunnhumby Germany GmbH. All rights reserved
License:
Boost Software License Version 1.0. See LICENSE.txt for details.
*******************************************************************************/
module dhtnode.request.model.IterationMixin;
/*******************************************************************************
Indicates if it is necessary to inject version for key-only iteration
or both keys + values
*******************************************************************************/
enum IterationKind
{
Key,
KeyValue
}
/*******************************************************************************
Common code shared by all requests that implement protocol based on
dhtproto.node.request.model.CompressedBatch
Template Params:
resources = host field which stores IRequestResources
kind = indicates which version of getNext to generate
predicate = optional predicate function to filter away some records.
Defaults to predicate that allows everything.
*******************************************************************************/
public template ChannelIteration ( alias resources, IterationKind kind,
alias predicate = alwaysTrue )
{
import dhtnode.storage.StorageEngine;
import dhtnode.storage.StorageEngineStepIterator;
import ocean.core.Tuple;
import ocean.core.Verify;
import ocean.transition;
/***************************************************************************
Convenience alias for argument set getNext should expect
***************************************************************************/
static if (kind == IterationKind.Key)
{
private alias Tuple!(mstring) ARGS;
}
else
{
private alias Tuple!(mstring, mstring) ARGS;
}
/***************************************************************************
Set to iterator over requested channel if that channel is present in
the node. Set to null otherwise (should result in empty OK response)
***************************************************************************/
private StorageEngineStepIterator iterator;
/***************************************************************************
Initialize the channel iterator
Params:
channel_name = name of channel to be prepared
Return:
`true` if it is possible to proceed with request
***************************************************************************/
override protected bool prepareChannel ( cstring channel_name )
{
auto storage_channel = channel_name in resources.storage_channels;
if (storage_channel is null)
{
this.iterator = null;
}
else
{
resources.iterator.setStorage(*storage_channel);
this.iterator = resources.iterator;
verify(this.iterator !is null);
}
// even missing channel is ok, response must return empty record
// list in that case
return true;
}
/***************************************************************************
Iterates records for the protocol
Params:
args = either key or key + value, depending on request type
Returns:
`true` if there was data, `false` if request is complete
***************************************************************************/
override protected bool getNext (out ARGS args)
{
// missing channel case
if (this.iterator is null)
return false;
// loops either until match is found or last key processed
while (true)
{
this.iterator.next();
resources.loop_ceder.handleCeding();
if (this.iterator.lastKey)
return false;
static if (kind == IterationKind.Key)
{
args[0] = this.iterator.key_as_string();
}
else
{
args[0] = this.iterator.key_as_string();
args[1] = this.iterator.value();
}
if (predicate(args))
{
this.resources.node_info.record_action_counters
.increment("iterated", this.iterator.value.length);
return true;
}
}
}
}
/*******************************************************************************
Default predicate which allows all records to be sent to the client.
Params:
args = any arguments
Returns:
true
*******************************************************************************/
public bool alwaysTrue ( T... ) ( T args )
{
return true;
}
|
D
|
/home/tyler/Documents/AdventOfCode/Rust/day_9_2/target/debug/day_9_2: /home/tyler/Documents/AdventOfCode/Rust/day_9_2/src/main.rs
|
D
|
/*******************************************************************************
D language bindings for libsodium's crypto_hash.h
License: ISC (see LICENSE.txt)
*******************************************************************************/
module libsodium.crypto_hash;
@nogc nothrow:
import libsodium;
extern (C):
/*
* WARNING: Unless you absolutely need to use SHA512 for interoperatibility,
* purposes, you might want to consider crypto_generichash() instead.
* Unlike SHA512, crypto_generichash() is not vulnerable to length
* extension attacks.
*/
enum crypto_hash_BYTES = crypto_hash_sha512_BYTES;
size_t crypto_hash_bytes ();
int crypto_hash (ubyte* out_, const(ubyte)* in_, ulong inlen);
enum crypto_hash_PRIMITIVE = "sha512";
const(char)* crypto_hash_primitive ();
|
D
|
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Vapor.build/Routing/Router+Function.swift.o : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Vapor.build/Routing/Router+Function~partial.swiftmodule : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Vapor.build/Routing/Router+Function~partial.swiftdoc : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/failinout1.d(9): Error: cannot modify `inout` expression `x`
---
*/
inout(int) foo(inout(int) x)
{
x = 5; // cannot modify inout
return 0;
}
|
D
|
module dmagick.c.option;
import core.stdc.stdio;
import dmagick.c.exception;
import dmagick.c.image;
import dmagick.c.magickType;
import dmagick.c.magickVersion;
alias ptrdiff_t ssize_t;
extern(C)
{
mixin(
{
static if ( MagickLibVersion >= 0x670 )
{
string options = "enum CommandOption";
}
else
{
string options = "enum MagickOption";
}
options ~= "
{
MagickUndefinedOptions = -1,
MagickAlignOptions = 0,
MagickAlphaOptions,
MagickBooleanOptions,";
static if ( MagickLibVersion >= 0x682 )
{
options ~= "MagickCacheOptions,";
}
options ~= "
MagickChannelOptions,
MagickClassOptions,
MagickClipPathOptions,
MagickCoderOptions,
MagickColorOptions,
MagickColorspaceOptions,
MagickCommandOptions,
MagickComposeOptions,
MagickCompressOptions,
MagickConfigureOptions,
MagickDataTypeOptions,
MagickDebugOptions,
MagickDecorateOptions,
MagickDelegateOptions,";
static if ( MagickLibVersion >= 0x661 )
{
options ~= "MagickDirectionOptions,";
}
options ~= "
MagickDisposeOptions,
MagickDistortOptions,
MagickDitherOptions,
MagickEndianOptions,
MagickEvaluateOptions,
MagickFillRuleOptions,
MagickFilterOptions,
MagickFontOptions,
MagickFontsOptions,
MagickFormatOptions,
MagickFunctionOptions,
MagickGravityOptions,";
static if ( MagickLibVersion < 0x670 )
{
options ~= "MagickImageListOptions,";
}
options ~= "
MagickIntentOptions,
MagickInterlaceOptions,
MagickInterpolateOptions,
MagickKernelOptions,
MagickLayerOptions,
MagickLineCapOptions,
MagickLineJoinOptions,
MagickListOptions,
MagickLocaleOptions,
MagickLogEventOptions,
MagickLogOptions,
MagickMagicOptions,
MagickMethodOptions,
MagickMetricOptions,
MagickMimeOptions,
MagickModeOptions,
MagickModuleOptions,
MagickMorphologyOptions,
MagickNoiseOptions,
MagickOrientationOptions,";
static if ( MagickLibVersion >= 0x684 )
{
options ~= "MagickPixelIntensityOptions,";
}
options ~= "
MagickPolicyOptions,
MagickPolicyDomainOptions,
MagickPolicyRightsOptions,
MagickPreviewOptions,
MagickPrimitiveOptions,
MagickQuantumFormatOptions,
MagickResolutionOptions,
MagickResourceOptions,
MagickSparseColorOptions,";
static if ( MagickLibVersion >= 0x669 )
{
options ~= "MagickStatisticOptions,";
}
options ~= "
MagickStorageOptions,
MagickStretchOptions,
MagickStyleOptions,
MagickThresholdOptions,
MagickTypeOptions,
MagickValidateOptions,
MagickVirtualPixelOptions";
static if ( MagickLibVersion >= 0x688 )
{
options ~= "MagickComplexOptions,
MagickIntensityOptions,";
}
options ~= "}";
return options;
}());
static if ( MagickLibVersion >= 0x686 )
{
enum ValidateType
{
UndefinedValidate,
NoValidate = 0x00000,
ColorspaceValidate = 0x00001,
CompareValidate = 0x00002,
CompositeValidate = 0x00004,
ConvertValidate = 0x00008,
FormatsDiskValidate = 0x00010,
FormatsMapValidate = 0x00020,
FormatsMemoryValidate = 0x00040,
IdentifyValidate = 0x00080,
ImportExportValidate = 0x00100,
MontageValidate = 0x00200,
StreamValidate = 0x00400,
AllValidate = 0x7fffffff
}
}
else
{
enum ValidateType
{
UndefinedValidate,
NoValidate = 0x00000,
CompareValidate = 0x00001,
CompositeValidate = 0x00002,
ConvertValidate = 0x00004,
FormatsInMemoryValidate = 0x00008,
FormatsOnDiskValidate = 0x00010,
IdentifyValidate = 0x00020,
ImportExportValidate = 0x00040,
MontageValidate = 0x00080,
StreamValidate = 0x00100,
AllValidate = 0x7fffffff
}
}
enum CommandOptionFlags
{
UndefinedOptionFlag = 0x0000,
FireOptionFlag = 0x0001, /* Option sequence firing point */
ImageInfoOptionFlag = 0x0002, /* Sets ImageInfo, no image needed */
DrawInfoOptionFlag = 0x0004, /* Sets DrawInfo, no image needed */
QuantizeInfoOptionFlag = 0x0008, /* Sets QuantizeInfo, no image needed */
GlobalOptionFlag = 0x0010, /* Sets Global Option, no image needed */
SimpleOperatorOptionFlag = 0x0100, /* Simple Image processing operator */
ListOperatorOptionFlag = 0x0200, /* Multi-Image List processing operator */
SpecialOperatorOptionFlag = 0x0400, /* Specially handled Operator Option */
GenesisOptionFlag = 0x0400, /* Genesis Command Wrapper Option */
NonConvertOptionFlag = 0x4000, /* Option not used by Convert */
DeprecateOptionFlag = 0x8000 /* Deprecate option, give warning */
}
struct OptionInfo
{
const(char)*
mnemonic;
ssize_t
type;
static if ( MagickLibVersion >= 0x670 )
{
ssize_t
flags;
}
MagickBooleanType
stealth;
}
static if ( MagickLibVersion >= 0x670 )
{
char** GetCommandOptions(const CommandOption);
const(char)* CommandOptionToMnemonic(const CommandOption, const ssize_t);
MagickBooleanType IsCommandOption(const(char)*);
MagickBooleanType ListCommandOptions(FILE*, const CommandOption, ExceptionInfo*);
ssize_t GetCommandOptionFlags(const CommandOption, const MagickBooleanType, const(char)*);
ssize_t ParseCommandOption(const CommandOption, const MagickBooleanType, const(char)*);
}
else
{
char** GetMagickOptions(const MagickOption);
const(char)* MagickOptionToMnemonic(const MagickOption, const ssize_t);
MagickBooleanType IsMagickOption(const(char)*);
MagickBooleanType ListMagickOptions(FILE*, const MagickOption, ExceptionInfo*);
ssize_t ParseMagickOption(const MagickOption, const MagickBooleanType,const(char)*);
}
static if ( MagickLibVersion >= 0x690 )
{
MagickBooleanType IsOptionMember(const(char)*, const(char)*);
}
char* GetNextImageOption(const(ImageInfo)*);
char* RemoveImageOption(ImageInfo*, const(char)*);
const(char)* GetImageOption(const(ImageInfo)*, const(char)*);
MagickBooleanType CloneImageOptions(ImageInfo*, const(ImageInfo)*);
MagickBooleanType DefineImageOption(ImageInfo*, const(char)*);
MagickBooleanType DeleteImageOption(ImageInfo*, const(char)*);
MagickBooleanType SetImageOption(ImageInfo*, const(char)*, const(char)*);
ssize_t ParseChannelOption(const(char)*);
void DestroyImageOptions(ImageInfo*);
void ResetImageOptions(const(ImageInfo)*);
void ResetImageOptionIterator(const(ImageInfo)*);
}
|
D
|
instance SLD_820_Soeldner(Npc_Default)
{
name[0] = NAME_Soeldner;
guild = GIL_SLD;
id = 820;
voice = 7;
flags = 0;
npcType = NPCTYPE_MAIN;
B_SetAttributesToChapter(self,4);
fight_tactic = FAI_HUMAN_STRONG;
EquipItem(self,ItMw_1h_Sld_Sword);
EquipItem(self,ItRw_Sld_Bow);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_P_Normal01,BodyTex_P,ITAR_SLD_M);
Mdl_SetModelFatness(self,2);
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,50);
daily_routine = Rtn_Start_820;
};
func void Rtn_Start_820()
{
TA_Stand_Guarding(8,0,22,0,"NW_BIGFARM_HOUSE_OUT_03");
TA_Stand_Guarding(22,0,8,0,"NW_BIGFARM_HOUSE_OUT_03");
};
|
D
|
/*
DSFML - The Simple and Fast Multimedia Library for D
Copyright (c) <2013> <Jeremy DeHaan>
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications,
and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution
***All code is based on code written by Laurent Gomila***
External Libraries Used:
SFML - The Simple and Fast Multimedia Library
Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
All Libraries used by SFML - For a full list see http://www.sfml-dev.org/license.php
*/
///Sounds, streaming (musics or custom sources), recording, spatialization.
module dsfml.audio;
public
{
import dsfml.system;
import dsfml.audio.listener;
import dsfml.audio.music;
import dsfml.audio.sound;
import dsfml.audio.soundbuffer;
import dsfml.audio.soundbufferrecorder;
import dsfml.audio.soundrecorder;
import dsfml.audio.soundsource;
import dsfml.audio.soundstream;
}
|
D
|
import std.stdio;
import std.conv : to;
import std.array : split, array;
import std.algorithm;
import std.range;
void main()
{
int[][] ings =
stdin
.byLine
.map!split
.map!(sp => iota(2, 10 + 1, 2)
.map!(i => to!int(sp[i]))
.array)
.array;
enum ingsMax = 100;
auto scoreMax = int.min;
foreach(a; 0..ingsMax+1)
{
foreach(b; 0..ingsMax+1-a)
{
foreach(c; 0..ingsMax+1-a-b)
{
foreach(d; 0..ingsMax+1-a-b-c)
{
auto scores = new int[ings[0].length];
for(int i = 0; i < scores.length; i++)
{
scores[i] += a * ings[0][i];
scores[i] += b * ings[1][i];
scores[i] += c * ings[2][i];
scores[i] += d * ings[3][i];
scores[i] = max(0, scores[i]);
}
if(scores[$ - 1] == 500)
{
auto score = reduce!((a, b) => a * b)(1, scores[0..$ - 1]);
if(score > scoreMax)
{
scoreMax = score;
}
}
}
}
}
}
writeln(scoreMax);
}
|
D
|
(if
(is (application_name) 'Zeiterfassung')
(begin
(println "--[ Hamster ]--")
(center)
)
)
|
D
|
module DABStationColumn;
// Enum DABStationColumn
/**
* TODO add enumeration class description
*/
enum DABStationColumn
{
COLUMN_CHANNEL,
COLUMN_NAME,
}
|
D
|
import std.stdio, std.array, std.ascii;
immutable string mDigits = digits ~ lowercase;
ulong atoiRadix(in string str, in uint radix=10, int* consumed=null)
nothrow {
static int dtoi(in char dc, in uint radix) nothrow {
static int[immutable char] digit;
immutable char d = dc.toLower;
if (digit.length == 0) // Not init yet.
foreach (i, c; mDigits)
digit[c] = i;
if (radix > 1 && radix <= digit.length &&
d in digit && digit[d] < radix)
return digit[d];
return int.min; // A negative for error.
}
ulong result;
int sp;
for (; sp < str.length; sp++) {
immutable int d = dtoi(str[sp], radix);
if (d >= 0) // Valid digit char.
result = radix * result + d;
else
break;
}
if (sp != str.length) // Some char in str not converted.
sp = -sp;
if (consumed !is null) // Signal error if not positive.
*consumed = sp;
return result;
}
string itoaRadix(ulong num, in uint radix=10) pure nothrow
in {
assert(radix > 1 && radix <= mDigits.length);
} body {
string result;
while (num > 0) {
immutable uint d = num % radix;
result = mDigits[d] ~ result;
num = (num - d) / radix;
}
return result.empty ? "0" : result;
}
void main() {
immutable string numStr = "1ABcdxyz???";
int ate;
writef("'%s' (base %d) = %d", numStr, 16,
atoiRadix(numStr, 16, &ate));
if (ate <= 0)
writefln("\tConverted only: '%s'", numStr[0 .. -ate]);
else
writeln();
writeln(itoaRadix(60_272_032_366, 36), " ",
itoaRadix(591_458, 36));
}
|
D
|
/Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/Build/Intermediates/TwoDirectionalScroller.build/Debug-iphonesimulator/TwoDirectionalScroller.build/Objects-normal/x86_64/CategoryRow.o : /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/AppDelegate.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/VideoCell.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/ViewController.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/CategoryRow.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/apple-1/Downloads/HorizontalScrollingCollectionView-master/Build/Intermediates/TwoDirectionalScroller.build/Debug-iphonesimulator/TwoDirectionalScroller.build/Objects-normal/x86_64/CategoryRow~partial.swiftmodule : /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/AppDelegate.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/VideoCell.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/ViewController.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/CategoryRow.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/apple-1/Downloads/HorizontalScrollingCollectionView-master/Build/Intermediates/TwoDirectionalScroller.build/Debug-iphonesimulator/TwoDirectionalScroller.build/Objects-normal/x86_64/CategoryRow~partial.swiftdoc : /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/AppDelegate.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/VideoCell.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/ViewController.swift /Users/apple-1/Downloads/HorizontalScrollingCollectionView-master/TwoDirectionalScroller/CategoryRow.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
|
D
|
module dsfml.graphics.glyph;
import dsfml.graphics.rect;
struct Glyph {
int advance = 0;
IntRect bounds;
IntRect subRect;
}
|
D
|
/Users/mwaly/Desktop/Apps/EventsVIPER/Build/Intermediates/EventsVIPER.build/Debug-iphonesimulator/EventsVIPERTests.build/Objects-normal/x86_64/NetworkingTests.o : /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/Common/NetworkingService/Tests/NetworkTestHelpers.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPERTests/EventsVIPERTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/Common/NetworkingService/Tests/NetworkingTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/List/DataManager/ListDataManagerTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/List/Presenter/ListPresenterTests.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/EventsVIPER.swiftmodule/x86_64.swiftmodule /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting.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/ModelIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SceneKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting-umbrella.h /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/Swift\ Compatibility\ Header/SnapshotTesting-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting.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/ModelIO.framework/Headers/ModelIO.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/GLKit.framework/Headers/GLKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SpriteKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.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/mwaly/Desktop/Apps/EventsVIPER/Build/Intermediates/EventsVIPER.build/Debug-iphonesimulator/EventsVIPERTests.build/Objects-normal/x86_64/NetworkingTests~partial.swiftmodule : /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/Common/NetworkingService/Tests/NetworkTestHelpers.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPERTests/EventsVIPERTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/Common/NetworkingService/Tests/NetworkingTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/List/DataManager/ListDataManagerTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/List/Presenter/ListPresenterTests.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/EventsVIPER.swiftmodule/x86_64.swiftmodule /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting.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/ModelIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SceneKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting-umbrella.h /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/Swift\ Compatibility\ Header/SnapshotTesting-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting.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/ModelIO.framework/Headers/ModelIO.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/GLKit.framework/Headers/GLKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SpriteKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.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/mwaly/Desktop/Apps/EventsVIPER/Build/Intermediates/EventsVIPER.build/Debug-iphonesimulator/EventsVIPERTests.build/Objects-normal/x86_64/NetworkingTests~partial.swiftdoc : /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/Common/NetworkingService/Tests/NetworkTestHelpers.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPERTests/EventsVIPERTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/Common/NetworkingService/Tests/NetworkingTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/List/DataManager/ListDataManagerTests.swift /Users/mwaly/Desktop/Apps/EventsVIPER/EventsVIPER/List/Presenter/ListPresenterTests.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/EventsVIPER.swiftmodule/x86_64.swiftmodule /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting.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/ModelIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SceneKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting-umbrella.h /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/Swift\ Compatibility\ Header/SnapshotTesting-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Users/mwaly/Desktop/Apps/EventsVIPER/Build/Products/Debug-iphonesimulator/SnapshotTesting/SnapshotTesting.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/ModelIO.framework/Headers/ModelIO.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/GLKit.framework/Headers/GLKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SpriteKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.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
|
import std.stdio: readln, writeln;
import std.string: strip;
import std.array: split;
import std.conv: to;
import std.algorithm: min, count;
/**
* User: Jior
* Date: 03.06.13
* Time: 13:13
*/
void main() {
auto rgb = strip(readln()).split().to!(int[]);
int result = 0;
foreach(ref color; rgb) {
if(color) {
if (color % 3) {
result += color / 3;
color %= 3;
} else {
result += color / 3 - 1;
color = 3;
}
}
}
switch(rgb.count(3)) {
case 2:
result += 2;
break;
case 3:
result += 3;
break;
default:
result += min(rgb[0], rgb[1], rgb[2]);
}
writeln(result);
}
|
D
|
/Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/Objects-normal/x86_64/Util.o : /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Schema.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ObjectSchema.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Sync.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ThreadSafeReference.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Optional.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Util.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Realm.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/SwiftVersion.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Migration.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/RealmCollection.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Error.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/SortDescriptor.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Aliases.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/LinkingObjects.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Results.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Object.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ObjectiveCSupport.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/List.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Property.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/RealmSwift/RealmSwift-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/Objects-normal/x86_64/Util~partial.swiftmodule : /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Schema.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ObjectSchema.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Sync.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ThreadSafeReference.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Optional.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Util.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Realm.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/SwiftVersion.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Migration.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/RealmCollection.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Error.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/SortDescriptor.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Aliases.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/LinkingObjects.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Results.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Object.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ObjectiveCSupport.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/List.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Property.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/RealmSwift/RealmSwift-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/Objects-normal/x86_64/Util~partial.swiftdoc : /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Schema.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ObjectSchema.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Sync.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ThreadSafeReference.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Optional.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Util.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Realm.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/SwiftVersion.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Migration.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/RealmCollection.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Error.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/SortDescriptor.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Aliases.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/LinkingObjects.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Results.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Object.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/ObjectiveCSupport.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/List.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/RealmSwift/RealmSwift/Property.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/RealmSwift/RealmSwift-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/// Math constants
/// Authors: Phobos Team, Ilya Yaroshenko
module mir.math.constant;
enum real E = 0x1.5bf0a8b1457695355fb8ac404e7a8p+1L; /++ e = 2.718281... +/
enum real LOG2T = 0x1.a934f0979a3715fc9257edfe9b5fbp+1L; /++ $(SUB log, 2)10 = 3.321928... +/
enum real LOG2E = 0x1.71547652b82fe1777d0ffda0d23a8p+0L; /++ $(SUB log, 2)e = 1.442695... +/
enum real LOG2 = 0x1.34413509f79fef311f12b35816f92p-2L; /++ $(SUB log, 10)2 = 0.301029... +/
enum real LOG10E = 0x1.bcb7b1526e50e32a6ab7555f5a67cp-2L; /++ $(SUB log, 10)e = 0.434294... +/
enum real LN2 = 0x1.62e42fefa39ef35793c7673007e5fp-1L; /++ ln 2 = 0.693147... +/
enum real LN10 = 0x1.26bb1bbb5551582dd4adac5705a61p+1L; /++ ln 10 = 2.302585... +/
enum real PI = 0x1.921fb54442d18469898cc51701b84p+1L; /++ π = 3.141592... +/
enum real PI_2 = PI/2; /++ $(PI) / 2 = 1.570796... +/
enum real PI_4 = PI/4; /++ $(PI) / 4 = 0.785398... +/
enum real M_1_PI = 0x1.45f306dc9c882a53f84eafa3ea69cp-2L; /++ 1 / $(PI) = 0.318309... +/
enum real M_2_PI = 2*M_1_PI; /++ 2 / $(PI) = 0.636619... +/
enum real M_2_SQRTPI = 0x1.20dd750429b6d11ae3a914fed7fd8p+0L; /++ 2 / $(SQRT)$(PI) = 1.128379... +/
enum real SQRT2 = 0x1.6a09e667f3bcc908b2fb1366ea958p+0L; /++ $(SQRT)2 = 1.414213... +/
enum real SQRT1_2 = SQRT2 / 2; /++ $(SQRT)$(HALF) = 0.707106... +/
/++
Exponent of minus Euler–Mascheroni constant.
+/
enum real ExpMEuler = 0x0.8fbbcf07f2e5f2c56894d7014c3086p0;
enum real GoldenRatio = 0x1.9e3779b97f4a7c15f39cc0605cedc8341082276bf3a27251f86c6a11d0c18p+0L; /++ Golden Ratio = (1 + sqrt(5)) / 2 = 1.6180339... ++/
enum real GoldenRatioInverseSquared = 0x0.61c8864680b583ea0c633f9fa31237cbef7dd8940c5d8dae079395ee2f3e71p+0L; /++ Golden Ratio ^ -2 = 0.381966... ++/
|
D
|
module ppl2.ast.expr_composite;
import ppl2.internal;
///
/// Wrap one or more nodes to appear as one single node.
///
final class Composite : Expression {
enum Usage {
STANDARD, /// Can be removed. Can be replaced if contains single child
PERMANENT, /// Never remove or replace even if empty
PLACEHOLDER /// Never remove. Can be replaced if contains single child
}
Usage usage = Usage.STANDARD;
static Composite make(Tokens t, Usage usage) {
auto c = makeNode!Composite(t);
c.usage = usage;
return c;
}
static Composite make(ASTNode node, Usage usage) {
auto c = makeNode!Composite(node);
c.usage = usage;
return c;
}
override bool isResolved() { return areResolved(children[]); }
override NodeID id() const { return NodeID.COMPOSITE; }
override int priority() const { return 15; }
/// The type is the type of the last element
override Type getType() {
if(hasChildren) return last().getType();
return TYPE_VOID;
}
bool endsWithReturn() {
return numChildren > 0 && last().isReturn;
}
bool isPlaceholder() { return usage==Usage.PLACEHOLDER; }
override string toString() {
return "Composite %s %s(type=%s)".format(usage, nid, getType);
}
}
|
D
|
// D import file generated from 'gamelib\window.d'
module gamelib.window;
import gamelib.all;
import dxlib.all;
import std.stdio;
import std.conv;
class Window
{
protected
{
bool _changeScreen = false;
GameSystem _game;
package
{
void changeScreen(bool val)
{
this._changeScreen = val;
}
this(GameSystem game)
{
this._game = game;
}
public
{
const void iconId(int val)
{
dx_SetWindowIconID(val);
}
const void caption(string val)
{
dx_SetWindowText(toWStringz(val));
}
const void caption(wstring val)
{
dx_SetWindowText(toWStringz(val));
}
void fullScreen(bool val);
const bool fullScreen()
{
return 0 != dx_GetChangeDisplayFlag();
}
bool changeScreen();
const void screenRate(double val)
in
{
assert(val > 0);
}
body
{
dx_SetWindowSizeExtendRate(val);
}
void position(int x, int y)
{
dx_SetWindowInitPosition(x,y);
}
const double screenRate()
{
return dx_GetWindowSizeExtendRate();
}
const void dragFileValid(bool val)
{
dx_SetDragFileValidFlag(val);
}
const void clearDragFileInfo()
{
dx_DragFileInfoClear();
}
const wstring dragFilePath();
const int dragFileNum()
{
return dx_GetDragFileNum();
}
const bool active()
{
return 0 != dx_GetWindowActiveFlag();
}
void changeWindowSizeButton(bool val);
int x()
{
int x,y;
dx_GetWindowPosition(&x,&y);
return x;
}
void x(int val)
{
dx_SetWindowPosition(val,this.y);
}
int y()
{
int x,y;
dx_GetWindowPosition(&x,&y);
return y;
}
void y(int val)
{
dx_SetWindowPosition(this.x,val);
}
IntVector pos()
{
int x,y;
dx_GetWindowPosition(&x,&y);
return IntVector(x,y);
}
void pos(int x, int y)
{
dx_SetWindowPosition(x,y);
}
void pos(Vector val)
{
this.pos(cast(int)val.x,cast(int)val.y);
}
void pos(IntVector val)
{
this.pos(val.x,val.y);
}
}
}
}
}
|
D
|
module cidr.ipaddress;
import cidr.exception;
import std.stdio;
import std.exception;
import core.sys.posix.arpa.inet;
import std.format;
import std.traits : isSomeString;
struct IP {
private:
uint _value;
ubyte _netmask;
public:
import std.socket;
this(uint address) {
_value = address;
}
this(uint address, ubyte maskbits) {
this(address);
this._netmask = maskbits;
}
this(AddressT)(AddressT addr)
if (__traits(compiles, addr.toAddrString=="")
|| __traits(compiles, addr.addr == cast(uint)0)
|| __traits(compiles, addr.addr == cast(ubyte[16])""))
{
static if (__traits(compiles, addr.addr == cast(ubyte[16])"")) {
enforce!IPv6NotImplemented(0, "ipv6 not implemented");
} else static if (__traits(compiles, addr.addr == cast(uint)0)) {
this._value = addr.addr;
return;
} else if (__traits(compiles, addr.toAddrString=="")) {
this = addr.toAddrString();
return;
}
assert(0);
}
alias _value this;
ref opAssign(T)(T s) if (isSomeString!T) {
import std.exception;
import std.string;
import std.algorithm : canFind, countUntil;
import std.conv;
auto netmask_idx = s.countUntil("/");
if (netmask_idx>=0) {
enforce(netmask_idx<s.length-1, "netmask invalid");
//writefln("mask: %d" , );
setMask(to!ubyte(s[netmask_idx+1..$]));
s = s[0..netmask_idx];
}
string[] components;
if (s.canFind('.')) {
components = s.split('.');
} else if (s.canFind(':')) {
components = s.split(':');
} else {
enforce(0, "not an ipaddress");
}
if (components.length == 4) {
ubyte[] arr = (cast(ubyte*)&_value)[0 .. 4];
foreach (i, n; components) {
arr[3-i] = std.conv.to!ubyte(n);
}
} else {
enforce(0, "err, ipv6 not supported");
}
return this;
}
static IP fromString(string s) {
IP ret;
ret = s;
return ret;
}
void setMask(string maskaddr) {
_netmask = 0;
auto addr = IP.fromString(maskaddr);
uint counter = addr._value;
while ((counter & 1) == 0) {
counter >>= 1;
}
while ((counter & 1) == 1) {
_netmask += 1;
counter >>= 1;
}
enforce(_netmask <= 32, "netmask max is 32: %d".format(_netmask));
}
void setMask(ubyte v) {
enforce(v <= 32, "netmask max is 32: %d".format(_netmask));
_netmask = v;
}
IP netmask() {
return IP(mask());
}
IP id() {
return IP(mask & _value);
}
alias network = id;
IP broadcast() {
return IP((~mask) | id);
}
IP ip() {
return IP(_value);
}
uint mask() {
enforce(_netmask <= 32, "netmask max is 32: %d".format(_netmask));
uint ret;
for (int i=0; i < _netmask; i++) {
ret <<= 1;
ret |= 1;
//writefln("%d %.32b", _netmask, ret);
}
ret <<= (32-_netmask);
//writefln("---%d %.32b", _netmask, ret);
return ret;
}
bool contains(IP other) {
//auto bytes = cast(ubyte[])this;
//writefln("%.32b %.32b", _value, _value&mask);
//writefln("%.32b %.32b %s", other._value, other._value&mask, (_value&mask) == (other._value&mask));
//writefln("%.32b %.32b", _value.htonl, _value.htonl&mask);
//writefln("%.32b %.32b %s", other._value.htonl, other._value.htonl&mask, (_value.htonl&mask)==(other._value.htonl&mask));
//writefln("\t%.8b\t%.8b\t%.8b\t%.8b", bytes[0], bytes[1], bytes[2], bytes[3]);
//bytes = cast(ubyte[])other;
//writefln("\t%.8b\t%.8b\t%.8b\t%.8b", bytes[0], bytes[1], bytes[2], bytes[3]);
//auto tmp = _value.htonl;
//bytes = (cast(ubyte*)&tmp)[0 .. 4];
//writefln("\t%.8b\t%.8b\t%.8b\t%.8b", bytes[0], bytes[1], bytes[2], bytes[3]);
//tmp = other._value.htonl;
//bytes = (cast(ubyte*)&tmp)[0 .. 4];
//writefln("\t%.8b\t%.8b\t%.8b\t%.8b", bytes[0], bytes[1], bytes[2], bytes[3]);
return (other&mask) == id;
}
bool usable(IP other) {
return this.contains(other) && other._value != id._value && other._value != broadcast._value;
}
auto range() {
struct Ret {
IP network;
bool empty;
IP front;
private uint _front;
void popFront() {
auto tmp = IP(_front);
if (!network.contains(tmp)) {
empty = true;
return;
}
assert(_front < typeof(_front).max);
_front++;
front = tmp;
}
IP back() {
return network.broadcast;
}
auto broadcast() {
return network.broadcast;
}
size_t length;
private typeof(this) prime() {
// pretend an empty netmask is a network with just one ip
if (network._netmask == 0) {
network._netmask = 32;
}
_front = network._value;
length = (~network.mask)+1;
this.popFront();
return this;
}
}
return Ret(IP(id, _netmask)).prime;
}
auto hosts() {
import std.traits : ReturnType;
struct Ret1 {
ReturnType!range inner;
alias inner this;
bool empty;
void popFront() {
inner.popFront();
// don't include broadcast
if (inner.empty || front._value == inner.broadcast._value) {
empty = true;
}
}
size_t length;
private typeof(this) prime() {
length = inner.length - 2;
popFront(); // skip network
return this;
}
}
return Ret1(range()).prime;//.drop(1).filter!(a => a._value != broadcast._value);
}
void print() {
import std.stdio;
writefln("======print:%s========", this);
ubyte[] arr = cast(ubyte[])this;
if (_netmask != 0) {
writefln("%.8b.%.8b.%.8b.%.8b/%d", arr[0], arr[1], arr[2], arr[3], _netmask);
} else {
writefln("%.8b.%.8b.%.8b.%.8b", arr[0], arr[1], arr[2], arr[3]);
}
writefln("ip: %.32b - %s", ip()._value, ip);
if (_netmask) {
writefln("mask: %.32b - %s", mask(), netmask);
writefln("id: %.32b - %s", id()._value, id);
writefln("range: %s - %s", range.front, range.back);
}
writefln("=====printed:%s=======", this);
}
string toString() {
import std.format;
ubyte[] arr = cast(ubyte[])this;
if (_netmask != 0) {
return "%d.%d.%d.%d/%d".format(arr[3], arr[2], arr[1], arr[0], _netmask);
} else {
return "%d.%d.%d.%d".format(arr[3], arr[2], arr[1], arr[0]);
}
}
ubyte[] opCast(T)() if (is(T == ubyte[])) {
return (cast(ubyte*)&_value)[0 .. 4];
}
uint opCast(T)() if (is(T == uint)) {
return _value;
}
}
unittest {
import testdata;
import std.algorithm : map;
import std.array;
auto ip = IP.fromString(network_input.ip);
assert(ip.toString() == network_input.ip);
ip.print();
ip = IP.fromString(network_input.network);
assert(ip.netmask.toString == network_output.netmask);
ip.setMask("255.255.255.252");
ip.print();
ip.setMask(30);
ip.print();
assert(ip.id.toString == network_input.id);
assert(ip.broadcast.toString == network_input.broadcast);
assert(ip.contains(IP.fromString(network_input.ip_host)));
assert(!ip.contains(IP.fromString(network_input.ip_host_fail)));
assert(ip.range.map!(a => a.toString).array == network_output.range);
assert(ip.range.map!(a => a.toString).array != network_output.hosts);
assert(ip.range.length == 4);
assert(ip.hosts.length == 2);
assert(ip.hosts.map!(a => a.toString).array == network_output.hosts);
assert(!ip.usable(IP.fromString(network_input.ip)));
assert(!ip.usable(IP.fromString(network_input.broadcast)));
foreach (item; network_output.hosts) {
assert(ip.usable(IP.fromString(item)));
}
ip = IP.fromString("255.255.255.0");
assert(ip.toString() == "255.255.255.0");
ip.print();
ip = IP.fromString("10.255.0.0/8");
assert(ip.id().toString == "10.0.0.0");
ip.print();
auto ip2 = IP.fromString("10.255.0.1");
assert(ip.contains(ip2));
assert(ip2.toString == "10.255.0.1");
}
unittest {
import std.socket;
auto ip = IP.fromString("10.255.0.0/8");
auto ip3 = IP(InternetAddress.parse("10.255.0.1"));
assert(ip.contains(ip3));
import std.exception;
assertThrown!IPv6NotImplemented(IP(new Internet6Address(Internet6Address.parse("::ffff:127.0.0.1"), cast(ushort)0)));
}
unittest {
auto net = IP.fromString("216.239.32.0/19");
auto ip = IP.fromString("192.168.0.1");
net.print();
ip.print();
assert(!net.contains(ip));
}
|
D
|
/workspace/target/debug/build/serde-27df1f8e6eb9b120/build_script_build-27df1f8e6eb9b120: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.125/build.rs
/workspace/target/debug/build/serde-27df1f8e6eb9b120/build_script_build-27df1f8e6eb9b120.d: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.125/build.rs
/root/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.125/build.rs:
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1984-1998 by Symantec
* Copyright (C) 2000-2021 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/cgobj.d, backend/cgobj.d)
*/
module dmd.backend.cgobj;
version (SCPP)
version = COMPILE;
version (MARS)
version = COMPILE;
version (COMPILE)
{
import core.stdc.ctype;
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import dmd.backend.barray;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.cgcv;
import dmd.backend.code;
import dmd.backend.code_x86;
import dmd.backend.dlist;
import dmd.backend.dvec;
import dmd.backend.el;
import dmd.backend.md5;
import dmd.backend.mem;
import dmd.backend.global;
import dmd.backend.obj;
import dmd.backend.oper;
import dmd.backend.outbuf;
import dmd.backend.rtlsym;
import dmd.backend.ty;
import dmd.backend.type;
extern (C++):
nothrow:
version (SCPP)
{
import filespec;
import msgs2;
import scopeh;
extern(C) char* getcwd(char*,size_t);
}
version (MARS)
{
import dmd.backend.dvarstats;
//import dmd.backend.filespec;
char *filespecdotext(const(char)* filespec);
char *filespecgetroot(const(char)* name);
char *filespecname(const(char)* filespec);
version (Windows)
{
extern (C) int stricmp(const(char)*, const(char)*) pure nothrow @nogc;
alias filespeccmp = stricmp;
}
else
alias filespeccmp = strcmp;
extern(C) char* getcwd(char*,size_t);
struct Loc
{
char *filename;
uint linnum;
uint charnum;
this(int y, int x)
{
linnum = y;
charnum = x;
filename = null;
}
}
static if (__VERSION__ < 2092)
void error(Loc loc, const(char)* format, ...);
else
pragma(printf) void error(Loc loc, const(char)* format, ...);
}
version (Windows)
{
extern(C) char* strupr(char*);
}
version (Posix)
{
extern(C) char* strupr(char* s)
{
for (char* p = s; *p; ++p)
{
char c = *p;
if ('a' <= c && c <= 'z')
*p = cast(char)(c - 'a' + 'A');
}
return s;
}
}
int obj_namestring(char *p,const(char)* name);
enum MULTISCOPE = 1; /* account for bug in MultiScope debugger
where it cannot handle a line number
with multiple offsets. We use a bit vector
to filter out the extra offsets.
*/
extern (C) void TOOFFSET(void* p, targ_size_t value);
void TOWORD(void* a, uint b)
{
*cast(ushort*)a = cast(ushort)b;
}
void TOLONG(void* a, uint b)
{
*cast(uint*)a = b;
}
/**************************
* Record types:
*/
enum
{
RHEADR = 0x6E,
REGINT = 0x70,
REDATA = 0x72,
RIDATA = 0x74,
OVLDEF = 0x76,
ENDREC = 0x78,
BLKDEF = 0x7A,
BLKEND = 0x7C,
// DEBSYM = 0x7E,
THEADR = 0x80,
LHEADR = 0x82,
PEDATA = 0x84,
PIDATA = 0x86,
COMENT = 0x88,
MODEND = 0x8A,
EXTDEF = 0x8C,
TYPDEF = 0x8E,
PUBDEF = 0x90,
PUB386 = 0x91,
LOCSYM = 0x92,
LINNUM = 0x94,
LNAMES = 0x96,
SEGDEF = 0x98,
SEG386 = 0x99,
GRPDEF = 0x9A,
FIXUPP = 0x9C,
FIX386 = 0x9D,
LEDATA = 0xA0,
LED386 = 0xA1,
LIDATA = 0xA2,
LID386 = 0xA3,
LIBHED = 0xA4,
LIBNAM = 0xA6,
LIBLOC = 0xA8,
LIBDIC = 0xAA,
COMDEF = 0xB0,
LEXTDEF = 0xB4,
LPUBDEF = 0xB6,
LCOMDEF = 0xB8,
CEXTDEF = 0xBC,
COMDAT = 0xC2,
LINSYM = 0xC4,
ALIAS = 0xC6,
LLNAMES = 0xCA,
}
// Some definitions for .OBJ files. Trial and error to determine which
// one to use when. Page #s refer to Intel spec on .OBJ files.
// Values for LOCAT byte: (pg. 71)
enum
{
LOCATselfrel = 0x8000,
LOCATsegrel = 0xC000,
// OR'd with one of the following:
LOClobyte = 0x0000,
LOCbase = 0x0800,
LOChibyte = 0x1000,
LOCloader_resolved = 0x1400,
// Unfortunately, the fixup stuff is different for EASY OMF and Microsoft
EASY_LOCoffset = 0x1400, // 32 bit offset
EASY_LOCpointer = 0x1800, // 48 bit seg/offset
LOC32offset = 0x2400,
LOC32tlsoffset = 0x2800,
LOC32pointer = 0x2C00,
LOC16offset = 0x0400,
LOC16pointer = 0x0C00,
LOCxx = 0x3C00
}
// FDxxxx are constants for the FIXDAT byte in fixup records (pg. 72)
enum
{
FD_F0 = 0x00, // segment index
FD_F1 = 0x10, // group index
FD_F2 = 0x20, // external index
FD_F4 = 0x40, // canonic frame of LSEG that contains Location
FD_F5 = 0x50, // Target determines the frame
FD_T0 = 0, // segment index
FD_T1 = 1, // group index
FD_T2 = 2, // external index
FD_T4 = 4, // segment index, 0 displacement
FD_T5 = 5, // group index, 0 displacement
FD_T6 = 6, // external index, 0 displacement
}
/***************
* Fixup list.
*/
struct FIXUP
{
FIXUP *FUnext;
targ_size_t FUoffset; // offset from start of ledata
ushort FUlcfd; // LCxxxx | FDxxxx
ushort FUframedatum;
ushort FUtargetdatum;
}
FIXUP* list_fixup(list_t fl) { return cast(FIXUP *)list_ptr(fl); }
int seg_is_comdat(int seg) { return seg < 0; }
/*****************************
* Ledata records
*/
enum LEDATAMAX = 1024-14;
struct Ledatarec
{
ubyte[14] header; // big enough to handle COMDAT header
ubyte[LEDATAMAX] data;
int lseg; // segment value
uint i; // number of bytes in data
targ_size_t offset; // segment offset of start of data
FIXUP *fixuplist; // fixups for this ledata
// For COMDATs
ubyte flags; // flags byte of COMDAT
ubyte alloctyp; // allocation type of COMDAT
ubyte _align; // align type
int typidx;
int pubbase;
int pubnamidx;
}
/*****************************
* For defining segments.
*/
uint SEG_ATTR(uint A, uint C, uint B, uint P)
{
return (A << 5) | (C << 2) | (B << 1) | P;
}
enum
{
// Segment alignment A
SEG_ALIGN0 = 0, // absolute segment
SEG_ALIGN1 = 1, // byte align
SEG_ALIGN2 = 2, // word align
SEG_ALIGN16 = 3, // paragraph align
SEG_ALIGN4K = 4, // 4Kb page align
SEG_ALIGN4 = 5, // dword align
// Segment combine types C
SEG_C_ABS = 0,
SEG_C_PUBLIC = 2,
SEG_C_STACK = 5,
SEG_C_COMMON = 6,
// Segment type P
USE16 = 0,
USE32 = 1,
USE32_CODE = (4+2), // use32 + execute/read
USE32_DATA = (4+3), // use32 + read/write
}
/*****************************
* Line number support.
*/
struct Linnum
{
version (MARS)
const(char)* filename; // source file name
else
Sfile *filptr; // file pointer
int cseg; // our internal segment number
int seg; // segment/public index
Outbuffer data; // linnum/offset data
void reset() nothrow
{
data.reset();
}
}
/*****************************
*/
struct PtrRef
{
align(4):
Symbol* sym;
uint offset;
}
enum LINRECMAX = 2 + 255 * 2; // room for 255 line numbers
/************************************
* State of object file.
*/
struct Objstate
{
const(char)* modname;
char *csegname;
Outbuffer *buf; // output buffer
int fdsegattr; // far data segment attribute
int csegattr; // code segment attribute
int lastfardatasegi; // SegData[] index of last far data seg
int LOCoffset;
int LOCpointer;
int mlidata;
int mpubdef;
int mfixupp;
int mmodend;
int lnameidx; // index of next LNAMES record
int segidx; // index of next SEGDEF record
int extidx; // index of next EXTDEF record
int pubnamidx; // index of COMDAT public name index
Symbol *startaddress; // if !null, then Symbol is start address
debug
int fixup_count;
// Line numbers
char *linrec; // line number record
uint linreci; // index of next avail in linrec[]
uint linrecheader; // size of line record header
uint linrecnum; // number of line record entries
int mlinnum;
int recseg;
int term;
static if (MULTISCOPE)
{
vec_t linvec; // bit vector of line numbers used
vec_t offvec; // and offsets used
}
int fisegi; // SegData[] index of FI segment
version (MARS)
{
int fmsegi; // SegData[] of FM segment
int datrefsegi; // SegData[] of DATA pointer ref segment
int tlsrefsegi; // SegData[] of TLS pointer ref segment
}
int tlssegi; // SegData[] of tls segment
int fardataidx;
char[1024] pubdata;
int pubdatai;
char[1024] extdata;
int extdatai;
// For OmfObj_far16thunk
int code16segi; // SegData[] index
targ_size_t CODE16offset;
int fltused;
int nullext;
// The rest don't get re-zeroed for each object file, they get reset
Rarray!(Ledatarec*) ledatas;
Barray!(Symbol*) resetSymbols; // reset symbols
Rarray!(Linnum) linnum_list;
Barray!(char*) linreclist; // array of line records
version (MARS)
{
Barray!PtrRef ptrrefs; // buffer for pointer references
}
}
__gshared
{
Rarray!(seg_data*) SegData;
Objstate obj;
}
/*******************************
* Output an object file data record.
* Input:
* rectyp = record type
* record . the data
* reclen = # of bytes in record
*/
void objrecord(uint rectyp, const(char)* record, uint reclen)
{
Outbuffer *o = obj.buf;
//printf("rectyp = x%x, record[0] = x%x, reclen = x%x\n",rectyp,record[0],reclen);
o.reserve(reclen + 4);
o.writeByten(cast(ubyte)rectyp);
o.write16n(reclen + 1); // record length includes checksum
o.writen(record,reclen);
o.writeByten(0); // use 0 for checksum
}
/**************************
* Insert an index number.
* Input:
* p . where to put the 1 or 2 byte index
* index = the 15 bit index
* Returns:
* # of bytes stored
*/
void error(const(char)* filename, uint linnum, uint charnum, const(char)* format, ...);
void fatal();
void too_many_symbols()
{
version (SCPP)
err_fatal(EM_too_many_symbols, 0x7FFF);
else // MARS
{
error(null, 0, 0, "more than %d symbols in object file", 0x7FFF);
fatal();
}
}
version (X86) version (DigitalMars)
version = X86ASM;
version (X86ASM)
{
int insidx(char *p,uint index)
{
asm nothrow
{
naked ;
mov EAX,[ESP+8] ; // index
mov ECX,[ESP+4] ; // p
cmp EAX,0x7F ;
jae L1 ;
mov [ECX],AL ;
mov EAX,1 ;
ret ;
L1: ;
cmp EAX,0x7FFF ;
ja L2 ;
mov [ECX+1],AL ;
or EAX,0x8000 ;
mov [ECX],AH ;
mov EAX,2 ;
ret ;
}
L2:
too_many_symbols();
}
}
else
{
int insidx(char *p,uint index)
{
//if (index > 0x7FFF) printf("index = x%x\n",index);
/* OFM spec says it could be <=0x7F, but that seems to cause
* "library is corrupted" messages. Unverified. See Bugzilla 3601
*/
if (index < 0x7F)
{
*p = cast(char)index;
return 1;
}
else if (index <= 0x7FFF)
{
*(p + 1) = cast(char)index;
*p = cast(char)((index >> 8) | 0x80);
return 2;
}
else
{
too_many_symbols();
return 0;
}
}
}
/**************************
* Insert a type index number.
* Input:
* p . where to put the 1 or 2 byte index
* index = the 15 bit index
* Returns:
* # of bytes stored
*/
int instypidx(char *p,uint index)
{
if (index <= 127)
{ *p = cast(char)index;
return 1;
}
else if (index <= 0x7FFF)
{ *(p + 1) = cast(char)index;
*p = cast(char)((index >> 8) | 0x80);
return 2;
}
else // overflow
{ *p = 0; // the linker ignores this field anyway
return 1;
}
}
/****************************
* Read index.
*/
int getindex(ubyte* p)
{
return ((*p & 0x80)
? ((*p & 0x7F) << 8) | *(p + 1)
: *p);
}
enum ONS_OHD = 4; // max # of extra bytes added by obj_namestring()
/******************************
* Allocate a new segment.
* Return index for the new segment.
*/
seg_data *getsegment()
{
const int seg = cast(int)SegData.length;
seg_data** ppseg = SegData.push();
seg_data* pseg = *ppseg;
if (!pseg)
{
pseg = cast(seg_data *)mem_calloc(seg_data.sizeof);
//printf("test2: SegData[%d] = %p\n", seg, SegData[seg]);
SegData[seg] = pseg;
}
else
memset(pseg, 0, seg_data.sizeof);
pseg.SDseg = seg;
pseg.segidx = 0;
return pseg;
}
/**************************
* Output read only data and generate a symbol for it.
*
*/
Symbol * OmfObj_sym_cdata(tym_t ty,char *p,int len)
{
Symbol *s;
alignOffset(CDATA, tysize(ty));
s = symboldata(Offset(CDATA), ty);
s.Sseg = CDATA;
OmfObj_bytes(CDATA, Offset(CDATA), len, p);
Offset(CDATA) += len;
s.Sfl = FLdata; //FLextern;
return s;
}
/**************************
* Ouput read only data for data.
* Output:
* *pseg segment of that data
* Returns:
* offset of that data
*/
int OmfObj_data_readonly(char *p, int len, int *pseg)
{
version (MARS)
{
targ_size_t oldoff = Offset(CDATA);
OmfObj_bytes(CDATA,Offset(CDATA),len,p);
Offset(CDATA) += len;
*pseg = CDATA;
}
else
{
targ_size_t oldoff = Offset(DATA);
OmfObj_bytes(DATA,Offset(DATA),len,p);
Offset(DATA) += len;
*pseg = DATA;
}
return cast(int)oldoff;
}
int OmfObj_data_readonly(char *p, int len)
{
int pseg;
return OmfObj_data_readonly(p, len, &pseg);
}
/*****************************
* Get segment for readonly string literals.
* The linker will pool strings in this section.
* Params:
* sz = number of bytes per character (1, 2, or 4)
* Returns:
* segment index
*/
int OmfObj_string_literal_segment(uint sz)
{
assert(0);
}
segidx_t OmfObj_seg_debugT()
{
return DEBTYP;
}
/******************************
* Perform initialization that applies to all .obj output files.
* Input:
* filename source file name
* csegname code segment name (can be null)
*/
Obj OmfObj_init(Outbuffer *objbuf, const(char)* filename, const(char)* csegname)
{
//printf("OmfObj_init()\n");
Obj mobj = cast(Obj)mem_calloc(__traits(classInstanceSize, Obj));
// Zero obj up to ledatas
memset(&obj,0,obj.ledatas.offsetof);
obj.ledatas.reset(); // recycle the memory used by ledatas
foreach (s; obj.resetSymbols)
symbol_reset(s);
obj.resetSymbols.reset();
obj.buf = objbuf;
obj.buf.reserve(40_000);
obj.lastfardatasegi = -1;
obj.mlidata = LIDATA;
obj.mpubdef = PUBDEF;
obj.mfixupp = FIXUPP;
obj.mmodend = MODEND;
obj.mlinnum = LINNUM;
// Reset for different OBJ file formats
if (I32)
{ if (config.flags & CFGeasyomf)
{ obj.LOCoffset = EASY_LOCoffset;
obj.LOCpointer = EASY_LOCpointer;
}
else
{
obj.mlidata = LID386;
obj.mpubdef = PUB386;
obj.mfixupp = FIX386;
obj.mmodend = MODEND + 1;
obj.LOCoffset = LOC32offset;
obj.LOCpointer = LOC32pointer;
}
obj.fdsegattr = SEG_ATTR(SEG_ALIGN16,SEG_C_PUBLIC,0,USE32);
obj.csegattr = SEG_ATTR(SEG_ALIGN4, SEG_C_PUBLIC,0,USE32);
}
else
{
obj.LOCoffset = LOC16offset;
obj.LOCpointer = LOC16pointer;
obj.fdsegattr = SEG_ATTR(SEG_ALIGN16,SEG_C_PUBLIC,0,USE16);
obj.csegattr = SEG_ATTR(SEG_ALIGN2, SEG_C_PUBLIC,0,USE16);
}
if (config.flags4 & CFG4speed && // if optimized for speed
config.target_cpu == TARGET_80486)
// 486 is only CPU that really benefits from alignment
obj.csegattr = I32 ? SEG_ATTR(SEG_ALIGN16, SEG_C_PUBLIC,0,USE32)
: SEG_ATTR(SEG_ALIGN16, SEG_C_PUBLIC,0,USE16);
SegData.reset(); // recycle memory
getsegment(); // element 0 is reserved
getsegment();
getsegment();
getsegment();
getsegment();
SegData[CODE].SDseg = CODE;
SegData[DATA].SDseg = DATA;
SegData[CDATA].SDseg = CDATA;
SegData[UDATA].SDseg = UDATA;
SegData[CODE].segidx = CODE;
SegData[DATA].segidx = DATA;
SegData[CDATA].segidx = CDATA;
SegData[UDATA].segidx = UDATA;
if (config.fulltypes)
{
getsegment();
getsegment();
SegData[DEBSYM].SDseg = DEBSYM;
SegData[DEBTYP].SDseg = DEBTYP;
SegData[DEBSYM].segidx = DEBSYM;
SegData[DEBTYP].segidx = DEBTYP;
}
OmfObj_theadr(filename);
obj.modname = filename;
if (!csegname || !*csegname) // if no code seg name supplied
obj.csegname = objmodtoseg(obj.modname); // generate one
else
obj.csegname = mem_strdup(csegname); // our own copy
objheader(obj.csegname);
OmfObj_segment_group(0,0,0,0); // obj seg and grp info
ledata_new(cseg,0); // so ledata is never null
if (config.fulltypes) // if full typing information
{ objmod = mobj;
cv_init(); // initialize debug output code
}
return mobj;
}
/**************************
* Initialize the start of object output for this particular .obj file.
*/
void OmfObj_initfile(const(char)* filename,const(char)* csegname, const(char)* modname)
{
}
/***************************
* Fixup and terminate object file.
*/
void OmfObj_termfile()
{
}
/*********************************
* Terminate package.
*/
void OmfObj_term(const(char)* objfilename)
{
//printf("OmfObj_term()\n");
list_t dl;
uint size;
version (SCPP)
{
if (!errcnt)
{
obj_defaultlib();
objflush_pointerRefs();
outfixlist(); // backpatches
}
}
else
{
obj_defaultlib();
objflush_pointerRefs();
outfixlist(); // backpatches
}
if (config.fulltypes)
cv_term(); // write out final debug info
outextdata(); // finish writing EXTDEFs
outpubdata(); // finish writing PUBDEFs
// Put out LEDATA records and associated fixups
for (size_t i = 0; i < obj.ledatas.length; i++)
{ Ledatarec *d = obj.ledatas[i];
if (d.i) // if any data in this record
{ // Fill in header
int headersize;
int rectyp;
assert(d.lseg > 0 && d.lseg < SegData.length);
int lseg = SegData[d.lseg].segidx;
char[(d.header).sizeof] header = void;
if (seg_is_comdat(lseg)) // if COMDAT
{
header[0] = d.flags | (d.offset ? 1 : 0); // continuation flag
header[1] = d.alloctyp;
header[2] = d._align;
TOOFFSET(header.ptr + 3,d.offset);
headersize = 3 + _tysize[TYint];
headersize += instypidx(header.ptr + headersize,d.typidx);
if ((header[1] & 0x0F) == 0)
{ // Group index
header[headersize] = (d.pubbase == DATA) ? 1 : 0;
headersize++;
// Segment index
headersize += insidx(header.ptr + headersize,d.pubbase);
}
headersize += insidx(header.ptr + headersize,d.pubnamidx);
rectyp = I32 ? COMDAT + 1 : COMDAT;
}
else
{
rectyp = LEDATA;
headersize = insidx(header.ptr,lseg);
if (_tysize[TYint] == LONGSIZE || d.offset & ~0xFFFFL)
{ if (!(config.flags & CFGeasyomf))
rectyp++;
TOLONG(header.ptr + headersize,cast(uint)d.offset);
headersize += 4;
}
else
{
TOWORD(header.ptr + headersize,cast(uint)d.offset);
headersize += 2;
}
}
assert(headersize <= (d.header).sizeof);
// Right-justify data in d.header[]
memcpy(d.header.ptr + (d.header).sizeof - headersize,header.ptr,headersize);
//printf("objrecord(rectyp=x%02x, d=%p, p=%p, size = %d)\n",
//rectyp,d,d.header.ptr + ((d.header).sizeof - headersize),d.i + headersize);
objrecord(rectyp,cast(char*)d.header.ptr + ((d.header).sizeof - headersize),
d.i + headersize);
objfixupp(d.fixuplist);
}
}
static if (TERMCODE)
{
//list_free(&obj.ledata_list,mem_freefp);
}
linnum_term();
obj_modend();
size = cast(uint)obj.buf.length();
obj.buf.reset(); // rewind file
OmfObj_theadr(obj.modname);
objheader(obj.csegname);
mem_free(obj.csegname);
OmfObj_segment_group(SegData[CODE].SDoffset, SegData[DATA].SDoffset, SegData[CDATA].SDoffset, SegData[UDATA].SDoffset); // do real sizes
// Update any out-of-date far segment sizes
for (size_t i = 0; i < SegData.length; i++)
{
seg_data* f = SegData[i];
if (f.isfarseg && f.origsize != f.SDoffset)
{ obj.buf.setsize(cast(int)f.seek);
objsegdef(f.attr,f.SDoffset,f.lnameidx,f.classidx);
}
}
//mem_free(obj.farseg);
//printf("Ledata max = %d\n", obj.ledatas.length);
//printf("Max # of fixups = %d\n",obj.fixup_count);
obj.buf.setsize(size);
}
/*****************************
* Line number support.
*/
/***************************
* Record line number linnum at offset.
* Params:
* srcpos = source file position
* seg = segment it corresponds to (negative for COMDAT segments)
* offset = offset within seg
* pubnamidx = public name index
* obj.mlinnum = LINNUM or LINSYM
*/
void OmfObj_linnum(Srcpos srcpos,int seg,targ_size_t offset)
{
version (MARS)
varStats_recordLineOffset(srcpos, offset);
uint linnum = srcpos.Slinnum;
static if (0)
{
printf("OmfObj_linnum(seg=%d, offset=0x%x) ", seg, cast(int)offset);
srcpos.print("");
}
char linos2 = config.exe == EX_OS2 && !seg_is_comdat(SegData[seg].segidx);
version (MARS)
{
bool cond = (!obj.term &&
(seg_is_comdat(SegData[seg].segidx) || (srcpos.Sfilename && srcpos.Sfilename != obj.modname)));
}
else
{
if (!srcpos.Sfilptr)
return;
sfile_debug(*srcpos.Sfilptr);
bool cond = !obj.term &&
(!(srcpos_sfile(srcpos).SFflags & SFtop) || (seg_is_comdat(SegData[seg].segidx) && !obj.term));
}
if (cond)
{
// Not original source file, or a COMDAT.
// Save data away and deal with it at close of compile.
// It is done this way because presumably 99% of the lines
// will be in the original source file, so we wish to minimize
// memory consumption and maximize speed.
if (linos2)
return; // BUG: not supported under OS/2
Linnum* ln;
foreach (ref rln; obj.linnum_list)
{
version (MARS)
bool cond2 = rln.filename == srcpos.Sfilename;
else version (SCPP)
bool cond2 = rln.filptr == *srcpos.Sfilptr;
if (cond2 &&
rln.cseg == seg)
{
ln = &rln; // found existing entry with room
goto L1;
}
}
// Create new entry
ln = obj.linnum_list.push();
version (MARS)
ln.filename = srcpos.Sfilename;
else
ln.filptr = *srcpos.Sfilptr;
ln.cseg = seg;
ln.seg = obj.pubnamidx;
ln.reset();
L1:
//printf("offset = x%x, line = %d\n", (int)offset, linnum);
ln.data.write16(linnum);
if (_tysize[TYint] == 2)
ln.data.write16(cast(int)offset);
else
ln.data.write32(cast(int)offset);
}
else
{
if (linos2 && obj.linreci > LINRECMAX - 8)
obj.linrec = null; // allocate a new one
else if (seg != obj.recseg)
linnum_flush();
if (!obj.linrec) // if not allocated
{
obj.linrec = cast(char* ) mem_calloc(LINRECMAX);
obj.linrec[0] = 0; // base group / flags
obj.linrecheader = 1 + insidx(obj.linrec + 1,seg_is_comdat(SegData[seg].segidx) ? obj.pubnamidx : SegData[seg].segidx);
obj.linreci = obj.linrecheader;
obj.recseg = seg;
static if (MULTISCOPE)
{
if (!obj.linvec)
{
obj.linvec = vec_calloc(1000);
obj.offvec = vec_calloc(1000);
}
}
if (linos2)
{
if (obj.linreclist.length == 0) // if first line number record
obj.linreci += 8; // leave room for header
obj.linreclist.push(obj.linrec);
}
// Select record type to use
obj.mlinnum = seg_is_comdat(SegData[seg].segidx) ? LINSYM : LINNUM;
if (I32 && !(config.flags & CFGeasyomf))
obj.mlinnum++;
}
else if (obj.linreci > LINRECMAX - (2 + _tysize[TYint]))
{
objrecord(obj.mlinnum,obj.linrec,obj.linreci); // output data
obj.linreci = obj.linrecheader;
if (seg_is_comdat(SegData[seg].segidx)) // if LINSYM record
obj.linrec[0] |= 1; // continuation bit
}
static if (MULTISCOPE)
{
if (linnum >= vec_numbits(obj.linvec))
obj.linvec = vec_realloc(obj.linvec,linnum + 1000);
if (offset >= vec_numbits(obj.offvec))
{
if (offset < 0xFF00) // otherwise we overflow ph_malloc()
obj.offvec = vec_realloc(obj.offvec,cast(uint)offset * 2);
}
bool cond3 =
// disallow multiple offsets per line
!vec_testbit(linnum,obj.linvec) && // if linnum not already used
// disallow multiple lines per offset
(offset >= 0xFF00 || !vec_testbit(cast(uint)offset,obj.offvec)); // and offset not already used
}
else
enum cond3 = true;
if (cond3)
{
static if (MULTISCOPE)
{
vec_setbit(linnum,obj.linvec); // mark linnum as used
if (offset < 0xFF00)
vec_setbit(cast(uint)offset,obj.offvec); // mark offset as used
}
TOWORD(obj.linrec + obj.linreci,linnum);
if (linos2)
{
obj.linrec[obj.linreci + 2] = 1; // source file index
TOLONG(obj.linrec + obj.linreci + 4,cast(uint)offset);
obj.linrecnum++;
obj.linreci += 8;
}
else
{
TOOFFSET(obj.linrec + obj.linreci + 2,offset);
obj.linreci += 2 + _tysize[TYint];
}
}
}
}
/***************************
* Flush any pending line number records.
*/
private void linnum_flush()
{
if (obj.linreclist.length)
{
obj.linrec = obj.linreclist[0];
TOWORD(obj.linrec + 6,obj.linrecnum);
foreach (i; 0 .. obj.linreclist.length - 1)
{
obj.linrec = obj.linreclist[i];
objrecord(obj.mlinnum, obj.linrec, LINRECMAX);
mem_free(obj.linrec);
}
obj.linrec = obj.linreclist[obj.linreclist.length - 1];
objrecord(obj.mlinnum,obj.linrec,obj.linreci);
obj.linreclist.reset();
// Put out File Names Table
TOLONG(obj.linrec + 2,0); // record no. of start of source (???)
TOLONG(obj.linrec + 6,obj.linrecnum); // number of primary source records
TOLONG(obj.linrec + 10,1); // number of source and listing files
const len = obj_namestring(obj.linrec + 14,obj.modname);
assert(14 + len <= LINRECMAX);
objrecord(obj.mlinnum,obj.linrec,cast(uint)(14 + len));
mem_free(obj.linrec);
obj.linrec = null;
}
else if (obj.linrec) // if some line numbers to send
{
objrecord(obj.mlinnum,obj.linrec,obj.linreci);
mem_free(obj.linrec);
obj.linrec = null;
}
static if (MULTISCOPE)
{
vec_clear(obj.linvec);
vec_clear(obj.offvec);
}
}
/*************************************
* Terminate line numbers.
*/
private void linnum_term()
{
version (SCPP)
Sfile *lastfilptr = null;
version (MARS)
const(char)* lastfilename = null;
const csegsave = cseg;
linnum_flush();
obj.term = 1;
foreach (ref ln; obj.linnum_list)
{
version (SCPP)
{
Sfile *filptr = ln.filptr;
if (filptr != lastfilptr)
{
if (lastfilptr == null && strcmp(filptr.SFname,obj.modname))
OmfObj_theadr(filptr.SFname);
lastfilptr = filptr;
}
}
version (MARS)
{
const(char)* filename = ln.filename;
if (filename != lastfilename)
{
if (filename)
objmod.theadr(filename);
lastfilename = filename;
}
}
cseg = ln.cseg;
assert(cseg > 0);
obj.pubnamidx = ln.seg;
Srcpos srcpos;
version (MARS)
srcpos.Sfilename = ln.filename;
else
srcpos.Sfilptr = &ln.filptr;
const slice = ln.data[];
const pend = slice.ptr + slice.length;
for (const(ubyte)* p = slice.ptr; p < pend; )
{
srcpos.Slinnum = *cast(ushort *)p;
p += 2;
targ_size_t offset;
if (I32)
{
offset = *cast(uint *)p;
p += 4;
}
else
{
offset = *cast(ushort *)p;
p += 2;
}
OmfObj_linnum(srcpos,cseg,offset);
}
linnum_flush();
}
obj.linnum_list.reset();
cseg = csegsave;
assert(cseg > 0);
static if (MULTISCOPE)
{
vec_free(obj.linvec);
vec_free(obj.offvec);
}
}
/*******************************
* Set start address
*/
void OmfObj_startaddress(Symbol *s)
{
obj.startaddress = s;
}
/*******************************
* Output DOSSEG coment record.
*/
void OmfObj_dosseg()
{
static immutable char[2] dosseg = [ 0x80,0x9E ];
objrecord(COMENT, dosseg.ptr, dosseg.sizeof);
}
/*******************************
* Embed comment record.
*/
private void obj_comment(ubyte x, const(char)* string, size_t len)
{
char[128] buf = void;
char *library = (2 + len <= buf.sizeof) ? buf.ptr : cast(char *) malloc(2 + len);
assert(library);
library[0] = 0;
library[1] = x;
memcpy(library + 2,string,len);
objrecord(COMENT,library,cast(uint)(len + 2));
if (library != buf.ptr)
free(library);
}
/*******************************
* Output library name.
* Output:
* name is modified
* Returns:
* true if operation is supported
*/
bool OmfObj_includelib(const(char)* name)
{
const(char)* p;
size_t len = strlen(name);
p = filespecdotext(name);
if (!filespeccmp(p,".lib"))
len -= strlen(p); // lop off .LIB extension
obj_comment(0x9F, name, len);
return true;
}
/*******************************
* Output linker directive.
* Output:
* directive is modified
* Returns:
* true if operation is supported
*/
bool OmfObj_linkerdirective(const(char)* name)
{
return false;
}
/**********************************
* Do we allow zero sized objects?
*/
bool OmfObj_allowZeroSize()
{
return false;
}
/**************************
* Embed string in executable.
*/
void OmfObj_exestr(const(char)* p)
{
obj_comment(0xA4,p, strlen(p));
}
/**************************
* Embed string in obj.
*/
void OmfObj_user(const(char)* p)
{
obj_comment(0xDF,p, strlen(p));
}
/*********************************
* Put out default library name.
*/
private void obj_defaultlib()
{
char[4] library; // default library
static immutable char[5+1] model = "SMCLV";
version (MARS)
memcpy(library.ptr,"SM?".ptr,4);
else
memcpy(library.ptr,"SD?".ptr,4);
switch (config.exe)
{
case EX_OS2:
library[2] = 'F';
goto case;
case EX_OS1:
library[1] = 'O';
break;
case EX_WIN32:
version (MARS)
library[1] = 'M';
else
library[1] = 'N';
library[2] = (config.flags4 & CFG4dllrtl) ? 'D' : 'N';
break;
case EX_DOSX:
case EX_PHARLAP:
library[2] = 'X';
break;
default:
library[2] = model[config.memmodel];
if (config.wflags & WFwindows)
library[1] = 'W';
break;
}
if (!(config.flags2 & CFG2nodeflib))
{
objmod.includelib(configv.deflibname ? configv.deflibname : library.ptr);
}
}
/*******************************
* Output a weak extern record.
* s1 is the weak extern, s2 is its default resolution.
*/
void OmfObj_wkext(Symbol *s1,Symbol *s2)
{
//printf("OmfObj_wkext(%s)\n", s1.Sident.ptr);
if (I32)
{
// Optlink crashes with weak symbols at EIP 41AFE7, 402000
return;
}
int x2;
if (s2)
x2 = s2.Sxtrnnum;
else
{
if (!obj.nullext)
{
obj.nullext = OmfObj_external_def("__nullext");
}
x2 = obj.nullext;
}
outextdata();
char[2+2+2] buffer = void;
buffer[0] = 0x80;
buffer[1] = 0xA8;
int i = 2;
i += insidx(&buffer[2],s1.Sxtrnnum);
i += insidx(&buffer[i],x2);
objrecord(COMENT,buffer.ptr,i);
}
/*******************************
* Output a lazy extern record.
* s1 is the lazy extern, s2 is its default resolution.
*/
void OmfObj_lzext(Symbol *s1,Symbol *s2)
{
char[2+2+2] buffer = void;
int i;
outextdata();
buffer[0] = 0x80;
buffer[1] = 0xA9;
i = 2;
i += insidx(&buffer[2],s1.Sxtrnnum);
i += insidx(&buffer[i],s2.Sxtrnnum);
objrecord(COMENT,buffer.ptr,i);
}
/*******************************
* Output an alias definition record.
*/
void OmfObj_alias(const(char)* n1,const(char)* n2)
{
uint len;
char* buffer;
buffer = cast(char *) alloca(strlen(n1) + strlen(n2) + 2 * ONS_OHD);
len = obj_namestring(buffer,n1);
len += obj_namestring(buffer + len,n2);
objrecord(ALIAS,buffer,len);
}
/*******************************
* Output module name record.
*/
void OmfObj_theadr(const(char)* modname)
{
//printf("OmfObj_theadr(%s)\n", modname);
// Convert to absolute file name, so debugger can find it anywhere
char[260] absname = void;
if (config.fulltypes &&
modname[0] != '\\' && modname[0] != '/' && !(modname[0] && modname[1] == ':'))
{
if (getcwd(absname.ptr, absname.sizeof))
{
int len = cast(int)strlen(absname.ptr);
if(absname[len - 1] != '\\' && absname[len - 1] != '/')
absname[len++] = '\\';
strcpy(absname.ptr + len, modname);
modname = absname.ptr;
}
}
char *theadr = cast(char *)alloca(ONS_OHD + strlen(modname));
int i = obj_namestring(theadr,modname);
objrecord(THEADR,theadr,i); // module name record
}
/*******************************
* Embed compiler version in .obj file.
*/
void OmfObj_compiler()
{
const(char)* compiler = "\0\xDB" ~ "Digital Mars C/C++"
~ VERSION
; // compiled by ...
objrecord(COMENT,compiler,cast(uint)strlen(compiler));
}
/*******************************
* Output header stuff for object files.
* Input:
* csegname Name to use for code segment (null if use default)
*/
enum CODECLASS = 4; // code class lname index
enum DATACLASS = 6; // data class lname index
enum CDATACLASS = 7; // CONST class lname index
enum BSSCLASS = 9; // BSS class lname index
private void objheader(char *csegname)
{
char *nam;
__gshared char[78] lnames =
"\0\06DGROUP\05_TEXT\04CODE\05_DATA\04DATA\05CONST\04_BSS\03BSS" ~
"\07$$TYPES\06DEBTYP\011$$SYMBOLS\06DEBSYM";
assert(lnames[lnames.length - 2] == 'M');
// Include debug segment names if inserting type information
int lnamesize = config.fulltypes ? lnames.sizeof - 1 : lnames.sizeof - 1 - 32;
int texti = 8; // index of _TEXT
__gshared char[5] comment = [0,0x9D,'0','?','O']; // memory model
__gshared char[5+1] model = "smclv";
__gshared char[5] exten = [0,0xA1,1,'C','V']; // extended format
__gshared char[7] pmdeb = [0x80,0xA1,1,'H','L','L',0]; // IBM PM debug format
if (I32)
{
if (config.flags & CFGeasyomf)
{
// Indicate we're in EASY OMF (hah!) format
static immutable char[7] easy_omf = [ 0x80,0xAA,'8','0','3','8','6' ];
objrecord(COMENT,easy_omf.ptr,easy_omf.sizeof);
}
}
// Send out a comment record showing what memory model was used
comment[2] = cast(char)(config.target_cpu + '0');
comment[3] = model[config.memmodel];
if (I32)
{
if (config.exe == EX_WIN32)
comment[3] = 'n';
else if (config.exe == EX_OS2)
comment[3] = 'f';
else
comment[3] = 'x';
}
objrecord(COMENT,comment.ptr,comment.sizeof);
// Send out comment indicating we're using extensions to .OBJ format
if (config.exe == EX_OS2)
objrecord(COMENT, pmdeb.ptr, pmdeb.sizeof);
else
objrecord(COMENT, exten.ptr, exten.sizeof);
// Change DGROUP to FLAT if we are doing flat memory model
// (Watch out, objheader() is called twice!)
if (config.exe & EX_flat)
{
if (lnames[2] != 'F') // do not do this twice
{
memcpy(lnames.ptr + 1, "\04FLAT".ptr, 5);
memmove(lnames.ptr + 6, lnames.ptr + 8, lnames.sizeof - 8);
}
lnamesize -= 2;
texti -= 2;
}
// Put out segment and group names
if (csegname)
{
// Replace the module name _TEXT with the new code segment name
const size_t i = strlen(csegname);
char *p = cast(char *)alloca(lnamesize + i - 5);
memcpy(p,lnames.ptr,8);
p[texti] = cast(char)i;
texti++;
memcpy(p + texti,csegname,i);
memcpy(p + texti + i,lnames.ptr + texti + 5,lnamesize - (texti + 5));
objrecord(LNAMES,p,cast(uint)(lnamesize + i - 5));
}
else
objrecord(LNAMES,lnames.ptr,lnamesize);
}
/********************************
* Convert module name to code segment name.
* Output:
* mem_malloc'd code seg name
*/
private char* objmodtoseg(const(char)* modname)
{
char* csegname = null;
if (LARGECODE) // if need to add in module name
{
int i;
char* m;
static immutable char[6] suffix = "_TEXT";
// Prepend the module name to the beginning of the _TEXT
m = filespecgetroot(filespecname(modname));
strupr(m);
i = cast(int)strlen(m);
csegname = cast(char *)mem_malloc(i + suffix.sizeof);
strcpy(csegname,m);
strcat(csegname,suffix.ptr);
mem_free(m);
}
return csegname;
}
/*********************************
* Put out a segment definition.
*/
private void objsegdef(int attr,targ_size_t size,int segnamidx,int classnamidx)
{
uint reclen;
char[1+4+2+2+2+1] sd = void;
//printf("objsegdef(attr=x%x, size=x%x, segnamidx=x%x, classnamidx=x%x)\n",
//attr,size,segnamidx,classnamidx);
sd[0] = cast(char)attr;
if (attr & 1 || config.flags & CFGeasyomf)
{
TOLONG(sd.ptr + 1, cast(uint)size); // store segment size
reclen = 5;
}
else
{
debug
assert(size <= 0xFFFF);
TOWORD(sd.ptr + 1,cast(uint)size);
reclen = 3;
}
reclen += insidx(sd.ptr + reclen,segnamidx); // segment name index
reclen += insidx(sd.ptr + reclen,classnamidx); // class name index
sd[reclen] = 1; // overlay name index
reclen++;
if (attr & 1) // if USE32
{
if (config.flags & CFGeasyomf)
{
// Translate to Pharlap format
sd[0] &= ~1; // turn off P bit
// Translate A: 4.6
attr &= SEG_ATTR(7,0,0,0);
if (attr == SEG_ATTR(4,0,0,0))
sd[0] ^= SEG_ATTR(4 ^ 6,0,0,0);
// 2 is execute/read
// 3 is read/write
// 4 is use32
sd[reclen] = (classnamidx == 4) ? (4+2) : (4+3);
reclen++;
}
}
else // 16 bit segment
{
version (MARS)
assert(0);
else
{
if (size & ~0xFFFFL)
{
if (size == 0x10000) // if exactly 64Kb
sd[0] |= 2; // set "B" bit
else
synerr(EM_seg_gt_64k,size); // segment exceeds 64Kb
}
//printf("attr = %x\n", attr);
}
}
debug
assert(reclen <= sd.sizeof);
objrecord(SEGDEF + (sd[0] & 1),sd.ptr,reclen);
}
/*********************************
* Output segment and group definitions.
* Input:
* codesize size of code segment
* datasize size of initialized data segment
* cdatasize size of initialized const data segment
* udatasize size of uninitialized data segment
*/
void OmfObj_segment_group(targ_size_t codesize,targ_size_t datasize,
targ_size_t cdatasize,targ_size_t udatasize)
{
int dsegattr;
int dsymattr;
// Group into DGROUP the segments CONST, _BSS and _DATA
// For FLAT model, it's just GROUP FLAT
static immutable char[7] grpdef = [2,0xFF,2,0xFF,3,0xFF,4];
objsegdef(obj.csegattr,codesize,3,CODECLASS); // seg _TEXT, class CODE
version (MARS)
{
dsegattr = SEG_ATTR(SEG_ALIGN16,SEG_C_PUBLIC,0,USE32);
objsegdef(dsegattr,datasize,5,DATACLASS); // [DATA] seg _DATA, class DATA
objsegdef(dsegattr,cdatasize,7,CDATACLASS); // [CDATA] seg CONST, class CONST
objsegdef(dsegattr,udatasize,8,BSSCLASS); // [UDATA] seg _BSS, class BSS
}
else
{
dsegattr = I32
? SEG_ATTR(SEG_ALIGN4,SEG_C_PUBLIC,0,USE32)
: SEG_ATTR(SEG_ALIGN2,SEG_C_PUBLIC,0,USE16);
objsegdef(dsegattr,datasize,5,DATACLASS); // seg _DATA, class DATA
objsegdef(dsegattr,cdatasize,7,CDATACLASS); // seg CONST, class CONST
objsegdef(dsegattr,udatasize,8,BSSCLASS); // seg _BSS, class BSS
}
obj.lnameidx = 10; // next lname index
obj.segidx = 5; // next segment index
if (config.fulltypes)
{
dsymattr = I32
? SEG_ATTR(SEG_ALIGN1,SEG_C_ABS,0,USE32)
: SEG_ATTR(SEG_ALIGN1,SEG_C_ABS,0,USE16);
if (config.exe & EX_flat)
{
// IBM's version of CV uses dword aligned segments
dsymattr = SEG_ATTR(SEG_ALIGN4,SEG_C_ABS,0,USE32);
}
else if (config.fulltypes == CV4)
{
// Always use 32 bit segments
dsymattr |= USE32;
assert(!(config.flags & CFGeasyomf));
}
objsegdef(dsymattr,SegData[DEBSYM].SDoffset,0x0C,0x0D);
objsegdef(dsymattr,SegData[DEBTYP].SDoffset,0x0A,0x0B);
obj.lnameidx += 4; // next lname index
obj.segidx += 2; // next segment index
}
objrecord(GRPDEF,grpdef.ptr,(config.exe & EX_flat) ? 1 : grpdef.sizeof);
static if (0)
{
// Define fixup threads, we don't use them
{
static immutable char[12] thread = [ 0,3,1,2,2,1,3,4,0x40,1,0x45,1 ];
objrecord(obj.mfixupp,thread.ptr,thread.sizeof);
}
// This comment appears to indicate that no more PUBDEFs, EXTDEFs,
// or COMDEFs are coming.
{
static immutable char[3] cv = [0,0xA2,1];
objrecord(COMENT,cv.ptr,cv.sizeof);
}
}
}
/**************************************
* Symbol is the function that calls the static constructors.
* Put a pointer to it into a special segment that the startup code
* looks at.
* Input:
* s static constructor function
* dtor number of static destructors
* seg 1: user
* 2: lib
* 3: compiler
*/
void OmfObj_staticctor(Symbol *s,int dtor,int seg)
{
// We need to always put out the segments in triples, so that the
// linker will put them in the correct order.
static immutable char[28] lnamector = "\05XIFCB\04XIFU\04XIFL\04XIFM\05XIFCE";
static immutable char[15] lnamedtor = "\04XOFB\03XOF\04XOFE";
static immutable char[12] lnamedtorf = "\03XOB\02XO\03XOE";
symbol_debug(s);
// Determine if near or far function
assert(I32 || tyfarfunc(s.ty()));
// Put out LNAMES record
objrecord(LNAMES,lnamector.ptr,lnamector.sizeof - 1);
int dsegattr = I32
? SEG_ATTR(SEG_ALIGN4,SEG_C_PUBLIC,0,USE32)
: SEG_ATTR(SEG_ALIGN2,SEG_C_PUBLIC,0,USE16);
for (int i = 0; i < 5; i++)
{
int sz;
sz = (i == seg) ? 4 : 0;
// Put out segment definition record
objsegdef(dsegattr,sz,obj.lnameidx,DATACLASS);
if (i == seg)
{
seg_data *pseg = getsegment();
pseg.segidx = obj.segidx;
OmfObj_reftoident(pseg.SDseg,0,s,0,0); // put out function pointer
}
obj.segidx++;
obj.lnameidx++;
}
if (dtor)
{
// Leave space in XOF segment so that __fatexit() can insert a
// pointer to the static destructor in XOF.
// Put out LNAMES record
if (LARGEDATA)
objrecord(LNAMES,lnamedtorf.ptr,lnamedtorf.sizeof - 1);
else
objrecord(LNAMES,lnamedtor.ptr,lnamedtor.sizeof - 1);
// Put out beginning segment
objsegdef(dsegattr,0,obj.lnameidx,BSSCLASS);
// Put out segment definition record
objsegdef(dsegattr,4 * dtor,obj.lnameidx + 1,BSSCLASS);
// Put out ending segment
objsegdef(dsegattr,0,obj.lnameidx + 2,BSSCLASS);
obj.lnameidx += 3; // for next time
obj.segidx += 3;
}
}
void OmfObj_staticdtor(Symbol *s)
{
assert(0);
}
/***************************************
* Set up function to be called as static constructor on program
* startup or static destructor on program shutdown.
* Params:
* s = function symbol
* isCtor = true if constructor, false if destructor
*/
void OmfObj_setModuleCtorDtor(Symbol *s, bool isCtor)
{
// We need to always put out the segments in triples, so that the
// linker will put them in the correct order.
static immutable char[5+4+5+1][4] lnames =
[ "\03XIB\02XI\03XIE", // near constructor
"\03XCB\02XC\03XCE", // near destructor
"\04XIFB\03XIF\04XIFE", // far constructor
"\04XCFB\03XCF\04XCFE", // far destructor
];
// Size of each of the above strings
static immutable int[4] lnamesize = [ 4+3+4,4+3+4,5+4+5,5+4+5 ];
int dsegattr;
symbol_debug(s);
version (SCPP)
debug assert(memcmp(s.Sident.ptr,"_ST".ptr,3) == 0);
// Determine if constructor or destructor
// _STI... is a constructor, _STD... is a destructor
int i = !isCtor;
// Determine if near or far function
if (tyfarfunc(s.Stype.Tty))
i += 2;
// Put out LNAMES record
objrecord(LNAMES,lnames[i].ptr,lnamesize[i]);
dsegattr = I32
? SEG_ATTR(SEG_ALIGN4,SEG_C_PUBLIC,0,USE32)
: SEG_ATTR(SEG_ALIGN2,SEG_C_PUBLIC,0,USE16);
// Put out beginning segment
objsegdef(dsegattr,0,obj.lnameidx,DATACLASS);
obj.segidx++;
// Put out segment definition record
// size is NPTRSIZE or FPTRSIZE
objsegdef(dsegattr,(i & 2) + tysize(TYnptr),obj.lnameidx + 1,DATACLASS);
seg_data *pseg = getsegment();
pseg.segidx = obj.segidx;
OmfObj_reftoident(pseg.SDseg,0,s,0,0); // put out function pointer
obj.segidx++;
// Put out ending segment
objsegdef(dsegattr,0,obj.lnameidx + 2,DATACLASS);
obj.segidx++;
obj.lnameidx += 3; // for next time
}
/***************************************
* Stuff pointer to function in its own segment.
* Used for static ctor and dtor lists.
*/
void OmfObj_ehtables(Symbol *sfunc,uint size,Symbol *ehsym)
{
// We need to always put out the segments in triples, so that the
// linker will put them in the correct order.
static immutable char[12] lnames =
"\03FIB\02FI\03FIE"; // near constructor
int i;
int dsegattr;
targ_size_t offset;
symbol_debug(sfunc);
if (obj.fisegi == 0)
{
// Put out LNAMES record
objrecord(LNAMES,lnames.ptr,lnames.sizeof - 1);
dsegattr = I32
? SEG_ATTR(SEG_ALIGN4,SEG_C_PUBLIC,0,USE32)
: SEG_ATTR(SEG_ALIGN2,SEG_C_PUBLIC,0,USE16);
// Put out beginning segment
objsegdef(dsegattr,0,obj.lnameidx,DATACLASS);
obj.lnameidx++;
obj.segidx++;
// Put out segment definition record
obj.fisegi = obj_newfarseg(0,DATACLASS);
objsegdef(dsegattr,0,obj.lnameidx,DATACLASS);
SegData[obj.fisegi].attr = dsegattr;
assert(SegData[obj.fisegi].segidx == obj.segidx);
// Put out ending segment
objsegdef(dsegattr,0,obj.lnameidx + 1,DATACLASS);
obj.lnameidx += 2; // for next time
obj.segidx += 2;
}
offset = SegData[obj.fisegi].SDoffset;
offset += OmfObj_reftoident(obj.fisegi,offset,sfunc,0,LARGECODE ? CFoff | CFseg : CFoff); // put out function pointer
offset += OmfObj_reftoident(obj.fisegi,offset,ehsym,0,0); // pointer to data
OmfObj_bytes(obj.fisegi,offset,_tysize[TYint],&size); // size of function
SegData[obj.fisegi].SDoffset = offset + _tysize[TYint];
}
void OmfObj_ehsections()
{
assert(0);
}
/***************************************
* Append pointer to ModuleInfo to "FM" segment.
* The FM segment is bracketed by the empty FMB and FME segments.
*/
version (MARS)
{
void OmfObj_moduleinfo(Symbol *scc)
{
// We need to always put out the segments in triples, so that the
// linker will put them in the correct order.
static immutable char[12] lnames =
"\03FMB\02FM\03FME";
symbol_debug(scc);
if (obj.fmsegi == 0)
{
// Put out LNAMES record
objrecord(LNAMES,lnames.ptr,lnames.sizeof - 1);
int dsegattr = I32
? SEG_ATTR(SEG_ALIGN4,SEG_C_PUBLIC,0,USE32)
: SEG_ATTR(SEG_ALIGN2,SEG_C_PUBLIC,0,USE16);
// Put out beginning segment
objsegdef(dsegattr,0,obj.lnameidx,DATACLASS);
obj.lnameidx++;
obj.segidx++;
// Put out segment definition record
obj.fmsegi = obj_newfarseg(0,DATACLASS);
objsegdef(dsegattr,0,obj.lnameidx,DATACLASS);
SegData[obj.fmsegi].attr = dsegattr;
assert(SegData[obj.fmsegi].segidx == obj.segidx);
// Put out ending segment
objsegdef(dsegattr,0,obj.lnameidx + 1,DATACLASS);
obj.lnameidx += 2; // for next time
obj.segidx += 2;
}
targ_size_t offset = SegData[obj.fmsegi].SDoffset;
offset += OmfObj_reftoident(obj.fmsegi,offset,scc,0,LARGECODE ? CFoff | CFseg : CFoff); // put out function pointer
SegData[obj.fmsegi].SDoffset = offset;
}
}
/*********************************
* Setup for Symbol s to go into a COMDAT segment.
* Output (if s is a function):
* cseg segment index of new current code segment
* Coffset starting offset in cseg
* Returns:
* "segment index" of COMDAT (which will be a negative value to
* distinguish it from regular segments).
*/
int OmfObj_comdatsize(Symbol *s, targ_size_t symsize)
{
return generate_comdat(s, false);
}
int OmfObj_comdat(Symbol *s)
{
return generate_comdat(s, false);
}
int OmfObj_readonly_comdat(Symbol *s)
{
s.Sseg = generate_comdat(s, true);
return s.Sseg;
}
static int generate_comdat(Symbol *s, bool is_readonly_comdat)
{
char[IDMAX+IDOHD+1] lnames = void; // +1 to allow room for strcpy() terminating 0
char[2+2] cextdef = void;
char *p;
size_t lnamesize;
uint ti;
int isfunc;
tym_t ty;
symbol_debug(s);
obj.resetSymbols.push(s);
ty = s.ty();
isfunc = tyfunc(ty) != 0 || is_readonly_comdat;
// Put out LNAME for name of Symbol
lnamesize = OmfObj_mangle(s,lnames.ptr);
objrecord((s.Sclass == SCstatic ? LLNAMES : LNAMES),lnames.ptr,cast(uint)lnamesize);
// Put out CEXTDEF for name of Symbol
outextdata();
p = cextdef.ptr;
p += insidx(p,obj.lnameidx++);
ti = (config.fulltypes == CVOLD) ? cv_typidx(s.Stype) : 0;
p += instypidx(p,ti);
objrecord(CEXTDEF,cextdef.ptr,cast(uint)(p - cextdef.ptr));
s.Sxtrnnum = ++obj.extidx;
seg_data *pseg = getsegment();
pseg.segidx = -obj.extidx;
assert(pseg.SDseg > 0);
// Start new LEDATA record for this COMDAT
Ledatarec *lr = ledata_new(pseg.SDseg,0);
lr.typidx = ti;
lr.pubnamidx = obj.lnameidx - 1;
if (isfunc)
{ lr.pubbase = SegData[cseg].segidx;
if (s.Sclass == SCcomdat || s.Sclass == SCinline)
lr.alloctyp = 0x10 | 0x00; // pick any instance | explicit allocation
if (is_readonly_comdat)
{
assert(lr.lseg > 0 && lr.lseg < SegData.length);
lr.flags |= 0x08; // data in code seg
}
else
{
cseg = lr.lseg;
assert(cseg > 0 && cseg < SegData.length);
obj.pubnamidx = obj.lnameidx - 1;
Offset(cseg) = 0;
if (tyfarfunc(ty) && strcmp(s.Sident.ptr,"main") == 0)
lr.alloctyp |= 1; // because MS does for unknown reasons
}
}
else
{
ubyte atyp;
switch (ty & mTYLINK)
{
case 0:
case mTYnear: lr.pubbase = DATA;
static if (0)
atyp = 0; // only one instance is allowed
else
atyp = 0x10; // pick any (also means it is
// not searched for in a library)
break;
case mTYcs: lr.flags |= 0x08; // data in code seg
atyp = 0x11; break;
case mTYfar: atyp = 0x12; break;
case mTYthread: lr.pubbase = OmfObj_tlsseg().segidx;
atyp = 0x10; // pick any (also means it is
// not searched for in a library)
break;
default: assert(0);
}
lr.alloctyp = atyp;
}
if (s.Sclass == SCstatic)
lr.flags |= 0x04; // local bit (make it an "LCOMDAT")
s.Soffset = 0;
s.Sseg = pseg.SDseg;
return pseg.SDseg;
}
/***********************************
* Returns:
* jump table segment for function s
*/
int OmfObj_jmpTableSegment(Symbol *s)
{
return (config.flags & CFGromable) ? cseg : DATA;
}
/**********************************
* Reset code seg to existing seg.
* Used after a COMDAT for a function is done.
*/
void OmfObj_setcodeseg(int seg)
{
assert(0 < seg && seg < SegData.length);
cseg = seg;
}
/********************************
* Define a new code segment.
* Input:
* name name of segment, if null then revert to default
* suffix 0 use name as is
* 1 append "_TEXT" to name
* Output:
* cseg segment index of new current code segment
* Coffset starting offset in cseg
* Returns:
* segment index of newly created code segment
*/
int OmfObj_codeseg(const char *name,int suffix)
{
if (!name)
{
if (cseg != CODE)
{
cseg = CODE;
}
return cseg;
}
// Put out LNAMES record
size_t lnamesize = strlen(name) + suffix * 5;
char *lnames = cast(char *) alloca(1 + lnamesize + 1);
lnames[0] = cast(char)lnamesize;
assert(lnamesize <= (255 - 2 - int.sizeof*3));
strcpy(lnames + 1,name);
if (suffix)
strcat(lnames + 1,"_TEXT");
objrecord(LNAMES,lnames,cast(uint)(lnamesize + 1));
cseg = obj_newfarseg(0,4);
SegData[cseg].attr = obj.csegattr;
SegData[cseg].segidx = obj.segidx;
assert(cseg > 0);
obj.segidx++;
Offset(cseg) = 0;
objsegdef(obj.csegattr,0,obj.lnameidx++,4);
return cseg;
}
/*********************************
* Define segment for Thread Local Storage.
* Output:
* tlsseg set to segment number for TLS segment.
* Returns:
* segment for TLS segment
*/
seg_data* OmfObj_tlsseg_bss() { return OmfObj_tlsseg(); }
seg_data* OmfObj_tlsseg()
{
//static char tlssegname[] = "\04$TLS\04$TLS";
//static char tlssegname[] = "\05.tls$\03tls";
static immutable char[25] tlssegname = "\05.tls$\03tls\04.tls\010.tls$ZZZ";
assert(tlssegname[tlssegname.length - 5] == '$');
if (obj.tlssegi == 0)
{
int segattr;
objrecord(LNAMES,tlssegname.ptr,tlssegname.sizeof - 1);
version (MARS)
segattr = SEG_ATTR(SEG_ALIGN16,SEG_C_PUBLIC,0,USE32);
else
segattr = I32
? SEG_ATTR(SEG_ALIGN4,SEG_C_PUBLIC,0,USE32)
: SEG_ATTR(SEG_ALIGN2,SEG_C_PUBLIC,0,USE16);
// Put out beginning segment (.tls)
objsegdef(segattr,0,obj.lnameidx + 2,obj.lnameidx + 1);
obj.segidx++;
// Put out .tls$ segment definition record
obj.tlssegi = obj_newfarseg(0,obj.lnameidx + 1);
objsegdef(segattr,0,obj.lnameidx,obj.lnameidx + 1);
SegData[obj.tlssegi].attr = segattr;
SegData[obj.tlssegi].segidx = obj.segidx;
// Put out ending segment (.tls$ZZZ)
objsegdef(segattr,0,obj.lnameidx + 3,obj.lnameidx + 1);
obj.lnameidx += 4;
obj.segidx += 2;
}
return SegData[obj.tlssegi];
}
seg_data *OmfObj_tlsseg_data()
{
// specific for Mach-O
assert(0);
}
/********************************
* Define a far data segment.
* Input:
* name Name of module
* size Size of the segment to be created
* Returns:
* segment index of far data segment created
* *poffset start of the data for the far data segment
*/
int OmfObj_fardata(char *name,targ_size_t size,targ_size_t *poffset)
{
static immutable char[10] fardataclass = "\010FAR_DATA";
int len;
int i;
char *buffer;
// See if we can use existing far segment, and just bump its size
i = obj.lastfardatasegi;
if (i != -1
&& (_tysize[TYint] != 2 || cast(uint) SegData[i].SDoffset + size < 0x8000)
)
{ *poffset = SegData[i].SDoffset; // BUG: should align this
SegData[i].SDoffset += size;
return i;
}
// No. We need to build a new far segment
if (obj.fardataidx == 0) // if haven't put out far data lname
{ // Put out class lname
objrecord(LNAMES,fardataclass.ptr,fardataclass.sizeof - 1);
obj.fardataidx = obj.lnameidx++;
}
// Generate name based on module name
name = strupr(filespecgetroot(filespecname(obj.modname)));
// Generate name for this far segment
len = 1 + cast(int)strlen(name) + 3 + 5 + 1;
buffer = cast(char *)alloca(len);
sprintf(buffer + 1,"%s%d_DATA",name,obj.segidx);
len = cast(int)strlen(buffer + 1);
buffer[0] = cast(char)len;
assert(len <= 255);
objrecord(LNAMES,buffer,len + 1);
mem_free(name);
// Construct a new SegData[] entry
obj.lastfardatasegi = obj_newfarseg(size,obj.fardataidx);
// Generate segment definition
objsegdef(obj.fdsegattr,size,obj.lnameidx++,obj.fardataidx);
obj.segidx++;
*poffset = 0;
return SegData[obj.lastfardatasegi].SDseg;
}
/************************************
* Remember where we put a far segment so we can adjust
* its size later.
* Input:
* obj.segidx
* lnameidx
* Returns:
* index of SegData[]
*/
private int obj_newfarseg(targ_size_t size,int classidx)
{
seg_data *f = getsegment();
f.isfarseg = true;
f.seek = cast(int)obj.buf.length();
f.attr = obj.fdsegattr;
f.origsize = size;
f.SDoffset = size;
f.segidx = obj.segidx;
f.lnameidx = obj.lnameidx;
f.classidx = classidx;
return f.SDseg;
}
/******************************
* Convert reference to imported name.
*/
void OmfObj_import(elem *e)
{
version (MARS)
assert(0);
else
{
Symbol *s;
Symbol *simp;
elem_debug(e);
if ((e.Eoper == OPvar || e.Eoper == OPrelconst) &&
(s = e.EV.Vsym).ty() & mTYimport &&
(s.Sclass == SCextern || s.Sclass == SCinline)
)
{
char* name;
char* p;
size_t len;
char[IDMAX + IDOHD + 1] buffer = void;
// Create import name
len = OmfObj_mangle(s,buffer.ptr);
if (buffer[0] == cast(char)0xFF && buffer[1] == 0)
{ name = buffer.ptr + 4;
len -= 4;
}
else
{ name = buffer.ptr + 1;
len -= 1;
}
if (config.flags4 & CFG4underscore)
{ p = cast(char *) alloca(5 + len + 1);
memcpy(p,"_imp_".ptr,5);
memcpy(p + 5,name,len);
p[5 + len] = 0;
}
else
{ p = cast(char *) alloca(6 + len + 1);
memcpy(p,"__imp_".ptr,6);
memcpy(p + 6,name,len);
p[6 + len] = 0;
}
simp = scope_search(p,SCTglobal);
if (!simp)
{ type *t;
simp = scope_define(p,SCTglobal,SCextern);
simp.Ssequence = 0;
simp.Sfl = FLextern;
simp.Simport = s;
t = newpointer(s.Stype);
t.Tmangle = mTYman_c;
t.Tcount++;
simp.Stype = t;
}
assert(!e.EV.Voffset);
if (e.Eoper == OPrelconst)
{
e.Eoper = OPvar;
e.EV.Vsym = simp;
}
else // OPvar
{
e.Eoper = OPind;
e.EV.E1 = el_var(simp);
e.EV.E2 = null;
}
}
}
}
/*******************************
* Mangle a name.
* Returns:
* length of mangled name
*/
size_t OmfObj_mangle(Symbol *s,char *dest)
{ size_t len;
size_t ilen;
const(char)* name;
char *name2 = null;
//printf("OmfObj_mangle('%s'), mangle = x%x\n",s.Sident.ptr,type_mangle(s.Stype));
version (SCPP)
name = CPP ? cpp_mangle(s) : &s.Sident[0];
else version (MARS)
name = &s.Sident[0];
else
static assert(0);
len = strlen(name); // # of bytes in name
// Use as max length the max length lib.exe can handle
// Use 5 as length of _ + @nnn
// enum LIBIDMAX = ((512 - 0x25 - 3 - 4) - 5);
enum LIBIDMAX = 128;
if (len > LIBIDMAX)
//if (len > IDMAX)
{
size_t len2;
// Attempt to compress the name
name2 = id_compress(name, cast(int)len, &len2);
version (MARS)
{
if (len2 > LIBIDMAX) // still too long
{
/* Form md5 digest of the name and store it in the
* last 32 bytes of the name.
*/
MD5_CTX mdContext;
MD5Init(&mdContext);
MD5Update(&mdContext, cast(ubyte *)name, cast(uint)len);
MD5Final(&mdContext);
memcpy(name2, name, LIBIDMAX - 32);
for (int i = 0; i < 16; i++)
{ ubyte c = mdContext.digest[i];
ubyte c1 = (c >> 4) & 0x0F;
ubyte c2 = c & 0x0F;
c1 += (c1 < 10) ? '0' : 'A' - 10;
name2[LIBIDMAX - 32 + i * 2] = c1;
c2 += (c2 < 10) ? '0' : 'A' - 10;
name2[LIBIDMAX - 32 + i * 2 + 1] = c2;
}
len = LIBIDMAX;
name2[len] = 0;
name = name2;
//printf("name = '%s', len = %d, strlen = %d\n", name, len, strlen(name));
}
else
{
name = name2;
len = len2;
}
}
else
{
if (len2 > IDMAX) // still too long
{
version (SCPP)
synerr(EM_identifier_too_long, name, len - IDMAX, IDMAX);
else version (MARS)
{
// error(Loc(), "identifier %s is too long by %d characters", name, len - IDMAX);
}
else
assert(0);
len = IDMAX;
}
else
{
name = name2;
len = len2;
}
}
}
ilen = len;
if (ilen > (255-2-int.sizeof*3))
dest += 3;
switch (type_mangle(s.Stype))
{
case mTYman_pas: // if upper case
case mTYman_for:
memcpy(dest + 1,name,len); // copy in name
dest[1 + len] = 0;
strupr(dest + 1); // to upper case
break;
case mTYman_cpp:
memcpy(dest + 1,name,len);
break;
case mTYman_std:
if (!(config.flags4 & CFG4oldstdmangle) &&
config.exe == EX_WIN32 && tyfunc(s.ty()) &&
!variadic(s.Stype))
{
dest[1] = '_';
memcpy(dest + 2,name,len);
dest[1 + 1 + len] = '@';
sprintf(dest + 3 + len, "%d", type_paramsize(s.Stype));
len = strlen(dest + 1);
assert(isdigit(dest[len]));
break;
}
goto case;
case mTYman_c:
case mTYman_d:
if (config.flags4 & CFG4underscore)
{
dest[1] = '_'; // leading _ in name
memcpy(&dest[2],name,len); // copy in name
len++;
break;
}
goto case;
case mTYman_sys:
memcpy(dest + 1, name, len); // no mangling
dest[1 + len] = 0;
break;
default:
symbol_print(s);
assert(0);
}
if (ilen > (255-2-int.sizeof*3))
{
dest -= 3;
dest[0] = 0xFF;
dest[1] = 0;
debug
assert(len <= 0xFFFF);
TOWORD(dest + 2,cast(uint)len);
len += 4;
}
else
{
*dest = cast(char)len;
len++;
}
if (name2)
free(name2);
assert(len <= IDMAX + IDOHD);
return len;
}
/*******************************
* Export a function name.
*/
void OmfObj_export_symbol(Symbol* s, uint argsize)
{
char* coment;
size_t len;
coment = cast(char *) alloca(4 + 1 + (IDMAX + IDOHD) + 1); // allow extra byte for mangling
len = OmfObj_mangle(s,&coment[4]);
assert(len <= IDMAX + IDOHD);
coment[1] = 0xA0; // comment class
coment[2] = 2; // why??? who knows
if (argsize >= 64) // we only have a 5 bit field
argsize = 0; // hope we don't need callgate
coment[3] = cast(char)((argsize + 1) >> 1); // # words on stack
coment[4 + len] = 0; // no internal name
objrecord(COMENT,coment,cast(uint)(4 + len + 1)); // module name record
}
/*******************************
* Update data information about symbol
* align for output and assign segment
* if not already specified.
*
* Input:
* sdata data symbol
* datasize output size
* seg default seg if not known
* Returns:
* actual seg
*/
int OmfObj_data_start(Symbol *sdata, targ_size_t datasize, int seg)
{
targ_size_t alignbytes;
//printf("OmfObj_data_start(%s,size %llx,seg %d)\n",sdata.Sident.ptr,datasize,seg);
//symbol_print(sdata);
if (sdata.Sseg == UNKNOWN) // if we don't know then there
sdata.Sseg = seg; // wasn't any segment override
else
seg = sdata.Sseg;
targ_size_t offset = SegData[seg].SDoffset;
if (sdata.Salignment > 0)
{
if (SegData[seg].SDalignment < sdata.Salignment)
SegData[seg].SDalignment = sdata.Salignment;
alignbytes = ((offset + sdata.Salignment - 1) & ~(sdata.Salignment - 1)) - offset;
}
else
alignbytes = _align(datasize, offset) - offset;
sdata.Soffset = offset + alignbytes;
SegData[seg].SDoffset = sdata.Soffset;
return seg;
}
void OmfObj_func_start(Symbol *sfunc)
{
//printf("OmfObj_func_start(%s)\n",sfunc.Sident.ptr);
symbol_debug(sfunc);
sfunc.Sseg = cseg; // current code seg
sfunc.Soffset = Offset(cseg); // offset of start of function
version (MARS)
varStats_startFunction();
}
/*******************************
* Update function info after codgen
*/
void OmfObj_func_term(Symbol *sfunc)
{
}
/********************************
* Output a public definition.
* Input:
* seg = segment index that symbol is defined in
* s . symbol
* offset = offset of name
*/
private void outpubdata()
{
if (obj.pubdatai)
{
objrecord(obj.mpubdef,obj.pubdata.ptr,obj.pubdatai);
obj.pubdatai = 0;
}
}
void OmfObj_pubdef(int seg,Symbol *s,targ_size_t offset)
{
uint reclen, len;
char* p;
uint ti;
assert(offset < 100_000_000);
obj.resetSymbols.push(s);
int idx = SegData[seg].segidx;
if (obj.pubdatai + 1 + (IDMAX + IDOHD) + 4 + 2 > obj.pubdata.sizeof ||
idx != getindex(cast(ubyte*)obj.pubdata.ptr + 1))
outpubdata();
if (obj.pubdatai == 0)
{
obj.pubdata[0] = (seg == DATA || seg == CDATA || seg == UDATA) ? 1 : 0; // group index
obj.pubdatai += 1 + insidx(obj.pubdata.ptr + 1,idx); // segment index
}
p = &obj.pubdata[obj.pubdatai];
len = cast(uint)OmfObj_mangle(s,p); // mangle in name
reclen = len + _tysize[TYint];
p += len;
TOOFFSET(p,offset);
p += _tysize[TYint];
ti = (config.fulltypes == CVOLD) ? cv_typidx(s.Stype) : 0;
reclen += instypidx(p,ti);
obj.pubdatai += reclen;
}
void OmfObj_pubdefsize(int seg, Symbol *s, targ_size_t offset, targ_size_t symsize)
{
OmfObj_pubdef(seg, s, offset);
}
/*******************************
* Output an external definition.
* Input:
* name . external identifier
* Returns:
* External index of the definition (1,2,...)
*/
private void outextdata()
{
if (obj.extdatai)
{
objrecord(EXTDEF, obj.extdata.ptr, obj.extdatai);
obj.extdatai = 0;
}
}
int OmfObj_external_def(const(char)* name)
{
uint len;
char *e;
//printf("OmfObj_external_def('%s', %d)\n",name,obj.extidx + 1);
assert(name);
len = cast(uint)strlen(name); // length of identifier
if (obj.extdatai + len + ONS_OHD + 1 > obj.extdata.sizeof)
outextdata();
e = &obj.extdata[obj.extdatai];
len = obj_namestring(e,name);
e[len] = 0; // typidx = 0
obj.extdatai += len + 1;
assert(obj.extdatai <= obj.extdata.sizeof);
return ++obj.extidx;
}
/*******************************
* Output an external definition.
* Input:
* s Symbol to do EXTDEF on
* Returns:
* External index of the definition (1,2,...)
*/
int OmfObj_external(Symbol *s)
{
//printf("OmfObj_external('%s', %d)\n",s.Sident.ptr, obj.extidx + 1);
symbol_debug(s);
obj.resetSymbols.push(s);
if (obj.extdatai + (IDMAX + IDOHD) + 3 > obj.extdata.sizeof)
outextdata();
char *e = &obj.extdata[obj.extdatai];
uint len = cast(uint)OmfObj_mangle(s,e);
e[len] = 0; // typidx = 0
obj.extdatai += len + 1;
s.Sxtrnnum = ++obj.extidx;
return obj.extidx;
}
/*******************************
* Output a common block definition.
* Input:
* p . external identifier
* flag TRUE: in default data segment
* FALSE: not in default data segment
* size size in bytes of each elem
* count number of elems
* Returns:
* External index of the definition (1,2,...)
*/
// Helper for OmfObj_common_block()
static uint storelength(uint length,uint i)
{
obj.extdata[i] = cast(char)length;
if (length >= 128) // Microsoft docs say 129, but their linker
// won't take >=128, so accommodate it
{ obj.extdata[i] = 129;
TOWORD(obj.extdata.ptr + i + 1,length);
if (length >= 0x10000)
{ obj.extdata[i] = 132;
obj.extdata[i + 3] = cast(char)(length >> 16);
// Only 386 can generate lengths this big
if (I32 && length >= 0x1000000)
{ obj.extdata[i] = 136;
obj.extdata[i + 4] = length >> 24;
i += 4;
}
else
i += 3;
}
else
i += 2;
}
return i + 1; // index past where we stuffed length
}
int OmfObj_common_block(Symbol *s,targ_size_t size,targ_size_t count)
{
return OmfObj_common_block(s, 0, size, count);
}
int OmfObj_common_block(Symbol *s,int flag,targ_size_t size,targ_size_t count)
{
uint i;
uint length;
uint ti;
//printf("OmfObj_common_block('%s',%d,%d,%d, %d)\n",s.Sident.ptr,flag,size,count, obj.extidx + 1);
obj.resetSymbols.push(s);
outextdata(); // borrow the extdata[] storage
i = cast(uint)OmfObj_mangle(s,obj.extdata.ptr);
ti = (config.fulltypes == CVOLD) ? cv_typidx(s.Stype) : 0;
i += instypidx(obj.extdata.ptr + i,ti);
if (flag) // if in default data segment
{
//printf("NEAR comdef\n");
obj.extdata[i] = 0x62;
length = cast(uint) size * cast(uint) count;
assert(I32 || length <= 0x10000);
i = storelength(length,i + 1);
}
else
{
//printf("FAR comdef\n");
obj.extdata[i] = 0x61;
i = storelength(cast(uint) size,i + 1);
i = storelength(cast(uint) count,i);
}
assert(i <= obj.extdata.length);
objrecord(COMDEF,obj.extdata.ptr,i);
return ++obj.extidx;
}
/***************************************
* Append an iterated data block of 0s.
* (uninitialized data only)
*/
void OmfObj_write_zeros(seg_data *pseg, targ_size_t count)
{
OmfObj_lidata(pseg.SDseg, pseg.SDoffset, count);
//pseg.SDoffset += count;
}
/***************************************
* Output an iterated data block of 0s.
* (uninitialized data only)
*/
void OmfObj_lidata(int seg,targ_size_t offset,targ_size_t count)
{ int i;
uint reclen;
static immutable char[20] zero = 0;
char[20] data = void;
char *di;
//printf("OmfObj_lidata(seg = %d, offset = x%x, count = %d)\n", seg, offset, count);
SegData[seg].SDoffset += count;
if (seg == UDATA)
return;
int idx = SegData[seg].segidx;
Lagain:
if (count <= zero.sizeof) // if shorter to use ledata
{
OmfObj_bytes(seg,offset,cast(uint)count,cast(char*)zero.ptr);
return;
}
if (seg_is_comdat(idx))
{
while (count > zero.sizeof)
{
OmfObj_bytes(seg,offset,zero.sizeof,cast(char*)zero.ptr);
offset += zero.sizeof;
count -= zero.sizeof;
}
OmfObj_bytes(seg,offset,cast(uint)count,cast(char*)zero.ptr);
return;
}
i = insidx(data.ptr,idx);
di = data.ptr + i;
TOOFFSET(di,offset);
if (config.flags & CFGeasyomf)
{
if (count >= 0x8000) // repeat count can only go to 32k
{
TOWORD(di + 4,cast(ushort)(count / 0x8000));
TOWORD(di + 4 + 2,1); // 1 data block follows
TOWORD(di + 4 + 2 + 2,0x8000); // repeat count
TOWORD(di + 4 + 2 + 2 + 2,0); // block count
TOWORD(di + 4 + 2 + 2 + 2 + 2,1); // 1 byte of 0
reclen = i + 4 + 5 * 2;
objrecord(obj.mlidata,data.ptr,reclen);
offset += (count & ~cast(targ_size_t)0x7FFF);
count &= 0x7FFF;
goto Lagain;
}
else
{
TOWORD(di + 4,cast(ushort)count); // repeat count
TOWORD(di + 4 + 2,0); // block count
TOWORD(di + 4 + 2 + 2,1); // 1 byte of 0
reclen = i + 4 + 2 + 2 + 2;
objrecord(obj.mlidata,data.ptr,reclen);
}
}
else
{
TOOFFSET(di + _tysize[TYint],count);
TOWORD(di + _tysize[TYint] * 2,0); // block count
TOWORD(di + _tysize[TYint] * 2 + 2,1); // repeat 1 byte of 0s
reclen = i + (I32 ? 12 : 8);
objrecord(obj.mlidata,data.ptr,reclen);
}
assert(reclen <= data.sizeof);
}
/****************************
* Output a MODEND record.
*/
private void obj_modend()
{
if (obj.startaddress)
{ char[10] mdata = void;
int i;
uint framedatum,targetdatum;
ubyte fd;
targ_size_t offset;
int external; // !=0 if identifier is defined externally
tym_t ty;
Symbol *s = obj.startaddress;
// Turn startaddress into a fixup.
// Borrow heavilly from OmfObj_reftoident()
obj.resetSymbols.push(s);
symbol_debug(s);
offset = 0;
ty = s.ty();
switch (s.Sclass)
{
case SCcomdat:
case_SCcomdat:
case SCextern:
case SCcomdef:
if (s.Sxtrnnum) // identifier is defined somewhere else
external = s.Sxtrnnum;
else
{
Ladd:
s.Sclass = SCextern;
external = objmod.external(s);
outextdata();
}
break;
case SCinline:
if (config.flags2 & CFG2comdat)
goto case_SCcomdat; // treat as initialized common block
goto case;
case SCsinline:
case SCstatic:
case SCglobal:
if (s.Sseg == UNKNOWN)
goto Ladd;
if (seg_is_comdat(SegData[s.Sseg].segidx)) // if in comdat
goto case_SCcomdat;
goto case;
case SClocstat:
external = 0; // identifier is static or global
// and we know its offset
offset += s.Soffset;
break;
default:
//symbol_print(s);
assert(0);
}
if (external)
{ fd = FD_T2;
targetdatum = external;
switch (s.Sfl)
{
case FLextern:
if (!(ty & (mTYcs | mTYthread)))
goto L1;
goto case;
case FLfunc:
case FLfardata:
case FLcsdata:
case FLtlsdata:
if (config.exe & EX_flat)
{ fd |= FD_F1;
framedatum = 1;
}
else
{
//case FLtlsdata:
fd |= FD_F2;
framedatum = targetdatum;
}
break;
default:
goto L1;
}
}
else
{
fd = FD_T0; // target is always a segment
targetdatum = SegData[s.Sseg].segidx;
assert(targetdatum != -1);
switch (s.Sfl)
{
case FLextern:
if (!(ty & (mTYcs | mTYthread)))
goto L1;
goto case;
case FLfunc:
case FLfardata:
case FLcsdata:
case FLtlsdata:
if (config.exe & EX_flat)
{ fd |= FD_F1;
framedatum = 1;
}
else
{
//case FLtlsdata:
fd |= FD_F0;
framedatum = targetdatum;
}
break;
default:
L1:
fd |= FD_F1;
framedatum = DGROUPIDX;
//if (flags == CFseg)
{ fd = FD_F1 | FD_T1; // target is DGROUP
targetdatum = DGROUPIDX;
}
break;
}
}
// Write the fixup into mdata[]
mdata[0] = 0xC1;
mdata[1] = fd;
i = 2 + insidx(&mdata[2],framedatum);
i += insidx(&mdata[i],targetdatum);
TOOFFSET(mdata.ptr + i,offset);
objrecord(obj.mmodend,mdata.ptr,i + _tysize[TYint]); // write mdata[] to .OBJ file
}
else
{ static immutable char[1] modend = [0];
objrecord(obj.mmodend,modend.ptr,modend.sizeof);
}
}
/****************************
* Output the fixups in list fl.
*/
private void objfixupp(FIXUP *f)
{
uint i,j,k;
targ_size_t locat;
FIXUP *fn;
static if (1) // store in one record
{
char[1024] data = void;
i = 0;
for (; f; f = fn)
{ ubyte fd;
if (i >= data.sizeof - (3 + 2 + 2)) // if not enough room
{ objrecord(obj.mfixupp,data.ptr,i);
i = 0;
}
//printf("f = %p, offset = x%x\n",f,f.FUoffset);
assert(f.FUoffset < 1024);
locat = (f.FUlcfd & 0xFF00) | f.FUoffset;
data[i+0] = cast(char)(locat >> 8);
data[i+1] = cast(char)locat;
data[i+2] = fd = cast(ubyte)f.FUlcfd;
k = i;
i += 3 + insidx(&data[i+3],f.FUframedatum);
//printf("FUframedatum = x%x\n", f.FUframedatum);
if ((fd >> 4) == (fd & 3) && f.FUframedatum == f.FUtargetdatum)
{
data[k + 2] = (fd & 15) | FD_F5;
}
else
{ i += insidx(&data[i],f.FUtargetdatum);
//printf("FUtargetdatum = x%x\n", f.FUtargetdatum);
}
//printf("[%d]: %02x %02x %02x\n", k, data[k + 0] & 0xFF, data[k + 1] & 0xFF, data[k + 2] & 0xFF);
fn = f.FUnext;
free(f);
}
assert(i <= data.sizeof);
if (i)
objrecord(obj.mfixupp,data.ptr,i);
}
else // store in multiple records
{
for (; fl; fl = list_next(fl))
{
char[7] data = void;
assert(f.FUoffset < 1024);
locat = (f.FUlcfd & 0xFF00) | f.FUoffset;
data[0] = locat >> 8;
data[1] = locat;
data[2] = f.FUlcfd;
i = 3 + insidx(&data[3],f.FUframedatum);
i += insidx(&data[i],f.FUtargetdatum);
objrecord(obj.mfixupp,data,i);
}
}
}
/***************************
* Add a new fixup to the fixup list.
* Write things out if we overflow the list.
*/
private void addfixup(Ledatarec *lr, targ_size_t offset,uint lcfd,
uint framedatum,uint targetdatum)
{ FIXUP *f;
assert(offset < 0x1024);
debug
{
assert(targetdatum <= 0x7FFF);
assert(framedatum <= 0x7FFF);
}
f = cast(FIXUP *) malloc(FIXUP.sizeof);
//printf("f = %p, offset = x%x\n",f,offset);
f.FUoffset = offset;
f.FUlcfd = cast(ushort)lcfd;
f.FUframedatum = cast(ushort)framedatum;
f.FUtargetdatum = cast(ushort)targetdatum;
f.FUnext = lr.fixuplist; // link f into list
lr.fixuplist = f;
debug
obj.fixup_count++; // gather statistics
}
/*********************************
* Open up a new ledata record.
* Input:
* seg segment number data is in
* offset starting offset of start of data for this record
*/
private Ledatarec *ledata_new(int seg,targ_size_t offset)
{
//printf("ledata_new(seg = %d, offset = x%lx)\n",seg,offset);
assert(seg > 0 && seg < SegData.length);
Ledatarec** p = obj.ledatas.push();
Ledatarec* lr = *p;
if (!lr)
{
lr = cast(Ledatarec *) mem_malloc(Ledatarec.sizeof);
*p = lr;
}
memset(lr, 0, Ledatarec.sizeof);
lr.lseg = seg;
lr.offset = offset;
if (seg_is_comdat(SegData[seg].segidx) && offset) // if continuation of an existing COMDAT
{
Ledatarec *d = cast(Ledatarec*)SegData[seg].ledata;
if (d)
{
if (d.lseg == seg) // found existing COMDAT
{ lr.flags = d.flags;
lr.alloctyp = d.alloctyp;
lr._align = d._align;
lr.typidx = d.typidx;
lr.pubbase = d.pubbase;
lr.pubnamidx = d.pubnamidx;
}
}
}
SegData[seg].ledata = lr;
return lr;
}
/***********************************
* Append byte to segment.
*/
void OmfObj_write_byte(seg_data *pseg, uint _byte)
{
OmfObj_byte(pseg.SDseg, pseg.SDoffset, _byte);
pseg.SDoffset++;
}
/************************************
* Output byte to object file.
*/
void OmfObj_byte(int seg,targ_size_t offset,uint _byte)
{
Ledatarec *lr = cast(Ledatarec*)SegData[seg].ledata;
if (!lr)
goto L2;
if (
lr.i > LEDATAMAX - 1 || // if it'll overflow
offset < lr.offset || // underflow
offset > lr.offset + lr.i
)
{
// Try to find an existing ledata
for (size_t i = obj.ledatas.length; i; )
{ Ledatarec *d = obj.ledatas[--i];
if (seg == d.lseg && // segments match
offset >= d.offset &&
offset + 1 <= d.offset + LEDATAMAX &&
offset <= d.offset + d.i
)
{
lr = d;
SegData[seg].ledata = cast(void*)d;
goto L1;
}
}
L2:
lr = ledata_new(seg,offset);
L1: { }
}
uint i = cast(uint)(offset - lr.offset);
if (lr.i <= i)
lr.i = i + 1;
lr.data[i] = cast(ubyte)_byte; // 1st byte of data
}
/***********************************
* Append bytes to segment.
*/
void OmfObj_write_bytes(seg_data *pseg, uint nbytes, void *p)
{
OmfObj_bytes(pseg.SDseg, pseg.SDoffset, nbytes, p);
pseg.SDoffset += nbytes;
}
/************************************
* Output bytes to object file.
* Returns:
* nbytes
*/
uint OmfObj_bytes(int seg, targ_size_t offset, uint nbytes, void* p)
{
uint n = nbytes;
//dbg_printf("OmfObj_bytes(seg=%d, offset=x%lx, nbytes=x%x, p=%p)\n",seg,offset,nbytes,p);
Ledatarec *lr = cast(Ledatarec*)SegData[seg].ledata;
if (!lr)
lr = ledata_new(seg, offset);
L1:
if (
lr.i + nbytes > LEDATAMAX || // or it'll overflow
offset < lr.offset || // underflow
offset > lr.offset + lr.i
)
{
while (nbytes)
{
OmfObj_byte(seg, offset, *cast(char*)p);
offset++;
p = (cast(char *)p) + 1;
nbytes--;
lr = cast(Ledatarec*)SegData[seg].ledata;
if (lr.i + nbytes <= LEDATAMAX)
goto L1;
if (lr.i == LEDATAMAX)
{
while (nbytes > LEDATAMAX) // start writing full ledatas
{
lr = ledata_new(seg, offset);
memcpy(lr.data.ptr, p, LEDATAMAX);
p = (cast(char *)p) + LEDATAMAX;
nbytes -= LEDATAMAX;
offset += LEDATAMAX;
lr.i = LEDATAMAX;
}
goto L1;
}
}
}
else
{
uint i = cast(uint)(offset - lr.offset);
if (lr.i < i + nbytes)
lr.i = i + nbytes;
memcpy(lr.data.ptr + i,p,nbytes);
}
return n;
}
/************************************
* Output word of data. (Two words if segment:offset pair.)
* Input:
* seg CODE, DATA, CDATA, UDATA
* offset offset of start of data
* data word of data
* lcfd LCxxxx | FDxxxx
* if (FD_F2 | FD_T6)
* idx1 = external Symbol #
* else
* idx1 = frame datum
* idx2 = target datum
*/
void OmfObj_ledata(int seg,targ_size_t offset,targ_size_t data,
uint lcfd,uint idx1,uint idx2)
{
uint size; // number of bytes to output
uint ptrsize = tysize(TYfptr);
if ((lcfd & LOCxx) == obj.LOCpointer)
size = ptrsize;
else if ((lcfd & LOCxx) == LOCbase)
size = 2;
else
size = tysize(TYnptr);
Ledatarec *lr = cast(Ledatarec*)SegData[seg].ledata;
if (!lr)
lr = ledata_new(seg, offset);
assert(seg == lr.lseg);
if (
lr.i + size > LEDATAMAX || // if it'll overflow
offset < lr.offset || // underflow
offset > lr.offset + lr.i
)
{
// Try to find an existing ledata
//dbg_printf("seg = %d, offset = x%lx, size = %d\n",seg,offset,size);
for (size_t i = obj.ledatas.length; i; )
{ Ledatarec *d = obj.ledatas[--i];
//dbg_printf("d: seg = %d, offset = x%lx, i = x%x\n",d.lseg,d.offset,d.i);
if (seg == d.lseg && // segments match
offset >= d.offset &&
offset + size <= d.offset + LEDATAMAX &&
offset <= d.offset + d.i
)
{
//dbg_printf("match\n");
lr = d;
SegData[seg].ledata = cast(void*)d;
goto L1;
}
}
lr = ledata_new(seg,offset);
L1: { }
}
uint i = cast(uint)(offset - lr.offset);
if (lr.i < i + size)
lr.i = i + size;
if (size == 2 || !I32)
TOWORD(lr.data.ptr + i,cast(uint)data);
else
TOLONG(lr.data.ptr + i,cast(uint)data);
if (size == ptrsize) // if doing a seg:offset pair
TOWORD(lr.data.ptr + i + tysize(TYnptr),0); // segment portion
addfixup(lr, offset - lr.offset,lcfd,idx1,idx2);
}
/************************************
* Output long word of data.
* Input:
* seg CODE, DATA, CDATA, UDATA
* offset offset of start of data
* data long word of data
* Present only if size == 2:
* lcfd LCxxxx | FDxxxx
* if (FD_F2 | FD_T6)
* idx1 = external Symbol #
* else
* idx1 = frame datum
* idx2 = target datum
*/
void OmfObj_write_long(int seg,targ_size_t offset,uint data,
uint lcfd,uint idx1,uint idx2)
{
uint sz = tysize(TYfptr);
Ledatarec *lr = cast(Ledatarec*)SegData[seg].ledata;
if (!lr)
lr = ledata_new(seg, offset);
if (
lr.i + sz > LEDATAMAX || // if it'll overflow
offset < lr.offset || // underflow
offset > lr.offset + lr.i
)
lr = ledata_new(seg,offset);
uint i = cast(uint)(offset - lr.offset);
if (lr.i < i + sz)
lr.i = i + sz;
TOLONG(lr.data.ptr + i,data);
if (I32) // if 6 byte far pointers
TOWORD(lr.data.ptr + i + LONGSIZE,0); // fill out seg
addfixup(lr, offset - lr.offset,lcfd,idx1,idx2);
}
/*******************************
* Refer to address that is in the data segment.
* Input:
* seg = where the address is going
* offset = offset within seg
* val = displacement from address
* targetdatum = DATA, CDATA or UDATA, depending where the address is
* flags = CFoff, CFseg
* Example:
* int *abc = &def[3];
* to allocate storage:
* OmfObj_reftodatseg(DATA,offset,3 * (int *).sizeof,UDATA);
*/
void OmfObj_reftodatseg(int seg,targ_size_t offset,targ_size_t val,
uint targetdatum,int flags)
{
assert(flags);
if (flags == 0 || flags & CFoff)
{
// The frame datum is always 1, which is DGROUP
OmfObj_ledata(seg,offset,val,
LOCATsegrel | obj.LOCoffset | FD_F1 | FD_T4,DGROUPIDX,SegData[targetdatum].segidx);
offset += _tysize[TYint];
}
if (flags & CFseg)
{
static if (0)
{
if (config.wflags & WFdsnedgroup)
warerr(WM_ds_ne_dgroup);
}
OmfObj_ledata(seg,offset,0,
LOCATsegrel | LOCbase | FD_F1 | FD_T5,DGROUPIDX,DGROUPIDX);
}
}
/*******************************
* Refer to address that is in a far segment.
* Input:
* seg = where the address is going
* offset = offset within seg
* val = displacement from address
* farseg = far segment index
* flags = CFoff, CFseg
*/
void OmfObj_reftofarseg(int seg,targ_size_t offset,targ_size_t val,
int farseg,int flags)
{
assert(flags);
int idx = SegData[farseg].segidx;
if (flags == 0 || flags & CFoff)
{
OmfObj_ledata(seg,offset,val,
LOCATsegrel | obj.LOCoffset | FD_F0 | FD_T4,idx,idx);
offset += _tysize[TYint];
}
if (flags & CFseg)
{
OmfObj_ledata(seg,offset,0,
LOCATsegrel | LOCbase | FD_F0 | FD_T4,idx,idx);
}
}
/*******************************
* Refer to address that is in the code segment.
* Only offsets are output, regardless of the memory model.
* Used to put values in switch address tables.
* Input:
* seg = where the address is going (CODE or DATA)
* offset = offset within seg
* val = displacement from start of this module
*/
void OmfObj_reftocodeseg(int seg,targ_size_t offset,targ_size_t val)
{
uint framedatum;
uint lcfd;
int idx = SegData[cseg].segidx;
if (seg_is_comdat(idx)) // if comdat
{ idx = -idx;
framedatum = idx;
lcfd = (LOCATsegrel | obj.LOCoffset) | (FD_F2 | FD_T6);
}
else if (config.exe & EX_flat)
{ framedatum = 1;
lcfd = (LOCATsegrel | obj.LOCoffset) | (FD_F1 | FD_T4);
}
else
{ framedatum = idx;
lcfd = (LOCATsegrel | obj.LOCoffset) | (FD_F0 | FD_T4);
}
OmfObj_ledata(seg,offset,val,lcfd,framedatum,idx);
}
/*******************************
* Refer to an identifier.
* Input:
* seg = where the address is going (CODE or DATA)
* offset = offset within seg
* s . Symbol table entry for identifier
* val = displacement from identifier
* flags = CFselfrel: self-relative
* CFseg: get segment
* CFoff: get offset
* Returns:
* number of bytes in reference (2 or 4)
* Example:
* extern int def[];
* int *abc = &def[3];
* to allocate storage:
* OmfObj_reftodatseg(DATA,offset,3 * (int *).sizeof,UDATA);
*/
int OmfObj_reftoident(int seg,targ_size_t offset,Symbol *s,targ_size_t val,
int flags)
{
uint targetdatum; // which datum the symbol is in
uint framedatum;
int lc;
int external; // !=0 if identifier is defined externally
int numbytes;
tym_t ty;
static if (0)
{
printf("OmfObj_reftoident('%s' seg %d, offset x%lx, val x%lx, flags x%x)\n",
s.Sident.ptr,seg,offset,val,flags);
printf("Sseg = %d, Sxtrnnum = %d\n",s.Sseg,s.Sxtrnnum);
symbol_print(s);
}
assert(seg > 0);
ty = s.ty();
while (1)
{
switch (flags & (CFseg | CFoff))
{
case 0:
// Select default
flags |= CFoff;
if (tyfunc(ty))
{
if (tyfarfunc(ty))
flags |= CFseg;
}
else // DATA
{
if (LARGEDATA)
flags |= CFseg;
}
continue;
case CFoff:
if (I32)
{
if (ty & mTYthread)
{ lc = LOC32tlsoffset;
}
else
lc = obj.LOCoffset;
}
else
{
// The 'loader_resolved' offset is required for VCM
// and Windows support. A fixup of this type is
// relocated by the linker to point to a 'thunk'.
lc = (tyfarfunc(ty)
&& !(flags & CFselfrel))
? LOCloader_resolved : obj.LOCoffset;
}
numbytes = tysize(TYnptr);
break;
case CFseg:
lc = LOCbase;
numbytes = 2;
break;
case CFoff | CFseg:
lc = obj.LOCpointer;
numbytes = tysize(TYfptr);
break;
default:
assert(0);
}
break;
}
switch (s.Sclass)
{
case SCcomdat:
case_SCcomdat:
case SCextern:
case SCcomdef:
if (s.Sxtrnnum) // identifier is defined somewhere else
{
external = s.Sxtrnnum;
debug
if (external > obj.extidx)
{
printf("obj.extidx = %d\n", obj.extidx);
symbol_print(s);
}
assert(external <= obj.extidx);
}
else
{
// Don't know yet, worry about it later
Ladd:
size_t byteswritten = addtofixlist(s,offset,seg,val,flags);
assert(byteswritten == numbytes);
return numbytes;
}
break;
case SCinline:
if (config.flags2 & CFG2comdat)
goto case_SCcomdat; // treat as initialized common block
goto case;
case SCsinline:
case SCstatic:
case SCglobal:
if (s.Sseg == UNKNOWN)
goto Ladd;
if (seg_is_comdat(SegData[s.Sseg].segidx))
goto case_SCcomdat;
goto case;
case SClocstat:
external = 0; // identifier is static or global
// and we know its offset
if (flags & CFoff)
val += s.Soffset;
break;
default:
symbol_print(s);
assert(0);
}
lc |= (flags & CFselfrel) ? LOCATselfrel : LOCATsegrel;
if (external)
{ lc |= FD_T6;
targetdatum = external;
switch (s.Sfl)
{
case FLextern:
if (!(ty & (mTYcs | mTYthread)))
goto L1;
goto case;
case FLfunc:
case FLfardata:
case FLcsdata:
case FLtlsdata:
if (config.exe & EX_flat)
{ lc |= FD_F1;
framedatum = 1;
}
else
{
//case FLtlsdata:
lc |= FD_F2;
framedatum = targetdatum;
}
break;
default:
goto L1;
}
}
else
{
lc |= FD_T4; // target is always a segment
targetdatum = SegData[s.Sseg].segidx;
assert(s.Sseg != UNKNOWN);
switch (s.Sfl)
{
case FLextern:
if (!(ty & (mTYcs | mTYthread)))
goto L1;
goto case;
case FLfunc:
case FLfardata:
case FLcsdata:
case FLtlsdata:
if (config.exe & EX_flat)
{ lc |= FD_F1;
framedatum = 1;
}
else
{
//case FLtlsdata:
lc |= FD_F0;
framedatum = targetdatum;
}
break;
default:
L1:
lc |= FD_F1;
framedatum = DGROUPIDX;
if (flags == CFseg)
{ lc = LOCATsegrel | LOCbase | FD_F1 | FD_T5;
targetdatum = DGROUPIDX;
}
static if (0)
{
if (flags & CFseg && config.wflags & WFdsnedgroup)
warerr(WM_ds_ne_dgroup);
}
break;
}
}
OmfObj_ledata(seg,offset,val,lc,framedatum,targetdatum);
return numbytes;
}
/*****************************************
* Generate far16 thunk.
* Input:
* s Symbol to generate a thunk for
*/
void OmfObj_far16thunk(Symbol *s)
{
static ubyte[25] cod32_1 =
[
0x55, // PUSH EBP
0x8B,0xEC, // MOV EBP,ESP
0x83,0xEC,0x04, // SUB ESP,4
0x53, // PUSH EBX
0x57, // PUSH EDI
0x56, // PUSH ESI
0x06, // PUSH ES
0x8C,0xD2, // MOV DX,SS
0x80,0xE2,0x03, // AND DL,3
0x80,0xCA,0x07, // OR DL,7
0x89,0x65,0xFC, // MOV -4[EBP],ESP
0x8C,0xD0, // MOV AX,SS
0x66,0x3D, // 0x00,0x00 */ /* CMP AX,seg FLAT:_DATA
];
assert(cod32_1[cod32_1.length - 1] == 0x3D);
static ubyte[22 + 46] cod32_2 =
[
0x0F,0x85,0x10,0x00,0x00,0x00, // JNE L1
0x8B,0xC4, // MOV EAX,ESP
0x66,0x3D,0x00,0x08, // CMP AX,2048
0x0F,0x83,0x04,0x00,0x00,0x00, // JAE L1
0x66,0x33,0xC0, // XOR AX,AX
0x94, // XCHG ESP,EAX
// L1:
0x55, // PUSH EBP
0x8B,0xC4, // MOV EAX,ESP
0x16, // PUSH SS
0x50, // PUSH EAX
LEA,0x75,0x08, // LEA ESI,8[EBP]
0x81,0xEC,0x00,0x00,0x00,0x00, // SUB ESP,numparam
0x8B,0xFC, // MOV EDI,ESP
0xB9,0x00,0x00,0x00,0x00, // MOV ECX,numparam
0x66,0xF3,0xA4, // REP MOVSB
0x8B,0xC4, // MOV EAX,ESP
0xC1,0xC8,0x10, // ROR EAX,16
0x66,0xC1,0xE0,0x03, // SHL AX,3
0x0A,0xC2, // OR AL,DL
0xC1,0xC0,0x10, // ROL EAX,16
0x50, // PUSH EAX
0x66,0x0F,0xB2,0x24,0x24, // LSS SP,[ESP]
0x66,0xEA, // 0,0,0,0, */ /* JMPF L3
];
assert(cod32_2[cod32_2.length - 1] == 0xEA);
static ubyte[26] cod32_3 =
[ // L2:
0xC1,0xE0,0x10, // SHL EAX,16
0x0F,0xAC,0xD0,0x10, // SHRD EAX,EDX,16
0x0F,0xB7,0xE4, // MOVZX ESP,SP
0x0F,0xB2,0x24,0x24, // LSS ESP,[ESP]
0x5D, // POP EBP
0x8B,0x65,0xFC, // MOV ESP,-4[EBP]
0x07, // POP ES
0x5E, // POP ESI
0x5F, // POP EDI
0x5B, // POP EBX
0xC9, // LEAVE
0xC2,0x00,0x00 // RET numparam
];
assert(cod32_3[cod32_3.length - 3] == 0xC2);
uint numparam = 24;
targ_size_t L2offset;
int idx;
s.Sclass = SCstatic;
s.Sseg = cseg; // identifier is defined in code segment
s.Soffset = Offset(cseg);
// Store numparam into right places
assert((numparam & 0xFFFF) == numparam); // 2 byte value
TOWORD(&cod32_2[32],numparam);
TOWORD(&cod32_2[32 + 7],numparam);
TOWORD(&cod32_3[cod32_3.sizeof - 2],numparam);
//------------------------------------------
// Generate CODE16 segment if it isn't there already
if (obj.code16segi == 0)
{
// Define CODE16 segment for far16 thunks
static immutable char[8] lname = "\06CODE16";
// Put out LNAMES record
objrecord(LNAMES,lname.ptr,lname.sizeof - 1);
obj.code16segi = obj_newfarseg(0,4);
obj.CODE16offset = 0;
// class CODE
uint attr = SEG_ATTR(SEG_ALIGN2,SEG_C_PUBLIC,0,USE16);
SegData[obj.code16segi].attr = attr;
objsegdef(attr,0,obj.lnameidx++,4);
obj.segidx++;
}
//------------------------------------------
// Output the 32 bit thunk
OmfObj_bytes(cseg,Offset(cseg),cod32_1.sizeof,cod32_1.ptr);
Offset(cseg) += cod32_1.sizeof;
// Put out fixup for SEG FLAT:_DATA
OmfObj_ledata(cseg,Offset(cseg),0,LOCATsegrel|LOCbase|FD_F1|FD_T4,
DGROUPIDX,DATA);
Offset(cseg) += 2;
OmfObj_bytes(cseg,Offset(cseg),cod32_2.sizeof,cod32_2.ptr);
Offset(cseg) += cod32_2.sizeof;
// Put out fixup to CODE16 part of thunk
OmfObj_ledata(cseg,Offset(cseg),obj.CODE16offset,LOCATsegrel|LOC16pointer|FD_F0|FD_T4,
SegData[obj.code16segi].segidx,
SegData[obj.code16segi].segidx);
Offset(cseg) += 4;
L2offset = Offset(cseg);
OmfObj_bytes(cseg,Offset(cseg),cod32_3.sizeof,cod32_3.ptr);
Offset(cseg) += cod32_3.sizeof;
s.Ssize = Offset(cseg) - s.Soffset; // size of thunk
//------------------------------------------
// Output the 16 bit thunk
OmfObj_byte(obj.code16segi,obj.CODE16offset++,0x9A); // CALLF function
// Make function external
idx = OmfObj_external(s); // use Pascal name mangling
// Output fixup for function
OmfObj_ledata(obj.code16segi,obj.CODE16offset,0,LOCATsegrel|LOC16pointer|FD_F2|FD_T6,
idx,idx);
obj.CODE16offset += 4;
OmfObj_bytes(obj.code16segi,obj.CODE16offset,3,cast(void*)"\x66\x67\xEA".ptr); // JMPF L2
obj.CODE16offset += 3;
OmfObj_ledata(obj.code16segi,obj.CODE16offset,L2offset,
LOCATsegrel | LOC32pointer | FD_F1 | FD_T4,
DGROUPIDX,
SegData[cseg].segidx);
obj.CODE16offset += 6;
SegData[obj.code16segi].SDoffset = obj.CODE16offset;
}
/**************************************
* Mark object file as using floating point.
*/
void OmfObj_fltused()
{
if (!obj.fltused)
{
obj.fltused = 1;
if (!(config.flags3 & CFG3wkfloat))
OmfObj_external_def("__fltused");
}
}
Symbol *OmfObj_tlv_bootstrap()
{
// specific for Mach-O
assert(0);
}
void OmfObj_gotref(Symbol *s)
{
}
/*****************************************
* write a reference to a mutable pointer into the object file
* Params:
* s = symbol that contains the pointer
* soff = offset of the pointer inside the Symbol's memory
*/
void OmfObj_write_pointerRef(Symbol* s, uint soff)
{
version (MARS)
{
// defer writing pointer references until the symbols are written out
obj.ptrrefs.push(PtrRef(s, soff));
}
}
/*****************************************
* flush a single pointer reference saved by write_pointerRef
* to the object file
* Params:
* s = symbol that contains the pointer
* soff = offset of the pointer inside the Symbol's memory
*/
private void objflush_pointerRef(Symbol* s, uint soff)
{
version (MARS)
{
bool isTls = (s.Sfl == FLtlsdata);
int* segi = isTls ? &obj.tlsrefsegi : &obj.datrefsegi;
symbol_debug(s);
if (*segi == 0)
{
// We need to always put out the segments in triples, so that the
// linker will put them in the correct order.
static immutable char[12] lnames_dat = "\03DPB\02DP\03DPE";
static immutable char[12] lnames_tls = "\03TPB\02TP\03TPE";
const lnames = isTls ? lnames_tls.ptr : lnames_dat.ptr;
// Put out LNAMES record
objrecord(LNAMES,lnames,lnames_dat.sizeof - 1);
int dsegattr = obj.csegattr;
// Put out beginning segment
objsegdef(dsegattr,0,obj.lnameidx,CODECLASS);
obj.lnameidx++;
obj.segidx++;
// Put out segment definition record
*segi = obj_newfarseg(0,CODECLASS);
objsegdef(dsegattr,0,obj.lnameidx,CODECLASS);
SegData[*segi].attr = dsegattr;
assert(SegData[*segi].segidx == obj.segidx);
// Put out ending segment
objsegdef(dsegattr,0,obj.lnameidx + 1,CODECLASS);
obj.lnameidx += 2; // for next time
obj.segidx += 2;
}
targ_size_t offset = SegData[*segi].SDoffset;
offset += objmod.reftoident(*segi, offset, s, soff, CFoff);
SegData[*segi].SDoffset = offset;
}
}
/*****************************************
* flush all pointer references saved by write_pointerRef
* to the object file
*/
private void objflush_pointerRefs()
{
version (MARS)
{
foreach (ref pr; obj.ptrrefs)
objflush_pointerRef(pr.sym, pr.offset);
obj.ptrrefs.reset();
}
}
}
|
D
|
#! /usr/bin/env rdmd
void main() {
import std.regex : regex, matchFirst, ctRegex;
import std.exception : assumeUnique;
import std.algorithm : min, sort;
import std.stdio : writefln, File;
ulong[string] senders;
foreach (line; File("exim_mainlog").byLine) {
if (auto m = line.matchFirst(ctRegex!(`^(?:\S+ ){3,4}<= ([^ @]+@(\S+))`))) {
if (ulong* count = m[1].assumeUnique in senders) {
count[0]++;
} else {
senders[m[1].idup] = 1;
}
}
}
foreach (email; senders.keys.sort!((a, b) => senders[a] > senders[b])[0 .. min($, 5)]) {
writefln!"%5s %s"(senders[email], email);
}
}
|
D
|
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_All_MobileMedia-1128948878.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_All_MobileMedia-1128948878.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
/**
Contains routines for high level path handling.
Copyright: © 2012 RejectedSoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module vibe.inet.path;
import std.algorithm : canFind, min;
import std.array;
import std.conv;
import std.exception;
import std.string;
/**
Represents an absolute or relative file system path.
This struct allows to do safe operations on paths, such as concatenation and sub paths. Checks
are done to disallow invalid operations such as concatenating two absolute paths. It also
validates path strings and allows for easy checking of malicious relative paths.
*/
struct Path {
private {
immutable(PathEntry)[] m_nodes;
bool m_absolute = false;
bool m_endsWithSlash = false;
}
/// Constructs a Path object by parsing a path string.
this(string pathstr)
{
m_nodes = cast(immutable)splitPath(pathstr);
m_absolute = (pathstr.startsWith("/") || m_nodes.length > 0 && m_nodes[0].toString().indexOf(':')>0);
m_endsWithSlash = pathstr.endsWith("/");
foreach( e; m_nodes ) assert(e.toString().length > 0, "Empty path nodes not allowed: "~pathstr);
}
/// Constructs a path object from a list of PathEntry objects.
this(immutable(PathEntry)[] nodes, bool absolute)
{
m_nodes = nodes;
m_absolute = absolute;
}
/// Constructs a relative path with one path entry.
this(PathEntry entry){
m_nodes = [entry];
m_absolute = false;
}
/// Determines if the path is absolute.
@property bool absolute() const { return m_absolute; }
/// Resolves all '.' and '..' path entries as far as possible.
void normalize()
{
immutable(PathEntry)[] newnodes;
foreach( n; m_nodes ){
switch(n.toString()){
default:
newnodes ~= n;
break;
case ".": break;
case "..":
enforce(!m_absolute || newnodes.length > 0, "Path goes below root node.");
if( newnodes.length > 0 && newnodes[$-1] != ".." ) newnodes = newnodes[0 .. $-1];
else newnodes ~= n;
break;
}
}
m_nodes = newnodes;
}
/// Converts the Path back to a string representation using slashes.
string toString()
const {
if( m_nodes.empty ) return absolute ? "/" : "";
Appender!string ret;
// for absolute paths start with /
if( absolute ) ret.put('/');
foreach( i, f; m_nodes ){
if( i > 0 ) ret.put('/');
ret.put(f.toString());
}
if( m_nodes.length > 0 && m_endsWithSlash )
ret.put('/');
return ret.data;
}
/// Converts the Path object to a native path string (backslash as path separator on Windows).
string toNativeString()
const {
Appender!string ret;
// for absolute unix paths start with /
version(Posix) { if(absolute) ret.put('/'); }
foreach( i, f; m_nodes ){
version(Windows) { if( i > 0 ) ret.put('\\'); }
version(Posix) { if( i > 0 ) ret.put('/'); }
else { enforce("Unsupported OS"); }
ret.put(f.toString());
}
if( m_nodes.length > 0 && m_endsWithSlash ){
version(Windows) { ret.put('\\'); }
version(Posix) { ret.put('/'); }
}
return ret.data;
}
/// Tests if `rhs` is an anchestor or the same as this path.
bool startsWith(const Path rhs) const {
if( rhs.m_nodes.length > m_nodes.length ) return false;
foreach( i; 0 .. rhs.m_nodes.length )
if( m_nodes[i] != rhs.m_nodes[i] )
return false;
return true;
}
/// Computes the relative path from `parentPath` to this path.
Path relativeTo(const Path parentPath) const {
int nup = 0;
while( parentPath.length > nup && !startsWith(parentPath[0 .. parentPath.length-nup]) ){
nup++;
}
Path ret = Path(null, false);
ret.m_endsWithSlash = true;
foreach( i; 0 .. nup ) ret ~= "..";
ret ~= Path(m_nodes[parentPath.length-nup .. $], false);
return ret;
}
/// The last entry of the path
@property ref immutable(PathEntry) head() const { enforce(m_nodes.length > 0); return m_nodes[$-1]; }
/// The parent path
@property Path parentPath() const { return this[0 .. length-1]; }
/// The ist of path entries of which this path is composed
@property immutable(PathEntry)[] nodes() const { return m_nodes; }
/// The number of path entries of which this path is composed
@property size_t length() const { return m_nodes.length; }
/// True if the path contains no entries
@property bool empty() const { return m_nodes.length == 0; }
/// Determines if the path ends with a slash (i.e. is a directory)
@property bool endsWithSlash() const { return m_endsWithSlash; }
/// ditto
@property void endsWithSlash(bool v) { m_endsWithSlash = v; }
/// Determines if this path goes outside of its base path (i.e. begins with '..').
@property bool external() const { return !m_absolute && m_nodes.length > 0 && m_nodes[0].m_name == ".."; }
ref immutable(PathEntry) opIndex(size_t idx) const { return m_nodes[idx]; }
Path opSlice(size_t start, size_t end) const {
auto ret = Path(m_nodes[start .. end], start == 0 ? absolute : false);
if( end == m_nodes.length ) ret.m_endsWithSlash = m_endsWithSlash;
return ret;
}
size_t opDollar(int dim)() const if(dim == 0) { return m_nodes.length; }
Path opBinary(string OP)(const Path rhs) const if( OP == "~" ) {
Path ret;
ret.m_nodes = m_nodes;
ret.m_absolute = m_absolute;
ret.m_endsWithSlash = rhs.m_endsWithSlash;
ret.normalize(); // needed to avoid "."~".." become "" instead of ".."
assert(!rhs.absolute, "Trying to append absolute path.");
size_t idx = m_nodes.length;
foreach(folder; rhs.m_nodes){
switch(folder.toString()){
default: ret.m_nodes = ret.m_nodes ~ folder; break;
case ".": break;
case "..":
enforce(!ret.absolute || ret.m_nodes.length > 0, "Relative path goes below root node!");
if( ret.m_nodes.length > 0 && ret.m_nodes[$-1].toString() != ".." )
ret.m_nodes = ret.m_nodes[0 .. $-1];
else ret.m_nodes = ret.m_nodes ~ folder;
break;
}
}
return ret;
}
Path opBinary(string OP)(string rhs) const if( OP == "~" ) { return opBinary!"~"(Path(rhs)); }
Path opBinary(string OP)(PathEntry rhs) const if( OP == "~" ) { return opBinary!"~"(Path(rhs)); }
void opOpAssign(string OP)(string rhs) if( OP == "~" ) { opOpAssign!"~"(Path(rhs)); }
void opOpAssign(string OP)(PathEntry rhs) if( OP == "~" ) { opOpAssign!"~"(Path(rhs)); }
void opOpAssign(string OP)(Path rhs) if( OP == "~" ) { auto p = this ~ rhs; m_nodes = p.m_nodes; m_endsWithSlash = rhs.m_endsWithSlash; }
/// Tests two paths for equality using '=='.
bool opEquals(ref const Path rhs) const {
if( m_absolute != rhs.m_absolute ) return false;
if( m_endsWithSlash != rhs.m_endsWithSlash ) return false;
if( m_nodes.length != rhs.length ) return false;
foreach( i; 0 .. m_nodes.length )
if( m_nodes[i] != rhs.m_nodes[i] )
return false;
return true;
}
/// ditto
bool opEquals(const Path other) const { return opEquals(other); }
int opCmp(ref const Path rhs) const {
if( m_absolute != rhs.m_absolute ) return cast(int)m_absolute - cast(int)rhs.m_absolute;
foreach( i; 0 .. min(m_nodes.length, rhs.m_nodes.length) )
if( m_nodes[i] != rhs.m_nodes[i] )
return m_nodes[i].opCmp(rhs.m_nodes[i]);
if( m_nodes.length > rhs.m_nodes.length ) return 1;
if( m_nodes.length < rhs.m_nodes.length ) return -1;
return 0;
}
}
struct PathEntry {
private {
string m_name;
}
this(string str)
{
assert(!str.canFind('/') && !str.canFind('\\'));
m_name = str;
}
string toString() const { return m_name; }
Path opBinary(string OP)(PathEntry rhs) const if( OP == "~" ) { return Path(cast(immutable)[this, rhs], false); }
bool opEquals(ref const PathEntry rhs) const { return m_name == rhs.m_name; }
bool opEquals(PathEntry rhs) const { return m_name == rhs.m_name; }
bool opEquals(string rhs) const { return m_name == rhs; }
int opCmp(ref const PathEntry rhs) const { return m_name.cmp(rhs.m_name); }
int opCmp(string rhs) const { return m_name.cmp(rhs); }
}
private bool isValidFilename(string str)
{
foreach( ch; str )
if( ch == '/' || /*ch == ':' ||*/ ch == '\\' ) return false;
return true;
}
/// Joins two path strings. subpath must be relative.
string joinPath(string basepath, string subpath)
{
Path p1 = Path(basepath);
Path p2 = Path(subpath);
return (p1 ~ p2).toString();
}
/// Splits up a path string into its elements/folders
PathEntry[] splitPath(string path)
{
if( path.startsWith("/") || path.startsWith("\\") ) path = path[1 .. $];
if( path.empty ) return null;
if( path.endsWith("/") || path.endsWith("\\") ) path = path[0 .. $-1];
// count the number of path nodes
size_t nelements = 0;
foreach( i, char ch; path )
if( ch == '\\' || ch == '/' )
nelements++;
nelements++;
// reserve space for the elements
PathEntry[] storage;
/*if (alloc) {
auto mem = alloc.alloc(nelements * PathEntry.sizeof);
mem[] = 0;
storage = cast(PathEntry[])mem;
} else*/ storage = new PathEntry[nelements];
// read and return the elements
size_t startidx = 0;
size_t eidx = 0;
foreach( i, char ch; path )
if( ch == '\\' || ch == '/' ){
enforce(i - startidx > 0, "Empty path entries not allowed.");
storage[eidx++] = PathEntry(path[startidx .. i]);
startidx = i+1;
}
storage[eidx++] = PathEntry(path[startidx .. $]);
enforce(path.length - startidx > 0, "Empty path entries not allowed.");
assert(eidx == nelements);
return storage;
}
|
D
|
/home/orange/projects/rosthem/rosthem-dto/target/debug/build/serde_derive-675cfff16792b56c/build_script_build-675cfff16792b56c: /home/orange/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.130/build.rs
/home/orange/projects/rosthem/rosthem-dto/target/debug/build/serde_derive-675cfff16792b56c/build_script_build-675cfff16792b56c.d: /home/orange/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.130/build.rs
/home/orange/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.130/build.rs:
|
D
|
module gl3n.aabb;
private {
import gl3n.linalg : Vector, vec3;
import gl3n.math : almost_equal;
}
/// Base template for all AABB-types.
/// Params:
/// type = all values get stored as this type
struct AABBT(type) {
alias type at; /// Holds the internal type of the AABB.
alias Vector!(at, 3) vec3; /// Convenience alias to the corresponding vector type.
vec3 min = vec3(0.0f, 0.0f, 0.0f); /// The minimum of the AABB (e.g. vec3(0, 0, 0)).
vec3 max = vec3(0.0f, 0.0f, 0.0f); /// The maximum of the AABB (e.g. vec3(1, 1, 1)).
@safe pure nothrow:
/// Constructs the AABB.
/// Params:
/// min = minimum of the AABB
/// max = maximum of the AABB
this(vec3 min, vec3 max) {
this.min = min;
this.max = max;
}
/// Constructs the AABB around N points (all points will be part of the AABB).
static AABBT from_points(vec3[] points) {
AABBT res;
if(points.length == 0) {
return res;
}
res.min = points[0];
res.max = points[0];
foreach(v; points[1..$]) {
res.expand(v);
}
return res;
}
unittest {
AABB a = AABB(vec3(0.0f, 1.0f, 2.0f), vec3(1.0f, 2.0f, 3.0f));
assert(a.min == vec3(0.0f, 1.0f, 2.0f));
assert(a.max == vec3(1.0f, 2.0f, 3.0f));
a = AABB.from_points([vec3(0.0f, 0.0f, 0.0f), vec3(-1.0f, 2.0f, 3.0f), vec3(0.0f, 0.0f, 4.0f)]);
assert(a.min == vec3(-1.0f, 0.0f, 0.0f));
assert(a.max == vec3(0.0f, 2.0f, 4.0f));
a = AABB.from_points([vec3(1.0f, 1.0f, 1.0f), vec3(2.0f, 2.0f, 2.0f)]);
assert(a.min == vec3(1.0f, 1.0f, 1.0f));
assert(a.max == vec3(2.0f, 2.0f, 2.0f));
}
/// Expands the AABB by another AABB.
void expand(AABBT b) {
if (min.x > b.min.x) min.x = b.min.x;
if (min.y > b.min.y) min.y = b.min.y;
if (min.z > b.min.z) min.z = b.min.z;
if (max.x < b.max.x) max.x = b.max.x;
if (max.y < b.max.y) max.y = b.max.y;
if (max.z < b.max.z) max.z = b.max.z;
}
/// Expands the AABB, so that $(I v) is part of the AABB.
void expand(vec3 v) {
if (v.x > max.x) max.x = v.x;
if (v.y > max.y) max.y = v.y;
if (v.z > max.z) max.z = v.z;
if (v.x < min.x) min.x = v.x;
if (v.y < min.y) min.y = v.y;
if (v.z < min.z) min.z = v.z;
}
unittest {
AABB a = AABB(vec3(0.0f, 0.0f, 0.0f), vec3(1.0f, 4.0f, 1.0f));
AABB b = AABB(vec3(2.0f, -1.0f, 2.0f), vec3(3.0f, 3.0f, 3.0f));
AABB c;
c.expand(a);
c.expand(b);
assert(c.min == vec3(0.0f, -1.0f, 0.0f));
assert(c.max == vec3(3.0f, 4.0f, 3.0f));
c.expand(vec3(12.0f, -12.0f, 0.0f));
assert(c.min == vec3(0.0f, -12.0f, 0.0f));
assert(c.max == vec3(12.0f, 4.0f, 3.0f));
}
/// Returns true if the AABBs intersect.
/// This also returns true if one AABB lies inside another.
bool intersects(AABBT box) const {
return (min.x < box.max.x && max.x > box.min.x) &&
(min.y < box.max.y && max.y > box.min.y) &&
(min.z < box.max.z && max.z > box.min.z);
}
unittest {
assert(AABB(vec3(0.0f, 0.0f, 0.0f), vec3(1.0f, 1.0f, 1.0f)).intersects(
AABB(vec3(0.5f, 0.5f, 0.5f), vec3(3.0f, 3.0f, 3.0f))));
assert(AABB(vec3(0.0f, 0.0f, 0.0f), vec3(1.0f, 1.0f, 1.0f)).intersects(
AABB(vec3(0.5f, 0.5f, 0.5f), vec3(0.7f, 0.7f, 0.7f))));
assert(!AABB(vec3(0.0f, 0.0f, 0.0f), vec3(1.0f, 1.0f, 1.0f)).intersects(
AABB(vec3(1.5f, 1.5f, 1.5f), vec3(3.0f, 3.0f, 3.0f))));
}
/// Returns the extent of the AABB (also sometimes called size).
@property vec3 extent() const {
return max - min;
}
/// Returns the half extent.
@property vec3 half_extent() const {
return 0.5 * (max - min);
}
unittest {
AABB a = AABB(vec3(0.0f, 0.0f, 0.0f), vec3(1.0f, 1.0f, 1.0f));
assert(a.extent == vec3(1.0f, 1.0f, 1.0f));
assert(a.half_extent == 0.5 * a.extent);
AABB b = AABB(vec3(0.2f, 0.2f, 0.2f), vec3(1.0f, 1.0f, 1.0f));
assert(b.extent == vec3(0.8f, 0.8f, 0.8f));
assert(b.half_extent == 0.5 * b.extent);
}
/// Returns the area of the AABB.
@property at area() const {
vec3 e = extent;
return 2.0 * (e.x * e.y + e.x * e.z + e.y * e.z);
}
unittest {
AABB a = AABB(vec3(0.0f, 0.0f, 0.0f), vec3(1.0f, 1.0f, 1.0f));
assert(a.area == 6);
AABB b = AABB(vec3(0.2f, 0.2f, 0.2f), vec3(1.0f, 1.0f, 1.0f));
assert(almost_equal(b.area, 3.84f));
AABB c = AABB(vec3(0.2f, 0.4f, 0.6f), vec3(1.0f, 1.0f, 1.0f));
assert(almost_equal(c.area, 2.08f));
}
/// Returns the center of the AABB.
@property vec3 center() const {
return 0.5 * (max + min);
}
unittest {
AABB a = AABB(vec3(0.5f, 0.5f, 0.5f), vec3(1.0f, 1.0f, 1.0f));
assert(a.center == vec3(0.75f, 0.75f, 0.75f));
}
/// Returns all vertices of the AABB, basically one vec3 per corner.
@property vec3[] vertices() const {
return [
vec3(min.x, min.y, min.z),
vec3(min.x, min.y, max.z),
vec3(min.x, max.y, min.z),
vec3(min.x, max.y, max.z),
vec3(max.x, min.y, min.z),
vec3(max.x, min.y, max.z),
vec3(max.x, max.y, min.z),
vec3(max.x, max.y, max.z),
];
}
bool opEquals(AABBT other) const {
return other.min == min && other.max == max;
}
unittest {
assert(AABB(vec3(1.0f, 12.0f, 14.0f), vec3(33.0f, 222.0f, 342.0f)) ==
AABB(vec3(1.0f, 12.0f, 14.0f), vec3(33.0f, 222.0f, 342.0f)));
}
}
alias AABBT!(float) AABB;
|
D
|
/Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.build/Codec.swift.o : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.build/Codec~partial.swiftmodule : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.build/Codec~partial.swiftdoc : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
|
D
|
/Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/WeatherTestWork.build/Debug-iphonesimulator/WeatherTestWork.build/Objects-normal/x86_64/DescriptionViewController.o : /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PresistentStore.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/SceneDelegate.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/AppDelegate.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PlaceDataModel.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CellWeather.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/ViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PlaceViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/DescriptionViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CitySelectViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CityViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/Place+CoreDataProperties.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/Place+CoreDataClass.swift /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/MapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanorama.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaCamera.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaService.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaSource.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCircle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSStrokeStyle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapStyle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolyline.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GoogleMapsBase.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCameraUpdate.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaCameraUpdate.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorBuilding.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPath.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMutablePath.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaLink.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorLevel.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSStyleSpan.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolygon.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapView+Animation.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOrientation.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSProjection.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCameraPosition.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGeocoder.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMarker.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCALayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSURLTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSSyncTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolygonLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMarkerLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOverlayLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSCoordinateBounds.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSServices.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSUISettings.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSAccessibilityLabels.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGeometryUtils.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSDeprecationMacros.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSCompatabilityMacros.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCoordinateBounds+GoogleMaps.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GoogleMaps.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSAddress.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaView.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapView.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorDisplay.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOverlay.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGroundOverlay.h /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/dyld.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/objc/ObjectiveC.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/Darwin.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/WeatherTestWork.build/Debug-iphonesimulator/WeatherTestWork.build/Objects-normal/x86_64/DescriptionViewController~partial.swiftmodule : /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PresistentStore.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/SceneDelegate.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/AppDelegate.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PlaceDataModel.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CellWeather.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/ViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PlaceViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/DescriptionViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CitySelectViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CityViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/Place+CoreDataProperties.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/Place+CoreDataClass.swift /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/MapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanorama.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaCamera.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaService.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaSource.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCircle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSStrokeStyle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapStyle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolyline.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GoogleMapsBase.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCameraUpdate.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaCameraUpdate.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorBuilding.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPath.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMutablePath.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaLink.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorLevel.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSStyleSpan.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolygon.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapView+Animation.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOrientation.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSProjection.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCameraPosition.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGeocoder.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMarker.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCALayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSURLTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSSyncTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolygonLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMarkerLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOverlayLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSCoordinateBounds.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSServices.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSUISettings.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSAccessibilityLabels.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGeometryUtils.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSDeprecationMacros.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSCompatabilityMacros.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCoordinateBounds+GoogleMaps.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GoogleMaps.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSAddress.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaView.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapView.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorDisplay.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOverlay.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGroundOverlay.h /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/dyld.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/objc/ObjectiveC.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/Darwin.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/WeatherTestWork.build/Debug-iphonesimulator/WeatherTestWork.build/Objects-normal/x86_64/DescriptionViewController~partial.swiftdoc : /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PresistentStore.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/SceneDelegate.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/AppDelegate.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PlaceDataModel.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CellWeather.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/ViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PlaceViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/DescriptionViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CitySelectViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CityViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/Place+CoreDataProperties.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/Place+CoreDataClass.swift /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/MapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanorama.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaCamera.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaService.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaSource.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCircle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSStrokeStyle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapStyle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolyline.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GoogleMapsBase.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCameraUpdate.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaCameraUpdate.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorBuilding.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPath.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMutablePath.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaLink.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorLevel.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSStyleSpan.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolygon.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapView+Animation.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOrientation.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSProjection.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCameraPosition.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGeocoder.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMarker.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCALayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSURLTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSSyncTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolygonLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMarkerLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOverlayLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSCoordinateBounds.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSServices.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSUISettings.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSAccessibilityLabels.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGeometryUtils.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSDeprecationMacros.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSCompatabilityMacros.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCoordinateBounds+GoogleMaps.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GoogleMaps.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSAddress.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaView.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapView.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorDisplay.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOverlay.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGroundOverlay.h /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/dyld.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/objc/ObjectiveC.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/Darwin.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/WeatherTestWork.build/Debug-iphonesimulator/WeatherTestWork.build/Objects-normal/x86_64/DescriptionViewController~partial.swiftsourceinfo : /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PresistentStore.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/SceneDelegate.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/AppDelegate.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PlaceDataModel.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CellWeather.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/ViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/PlaceViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/DescriptionViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CitySelectViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/CityViewController.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/Place+CoreDataProperties.swift /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/WeatherTestWork/Place+CoreDataClass.swift /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/MapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanorama.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaCamera.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaService.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaSource.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCircle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSStrokeStyle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapStyle.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolyline.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GoogleMapsBase.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCameraUpdate.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaCameraUpdate.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorBuilding.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPath.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMutablePath.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaLink.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorLevel.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSStyleSpan.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolygon.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapView+Animation.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOrientation.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSProjection.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCameraPosition.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGeocoder.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMarker.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCALayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSURLTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSSyncTileLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPolygonLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMarkerLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOverlayLayer.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSCoordinateBounds.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSServices.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSUISettings.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSAccessibilityLabels.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGeometryUtils.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSDeprecationMacros.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Headers/GMSCompatabilityMacros.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSCoordinateBounds+GoogleMaps.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GoogleMaps.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSAddress.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSPanoramaView.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSMapView.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSIndoorDisplay.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSOverlay.h /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Headers/GMSGroundOverlay.h /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/dyld.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Projects/WeatherTestWork/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Modules/module.modulemap /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/objc/ObjectiveC.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/Darwin.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/dmitrijzuckov/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module rx.algorithm;
public import rx.algorithm.iteration;
public import rx.algorithm.timer;
|
D
|
module common.utils;
public:
import common.utils.array_utils;
import common.utils.asm_utils;
import common.utils.async_utils;
import common.utils.cpu_utils;
import common.utils.map_utils;
import common.utils.range_utils;
import common.utils.regex_utils;
import common.utils.static_utils;
import common.utils.string_utils;
import common.utils.timing;
import common.utils.tl_utils;
import common.utils.utilities;
|
D
|
import std.stdio;
void main()
{
int number;
while (number >= 0) {
write("Please enter a number: ");
readf(" %s", &number);
if (number == 13) {
writeln("Sorry, not accepting that one...");
continue;
}
writeln("Thank you for ", number);
}
writeln("Exited the loop");
}
|
D
|
/**
* D header file for GNU/Linux
*
* $(LINK2 http://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h, glibc elf/elf.h)
*/
module core.sys.linux.elf;
version (linux):
extern (C):
pure:
nothrow:
import core.stdc.stdint;
alias uint16_t Elf32_Half;
alias uint16_t Elf64_Half;
alias uint32_t Elf32_Word;
alias int32_t Elf32_Sword;
alias uint32_t Elf64_Word;
alias int32_t Elf64_Sword;
alias uint64_t Elf32_Xword;
alias int64_t Elf32_Sxword;
alias uint64_t Elf64_Xword;
alias int64_t Elf64_Sxword;
alias uint32_t Elf32_Addr;
alias uint64_t Elf64_Addr;
alias uint32_t Elf32_Off;
alias uint64_t Elf64_Off;
alias uint16_t Elf32_Section;
alias uint16_t Elf64_Section;
alias Elf32_Half Elf32_Versym;
alias Elf64_Half Elf64_Versym;
enum EI_NIDENT = 16;
struct Elf32_Ehdr
{
char[EI_NIDENT] e_ident;
Elf32_Half e_type;
Elf32_Half e_machine;
Elf32_Word e_version;
Elf32_Addr e_entry;
Elf32_Off e_phoff;
Elf32_Off e_shoff;
Elf32_Word e_flags;
Elf32_Half e_ehsize;
Elf32_Half e_phentsize;
Elf32_Half e_phnum;
Elf32_Half e_shentsize;
Elf32_Half e_shnum;
Elf32_Half e_shstrndx;
}
struct Elf64_Ehdr
{
char[EI_NIDENT] e_ident;
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry;
Elf64_Off e_phoff;
Elf64_Off e_shoff;
Elf64_Word e_flags;
Elf64_Half e_ehsize;
Elf64_Half e_phentsize;
Elf64_Half e_phnum;
Elf64_Half e_shentsize;
Elf64_Half e_shnum;
Elf64_Half e_shstrndx;
}
enum EI_MAG0 = 0;
enum ELFMAG0 = 0x7f;
enum EI_MAG1 = 1;
enum ELFMAG1 = 'E';
enum EI_MAG2 = 2;
enum ELFMAG2 = 'L';
enum EI_MAG3 = 3;
enum ELFMAG3 = 'F';
enum ELFMAG = "\177ELF";
enum SELFMAG = 4;
enum EI_CLASS = 4;
enum ELFCLASSNONE = 0;
enum ELFCLASS32 = 1;
enum ELFCLASS64 = 2;
enum ELFCLASSNUM = 3;
enum EI_DATA = 5;
enum ELFDATANONE = 0;
enum ELFDATA2LSB = 1;
enum ELFDATA2MSB = 2;
enum ELFDATANUM = 3;
enum EI_VERSION = 6;
enum EI_OSABI = 7;
enum ELFOSABI_NONE = 0;
enum ELFOSABI_SYSV = 0;
enum ELFOSABI_HPUX = 1;
enum ELFOSABI_NETBSD = 2;
enum ELFOSABI_GNU = 3;
enum ELFOSABI_LINUX = ELFOSABI_GNU;
enum ELFOSABI_SOLARIS = 6;
enum ELFOSABI_AIX = 7;
enum ELFOSABI_IRIX = 8;
enum ELFOSABI_FREEBSD = 9;
enum ELFOSABI_TRU64 = 10;
enum ELFOSABI_MODESTO = 11;
enum ELFOSABI_OPENBSD = 12;
enum ELFOSABI_ARM_AEABI = 64;
enum ELFOSABI_ARM = 97;
enum ELFOSABI_STANDALONE = 255;
enum ELFOSABI_DRAGONFLYBSD = ELFOSABI_NONE;
enum EI_ABIVERSION = 8;
enum EI_PAD = 9;
enum ET_NONE = 0;
enum ET_REL = 1;
enum ET_EXEC = 2;
enum ET_DYN = 3;
enum ET_CORE = 4;
enum ET_NUM = 5;
enum ET_LOOS = 0xfe00;
enum ET_HIOS = 0xfeff;
enum ET_LOPROC = 0xff00;
enum ET_HIPROC = 0xffff;
enum EM_NONE = 0;
enum EM_M32 = 1;
enum EM_SPARC = 2;
enum EM_386 = 3;
enum EM_68K = 4;
enum EM_88K = 5;
enum EM_860 = 7;
enum EM_MIPS = 8;
enum EM_S370 = 9;
enum EM_MIPS_RS3_LE = 10;
enum EM_PARISC = 15;
enum EM_VPP500 = 17;
enum EM_SPARC32PLUS = 18;
enum EM_960 = 19;
enum EM_PPC = 20;
enum EM_PPC64 = 21;
enum EM_S390 = 22;
enum EM_V800 = 36;
enum EM_FR20 = 37;
enum EM_RH32 = 38;
enum EM_RCE = 39;
enum EM_ARM = 40;
enum EM_FAKE_ALPHA = 41;
enum EM_SH = 42;
enum EM_SPARCV9 = 43;
enum EM_TRICORE = 44;
enum EM_ARC = 45;
enum EM_H8_300 = 46;
enum EM_H8_300H = 47;
enum EM_H8S = 48;
enum EM_H8_500 = 49;
enum EM_IA_64 = 50;
enum EM_MIPS_X = 51;
enum EM_COLDFIRE = 52;
enum EM_68HC12 = 53;
enum EM_MMA = 54;
enum EM_PCP = 55;
enum EM_NCPU = 56;
enum EM_NDR1 = 57;
enum EM_STARCORE = 58;
enum EM_ME16 = 59;
enum EM_ST100 = 60;
enum EM_TINYJ = 61;
enum EM_X86_64 = 62;
enum EM_PDSP = 63;
enum EM_FX66 = 66;
enum EM_ST9PLUS = 67;
enum EM_ST7 = 68;
enum EM_68HC16 = 69;
enum EM_68HC11 = 70;
enum EM_68HC08 = 71;
enum EM_68HC05 = 72;
enum EM_SVX = 73;
enum EM_ST19 = 74;
enum EM_VAX = 75;
enum EM_CRIS = 76;
enum EM_JAVELIN = 77;
enum EM_FIREPATH = 78;
enum EM_ZSP = 79;
enum EM_MMIX = 80;
enum EM_HUANY = 81;
enum EM_PRISM = 82;
enum EM_AVR = 83;
enum EM_FR30 = 84;
enum EM_D10V = 85;
enum EM_D30V = 86;
enum EM_V850 = 87;
enum EM_M32R = 88;
enum EM_MN10300 = 89;
enum EM_MN10200 = 90;
enum EM_PJ = 91;
enum EM_OPENRISC = 92;
enum EM_ARC_A5 = 93;
enum EM_XTENSA = 94;
enum EM_AARCH64 = 183;
enum EM_TILEPRO = 188;
enum EM_TILEGX = 191;
enum EM_NUM = 192;
enum EM_ALPHA = 0x9026;
enum EV_NONE = 0;
enum EV_CURRENT = 1;
enum EV_NUM = 2;
struct Elf32_Shdr
{
Elf32_Word sh_name;
Elf32_Word sh_type;
Elf32_Word sh_flags;
Elf32_Addr sh_addr;
Elf32_Off sh_offset;
Elf32_Word sh_size;
Elf32_Word sh_link;
Elf32_Word sh_info;
Elf32_Word sh_addralign;
Elf32_Word sh_entsize;
}
struct Elf64_Shdr
{
Elf64_Word sh_name;
Elf64_Word sh_type;
Elf64_Xword sh_flags;
Elf64_Addr sh_addr;
Elf64_Off sh_offset;
Elf64_Xword sh_size;
Elf64_Word sh_link;
Elf64_Word sh_info;
Elf64_Xword sh_addralign;
Elf64_Xword sh_entsize;
}
enum SHN_UNDEF = 0;
enum SHN_LORESERVE = 0xff00;
enum SHN_LOPROC = 0xff00;
enum SHN_BEFORE = 0xff00;
enum SHN_AFTER = 0xff01;
enum SHN_HIPROC = 0xff1f;
enum SHN_LOOS = 0xff20;
enum SHN_HIOS = 0xff3f;
enum SHN_ABS = 0xfff1;
enum SHN_COMMON = 0xfff2;
enum SHN_XINDEX = 0xffff;
enum SHN_HIRESERVE = 0xffff;
enum SHT_NULL = 0;
enum SHT_PROGBITS = 1;
enum SHT_SYMTAB = 2;
enum SHT_STRTAB = 3;
enum SHT_RELA = 4;
enum SHT_HASH = 5;
enum SHT_DYNAMIC = 6;
enum SHT_NOTE = 7;
enum SHT_NOBITS = 8;
enum SHT_REL = 9;
enum SHT_SHLIB = 10;
enum SHT_DYNSYM = 11;
enum SHT_INIT_ARRAY = 14;
enum SHT_FINI_ARRAY = 15;
enum SHT_PREINIT_ARRAY = 16;
enum SHT_GROUP = 17;
enum SHT_SYMTAB_SHNDX = 18;
enum SHT_NUM = 19;
enum SHT_LOOS = 0x60000000;
enum SHT_GNU_ATTRIBUTES = 0x6ffffff5;
enum SHT_GNU_HASH = 0x6ffffff6;
enum SHT_GNU_LIBLIST = 0x6ffffff7;
enum SHT_CHECKSUM = 0x6ffffff8;
enum SHT_LOSUNW = 0x6ffffffa;
enum SHT_SUNW_move = 0x6ffffffa;
enum SHT_SUNW_COMDAT = 0x6ffffffb;
enum SHT_SUNW_syminfo = 0x6ffffffc;
enum SHT_GNU_verdef = 0x6ffffffd;
enum SHT_GNU_verneed = 0x6ffffffe;
enum SHT_GNU_versym = 0x6fffffff;
enum SHT_HISUNW = 0x6fffffff;
enum SHT_HIOS = 0x6fffffff;
enum SHT_LOPROC = 0x70000000;
enum SHT_HIPROC = 0x7fffffff;
enum SHT_LOUSER = 0x80000000;
enum SHT_HIUSER = 0x8fffffff;
enum SHF_WRITE = (1 << 0);
enum SHF_ALLOC = (1 << 1);
enum SHF_EXECINSTR = (1 << 2);
enum SHF_MERGE = (1 << 4);
enum SHF_STRINGS = (1 << 5);
enum SHF_INFO_LINK = (1 << 6);
enum SHF_LINK_ORDER = (1 << 7);
enum SHF_OS_NONCONFORMING = (1 << 8);
enum SHF_GROUP = (1 << 9);
enum SHF_TLS = (1 << 10);
enum SHF_COMPRESSED = (1 << 11);
enum SHF_MASKOS = 0x0ff00000;
enum SHF_MASKPROC = 0xf0000000;
enum SHF_ORDERED = (1 << 30);
enum SHF_EXCLUDE = (1 << 31);
enum GRP_COMDAT = 0x1;
struct Elf32_Sym
{
Elf32_Word st_name;
Elf32_Addr st_value;
Elf32_Word st_size;
ubyte st_info;
ubyte st_other;
Elf32_Section st_shndx;
}
struct Elf64_Sym
{
Elf64_Word st_name;
ubyte st_info;
ubyte st_other;
Elf64_Section st_shndx;
Elf64_Addr st_value;
Elf64_Xword st_size;
}
struct Elf32_Syminfo
{
Elf32_Half si_boundto;
Elf32_Half si_flags;
}
struct Elf64_Syminfo
{
Elf64_Half si_boundto;
Elf64_Half si_flags;
}
enum SYMINFO_BT_SELF = 0xffff;
enum SYMINFO_BT_PARENT = 0xfffe;
enum SYMINFO_BT_LOWRESERVE = 0xff00;
enum SYMINFO_FLG_DIRECT = 0x0001;
enum SYMINFO_FLG_PASSTHRU = 0x0002;
enum SYMINFO_FLG_COPY = 0x0004;
enum SYMINFO_FLG_LAZYLOAD = 0x0008;
enum SYMINFO_NONE = 0;
enum SYMINFO_CURRENT = 1;
enum SYMINFO_NUM = 2;
extern (D)
{
auto ELF32_ST_BIND(T)(T val) { return cast(ubyte)val >> 4; }
auto ELF32_ST_TYPE(T)(T val) { return val & 0xf; }
auto ELF32_ST_INFO(B, T)(B bind, T type) { return (bind << 4) + (type & 0xf); }
alias ELF32_ST_BIND ELF64_ST_BIND;
alias ELF32_ST_TYPE ELF64_ST_TYPE;
alias ELF32_ST_INFO ELF64_ST_INFO;
}
enum STB_LOCAL = 0;
enum STB_GLOBAL = 1;
enum STB_WEAK = 2;
enum STB_NUM = 3;
enum STB_LOOS = 10;
enum STB_GNU_UNIQUE = 10;
enum STB_HIOS = 12;
enum STB_LOPROC = 13;
enum STB_HIPROC = 15;
enum STT_NOTYPE = 0;
enum STT_OBJECT = 1;
enum STT_FUNC = 2;
enum STT_SECTION = 3;
enum STT_FILE = 4;
enum STT_COMMON = 5;
enum STT_TLS = 6;
enum STT_NUM = 7;
enum STT_LOOS = 10;
enum STT_GNU_IFUNC = 10;
enum STT_HIOS = 12;
enum STT_LOPROC = 13;
enum STT_HIPROC = 15;
enum STN_UNDEF = 0;
extern (D)
{
auto ELF32_ST_VISIBILITY(O)(O o) { return o & 0x03; }
alias ELF32_ST_VISIBILITY ELF64_ST_VISIBILITY;
}
enum STV_DEFAULT = 0;
enum STV_INTERNAL = 1;
enum STV_HIDDEN = 2;
enum STV_PROTECTED = 3;
struct Elf32_Rel
{
Elf32_Addr r_offset;
Elf32_Word r_info;
}
struct Elf64_Rel
{
Elf64_Addr r_offset;
Elf64_Xword r_info;
}
struct Elf32_Rela
{
Elf32_Addr r_offset;
Elf32_Word r_info;
Elf32_Sword r_addend;
}
struct Elf64_Rela
{
Elf64_Addr r_offset;
Elf64_Xword r_info;
Elf64_Sxword r_addend;
}
extern (D)
{
auto ELF32_R_SYM(V)(V val) { return val >> 8; }
auto ELF32_R_TYPE(V)(V val) { return val & 0xff; }
auto ELF32_R_INFO(S, T)(S sym, T type) { return (sym << 8) + (type & 0xff); }
auto ELF64_R_SYM(I)(I i) { return i >> 32; }
auto ELF64_R_TYPE(I)(I i) { return i & 0xffffffff; }
auto ELF64_R_INFO(S, T)(S sym, T type) { return (sym << 32) + (type); }
}
struct Elf32_Phdr
{
Elf32_Word p_type;
Elf32_Off p_offset;
Elf32_Addr p_vaddr;
Elf32_Addr p_paddr;
Elf32_Word p_filesz;
Elf32_Word p_memsz;
Elf32_Word p_flags;
Elf32_Word p_align;
}
struct Elf64_Phdr
{
Elf64_Word p_type;
Elf64_Word p_flags;
Elf64_Off p_offset;
Elf64_Addr p_vaddr;
Elf64_Addr p_paddr;
Elf64_Xword p_filesz;
Elf64_Xword p_memsz;
Elf64_Xword p_align;
}
enum PN_XNUM = 0xffff;
enum PT_NULL = 0;
enum PT_LOAD = 1;
enum PT_DYNAMIC = 2;
enum PT_INTERP = 3;
enum PT_NOTE = 4;
enum PT_SHLIB = 5;
enum PT_PHDR = 6;
enum PT_TLS = 7;
enum PT_NUM = 8;
enum PT_LOOS = 0x60000000;
enum PT_GNU_EH_FRAME = 0x6474e550;
enum PT_GNU_STACK = 0x6474e551;
enum PT_GNU_RELRO = 0x6474e552;
enum PT_LOSUNW = 0x6ffffffa;
enum PT_SUNWBSS = 0x6ffffffa;
enum PT_SUNWSTACK = 0x6ffffffb;
enum PT_HISUNW = 0x6fffffff;
enum PT_HIOS = 0x6fffffff;
enum PT_LOPROC = 0x70000000;
enum PT_HIPROC = 0x7fffffff;
enum PF_X = (1 << 0);
enum PF_W = (1 << 1);
enum PF_R = (1 << 2);
enum PF_MASKOS = 0x0ff00000;
enum PF_MASKPROC = 0xf0000000;
enum NT_PRSTATUS = 1;
enum NT_FPREGSET = 2;
enum NT_PRPSINFO = 3;
enum NT_PRXREG = 4;
enum NT_TASKSTRUCT = 4;
enum NT_PLATFORM = 5;
enum NT_AUXV = 6;
enum NT_GWINDOWS = 7;
enum NT_ASRS = 8;
enum NT_PSTATUS = 10;
enum NT_PSINFO = 13;
enum NT_PRCRED = 14;
enum NT_UTSNAME = 15;
enum NT_LWPSTATUS = 16;
enum NT_LWPSINFO = 17;
enum NT_PRFPXREG = 20;
enum NT_SIGINFO = 0x53494749;
enum NT_FILE = 0x46494c45;
enum NT_PRXFPREG = 0x46e62b7f;
enum NT_PPC_VMX = 0x100;
enum NT_PPC_SPE = 0x101;
enum NT_PPC_VSX = 0x102;
enum NT_386_TLS = 0x200;
enum NT_386_IOPERM = 0x201;
enum NT_X86_XSTATE = 0x202;
enum NT_S390_HIGH_GPRS = 0x300;
enum NT_S390_TIMER = 0x301;
enum NT_S390_TODCMP = 0x302;
enum NT_S390_TODPREG = 0x303;
enum NT_S390_CTRS = 0x304;
enum NT_S390_PREFIX = 0x305;
enum NT_S390_LAST_BREAK = 0x306;
enum NT_S390_SYSTEM_CALL = 0x307;
enum NT_S390_TDB = 0x308;
enum NT_ARM_VFP = 0x400;
enum NT_ARM_TLS = 0x401;
enum NT_ARM_HW_BREAK = 0x402;
enum NT_ARM_HW_WATCH = 0x403;
enum NT_VERSION = 1;
struct Elf32_Dyn
{
Elf32_Sword d_tag;
union _d_un
{
Elf32_Word d_val;
Elf32_Addr d_ptr;
} _d_un d_un;
}
struct Elf64_Dyn
{
Elf64_Sxword d_tag;
union _d_un
{
Elf64_Xword d_val;
Elf64_Addr d_ptr;
} _d_un d_un;
}
enum DT_NULL = 0;
enum DT_NEEDED = 1;
enum DT_PLTRELSZ = 2;
enum DT_PLTGOT = 3;
enum DT_HASH = 4;
enum DT_STRTAB = 5;
enum DT_SYMTAB = 6;
enum DT_RELA = 7;
enum DT_RELASZ = 8;
enum DT_RELAENT = 9;
enum DT_STRSZ = 10;
enum DT_SYMENT = 11;
enum DT_INIT = 12;
enum DT_FINI = 13;
enum DT_SONAME = 14;
enum DT_RPATH = 15;
enum DT_SYMBOLIC = 16;
enum DT_REL = 17;
enum DT_RELSZ = 18;
enum DT_RELENT = 19;
enum DT_PLTREL = 20;
enum DT_DEBUG = 21;
enum DT_TEXTREL = 22;
enum DT_JMPREL = 23;
enum DT_BIND_NOW = 24;
enum DT_INIT_ARRAY = 25;
enum DT_FINI_ARRAY = 26;
enum DT_INIT_ARRAYSZ = 27;
enum DT_FINI_ARRAYSZ = 28;
enum DT_RUNPATH = 29;
enum DT_FLAGS = 30;
enum DT_ENCODING = 32;
enum DT_PREINIT_ARRAY = 32;
enum DT_PREINIT_ARRAYSZ = 33;
enum DT_NUM = 34;
enum DT_LOOS = 0x6000000d;
enum DT_HIOS = 0x6ffff000;
enum DT_LOPROC = 0x70000000;
enum DT_HIPROC = 0x7fffffff;
enum DT_PROCNUM = DT_MIPS_NUM;
enum DT_VALRNGLO = 0x6ffffd00;
enum DT_GNU_PRELINKED = 0x6ffffdf5;
enum DT_GNU_CONFLICTSZ = 0x6ffffdf6;
enum DT_GNU_LIBLISTSZ = 0x6ffffdf7;
enum DT_CHECKSUM = 0x6ffffdf8;
enum DT_PLTPADSZ = 0x6ffffdf9;
enum DT_MOVEENT = 0x6ffffdfa;
enum DT_MOVESZ = 0x6ffffdfb;
enum DT_FEATURE_1 = 0x6ffffdfc;
enum DT_POSFLAG_1 = 0x6ffffdfd;
enum DT_SYMINSZ = 0x6ffffdfe;
enum DT_SYMINENT = 0x6ffffdff;
enum DT_VALRNGHI = 0x6ffffdff;
extern (D) auto DT_VALTAGIDX(T)(T tag)
{
return DT_VALRNGHI - tag;
}
enum DT_VALNUM = 12;
enum DT_ADDRRNGLO = 0x6ffffe00;
enum DT_GNU_HASH = 0x6ffffef5;
enum DT_TLSDESC_PLT = 0x6ffffef6;
enum DT_TLSDESC_GOT = 0x6ffffef7;
enum DT_GNU_CONFLICT = 0x6ffffef8;
enum DT_GNU_LIBLIST = 0x6ffffef9;
enum DT_CONFIG = 0x6ffffefa;
enum DT_DEPAUDIT = 0x6ffffefb;
enum DT_AUDIT = 0x6ffffefc;
enum DT_PLTPAD = 0x6ffffefd;
enum DT_MOVETAB = 0x6ffffefe;
enum DT_SYMINFO = 0x6ffffeff;
enum DT_ADDRRNGHI = 0x6ffffeff;
extern (D) auto DT_ADDRTAGIDX(T)(T tag)
{
return DT_ADDRRNGHI - tag;
}
enum DT_ADDRNUM = 11;
enum DT_VERSYM = 0x6ffffff0;
enum DT_RELACOUNT = 0x6ffffff9;
enum DT_RELCOUNT = 0x6ffffffa;
enum DT_FLAGS_1 = 0x6ffffffb;
enum DT_VERDEF = 0x6ffffffc;
enum DT_VERDEFNUM = 0x6ffffffd;
enum DT_VERNEED = 0x6ffffffe;
enum DT_VERNEEDNUM = 0x6fffffff;
extern (D) auto DT_VERSIONTAGIDX(T)(T tag)
{
return DT_VERNEEDNUM - tag;
}
enum DT_VERSIONTAGNUM = 16;
enum DT_AUXILIARY = 0x7ffffffd;
enum DT_FILTER = 0x7fffffff;
extern (D) auto DT_EXTRATAGIDX(T)(T tag)
{
return cast(Elf32_Word)(-(cast(Elf32_Sword)(tag) <<1>>1)-1);
}
enum DT_EXTRANUM = 3;
enum DF_ORIGIN = 0x00000001;
enum DF_SYMBOLIC = 0x00000002;
enum DF_TEXTREL = 0x00000004;
enum DF_BIND_NOW = 0x00000008;
enum DF_STATIC_TLS = 0x00000010;
enum DF_1_NOW = 0x00000001;
enum DF_1_GLOBAL = 0x00000002;
enum DF_1_GROUP = 0x00000004;
enum DF_1_NODELETE = 0x00000008;
enum DF_1_LOADFLTR = 0x00000010;
enum DF_1_INITFIRST = 0x00000020;
enum DF_1_NOOPEN = 0x00000040;
enum DF_1_ORIGIN = 0x00000080;
enum DF_1_DIRECT = 0x00000100;
enum DF_1_TRANS = 0x00000200;
enum DF_1_INTERPOSE = 0x00000400;
enum DF_1_NODEFLIB = 0x00000800;
enum DF_1_NODUMP = 0x00001000;
enum DF_1_CONFALT = 0x00002000;
enum DF_1_ENDFILTEE = 0x00004000;
enum DF_1_DISPRELDNE = 0x00008000;
enum DF_1_DISPRELPND = 0x00010000;
enum DF_1_NODIRECT = 0x00020000;
enum DF_1_IGNMULDEF = 0x00040000;
enum DF_1_NOKSYMS = 0x00080000;
enum DF_1_NOHDR = 0x00100000;
enum DF_1_EDITED = 0x00200000;
enum DF_1_NORELOC = 0x00400000;
enum DF_1_SYMINTPOSE = 0x00800000;
enum DF_1_GLOBAUDIT = 0x01000000;
enum DF_1_SINGLETON = 0x02000000;
enum DTF_1_PARINIT = 0x00000001;
enum DTF_1_CONFEXP = 0x00000002;
enum DF_P1_LAZYLOAD = 0x00000001;
enum DF_P1_GROUPPERM = 0x00000002;
struct Elf32_Verdef
{
Elf32_Half vd_version;
Elf32_Half vd_flags;
Elf32_Half vd_ndx;
Elf32_Half vd_cnt;
Elf32_Word vd_hash;
Elf32_Word vd_aux;
Elf32_Word vd_next;
}
struct Elf64_Verdef
{
Elf64_Half vd_version;
Elf64_Half vd_flags;
Elf64_Half vd_ndx;
Elf64_Half vd_cnt;
Elf64_Word vd_hash;
Elf64_Word vd_aux;
Elf64_Word vd_next;
}
enum VER_DEF_NONE = 0;
enum VER_DEF_CURRENT = 1;
enum VER_DEF_NUM = 2;
enum VER_FLG_BASE = 0x1;
enum VER_FLG_WEAK = 0x2;
enum VER_NDX_LOCAL = 0;
enum VER_NDX_GLOBAL = 1;
enum VER_NDX_LORESERVE = 0xff00;
enum VER_NDX_ELIMINATE = 0xff01;
struct Elf32_Verdaux
{
Elf32_Word vda_name;
Elf32_Word vda_next;
}
struct Elf64_Verdaux
{
Elf64_Word vda_name;
Elf64_Word vda_next;
}
struct Elf32_Verneed
{
Elf32_Half vn_version;
Elf32_Half vn_cnt;
Elf32_Word vn_file;
Elf32_Word vn_aux;
Elf32_Word vn_next;
}
struct Elf64_Verneed
{
Elf64_Half vn_version;
Elf64_Half vn_cnt;
Elf64_Word vn_file;
Elf64_Word vn_aux;
Elf64_Word vn_next;
}
enum VER_NEED_NONE = 0;
enum VER_NEED_CURRENT = 1;
enum VER_NEED_NUM = 2;
struct Elf32_Vernaux
{
Elf32_Word vna_hash;
Elf32_Half vna_flags;
Elf32_Half vna_other;
Elf32_Word vna_name;
Elf32_Word vna_next;
}
struct Elf64_Vernaux
{
Elf64_Word vna_hash;
Elf64_Half vna_flags;
Elf64_Half vna_other;
Elf64_Word vna_name;
Elf64_Word vna_next;
}
// duplicate
// enum VER_FLG_WEAK = 0x2;
struct Elf32_auxv_t
{
uint32_t a_type;
union _a_un
{
uint32_t a_val;
} _a_un a_un;
}
struct Elf64_auxv_t
{
uint64_t a_type;
union _a_un
{
uint64_t a_val;
} _a_un a_un;
}
enum AT_NULL = 0;
enum AT_IGNORE = 1;
enum AT_EXECFD = 2;
enum AT_PHDR = 3;
enum AT_PHENT = 4;
enum AT_PHNUM = 5;
enum AT_PAGESZ = 6;
enum AT_BASE = 7;
enum AT_FLAGS = 8;
enum AT_ENTRY = 9;
enum AT_NOTELF = 10;
enum AT_UID = 11;
enum AT_EUID = 12;
enum AT_GID = 13;
enum AT_EGID = 14;
enum AT_CLKTCK = 17;
enum AT_PLATFORM = 15;
enum AT_HWCAP = 16;
enum AT_FPUCW = 18;
enum AT_DCACHEBSIZE = 19;
enum AT_ICACHEBSIZE = 20;
enum AT_UCACHEBSIZE = 21;
enum AT_IGNOREPPC = 22;
enum AT_SECURE = 23;
enum AT_BASE_PLATFORM = 24;
enum AT_RANDOM = 25;
enum AT_HWCAP2 = 26;
enum AT_EXECFN = 31;
enum AT_SYSINFO = 32;
enum AT_SYSINFO_EHDR = 33;
;
enum AT_L1I_CACHESHAPE = 34;
enum AT_L1D_CACHESHAPE = 35;
enum AT_L2_CACHESHAPE = 36;
enum AT_L3_CACHESHAPE = 37;
struct Elf32_Nhdr
{
Elf32_Word n_namesz;
Elf32_Word n_descsz;
Elf32_Word n_type;
}
struct Elf64_Nhdr
{
Elf64_Word n_namesz;
Elf64_Word n_descsz;
Elf64_Word n_type;
}
enum ELF_NOTE_SOLARIS = "SUNW Solaris";
enum ELF_NOTE_GNU = "GNU";
enum ELF_NOTE_PAGESIZE_HINT = 1;
enum NT_GNU_ABI_TAG = 1;
enum ELF_NOTE_ABI = NT_GNU_ABI_TAG;
enum ELF_NOTE_OS_LINUX = 0;
enum ELF_NOTE_OS_GNU = 1;
enum ELF_NOTE_OS_SOLARIS2 = 2;
enum ELF_NOTE_OS_FREEBSD = 3;
enum NT_GNU_HWCAP = 2;
enum NT_GNU_BUILD_ID = 3;
enum NT_GNU_GOLD_VERSION = 4;
struct Elf32_Move
{
Elf32_Xword m_value;
Elf32_Word m_info;
Elf32_Word m_poffset;
Elf32_Half m_repeat;
Elf32_Half m_stride;
}
struct Elf64_Move
{
Elf64_Xword m_value;
Elf64_Xword m_info;
Elf64_Xword m_poffset;
Elf64_Half m_repeat;
Elf64_Half m_stride;
}
extern (D)
{
auto ELF32_M_SYM(I)(I info) { return info >> 8; }
auto ELF32_M_SIZE(I)(I info) { return cast(ubyte)info; }
auto ELF32_M_INFO(S, SZ)(S sym, SZ size) { return (sym << 8) + cast(ubyte)size; }
}
alias ELF32_M_SYM ELF64_M_SYM;
alias ELF32_M_SIZE ELF64_M_SIZE;
alias ELF32_M_INFO ELF64_M_INFO;
enum EF_CPU32 = 0x00810000;
enum R_68K_NONE = 0;
enum R_68K_32 = 1;
enum R_68K_16 = 2;
enum R_68K_8 = 3;
enum R_68K_PC32 = 4;
enum R_68K_PC16 = 5;
enum R_68K_PC8 = 6;
enum R_68K_GOT32 = 7;
enum R_68K_GOT16 = 8;
enum R_68K_GOT8 = 9;
enum R_68K_GOT32O = 10;
enum R_68K_GOT16O = 11;
enum R_68K_GOT8O = 12;
enum R_68K_PLT32 = 13;
enum R_68K_PLT16 = 14;
enum R_68K_PLT8 = 15;
enum R_68K_PLT32O = 16;
enum R_68K_PLT16O = 17;
enum R_68K_PLT8O = 18;
enum R_68K_COPY = 19;
enum R_68K_GLOB_DAT = 20;
enum R_68K_JMP_SLOT = 21;
enum R_68K_RELATIVE = 22;
enum R_68K_TLS_GD32 = 25;
enum R_68K_TLS_GD16 = 26;
enum R_68K_TLS_GD8 = 27;
enum R_68K_TLS_LDM32 = 28;
enum R_68K_TLS_LDM16 = 29;
enum R_68K_TLS_LDM8 = 30;
enum R_68K_TLS_LDO32 = 31;
enum R_68K_TLS_LDO16 = 32;
enum R_68K_TLS_LDO8 = 33;
enum R_68K_TLS_IE32 = 34;
enum R_68K_TLS_IE16 = 35;
enum R_68K_TLS_IE8 = 36;
enum R_68K_TLS_LE32 = 37;
enum R_68K_TLS_LE16 = 38;
enum R_68K_TLS_LE8 = 39;
enum R_68K_TLS_DTPMOD32 = 40;
enum R_68K_TLS_DTPREL32 = 41;
enum R_68K_TLS_TPREL32 = 42;
enum R_68K_NUM = 43;
enum R_386_NONE = 0;
enum R_386_32 = 1;
enum R_386_PC32 = 2;
enum R_386_GOT32 = 3;
enum R_386_PLT32 = 4;
enum R_386_COPY = 5;
enum R_386_GLOB_DAT = 6;
enum R_386_JMP_SLOT = 7;
enum R_386_RELATIVE = 8;
enum R_386_GOTOFF = 9;
enum R_386_GOTPC = 10;
enum R_386_32PLT = 11;
enum R_386_TLS_TPOFF = 14;
enum R_386_TLS_IE = 15;
enum R_386_TLS_GOTIE = 16;
enum R_386_TLS_LE = 17;
enum R_386_TLS_GD = 18;
enum R_386_TLS_LDM = 19;
enum R_386_16 = 20;
enum R_386_PC16 = 21;
enum R_386_8 = 22;
enum R_386_PC8 = 23;
enum R_386_TLS_GD_32 = 24;
enum R_386_TLS_GD_PUSH = 25;
enum R_386_TLS_GD_CALL = 26;
enum R_386_TLS_GD_POP = 27;
enum R_386_TLS_LDM_32 = 28;
enum R_386_TLS_LDM_PUSH = 29;
enum R_386_TLS_LDM_CALL = 30;
enum R_386_TLS_LDM_POP = 31;
enum R_386_TLS_LDO_32 = 32;
enum R_386_TLS_IE_32 = 33;
enum R_386_TLS_LE_32 = 34;
enum R_386_TLS_DTPMOD32 = 35;
enum R_386_TLS_DTPOFF32 = 36;
enum R_386_TLS_TPOFF32 = 37;
enum R_386_SIZE32 = 38;
enum R_386_TLS_GOTDESC = 39;
enum R_386_TLS_DESC_CALL = 40;
enum R_386_TLS_DESC = 41;
enum R_386_IRELATIVE = 42;
enum R_386_NUM = 43;
enum STT_SPARC_REGISTER = 13;
enum EF_SPARCV9_MM = 3;
enum EF_SPARCV9_TSO = 0;
enum EF_SPARCV9_PSO = 1;
enum EF_SPARCV9_RMO = 2;
enum EF_SPARC_LEDATA = 0x800000;
enum EF_SPARC_EXT_MASK = 0xFFFF00;
enum EF_SPARC_32PLUS = 0x000100;
enum EF_SPARC_SUN_US1 = 0x000200;
enum EF_SPARC_HAL_R1 = 0x000400;
enum EF_SPARC_SUN_US3 = 0x000800;
enum R_SPARC_NONE = 0;
enum R_SPARC_8 = 1;
enum R_SPARC_16 = 2;
enum R_SPARC_32 = 3;
enum R_SPARC_DISP8 = 4;
enum R_SPARC_DISP16 = 5;
enum R_SPARC_DISP32 = 6;
enum R_SPARC_WDISP30 = 7;
enum R_SPARC_WDISP22 = 8;
enum R_SPARC_HI22 = 9;
enum R_SPARC_22 = 10;
enum R_SPARC_13 = 11;
enum R_SPARC_LO10 = 12;
enum R_SPARC_GOT10 = 13;
enum R_SPARC_GOT13 = 14;
enum R_SPARC_GOT22 = 15;
enum R_SPARC_PC10 = 16;
enum R_SPARC_PC22 = 17;
enum R_SPARC_WPLT30 = 18;
enum R_SPARC_COPY = 19;
enum R_SPARC_GLOB_DAT = 20;
enum R_SPARC_JMP_SLOT = 21;
enum R_SPARC_RELATIVE = 22;
enum R_SPARC_UA32 = 23;
enum R_SPARC_PLT32 = 24;
enum R_SPARC_HIPLT22 = 25;
enum R_SPARC_LOPLT10 = 26;
enum R_SPARC_PCPLT32 = 27;
enum R_SPARC_PCPLT22 = 28;
enum R_SPARC_PCPLT10 = 29;
enum R_SPARC_10 = 30;
enum R_SPARC_11 = 31;
enum R_SPARC_64 = 32;
enum R_SPARC_OLO10 = 33;
enum R_SPARC_HH22 = 34;
enum R_SPARC_HM10 = 35;
enum R_SPARC_LM22 = 36;
enum R_SPARC_PC_HH22 = 37;
enum R_SPARC_PC_HM10 = 38;
enum R_SPARC_PC_LM22 = 39;
enum R_SPARC_WDISP16 = 40;
enum R_SPARC_WDISP19 = 41;
enum R_SPARC_GLOB_JMP = 42;
enum R_SPARC_7 = 43;
enum R_SPARC_5 = 44;
enum R_SPARC_6 = 45;
enum R_SPARC_DISP64 = 46;
enum R_SPARC_PLT64 = 47;
enum R_SPARC_HIX22 = 48;
enum R_SPARC_LOX10 = 49;
enum R_SPARC_H44 = 50;
enum R_SPARC_M44 = 51;
enum R_SPARC_L44 = 52;
enum R_SPARC_REGISTER = 53;
enum R_SPARC_UA64 = 54;
enum R_SPARC_UA16 = 55;
enum R_SPARC_TLS_GD_HI22 = 56;
enum R_SPARC_TLS_GD_LO10 = 57;
enum R_SPARC_TLS_GD_ADD = 58;
enum R_SPARC_TLS_GD_CALL = 59;
enum R_SPARC_TLS_LDM_HI22 = 60;
enum R_SPARC_TLS_LDM_LO10 = 61;
enum R_SPARC_TLS_LDM_ADD = 62;
enum R_SPARC_TLS_LDM_CALL = 63;
enum R_SPARC_TLS_LDO_HIX22 = 64;
enum R_SPARC_TLS_LDO_LOX10 = 65;
enum R_SPARC_TLS_LDO_ADD = 66;
enum R_SPARC_TLS_IE_HI22 = 67;
enum R_SPARC_TLS_IE_LO10 = 68;
enum R_SPARC_TLS_IE_LD = 69;
enum R_SPARC_TLS_IE_LDX = 70;
enum R_SPARC_TLS_IE_ADD = 71;
enum R_SPARC_TLS_LE_HIX22 = 72;
enum R_SPARC_TLS_LE_LOX10 = 73;
enum R_SPARC_TLS_DTPMOD32 = 74;
enum R_SPARC_TLS_DTPMOD64 = 75;
enum R_SPARC_TLS_DTPOFF32 = 76;
enum R_SPARC_TLS_DTPOFF64 = 77;
enum R_SPARC_TLS_TPOFF32 = 78;
enum R_SPARC_TLS_TPOFF64 = 79;
enum R_SPARC_GOTDATA_HIX22 = 80;
enum R_SPARC_GOTDATA_LOX10 = 81;
enum R_SPARC_GOTDATA_OP_HIX22 = 82;
enum R_SPARC_GOTDATA_OP_LOX10 = 83;
enum R_SPARC_GOTDATA_OP = 84;
enum R_SPARC_H34 = 85;
enum R_SPARC_SIZE32 = 86;
enum R_SPARC_SIZE64 = 87;
enum R_SPARC_WDISP10 = 88;
enum R_SPARC_JMP_IREL = 248;
enum R_SPARC_IRELATIVE = 249;
enum R_SPARC_GNU_VTINHERIT = 250;
enum R_SPARC_GNU_VTENTRY = 251;
enum R_SPARC_REV32 = 252;
enum R_SPARC_NUM = 253;
enum DT_SPARC_REGISTER = 0x70000001;
enum DT_SPARC_NUM = 2;
enum EF_MIPS_NOREORDER = 1;
enum EF_MIPS_PIC = 2;
enum EF_MIPS_CPIC = 4;
enum EF_MIPS_XGOT = 8;
enum EF_MIPS_64BIT_WHIRL = 16;
enum EF_MIPS_ABI2 = 32;
enum EF_MIPS_ABI_ON32 = 64;
enum EF_MIPS_ARCH = 0xf0000000;
enum EF_MIPS_ARCH_1 = 0x00000000;
enum EF_MIPS_ARCH_2 = 0x10000000;
enum EF_MIPS_ARCH_3 = 0x20000000;
enum EF_MIPS_ARCH_4 = 0x30000000;
enum EF_MIPS_ARCH_5 = 0x40000000;
enum EF_MIPS_ARCH_32 = 0x50000000;
enum EF_MIPS_ARCH_64 = 0x60000000;
enum EF_MIPS_ARCH_32R2 = 0x70000000;
enum EF_MIPS_ARCH_64R2 = 0x80000000;
enum E_MIPS_ARCH_1 = EF_MIPS_ARCH_1;
enum E_MIPS_ARCH_2 = EF_MIPS_ARCH_2;
enum E_MIPS_ARCH_3 = EF_MIPS_ARCH_3;
enum E_MIPS_ARCH_4 = EF_MIPS_ARCH_4;
enum E_MIPS_ARCH_5 = EF_MIPS_ARCH_5;
enum E_MIPS_ARCH_32 = EF_MIPS_ARCH_32;
enum E_MIPS_ARCH_64 = EF_MIPS_ARCH_64;
enum SHN_MIPS_ACOMMON = 0xff00;
enum SHN_MIPS_TEXT = 0xff01;
enum SHN_MIPS_DATA = 0xff02;
enum SHN_MIPS_SCOMMON = 0xff03;
enum SHN_MIPS_SUNDEFINED = 0xff04;
enum SHT_MIPS_LIBLIST = 0x70000000;
enum SHT_MIPS_MSYM = 0x70000001;
enum SHT_MIPS_CONFLICT = 0x70000002;
enum SHT_MIPS_GPTAB = 0x70000003;
enum SHT_MIPS_UCODE = 0x70000004;
enum SHT_MIPS_DEBUG = 0x70000005;
enum SHT_MIPS_REGINFO = 0x70000006;
enum SHT_MIPS_PACKAGE = 0x70000007;
enum SHT_MIPS_PACKSYM = 0x70000008;
enum SHT_MIPS_RELD = 0x70000009;
enum SHT_MIPS_IFACE = 0x7000000b;
enum SHT_MIPS_CONTENT = 0x7000000c;
enum SHT_MIPS_OPTIONS = 0x7000000d;
enum SHT_MIPS_SHDR = 0x70000010;
enum SHT_MIPS_FDESC = 0x70000011;
enum SHT_MIPS_EXTSYM = 0x70000012;
enum SHT_MIPS_DENSE = 0x70000013;
enum SHT_MIPS_PDESC = 0x70000014;
enum SHT_MIPS_LOCSYM = 0x70000015;
enum SHT_MIPS_AUXSYM = 0x70000016;
enum SHT_MIPS_OPTSYM = 0x70000017;
enum SHT_MIPS_LOCSTR = 0x70000018;
enum SHT_MIPS_LINE = 0x70000019;
enum SHT_MIPS_RFDESC = 0x7000001a;
enum SHT_MIPS_DELTASYM = 0x7000001b;
enum SHT_MIPS_DELTAINST = 0x7000001c;
enum SHT_MIPS_DELTACLASS = 0x7000001d;
enum SHT_MIPS_DWARF = 0x7000001e;
enum SHT_MIPS_DELTADECL = 0x7000001f;
enum SHT_MIPS_SYMBOL_LIB = 0x70000020;
enum SHT_MIPS_EVENTS = 0x70000021;
enum SHT_MIPS_TRANSLATE = 0x70000022;
enum SHT_MIPS_PIXIE = 0x70000023;
enum SHT_MIPS_XLATE = 0x70000024;
enum SHT_MIPS_XLATE_DEBUG = 0x70000025;
enum SHT_MIPS_WHIRL = 0x70000026;
enum SHT_MIPS_EH_REGION = 0x70000027;
enum SHT_MIPS_XLATE_OLD = 0x70000028;
enum SHT_MIPS_PDR_EXCEPTION = 0x70000029;
enum SHF_MIPS_GPREL = 0x10000000;
enum SHF_MIPS_MERGE = 0x20000000;
enum SHF_MIPS_ADDR = 0x40000000;
enum SHF_MIPS_STRINGS = 0x80000000;
enum SHF_MIPS_NOSTRIP = 0x08000000;
enum SHF_MIPS_LOCAL = 0x04000000;
enum SHF_MIPS_NAMES = 0x02000000;
enum SHF_MIPS_NODUPE = 0x01000000;
enum STO_MIPS_DEFAULT = 0x0;
enum STO_MIPS_INTERNAL = 0x1;
enum STO_MIPS_HIDDEN = 0x2;
enum STO_MIPS_PROTECTED = 0x3;
enum STO_MIPS_PLT = 0x8;
enum STO_MIPS_SC_ALIGN_UNUSED = 0xff;
enum STB_MIPS_SPLIT_COMMON = 13;
union Elf32_gptab
{
struct _gt_header
{
Elf32_Word gt_current_g_value;
Elf32_Word gt_unused;
} _gt_header gt_header;
struct _gt_entry
{
Elf32_Word gt_g_value;
Elf32_Word gt_bytes;
} _gt_entry gt_entry;
}
struct Elf32_RegInfo
{
Elf32_Word ri_gprmask;
Elf32_Word[4] ri_cprmask;
Elf32_Sword ri_gp_value;
}
struct Elf_Options
{
ubyte kind;
ubyte size;
Elf32_Section section;
Elf32_Word info;
}
enum ODK_NULL = 0;
enum ODK_REGINFO = 1;
enum ODK_EXCEPTIONS = 2;
enum ODK_PAD = 3;
enum ODK_HWPATCH = 4;
enum ODK_FILL = 5;
enum ODK_TAGS = 6;
enum ODK_HWAND = 7;
enum ODK_HWOR = 8;
enum OEX_FPU_MIN = 0x1f;
enum OEX_FPU_MAX = 0x1f00;
enum OEX_PAGE0 = 0x10000;
enum OEX_SMM = 0x20000;
enum OEX_FPDBUG = 0x40000;
enum OEX_PRECISEFP = OEX_FPDBUG;
enum OEX_DISMISS = 0x80000;
enum OEX_FPU_INVAL = 0x10;
enum OEX_FPU_DIV0 = 0x08;
enum OEX_FPU_OFLO = 0x04;
enum OEX_FPU_UFLO = 0x02;
enum OEX_FPU_INEX = 0x01;
enum OHW_R4KEOP = 0x1;
enum OHW_R8KPFETCH = 0x2;
enum OHW_R5KEOP = 0x4;
enum OHW_R5KCVTL = 0x8;
enum OPAD_PREFIX = 0x1;
enum OPAD_POSTFIX = 0x2;
enum OPAD_SYMBOL = 0x4;
struct Elf_Options_Hw
{
Elf32_Word hwp_flags1;
Elf32_Word hwp_flags2;
}
enum OHWA0_R4KEOP_CHECKED = 0x00000001;
enum OHWA1_R4KEOP_CLEAN = 0x00000002;
enum R_MIPS_NONE = 0;
enum R_MIPS_16 = 1;
enum R_MIPS_32 = 2;
enum R_MIPS_REL32 = 3;
enum R_MIPS_26 = 4;
enum R_MIPS_HI16 = 5;
enum R_MIPS_LO16 = 6;
enum R_MIPS_GPREL16 = 7;
enum R_MIPS_LITERAL = 8;
enum R_MIPS_GOT16 = 9;
enum R_MIPS_PC16 = 10;
enum R_MIPS_CALL16 = 11;
enum R_MIPS_GPREL32 = 12;
enum R_MIPS_SHIFT5 = 16;
enum R_MIPS_SHIFT6 = 17;
enum R_MIPS_64 = 18;
enum R_MIPS_GOT_DISP = 19;
enum R_MIPS_GOT_PAGE = 20;
enum R_MIPS_GOT_OFST = 21;
enum R_MIPS_GOT_HI16 = 22;
enum R_MIPS_GOT_LO16 = 23;
enum R_MIPS_SUB = 24;
enum R_MIPS_INSERT_A = 25;
enum R_MIPS_INSERT_B = 26;
enum R_MIPS_DELETE = 27;
enum R_MIPS_HIGHER = 28;
enum R_MIPS_HIGHEST = 29;
enum R_MIPS_CALL_HI16 = 30;
enum R_MIPS_CALL_LO16 = 31;
enum R_MIPS_SCN_DISP = 32;
enum R_MIPS_REL16 = 33;
enum R_MIPS_ADD_IMMEDIATE = 34;
enum R_MIPS_PJUMP = 35;
enum R_MIPS_RELGOT = 36;
enum R_MIPS_JALR = 37;
enum R_MIPS_TLS_DTPMOD32 = 38;
enum R_MIPS_TLS_DTPREL32 = 39;
enum R_MIPS_TLS_DTPMOD64 = 40;
enum R_MIPS_TLS_DTPREL64 = 41;
enum R_MIPS_TLS_GD = 42;
enum R_MIPS_TLS_LDM = 43;
enum R_MIPS_TLS_DTPREL_HI16 = 44;
enum R_MIPS_TLS_DTPREL_LO16 = 45;
enum R_MIPS_TLS_GOTTPREL = 46;
enum R_MIPS_TLS_TPREL32 = 47;
enum R_MIPS_TLS_TPREL64 = 48;
enum R_MIPS_TLS_TPREL_HI16 = 49;
enum R_MIPS_TLS_TPREL_LO16 = 50;
enum R_MIPS_GLOB_DAT = 51;
enum R_MIPS_COPY = 126;
enum R_MIPS_JUMP_SLOT = 127;
enum R_MIPS_NUM = 128;
enum PT_MIPS_REGINFO = 0x70000000;
enum PT_MIPS_RTPROC = 0x70000001;
enum PT_MIPS_OPTIONS = 0x70000002;
enum PF_MIPS_LOCAL = 0x10000000;
enum DT_MIPS_RLD_VERSION = 0x70000001;
enum DT_MIPS_TIME_STAMP = 0x70000002;
enum DT_MIPS_ICHECKSUM = 0x70000003;
enum DT_MIPS_IVERSION = 0x70000004;
enum DT_MIPS_FLAGS = 0x70000005;
enum DT_MIPS_BASE_ADDRESS = 0x70000006;
enum DT_MIPS_MSYM = 0x70000007;
enum DT_MIPS_CONFLICT = 0x70000008;
enum DT_MIPS_LIBLIST = 0x70000009;
enum DT_MIPS_LOCAL_GOTNO = 0x7000000a;
enum DT_MIPS_CONFLICTNO = 0x7000000b;
enum DT_MIPS_LIBLISTNO = 0x70000010;
enum DT_MIPS_SYMTABNO = 0x70000011;
enum DT_MIPS_UNREFEXTNO = 0x70000012;
enum DT_MIPS_GOTSYM = 0x70000013;
enum DT_MIPS_HIPAGENO = 0x70000014;
enum DT_MIPS_RLD_MAP = 0x70000016;
enum DT_MIPS_DELTA_CLASS = 0x70000017;
enum DT_MIPS_DELTA_CLASS_NO = 0x70000018;
enum DT_MIPS_DELTA_INSTANCE = 0x70000019;
enum DT_MIPS_DELTA_INSTANCE_NO = 0x7000001a;
enum DT_MIPS_DELTA_RELOC = 0x7000001b;
enum DT_MIPS_DELTA_RELOC_NO = 0x7000001c;
enum DT_MIPS_DELTA_SYM = 0x7000001d;
enum DT_MIPS_DELTA_SYM_NO = 0x7000001e;
enum DT_MIPS_DELTA_CLASSSYM = 0x70000020;
enum DT_MIPS_DELTA_CLASSSYM_NO = 0x70000021;
enum DT_MIPS_CXX_FLAGS = 0x70000022;
enum DT_MIPS_PIXIE_INIT = 0x70000023;
enum DT_MIPS_SYMBOL_LIB = 0x70000024;
enum DT_MIPS_LOCALPAGE_GOTIDX = 0x70000025;
enum DT_MIPS_LOCAL_GOTIDX = 0x70000026;
enum DT_MIPS_HIDDEN_GOTIDX = 0x70000027;
enum DT_MIPS_PROTECTED_GOTIDX = 0x70000028;
enum DT_MIPS_OPTIONS = 0x70000029;
enum DT_MIPS_INTERFACE = 0x7000002a;
enum DT_MIPS_DYNSTR_ALIGN = 0x7000002b;
enum DT_MIPS_INTERFACE_SIZE = 0x7000002c;
enum DT_MIPS_RLD_TEXT_RESOLVE_ADDR = 0x7000002d;
enum DT_MIPS_PERF_SUFFIX = 0x7000002e;
enum DT_MIPS_COMPACT_SIZE = 0x7000002f;
enum DT_MIPS_GP_VALUE = 0x70000030;
enum DT_MIPS_AUX_DYNAMIC = 0x70000031;
enum DT_MIPS_PLTGOT = 0x70000032;
enum DT_MIPS_RWPLT = 0x70000034;
enum DT_MIPS_NUM = 0x35;
enum RHF_NONE = 0;
enum RHF_QUICKSTART = (1 << 0);
enum RHF_NOTPOT = (1 << 1);
enum RHF_NO_LIBRARY_REPLACEMENT = (1 << 2);
enum RHF_NO_MOVE = (1 << 3);
enum RHF_SGI_ONLY = (1 << 4);
enum RHF_GUARANTEE_INIT = (1 << 5);
enum RHF_DELTA_C_PLUS_PLUS = (1 << 6);
enum RHF_GUARANTEE_START_INIT = (1 << 7);
enum RHF_PIXIE = (1 << 8);
enum RHF_DEFAULT_DELAY_LOAD = (1 << 9);
enum RHF_REQUICKSTART = (1 << 10);
enum RHF_REQUICKSTARTED = (1 << 11);
enum RHF_CORD = (1 << 12);
enum RHF_NO_UNRES_UNDEF = (1 << 13);
enum RHF_RLD_ORDER_SAFE = (1 << 14);
struct Elf32_Lib
{
Elf32_Word l_name;
Elf32_Word l_time_stamp;
Elf32_Word l_checksum;
Elf32_Word l_version;
Elf32_Word l_flags;
}
struct Elf64_Lib
{
Elf64_Word l_name;
Elf64_Word l_time_stamp;
Elf64_Word l_checksum;
Elf64_Word l_version;
Elf64_Word l_flags;
}
enum LL_NONE = 0;
enum LL_EXACT_MATCH = (1 << 0);
enum LL_IGNORE_INT_VER = (1 << 1);
enum LL_REQUIRE_MINOR = (1 << 2);
enum LL_EXPORTS = (1 << 3);
enum LL_DELAY_LOAD = (1 << 4);
enum LL_DELTA = (1 << 5);
alias Elf32_Addr Elf32_Conflict;
enum EF_PARISC_TRAPNIL = 0x00010000;
enum EF_PARISC_EXT = 0x00020000;
enum EF_PARISC_LSB = 0x00040000;
enum EF_PARISC_WIDE = 0x00080000;
enum EF_PARISC_NO_KABP = 0x00100000;
enum EF_PARISC_LAZYSWAP = 0x00400000;
enum EF_PARISC_ARCH = 0x0000ffff;
enum EFA_PARISC_1_0 = 0x020b;
enum EFA_PARISC_1_1 = 0x0210;
enum EFA_PARISC_2_0 = 0x0214;
enum SHN_PARISC_ANSI_COMMON = 0xff00;
enum SHN_PARISC_HUGE_COMMON = 0xff01;
enum SHT_PARISC_EXT = 0x70000000;
enum SHT_PARISC_UNWIND = 0x70000001;
enum SHT_PARISC_DOC = 0x70000002;
enum SHF_PARISC_SHORT = 0x20000000;
enum SHF_PARISC_HUGE = 0x40000000;
enum SHF_PARISC_SBP = 0x80000000;
enum STT_PARISC_MILLICODE = 13;
enum STT_HP_OPAQUE = (STT_LOOS + 0x1);
enum STT_HP_STUB = (STT_LOOS + 0x2);
enum R_PARISC_NONE = 0;
enum R_PARISC_DIR32 = 1;
enum R_PARISC_DIR21L = 2;
enum R_PARISC_DIR17R = 3;
enum R_PARISC_DIR17F = 4;
enum R_PARISC_DIR14R = 6;
enum R_PARISC_PCREL32 = 9;
enum R_PARISC_PCREL21L = 10;
enum R_PARISC_PCREL17R = 11;
enum R_PARISC_PCREL17F = 12;
enum R_PARISC_PCREL14R = 14;
enum R_PARISC_DPREL21L = 18;
enum R_PARISC_DPREL14R = 22;
enum R_PARISC_GPREL21L = 26;
enum R_PARISC_GPREL14R = 30;
enum R_PARISC_LTOFF21L = 34;
enum R_PARISC_LTOFF14R = 38;
enum R_PARISC_SECREL32 = 41;
enum R_PARISC_SEGBASE = 48;
enum R_PARISC_SEGREL32 = 49;
enum R_PARISC_PLTOFF21L = 50;
enum R_PARISC_PLTOFF14R = 54;
enum R_PARISC_LTOFF_FPTR32 = 57;
enum R_PARISC_LTOFF_FPTR21L = 58;
enum R_PARISC_LTOFF_FPTR14R = 62;
enum R_PARISC_FPTR64 = 64;
enum R_PARISC_PLABEL32 = 65;
enum R_PARISC_PLABEL21L = 66;
enum R_PARISC_PLABEL14R = 70;
enum R_PARISC_PCREL64 = 72;
enum R_PARISC_PCREL22F = 74;
enum R_PARISC_PCREL14WR = 75;
enum R_PARISC_PCREL14DR = 76;
enum R_PARISC_PCREL16F = 77;
enum R_PARISC_PCREL16WF = 78;
enum R_PARISC_PCREL16DF = 79;
enum R_PARISC_DIR64 = 80;
enum R_PARISC_DIR14WR = 83;
enum R_PARISC_DIR14DR = 84;
enum R_PARISC_DIR16F = 85;
enum R_PARISC_DIR16WF = 86;
enum R_PARISC_DIR16DF = 87;
enum R_PARISC_GPREL64 = 88;
enum R_PARISC_GPREL14WR = 91;
enum R_PARISC_GPREL14DR = 92;
enum R_PARISC_GPREL16F = 93;
enum R_PARISC_GPREL16WF = 94;
enum R_PARISC_GPREL16DF = 95;
enum R_PARISC_LTOFF64 = 96;
enum R_PARISC_LTOFF14WR = 99;
enum R_PARISC_LTOFF14DR = 100;
enum R_PARISC_LTOFF16F = 101;
enum R_PARISC_LTOFF16WF = 102;
enum R_PARISC_LTOFF16DF = 103;
enum R_PARISC_SECREL64 = 104;
enum R_PARISC_SEGREL64 = 112;
enum R_PARISC_PLTOFF14WR = 115;
enum R_PARISC_PLTOFF14DR = 116;
enum R_PARISC_PLTOFF16F = 117;
enum R_PARISC_PLTOFF16WF = 118;
enum R_PARISC_PLTOFF16DF = 119;
enum R_PARISC_LTOFF_FPTR64 = 120;
enum R_PARISC_LTOFF_FPTR14WR = 123;
enum R_PARISC_LTOFF_FPTR14DR = 124;
enum R_PARISC_LTOFF_FPTR16F = 125;
enum R_PARISC_LTOFF_FPTR16WF = 126;
enum R_PARISC_LTOFF_FPTR16DF = 127;
enum R_PARISC_LORESERVE = 128;
enum R_PARISC_COPY = 128;
enum R_PARISC_IPLT = 129;
enum R_PARISC_EPLT = 130;
enum R_PARISC_TPREL32 = 153;
enum R_PARISC_TPREL21L = 154;
enum R_PARISC_TPREL14R = 158;
enum R_PARISC_LTOFF_TP21L = 162;
enum R_PARISC_LTOFF_TP14R = 166;
enum R_PARISC_LTOFF_TP14F = 167;
enum R_PARISC_TPREL64 = 216;
enum R_PARISC_TPREL14WR = 219;
enum R_PARISC_TPREL14DR = 220;
enum R_PARISC_TPREL16F = 221;
enum R_PARISC_TPREL16WF = 222;
enum R_PARISC_TPREL16DF = 223;
enum R_PARISC_LTOFF_TP64 = 224;
enum R_PARISC_LTOFF_TP14WR = 227;
enum R_PARISC_LTOFF_TP14DR = 228;
enum R_PARISC_LTOFF_TP16F = 229;
enum R_PARISC_LTOFF_TP16WF = 230;
enum R_PARISC_LTOFF_TP16DF = 231;
enum R_PARISC_GNU_VTENTRY = 232;
enum R_PARISC_GNU_VTINHERIT = 233;
enum R_PARISC_TLS_GD21L = 234;
enum R_PARISC_TLS_GD14R = 235;
enum R_PARISC_TLS_GDCALL = 236;
enum R_PARISC_TLS_LDM21L = 237;
enum R_PARISC_TLS_LDM14R = 238;
enum R_PARISC_TLS_LDMCALL = 239;
enum R_PARISC_TLS_LDO21L = 240;
enum R_PARISC_TLS_LDO14R = 241;
enum R_PARISC_TLS_DTPMOD32 = 242;
enum R_PARISC_TLS_DTPMOD64 = 243;
enum R_PARISC_TLS_DTPOFF32 = 244;
enum R_PARISC_TLS_DTPOFF64 = 245;
enum R_PARISC_TLS_LE21L = R_PARISC_TPREL21L;
enum R_PARISC_TLS_LE14R = R_PARISC_TPREL14R;
enum R_PARISC_TLS_IE21L = R_PARISC_LTOFF_TP21L;
enum R_PARISC_TLS_IE14R = R_PARISC_LTOFF_TP14R;
enum R_PARISC_TLS_TPREL32 = R_PARISC_TPREL32;
enum R_PARISC_TLS_TPREL64 = R_PARISC_TPREL64;
enum R_PARISC_HIRESERVE = 255;
enum PT_HP_TLS = (PT_LOOS + 0x0);
enum PT_HP_CORE_NONE = (PT_LOOS + 0x1);
enum PT_HP_CORE_VERSION = (PT_LOOS + 0x2);
enum PT_HP_CORE_KERNEL = (PT_LOOS + 0x3);
enum PT_HP_CORE_COMM = (PT_LOOS + 0x4);
enum PT_HP_CORE_PROC = (PT_LOOS + 0x5);
enum PT_HP_CORE_LOADABLE = (PT_LOOS + 0x6);
enum PT_HP_CORE_STACK = (PT_LOOS + 0x7);
enum PT_HP_CORE_SHM = (PT_LOOS + 0x8);
enum PT_HP_CORE_MMF = (PT_LOOS + 0x9);
enum PT_HP_PARALLEL = (PT_LOOS + 0x10);
enum PT_HP_FASTBIND = (PT_LOOS + 0x11);
enum PT_HP_OPT_ANNOT = (PT_LOOS + 0x12);
enum PT_HP_HSL_ANNOT = (PT_LOOS + 0x13);
enum PT_HP_STACK = (PT_LOOS + 0x14);
enum PT_PARISC_ARCHEXT = 0x70000000;
enum PT_PARISC_UNWIND = 0x70000001;
enum PF_PARISC_SBP = 0x08000000;
enum PF_HP_PAGE_SIZE = 0x00100000;
enum PF_HP_FAR_SHARED = 0x00200000;
enum PF_HP_NEAR_SHARED = 0x00400000;
enum PF_HP_CODE = 0x01000000;
enum PF_HP_MODIFY = 0x02000000;
enum PF_HP_LAZYSWAP = 0x04000000;
enum PF_HP_SBP = 0x08000000;
enum EF_ALPHA_32BIT = 1;
enum EF_ALPHA_CANRELAX = 2;
enum SHT_ALPHA_DEBUG = 0x70000001;
enum SHT_ALPHA_REGINFO = 0x70000002;
enum SHF_ALPHA_GPREL = 0x10000000;
enum STO_ALPHA_NOPV = 0x80;
enum STO_ALPHA_STD_GPLOAD = 0x88;
enum R_ALPHA_NONE = 0;
enum R_ALPHA_REFLONG = 1;
enum R_ALPHA_REFQUAD = 2;
enum R_ALPHA_GPREL32 = 3;
enum R_ALPHA_LITERAL = 4;
enum R_ALPHA_LITUSE = 5;
enum R_ALPHA_GPDISP = 6;
enum R_ALPHA_BRADDR = 7;
enum R_ALPHA_HINT = 8;
enum R_ALPHA_SREL16 = 9;
enum R_ALPHA_SREL32 = 10;
enum R_ALPHA_SREL64 = 11;
enum R_ALPHA_GPRELHIGH = 17;
enum R_ALPHA_GPRELLOW = 18;
enum R_ALPHA_GPREL16 = 19;
enum R_ALPHA_COPY = 24;
enum R_ALPHA_GLOB_DAT = 25;
enum R_ALPHA_JMP_SLOT = 26;
enum R_ALPHA_RELATIVE = 27;
enum R_ALPHA_TLS_GD_HI = 28;
enum R_ALPHA_TLSGD = 29;
enum R_ALPHA_TLS_LDM = 30;
enum R_ALPHA_DTPMOD64 = 31;
enum R_ALPHA_GOTDTPREL = 32;
enum R_ALPHA_DTPREL64 = 33;
enum R_ALPHA_DTPRELHI = 34;
enum R_ALPHA_DTPRELLO = 35;
enum R_ALPHA_DTPREL16 = 36;
enum R_ALPHA_GOTTPREL = 37;
enum R_ALPHA_TPREL64 = 38;
enum R_ALPHA_TPRELHI = 39;
enum R_ALPHA_TPRELLO = 40;
enum R_ALPHA_TPREL16 = 41;
enum R_ALPHA_NUM = 46;
enum LITUSE_ALPHA_ADDR = 0;
enum LITUSE_ALPHA_BASE = 1;
enum LITUSE_ALPHA_BYTOFF = 2;
enum LITUSE_ALPHA_JSR = 3;
enum LITUSE_ALPHA_TLS_GD = 4;
enum LITUSE_ALPHA_TLS_LDM = 5;
enum DT_ALPHA_PLTRO = (DT_LOPROC + 0);
enum DT_ALPHA_NUM = 1;
enum EF_PPC_EMB = 0x80000000;
enum EF_PPC_RELOCATABLE = 0x00010000;
enum EF_PPC_RELOCATABLE_LIB = 0x00008000;
enum R_PPC_NONE = 0;
enum R_PPC_ADDR32 = 1;
enum R_PPC_ADDR24 = 2;
enum R_PPC_ADDR16 = 3;
enum R_PPC_ADDR16_LO = 4;
enum R_PPC_ADDR16_HI = 5;
enum R_PPC_ADDR16_HA = 6;
enum R_PPC_ADDR14 = 7;
enum R_PPC_ADDR14_BRTAKEN = 8;
enum R_PPC_ADDR14_BRNTAKEN = 9;
enum R_PPC_REL24 = 10;
enum R_PPC_REL14 = 11;
enum R_PPC_REL14_BRTAKEN = 12;
enum R_PPC_REL14_BRNTAKEN = 13;
enum R_PPC_GOT16 = 14;
enum R_PPC_GOT16_LO = 15;
enum R_PPC_GOT16_HI = 16;
enum R_PPC_GOT16_HA = 17;
enum R_PPC_PLTREL24 = 18;
enum R_PPC_COPY = 19;
enum R_PPC_GLOB_DAT = 20;
enum R_PPC_JMP_SLOT = 21;
enum R_PPC_RELATIVE = 22;
enum R_PPC_LOCAL24PC = 23;
enum R_PPC_UADDR32 = 24;
enum R_PPC_UADDR16 = 25;
enum R_PPC_REL32 = 26;
enum R_PPC_PLT32 = 27;
enum R_PPC_PLTREL32 = 28;
enum R_PPC_PLT16_LO = 29;
enum R_PPC_PLT16_HI = 30;
enum R_PPC_PLT16_HA = 31;
enum R_PPC_SDAREL16 = 32;
enum R_PPC_SECTOFF = 33;
enum R_PPC_SECTOFF_LO = 34;
enum R_PPC_SECTOFF_HI = 35;
enum R_PPC_SECTOFF_HA = 36;
enum R_PPC_TLS = 67;
enum R_PPC_DTPMOD32 = 68;
enum R_PPC_TPREL16 = 69;
enum R_PPC_TPREL16_LO = 70;
enum R_PPC_TPREL16_HI = 71;
enum R_PPC_TPREL16_HA = 72;
enum R_PPC_TPREL32 = 73;
enum R_PPC_DTPREL16 = 74;
enum R_PPC_DTPREL16_LO = 75;
enum R_PPC_DTPREL16_HI = 76;
enum R_PPC_DTPREL16_HA = 77;
enum R_PPC_DTPREL32 = 78;
enum R_PPC_GOT_TLSGD16 = 79;
enum R_PPC_GOT_TLSGD16_LO = 80;
enum R_PPC_GOT_TLSGD16_HI = 81;
enum R_PPC_GOT_TLSGD16_HA = 82;
enum R_PPC_GOT_TLSLD16 = 83;
enum R_PPC_GOT_TLSLD16_LO = 84;
enum R_PPC_GOT_TLSLD16_HI = 85;
enum R_PPC_GOT_TLSLD16_HA = 86;
enum R_PPC_GOT_TPREL16 = 87;
enum R_PPC_GOT_TPREL16_LO = 88;
enum R_PPC_GOT_TPREL16_HI = 89;
enum R_PPC_GOT_TPREL16_HA = 90;
enum R_PPC_GOT_DTPREL16 = 91;
enum R_PPC_GOT_DTPREL16_LO = 92;
enum R_PPC_GOT_DTPREL16_HI = 93;
enum R_PPC_GOT_DTPREL16_HA = 94;
enum R_PPC_EMB_NADDR32 = 101;
enum R_PPC_EMB_NADDR16 = 102;
enum R_PPC_EMB_NADDR16_LO = 103;
enum R_PPC_EMB_NADDR16_HI = 104;
enum R_PPC_EMB_NADDR16_HA = 105;
enum R_PPC_EMB_SDAI16 = 106;
enum R_PPC_EMB_SDA2I16 = 107;
enum R_PPC_EMB_SDA2REL = 108;
enum R_PPC_EMB_SDA21 = 109;
enum R_PPC_EMB_MRKREF = 110;
enum R_PPC_EMB_RELSEC16 = 111;
enum R_PPC_EMB_RELST_LO = 112;
enum R_PPC_EMB_RELST_HI = 113;
enum R_PPC_EMB_RELST_HA = 114;
enum R_PPC_EMB_BIT_FLD = 115;
enum R_PPC_EMB_RELSDA = 116;
enum R_PPC_DIAB_SDA21_LO = 180;
enum R_PPC_DIAB_SDA21_HI = 181;
enum R_PPC_DIAB_SDA21_HA = 182;
enum R_PPC_DIAB_RELSDA_LO = 183;
enum R_PPC_DIAB_RELSDA_HI = 184;
enum R_PPC_DIAB_RELSDA_HA = 185;
enum R_PPC_IRELATIVE = 248;
enum R_PPC_REL16 = 249;
enum R_PPC_REL16_LO = 250;
enum R_PPC_REL16_HI = 251;
enum R_PPC_REL16_HA = 252;
enum R_PPC_TOC16 = 255;
enum DT_PPC_GOT = (DT_LOPROC + 0);
enum DT_PPC_NUM = 1;
enum R_PPC64_NONE = R_PPC_NONE;
enum R_PPC64_ADDR32 = R_PPC_ADDR32;
enum R_PPC64_ADDR24 = R_PPC_ADDR24;
enum R_PPC64_ADDR16 = R_PPC_ADDR16;
enum R_PPC64_ADDR16_LO = R_PPC_ADDR16_LO;
enum R_PPC64_ADDR16_HI = R_PPC_ADDR16_HI;
enum R_PPC64_ADDR16_HA = R_PPC_ADDR16_HA;
enum R_PPC64_ADDR14 = R_PPC_ADDR14;
enum R_PPC64_ADDR14_BRTAKEN = R_PPC_ADDR14_BRTAKEN;
enum R_PPC64_ADDR14_BRNTAKEN = R_PPC_ADDR14_BRNTAKEN;
enum R_PPC64_REL24 = R_PPC_REL24;
enum R_PPC64_REL14 = R_PPC_REL14;
enum R_PPC64_REL14_BRTAKEN = R_PPC_REL14_BRTAKEN;
enum R_PPC64_REL14_BRNTAKEN = R_PPC_REL14_BRNTAKEN;
enum R_PPC64_GOT16 = R_PPC_GOT16;
enum R_PPC64_GOT16_LO = R_PPC_GOT16_LO;
enum R_PPC64_GOT16_HI = R_PPC_GOT16_HI;
enum R_PPC64_GOT16_HA = R_PPC_GOT16_HA;
enum R_PPC64_COPY = R_PPC_COPY;
enum R_PPC64_GLOB_DAT = R_PPC_GLOB_DAT;
enum R_PPC64_JMP_SLOT = R_PPC_JMP_SLOT;
enum R_PPC64_RELATIVE = R_PPC_RELATIVE;
enum R_PPC64_UADDR32 = R_PPC_UADDR32;
enum R_PPC64_UADDR16 = R_PPC_UADDR16;
enum R_PPC64_REL32 = R_PPC_REL32;
enum R_PPC64_PLT32 = R_PPC_PLT32;
enum R_PPC64_PLTREL32 = R_PPC_PLTREL32;
enum R_PPC64_PLT16_LO = R_PPC_PLT16_LO;
enum R_PPC64_PLT16_HI = R_PPC_PLT16_HI;
enum R_PPC64_PLT16_HA = R_PPC_PLT16_HA;
enum R_PPC64_SECTOFF = R_PPC_SECTOFF;
enum R_PPC64_SECTOFF_LO = R_PPC_SECTOFF_LO;
enum R_PPC64_SECTOFF_HI = R_PPC_SECTOFF_HI;
enum R_PPC64_SECTOFF_HA = R_PPC_SECTOFF_HA;
enum R_PPC64_ADDR30 = 37;
enum R_PPC64_ADDR64 = 38;
enum R_PPC64_ADDR16_HIGHER = 39;
enum R_PPC64_ADDR16_HIGHERA = 40;
enum R_PPC64_ADDR16_HIGHEST = 41;
enum R_PPC64_ADDR16_HIGHESTA = 42;
enum R_PPC64_UADDR64 = 43;
enum R_PPC64_REL64 = 44;
enum R_PPC64_PLT64 = 45;
enum R_PPC64_PLTREL64 = 46;
enum R_PPC64_TOC16 = 47;
enum R_PPC64_TOC16_LO = 48;
enum R_PPC64_TOC16_HI = 49;
enum R_PPC64_TOC16_HA = 50;
enum R_PPC64_TOC = 51;
enum R_PPC64_PLTGOT16 = 52;
enum R_PPC64_PLTGOT16_LO = 53;
enum R_PPC64_PLTGOT16_HI = 54;
enum R_PPC64_PLTGOT16_HA = 55;
enum R_PPC64_ADDR16_DS = 56;
enum R_PPC64_ADDR16_LO_DS = 57;
enum R_PPC64_GOT16_DS = 58;
enum R_PPC64_GOT16_LO_DS = 59;
enum R_PPC64_PLT16_LO_DS = 60;
enum R_PPC64_SECTOFF_DS = 61;
enum R_PPC64_SECTOFF_LO_DS = 62;
enum R_PPC64_TOC16_DS = 63;
enum R_PPC64_TOC16_LO_DS = 64;
enum R_PPC64_PLTGOT16_DS = 65;
enum R_PPC64_PLTGOT16_LO_DS = 66;
enum R_PPC64_TLS = 67;
enum R_PPC64_DTPMOD64 = 68;
enum R_PPC64_TPREL16 = 69;
enum R_PPC64_TPREL16_LO = 70;
enum R_PPC64_TPREL16_HI = 71;
enum R_PPC64_TPREL16_HA = 72;
enum R_PPC64_TPREL64 = 73;
enum R_PPC64_DTPREL16 = 74;
enum R_PPC64_DTPREL16_LO = 75;
enum R_PPC64_DTPREL16_HI = 76;
enum R_PPC64_DTPREL16_HA = 77;
enum R_PPC64_DTPREL64 = 78;
enum R_PPC64_GOT_TLSGD16 = 79;
enum R_PPC64_GOT_TLSGD16_LO = 80;
enum R_PPC64_GOT_TLSGD16_HI = 81;
enum R_PPC64_GOT_TLSGD16_HA = 82;
enum R_PPC64_GOT_TLSLD16 = 83;
enum R_PPC64_GOT_TLSLD16_LO = 84;
enum R_PPC64_GOT_TLSLD16_HI = 85;
enum R_PPC64_GOT_TLSLD16_HA = 86;
enum R_PPC64_GOT_TPREL16_DS = 87;
enum R_PPC64_GOT_TPREL16_LO_DS = 88;
enum R_PPC64_GOT_TPREL16_HI = 89;
enum R_PPC64_GOT_TPREL16_HA = 90;
enum R_PPC64_GOT_DTPREL16_DS = 91;
enum R_PPC64_GOT_DTPREL16_LO_DS = 92;
enum R_PPC64_GOT_DTPREL16_HI = 93;
enum R_PPC64_GOT_DTPREL16_HA = 94;
enum R_PPC64_TPREL16_DS = 95;
enum R_PPC64_TPREL16_LO_DS = 96;
enum R_PPC64_TPREL16_HIGHER = 97;
enum R_PPC64_TPREL16_HIGHERA = 98;
enum R_PPC64_TPREL16_HIGHEST = 99;
enum R_PPC64_TPREL16_HIGHESTA = 100;
enum R_PPC64_DTPREL16_DS = 101;
enum R_PPC64_DTPREL16_LO_DS = 102;
enum R_PPC64_DTPREL16_HIGHER = 103;
enum R_PPC64_DTPREL16_HIGHERA = 104;
enum R_PPC64_DTPREL16_HIGHEST = 105;
enum R_PPC64_DTPREL16_HIGHESTA = 106;
enum R_PPC64_JMP_IREL = 247;
enum R_PPC64_IRELATIVE = 248;
enum R_PPC64_REL16 = 249;
enum R_PPC64_REL16_LO = 250;
enum R_PPC64_REL16_HI = 251;
enum R_PPC64_REL16_HA = 252;
enum DT_PPC64_GLINK = (DT_LOPROC + 0);
enum DT_PPC64_OPD = (DT_LOPROC + 1);
enum DT_PPC64_OPDSZ = (DT_LOPROC + 2);
enum DT_PPC64_NUM = 3;
enum EF_ARM_RELEXEC = 0x01;
enum EF_ARM_HASENTRY = 0x02;
enum EF_ARM_INTERWORK = 0x04;
enum EF_ARM_APCS_26 = 0x08;
enum EF_ARM_APCS_FLOAT = 0x10;
enum EF_ARM_PIC = 0x20;
enum EF_ARM_ALIGN8 = 0x40;
enum EF_ARM_NEW_ABI = 0x80;
enum EF_ARM_OLD_ABI = 0x100;
enum EF_ARM_SOFT_FLOAT = 0x200;
enum EF_ARM_VFP_FLOAT = 0x400;
enum EF_ARM_MAVERICK_FLOAT = 0x800;
enum EF_ARM_ABI_FLOAT_SOFT = 0x200;
enum EF_ARM_ABI_FLOAT_HARD = 0x400;
enum EF_ARM_SYMSARESORTED = 0x04;
enum EF_ARM_DYNSYMSUSESEGIDX = 0x08;
enum EF_ARM_MAPSYMSFIRST = 0x10;
enum EF_ARM_EABIMASK = 0XFF000000;
enum EF_ARM_BE8 = 0x00800000;
enum EF_ARM_LE8 = 0x00400000;
extern (D) auto EF_ARM_EABI_VERSION(F)(F flags) { return flags & EF_ARM_EABIMASK; }
enum EF_ARM_EABI_UNKNOWN = 0x00000000;
enum EF_ARM_EABI_VER1 = 0x01000000;
enum EF_ARM_EABI_VER2 = 0x02000000;
enum EF_ARM_EABI_VER3 = 0x03000000;
enum EF_ARM_EABI_VER4 = 0x04000000;
enum EF_ARM_EABI_VER5 = 0x05000000;
enum STT_ARM_TFUNC = STT_LOPROC;
enum STT_ARM_16BIT = STT_HIPROC;
enum SHF_ARM_ENTRYSECT = 0x10000000;
enum SHF_ARM_COMDEF = 0x80000000;
enum PF_ARM_SB = 0x10000000;
enum PF_ARM_PI = 0x20000000;
enum PF_ARM_ABS = 0x40000000;
enum PT_ARM_EXIDX = (PT_LOPROC + 1);
enum SHT_ARM_EXIDX = (SHT_LOPROC + 1);
enum SHT_ARM_PREEMPTMAP = (SHT_LOPROC + 2);
enum SHT_ARM_ATTRIBUTES = (SHT_LOPROC + 3);
enum R_AARCH64_NONE = 0;
enum R_AARCH64_ABS64 = 257;
enum R_AARCH64_ABS32 = 258;
enum R_AARCH64_COPY = 1024;
enum R_AARCH64_GLOB_DAT = 1025;
enum R_AARCH64_JUMP_SLOT = 1026;
enum R_AARCH64_RELATIVE = 1027;
enum R_AARCH64_TLS_DTPMOD64 = 1028;
enum R_AARCH64_TLS_DTPREL64 = 1029;
enum R_AARCH64_TLS_TPREL64 = 1030;
enum R_AARCH64_TLSDESC = 1031;
enum R_ARM_NONE = 0;
enum R_ARM_PC24 = 1;
enum R_ARM_ABS32 = 2;
enum R_ARM_REL32 = 3;
enum R_ARM_PC13 = 4;
enum R_ARM_ABS16 = 5;
enum R_ARM_ABS12 = 6;
enum R_ARM_THM_ABS5 = 7;
enum R_ARM_ABS8 = 8;
enum R_ARM_SBREL32 = 9;
enum R_ARM_THM_PC22 = 10;
enum R_ARM_THM_PC8 = 11;
enum R_ARM_AMP_VCALL9 = 12;
enum R_ARM_SWI24 = 13;
enum R_ARM_TLS_DESC = 13;
enum R_ARM_THM_SWI8 = 14;
enum R_ARM_XPC25 = 15;
enum R_ARM_THM_XPC22 = 16;
enum R_ARM_TLS_DTPMOD32 = 17;
enum R_ARM_TLS_DTPOFF32 = 18;
enum R_ARM_TLS_TPOFF32 = 19;
enum R_ARM_COPY = 20;
enum R_ARM_GLOB_DAT = 21;
enum R_ARM_JUMP_SLOT = 22;
enum R_ARM_RELATIVE = 23;
enum R_ARM_GOTOFF = 24;
enum R_ARM_GOTPC = 25;
enum R_ARM_GOT32 = 26;
enum R_ARM_PLT32 = 27;
enum R_ARM_ALU_PCREL_7_0 = 32;
enum R_ARM_ALU_PCREL_15_8 = 33;
enum R_ARM_ALU_PCREL_23_15 = 34;
enum R_ARM_LDR_SBREL_11_0 = 35;
enum R_ARM_ALU_SBREL_19_12 = 36;
enum R_ARM_ALU_SBREL_27_20 = 37;
enum R_ARM_TLS_GOTDESC = 90;
enum R_ARM_TLS_CALL = 91;
enum R_ARM_TLS_DESCSEQ = 92;
enum R_ARM_THM_TLS_CALL = 93;
enum R_ARM_GNU_VTENTRY = 100;
enum R_ARM_GNU_VTINHERIT = 101;
enum R_ARM_THM_PC11 = 102;
enum R_ARM_THM_PC9 = 103;
enum R_ARM_TLS_GD32 = 104;
enum R_ARM_TLS_LDM32 = 105;
enum R_ARM_TLS_LDO32 = 106;
enum R_ARM_TLS_IE32 = 107;
enum R_ARM_TLS_LE32 = 108;
enum R_ARM_THM_TLS_DESCSEQ = 129;
enum R_ARM_IRELATIVE = 160;
enum R_ARM_RXPC25 = 249;
enum R_ARM_RSBREL32 = 250;
enum R_ARM_THM_RPC22 = 251;
enum R_ARM_RREL32 = 252;
enum R_ARM_RABS22 = 253;
enum R_ARM_RPC24 = 254;
enum R_ARM_RBASE = 255;
enum R_ARM_NUM = 256;
enum EF_IA_64_MASKOS = 0x0000000f;
enum EF_IA_64_ABI64 = 0x00000010;
enum EF_IA_64_ARCH = 0xff000000;
enum PT_IA_64_ARCHEXT = (PT_LOPROC + 0);
enum PT_IA_64_UNWIND = (PT_LOPROC + 1);
enum PT_IA_64_HP_OPT_ANOT = (PT_LOOS + 0x12);
enum PT_IA_64_HP_HSL_ANOT = (PT_LOOS + 0x13);
enum PT_IA_64_HP_STACK = (PT_LOOS + 0x14);
enum PF_IA_64_NORECOV = 0x80000000;
enum SHT_IA_64_EXT = (SHT_LOPROC + 0);
enum SHT_IA_64_UNWIND = (SHT_LOPROC + 1);
enum SHF_IA_64_SHORT = 0x10000000;
enum SHF_IA_64_NORECOV = 0x20000000;
enum DT_IA_64_PLT_RESERVE = (DT_LOPROC + 0);
enum DT_IA_64_NUM = 1;
enum R_IA64_NONE = 0x00;
enum R_IA64_IMM14 = 0x21;
enum R_IA64_IMM22 = 0x22;
enum R_IA64_IMM64 = 0x23;
enum R_IA64_DIR32MSB = 0x24;
enum R_IA64_DIR32LSB = 0x25;
enum R_IA64_DIR64MSB = 0x26;
enum R_IA64_DIR64LSB = 0x27;
enum R_IA64_GPREL22 = 0x2a;
enum R_IA64_GPREL64I = 0x2b;
enum R_IA64_GPREL32MSB = 0x2c;
enum R_IA64_GPREL32LSB = 0x2d;
enum R_IA64_GPREL64MSB = 0x2e;
enum R_IA64_GPREL64LSB = 0x2f;
enum R_IA64_LTOFF22 = 0x32;
enum R_IA64_LTOFF64I = 0x33;
enum R_IA64_PLTOFF22 = 0x3a;
enum R_IA64_PLTOFF64I = 0x3b;
enum R_IA64_PLTOFF64MSB = 0x3e;
enum R_IA64_PLTOFF64LSB = 0x3f;
enum R_IA64_FPTR64I = 0x43;
enum R_IA64_FPTR32MSB = 0x44;
enum R_IA64_FPTR32LSB = 0x45;
enum R_IA64_FPTR64MSB = 0x46;
enum R_IA64_FPTR64LSB = 0x47;
enum R_IA64_PCREL60B = 0x48;
enum R_IA64_PCREL21B = 0x49;
enum R_IA64_PCREL21M = 0x4a;
enum R_IA64_PCREL21F = 0x4b;
enum R_IA64_PCREL32MSB = 0x4c;
enum R_IA64_PCREL32LSB = 0x4d;
enum R_IA64_PCREL64MSB = 0x4e;
enum R_IA64_PCREL64LSB = 0x4f;
enum R_IA64_LTOFF_FPTR22 = 0x52;
enum R_IA64_LTOFF_FPTR64I = 0x53;
enum R_IA64_LTOFF_FPTR32MSB = 0x54;
enum R_IA64_LTOFF_FPTR32LSB = 0x55;
enum R_IA64_LTOFF_FPTR64MSB = 0x56;
enum R_IA64_LTOFF_FPTR64LSB = 0x57;
enum R_IA64_SEGREL32MSB = 0x5c;
enum R_IA64_SEGREL32LSB = 0x5d;
enum R_IA64_SEGREL64MSB = 0x5e;
enum R_IA64_SEGREL64LSB = 0x5f;
enum R_IA64_SECREL32MSB = 0x64;
enum R_IA64_SECREL32LSB = 0x65;
enum R_IA64_SECREL64MSB = 0x66;
enum R_IA64_SECREL64LSB = 0x67;
enum R_IA64_REL32MSB = 0x6c;
enum R_IA64_REL32LSB = 0x6d;
enum R_IA64_REL64MSB = 0x6e;
enum R_IA64_REL64LSB = 0x6f;
enum R_IA64_LTV32MSB = 0x74;
enum R_IA64_LTV32LSB = 0x75;
enum R_IA64_LTV64MSB = 0x76;
enum R_IA64_LTV64LSB = 0x77;
enum R_IA64_PCREL21BI = 0x79;
enum R_IA64_PCREL22 = 0x7a;
enum R_IA64_PCREL64I = 0x7b;
enum R_IA64_IPLTMSB = 0x80;
enum R_IA64_IPLTLSB = 0x81;
enum R_IA64_COPY = 0x84;
enum R_IA64_SUB = 0x85;
enum R_IA64_LTOFF22X = 0x86;
enum R_IA64_LDXMOV = 0x87;
enum R_IA64_TPREL14 = 0x91;
enum R_IA64_TPREL22 = 0x92;
enum R_IA64_TPREL64I = 0x93;
enum R_IA64_TPREL64MSB = 0x96;
enum R_IA64_TPREL64LSB = 0x97;
enum R_IA64_LTOFF_TPREL22 = 0x9a;
enum R_IA64_DTPMOD64MSB = 0xa6;
enum R_IA64_DTPMOD64LSB = 0xa7;
enum R_IA64_LTOFF_DTPMOD22 = 0xaa;
enum R_IA64_DTPREL14 = 0xb1;
enum R_IA64_DTPREL22 = 0xb2;
enum R_IA64_DTPREL64I = 0xb3;
enum R_IA64_DTPREL32MSB = 0xb4;
enum R_IA64_DTPREL32LSB = 0xb5;
enum R_IA64_DTPREL64MSB = 0xb6;
enum R_IA64_DTPREL64LSB = 0xb7;
enum R_IA64_LTOFF_DTPREL22 = 0xba;
enum EF_SH_MACH_MASK = 0x1f;
enum EF_SH_UNKNOWN = 0x0;
enum EF_SH1 = 0x1;
enum EF_SH2 = 0x2;
enum EF_SH3 = 0x3;
enum EF_SH_DSP = 0x4;
enum EF_SH3_DSP = 0x5;
enum EF_SH4AL_DSP = 0x6;
enum EF_SH3E = 0x8;
enum EF_SH4 = 0x9;
enum EF_SH2E = 0xb;
enum EF_SH4A = 0xc;
enum EF_SH2A = 0xd;
enum EF_SH4_NOFPU = 0x10;
enum EF_SH4A_NOFPU = 0x11;
enum EF_SH4_NOMMU_NOFPU = 0x12;
enum EF_SH2A_NOFPU = 0x13;
enum EF_SH3_NOMMU = 0x14;
enum EF_SH2A_SH4_NOFPU = 0x15;
enum EF_SH2A_SH3_NOFPU = 0x16;
enum EF_SH2A_SH4 = 0x17;
enum EF_SH2A_SH3E = 0x18;
enum R_SH_NONE = 0;
enum R_SH_DIR32 = 1;
enum R_SH_REL32 = 2;
enum R_SH_DIR8WPN = 3;
enum R_SH_IND12W = 4;
enum R_SH_DIR8WPL = 5;
enum R_SH_DIR8WPZ = 6;
enum R_SH_DIR8BP = 7;
enum R_SH_DIR8W = 8;
enum R_SH_DIR8L = 9;
enum R_SH_SWITCH16 = 25;
enum R_SH_SWITCH32 = 26;
enum R_SH_USES = 27;
enum R_SH_COUNT = 28;
enum R_SH_ALIGN = 29;
enum R_SH_CODE = 30;
enum R_SH_DATA = 31;
enum R_SH_LABEL = 32;
enum R_SH_SWITCH8 = 33;
enum R_SH_GNU_VTINHERIT = 34;
enum R_SH_GNU_VTENTRY = 35;
enum R_SH_TLS_GD_32 = 144;
enum R_SH_TLS_LD_32 = 145;
enum R_SH_TLS_LDO_32 = 146;
enum R_SH_TLS_IE_32 = 147;
enum R_SH_TLS_LE_32 = 148;
enum R_SH_TLS_DTPMOD32 = 149;
enum R_SH_TLS_DTPOFF32 = 150;
enum R_SH_TLS_TPOFF32 = 151;
enum R_SH_GOT32 = 160;
enum R_SH_PLT32 = 161;
enum R_SH_COPY = 162;
enum R_SH_GLOB_DAT = 163;
enum R_SH_JMP_SLOT = 164;
enum R_SH_RELATIVE = 165;
enum R_SH_GOTOFF = 166;
enum R_SH_GOTPC = 167;
enum R_SH_NUM = 256;
enum EF_S390_HIGH_GPRS = 0x00000001;
enum R_390_NONE = 0;
enum R_390_8 = 1;
enum R_390_12 = 2;
enum R_390_16 = 3;
enum R_390_32 = 4;
enum R_390_PC32 = 5;
enum R_390_GOT12 = 6;
enum R_390_GOT32 = 7;
enum R_390_PLT32 = 8;
enum R_390_COPY = 9;
enum R_390_GLOB_DAT = 10;
enum R_390_JMP_SLOT = 11;
enum R_390_RELATIVE = 12;
enum R_390_GOTOFF32 = 13;
enum R_390_GOTPC = 14;
enum R_390_GOT16 = 15;
enum R_390_PC16 = 16;
enum R_390_PC16DBL = 17;
enum R_390_PLT16DBL = 18;
enum R_390_PC32DBL = 19;
enum R_390_PLT32DBL = 20;
enum R_390_GOTPCDBL = 21;
enum R_390_64 = 22;
enum R_390_PC64 = 23;
enum R_390_GOT64 = 24;
enum R_390_PLT64 = 25;
enum R_390_GOTENT = 26;
enum R_390_GOTOFF16 = 27;
enum R_390_GOTOFF64 = 28;
enum R_390_GOTPLT12 = 29;
enum R_390_GOTPLT16 = 30;
enum R_390_GOTPLT32 = 31;
enum R_390_GOTPLT64 = 32;
enum R_390_GOTPLTENT = 33;
enum R_390_PLTOFF16 = 34;
enum R_390_PLTOFF32 = 35;
enum R_390_PLTOFF64 = 36;
enum R_390_TLS_LOAD = 37;
enum R_390_TLS_GDCALL = 38;
enum R_390_TLS_LDCALL = 39;
enum R_390_TLS_GD32 = 40;
enum R_390_TLS_GD64 = 41;
enum R_390_TLS_GOTIE12 = 42;
enum R_390_TLS_GOTIE32 = 43;
enum R_390_TLS_GOTIE64 = 44;
enum R_390_TLS_LDM32 = 45;
enum R_390_TLS_LDM64 = 46;
enum R_390_TLS_IE32 = 47;
enum R_390_TLS_IE64 = 48;
enum R_390_TLS_IEENT = 49;
enum R_390_TLS_LE32 = 50;
enum R_390_TLS_LE64 = 51;
enum R_390_TLS_LDO32 = 52;
enum R_390_TLS_LDO64 = 53;
enum R_390_TLS_DTPMOD = 54;
enum R_390_TLS_DTPOFF = 55;
enum R_390_TLS_TPOFF = 56;
enum R_390_20 = 57;
enum R_390_GOT20 = 58;
enum R_390_GOTPLT20 = 59;
enum R_390_TLS_GOTIE20 = 60;
enum R_390_IRELATIVE = 61;
enum R_390_NUM = 62;
enum R_CRIS_NONE = 0;
enum R_CRIS_8 = 1;
enum R_CRIS_16 = 2;
enum R_CRIS_32 = 3;
enum R_CRIS_8_PCREL = 4;
enum R_CRIS_16_PCREL = 5;
enum R_CRIS_32_PCREL = 6;
enum R_CRIS_GNU_VTINHERIT = 7;
enum R_CRIS_GNU_VTENTRY = 8;
enum R_CRIS_COPY = 9;
enum R_CRIS_GLOB_DAT = 10;
enum R_CRIS_JUMP_SLOT = 11;
enum R_CRIS_RELATIVE = 12;
enum R_CRIS_16_GOT = 13;
enum R_CRIS_32_GOT = 14;
enum R_CRIS_16_GOTPLT = 15;
enum R_CRIS_32_GOTPLT = 16;
enum R_CRIS_32_GOTREL = 17;
enum R_CRIS_32_PLT_GOTREL = 18;
enum R_CRIS_32_PLT_PCREL = 19;
enum R_CRIS_NUM = 20;
enum R_X86_64_NONE = 0;
enum R_X86_64_64 = 1;
enum R_X86_64_PC32 = 2;
enum R_X86_64_GOT32 = 3;
enum R_X86_64_PLT32 = 4;
enum R_X86_64_COPY = 5;
enum R_X86_64_GLOB_DAT = 6;
enum R_X86_64_JUMP_SLOT = 7;
enum R_X86_64_RELATIVE = 8;
enum R_X86_64_GOTPCREL = 9;
enum R_X86_64_32 = 10;
enum R_X86_64_32S = 11;
enum R_X86_64_16 = 12;
enum R_X86_64_PC16 = 13;
enum R_X86_64_8 = 14;
enum R_X86_64_PC8 = 15;
enum R_X86_64_DTPMOD64 = 16;
enum R_X86_64_DTPOFF64 = 17;
enum R_X86_64_TPOFF64 = 18;
enum R_X86_64_TLSGD = 19;
enum R_X86_64_TLSLD = 20;
enum R_X86_64_DTPOFF32 = 21;
enum R_X86_64_GOTTPOFF = 22;
enum R_X86_64_TPOFF32 = 23;
enum R_X86_64_PC64 = 24;
enum R_X86_64_GOTOFF64 = 25;
enum R_X86_64_GOTPC32 = 26;
enum R_X86_64_GOT64 = 27;
enum R_X86_64_GOTPCREL64 = 28;
enum R_X86_64_GOTPC64 = 29;
enum R_X86_64_GOTPLT64 = 30;
enum R_X86_64_PLTOFF64 = 31;
enum R_X86_64_SIZE32 = 32;
enum R_X86_64_SIZE64 = 33;
enum R_X86_64_GOTPC32_TLSDESC = 34;
enum R_X86_64_TLSDESC_CALL = 35;
enum R_X86_64_TLSDESC = 36;
enum R_X86_64_IRELATIVE = 37;
enum R_X86_64_RELATIVE64 = 38;
enum R_X86_64_NUM = 39;
enum R_MN10300_NONE = 0;
enum R_MN10300_32 = 1;
enum R_MN10300_16 = 2;
enum R_MN10300_8 = 3;
enum R_MN10300_PCREL32 = 4;
enum R_MN10300_PCREL16 = 5;
enum R_MN10300_PCREL8 = 6;
enum R_MN10300_GNU_VTINHERIT = 7;
enum R_MN10300_GNU_VTENTRY = 8;
enum R_MN10300_24 = 9;
enum R_MN10300_GOTPC32 = 10;
enum R_MN10300_GOTPC16 = 11;
enum R_MN10300_GOTOFF32 = 12;
enum R_MN10300_GOTOFF24 = 13;
enum R_MN10300_GOTOFF16 = 14;
enum R_MN10300_PLT32 = 15;
enum R_MN10300_PLT16 = 16;
enum R_MN10300_GOT32 = 17;
enum R_MN10300_GOT24 = 18;
enum R_MN10300_GOT16 = 19;
enum R_MN10300_COPY = 20;
enum R_MN10300_GLOB_DAT = 21;
enum R_MN10300_JMP_SLOT = 22;
enum R_MN10300_RELATIVE = 23;
enum R_MN10300_TLS_GD = 24;
enum R_MN10300_TLS_LD = 25;
enum R_MN10300_TLS_LDO = 26;
enum R_MN10300_TLS_GOTIE = 27;
enum R_MN10300_TLS_IE = 28;
enum R_MN10300_TLS_LE = 29;
enum R_MN10300_TLS_DTPMOD = 30;
enum R_MN10300_TLS_DTPOFF = 31;
enum R_MN10300_TLS_TPOFF = 32;
enum R_MN10300_SYM_DIFF = 33;
enum R_MN10300_ALIGN = 34;
enum R_MN10300_NUM = 35;
enum R_M32R_NONE = 0;
enum R_M32R_16 = 1;
enum R_M32R_32 = 2;
enum R_M32R_24 = 3;
enum R_M32R_10_PCREL = 4;
enum R_M32R_18_PCREL = 5;
enum R_M32R_26_PCREL = 6;
enum R_M32R_HI16_ULO = 7;
enum R_M32R_HI16_SLO = 8;
enum R_M32R_LO16 = 9;
enum R_M32R_SDA16 = 10;
enum R_M32R_GNU_VTINHERIT = 11;
enum R_M32R_GNU_VTENTRY = 12;
enum R_M32R_16_RELA = 33;
enum R_M32R_32_RELA = 34;
enum R_M32R_24_RELA = 35;
enum R_M32R_10_PCREL_RELA = 36;
enum R_M32R_18_PCREL_RELA = 37;
enum R_M32R_26_PCREL_RELA = 38;
enum R_M32R_HI16_ULO_RELA = 39;
enum R_M32R_HI16_SLO_RELA = 40;
enum R_M32R_LO16_RELA = 41;
enum R_M32R_SDA16_RELA = 42;
enum R_M32R_RELA_GNU_VTINHERIT = 43;
enum R_M32R_RELA_GNU_VTENTRY = 44;
enum R_M32R_REL32 = 45;
enum R_M32R_GOT24 = 48;
enum R_M32R_26_PLTREL = 49;
enum R_M32R_COPY = 50;
enum R_M32R_GLOB_DAT = 51;
enum R_M32R_JMP_SLOT = 52;
enum R_M32R_RELATIVE = 53;
enum R_M32R_GOTOFF = 54;
enum R_M32R_GOTPC24 = 55;
enum R_M32R_GOT16_HI_ULO = 56;
enum R_M32R_GOT16_HI_SLO = 57;
enum R_M32R_GOT16_LO = 58;
enum R_M32R_GOTPC_HI_ULO = 59;
enum R_M32R_GOTPC_HI_SLO = 60;
enum R_M32R_GOTPC_LO = 61;
enum R_M32R_GOTOFF_HI_ULO = 62;
enum R_M32R_GOTOFF_HI_SLO = 63;
enum R_M32R_GOTOFF_LO = 64;
enum R_M32R_NUM = 256;
enum R_TILEPRO_NONE = 0;
enum R_TILEPRO_32 = 1;
enum R_TILEPRO_16 = 2;
enum R_TILEPRO_8 = 3;
enum R_TILEPRO_32_PCREL = 4;
enum R_TILEPRO_16_PCREL = 5;
enum R_TILEPRO_8_PCREL = 6;
enum R_TILEPRO_LO16 = 7;
enum R_TILEPRO_HI16 = 8;
enum R_TILEPRO_HA16 = 9;
enum R_TILEPRO_COPY = 10;
enum R_TILEPRO_GLOB_DAT = 11;
enum R_TILEPRO_JMP_SLOT = 12;
enum R_TILEPRO_RELATIVE = 13;
enum R_TILEPRO_BROFF_X1 = 14;
enum R_TILEPRO_JOFFLONG_X1 = 15;
enum R_TILEPRO_JOFFLONG_X1_PLT = 16;
enum R_TILEPRO_IMM8_X0 = 17;
enum R_TILEPRO_IMM8_Y0 = 18;
enum R_TILEPRO_IMM8_X1 = 19;
enum R_TILEPRO_IMM8_Y1 = 20;
enum R_TILEPRO_MT_IMM15_X1 = 21;
enum R_TILEPRO_MF_IMM15_X1 = 22;
enum R_TILEPRO_IMM16_X0 = 23;
enum R_TILEPRO_IMM16_X1 = 24;
enum R_TILEPRO_IMM16_X0_LO = 25;
enum R_TILEPRO_IMM16_X1_LO = 26;
enum R_TILEPRO_IMM16_X0_HI = 27;
enum R_TILEPRO_IMM16_X1_HI = 28;
enum R_TILEPRO_IMM16_X0_HA = 29;
enum R_TILEPRO_IMM16_X1_HA = 30;
enum R_TILEPRO_IMM16_X0_PCREL = 31;
enum R_TILEPRO_IMM16_X1_PCREL = 32;
enum R_TILEPRO_IMM16_X0_LO_PCREL = 33;
enum R_TILEPRO_IMM16_X1_LO_PCREL = 34;
enum R_TILEPRO_IMM16_X0_HI_PCREL = 35;
enum R_TILEPRO_IMM16_X1_HI_PCREL = 36;
enum R_TILEPRO_IMM16_X0_HA_PCREL = 37;
enum R_TILEPRO_IMM16_X1_HA_PCREL = 38;
enum R_TILEPRO_IMM16_X0_GOT = 39;
enum R_TILEPRO_IMM16_X1_GOT = 40;
enum R_TILEPRO_IMM16_X0_GOT_LO = 41;
enum R_TILEPRO_IMM16_X1_GOT_LO = 42;
enum R_TILEPRO_IMM16_X0_GOT_HI = 43;
enum R_TILEPRO_IMM16_X1_GOT_HI = 44;
enum R_TILEPRO_IMM16_X0_GOT_HA = 45;
enum R_TILEPRO_IMM16_X1_GOT_HA = 46;
enum R_TILEPRO_MMSTART_X0 = 47;
enum R_TILEPRO_MMEND_X0 = 48;
enum R_TILEPRO_MMSTART_X1 = 49;
enum R_TILEPRO_MMEND_X1 = 50;
enum R_TILEPRO_SHAMT_X0 = 51;
enum R_TILEPRO_SHAMT_X1 = 52;
enum R_TILEPRO_SHAMT_Y0 = 53;
enum R_TILEPRO_SHAMT_Y1 = 54;
enum R_TILEPRO_DEST_IMM8_X1 = 55;
enum R_TILEPRO_TLS_GD_CALL = 60;
enum R_TILEPRO_IMM8_X0_TLS_GD_ADD = 61;
enum R_TILEPRO_IMM8_X1_TLS_GD_ADD = 62;
enum R_TILEPRO_IMM8_Y0_TLS_GD_ADD = 63;
enum R_TILEPRO_IMM8_Y1_TLS_GD_ADD = 64;
enum R_TILEPRO_TLS_IE_LOAD = 65;
enum R_TILEPRO_IMM16_X0_TLS_GD = 66;
enum R_TILEPRO_IMM16_X1_TLS_GD = 67;
enum R_TILEPRO_IMM16_X0_TLS_GD_LO = 68;
enum R_TILEPRO_IMM16_X1_TLS_GD_LO = 69;
enum R_TILEPRO_IMM16_X0_TLS_GD_HI = 70;
enum R_TILEPRO_IMM16_X1_TLS_GD_HI = 71;
enum R_TILEPRO_IMM16_X0_TLS_GD_HA = 72;
enum R_TILEPRO_IMM16_X1_TLS_GD_HA = 73;
enum R_TILEPRO_IMM16_X0_TLS_IE = 74;
enum R_TILEPRO_IMM16_X1_TLS_IE = 75;
enum R_TILEPRO_IMM16_X0_TLS_IE_LO = 76;
enum R_TILEPRO_IMM16_X1_TLS_IE_LO = 77;
enum R_TILEPRO_IMM16_X0_TLS_IE_HI = 78;
enum R_TILEPRO_IMM16_X1_TLS_IE_HI = 79;
enum R_TILEPRO_IMM16_X0_TLS_IE_HA = 80;
enum R_TILEPRO_IMM16_X1_TLS_IE_HA = 81;
enum R_TILEPRO_TLS_DTPMOD32 = 82;
enum R_TILEPRO_TLS_DTPOFF32 = 83;
enum R_TILEPRO_TLS_TPOFF32 = 84;
enum R_TILEPRO_IMM16_X0_TLS_LE = 85;
enum R_TILEPRO_IMM16_X1_TLS_LE = 86;
enum R_TILEPRO_IMM16_X0_TLS_LE_LO = 87;
enum R_TILEPRO_IMM16_X1_TLS_LE_LO = 88;
enum R_TILEPRO_IMM16_X0_TLS_LE_HI = 89;
enum R_TILEPRO_IMM16_X1_TLS_LE_HI = 90;
enum R_TILEPRO_IMM16_X0_TLS_LE_HA = 91;
enum R_TILEPRO_IMM16_X1_TLS_LE_HA = 92;
enum R_TILEPRO_GNU_VTINHERIT = 128;
enum R_TILEPRO_GNU_VTENTRY = 129;
enum R_TILEPRO_NUM = 130;
enum R_TILEGX_NONE = 0;
enum R_TILEGX_64 = 1;
enum R_TILEGX_32 = 2;
enum R_TILEGX_16 = 3;
enum R_TILEGX_8 = 4;
enum R_TILEGX_64_PCREL = 5;
enum R_TILEGX_32_PCREL = 6;
enum R_TILEGX_16_PCREL = 7;
enum R_TILEGX_8_PCREL = 8;
enum R_TILEGX_HW0 = 9;
enum R_TILEGX_HW1 = 10;
enum R_TILEGX_HW2 = 11;
enum R_TILEGX_HW3 = 12;
enum R_TILEGX_HW0_LAST = 13;
enum R_TILEGX_HW1_LAST = 14;
enum R_TILEGX_HW2_LAST = 15;
enum R_TILEGX_COPY = 16;
enum R_TILEGX_GLOB_DAT = 17;
enum R_TILEGX_JMP_SLOT = 18;
enum R_TILEGX_RELATIVE = 19;
enum R_TILEGX_BROFF_X1 = 20;
enum R_TILEGX_JUMPOFF_X1 = 21;
enum R_TILEGX_JUMPOFF_X1_PLT = 22;
enum R_TILEGX_IMM8_X0 = 23;
enum R_TILEGX_IMM8_Y0 = 24;
enum R_TILEGX_IMM8_X1 = 25;
enum R_TILEGX_IMM8_Y1 = 26;
enum R_TILEGX_DEST_IMM8_X1 = 27;
enum R_TILEGX_MT_IMM14_X1 = 28;
enum R_TILEGX_MF_IMM14_X1 = 29;
enum R_TILEGX_MMSTART_X0 = 30;
enum R_TILEGX_MMEND_X0 = 31;
enum R_TILEGX_SHAMT_X0 = 32;
enum R_TILEGX_SHAMT_X1 = 33;
enum R_TILEGX_SHAMT_Y0 = 34;
enum R_TILEGX_SHAMT_Y1 = 35;
enum R_TILEGX_IMM16_X0_HW0 = 36;
enum R_TILEGX_IMM16_X1_HW0 = 37;
enum R_TILEGX_IMM16_X0_HW1 = 38;
enum R_TILEGX_IMM16_X1_HW1 = 39;
enum R_TILEGX_IMM16_X0_HW2 = 40;
enum R_TILEGX_IMM16_X1_HW2 = 41;
enum R_TILEGX_IMM16_X0_HW3 = 42;
enum R_TILEGX_IMM16_X1_HW3 = 43;
enum R_TILEGX_IMM16_X0_HW0_LAST = 44;
enum R_TILEGX_IMM16_X1_HW0_LAST = 45;
enum R_TILEGX_IMM16_X0_HW1_LAST = 46;
enum R_TILEGX_IMM16_X1_HW1_LAST = 47;
enum R_TILEGX_IMM16_X0_HW2_LAST = 48;
enum R_TILEGX_IMM16_X1_HW2_LAST = 49;
enum R_TILEGX_IMM16_X0_HW0_PCREL = 50;
enum R_TILEGX_IMM16_X1_HW0_PCREL = 51;
enum R_TILEGX_IMM16_X0_HW1_PCREL = 52;
enum R_TILEGX_IMM16_X1_HW1_PCREL = 53;
enum R_TILEGX_IMM16_X0_HW2_PCREL = 54;
enum R_TILEGX_IMM16_X1_HW2_PCREL = 55;
enum R_TILEGX_IMM16_X0_HW3_PCREL = 56;
enum R_TILEGX_IMM16_X1_HW3_PCREL = 57;
enum R_TILEGX_IMM16_X0_HW0_LAST_PCREL = 58;
enum R_TILEGX_IMM16_X1_HW0_LAST_PCREL = 59;
enum R_TILEGX_IMM16_X0_HW1_LAST_PCREL = 60;
enum R_TILEGX_IMM16_X1_HW1_LAST_PCREL = 61;
enum R_TILEGX_IMM16_X0_HW2_LAST_PCREL = 62;
enum R_TILEGX_IMM16_X1_HW2_LAST_PCREL = 63;
enum R_TILEGX_IMM16_X0_HW0_GOT = 64;
enum R_TILEGX_IMM16_X1_HW0_GOT = 65;
enum R_TILEGX_IMM16_X0_HW0_PLT_PCREL = 66;
enum R_TILEGX_IMM16_X1_HW0_PLT_PCREL = 67;
enum R_TILEGX_IMM16_X0_HW1_PLT_PCREL = 68;
enum R_TILEGX_IMM16_X1_HW1_PLT_PCREL = 69;
enum R_TILEGX_IMM16_X0_HW2_PLT_PCREL = 70;
enum R_TILEGX_IMM16_X1_HW2_PLT_PCREL = 71;
enum R_TILEGX_IMM16_X0_HW0_LAST_GOT = 72;
enum R_TILEGX_IMM16_X1_HW0_LAST_GOT = 73;
enum R_TILEGX_IMM16_X0_HW1_LAST_GOT = 74;
enum R_TILEGX_IMM16_X1_HW1_LAST_GOT = 75;
enum R_TILEGX_IMM16_X0_HW3_PLT_PCREL = 76;
enum R_TILEGX_IMM16_X1_HW3_PLT_PCREL = 77;
enum R_TILEGX_IMM16_X0_HW0_TLS_GD = 78;
enum R_TILEGX_IMM16_X1_HW0_TLS_GD = 79;
enum R_TILEGX_IMM16_X0_HW0_TLS_LE = 80;
enum R_TILEGX_IMM16_X1_HW0_TLS_LE = 81;
enum R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE = 82;
enum R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE = 83;
enum R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE = 84;
enum R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE = 85;
enum R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD = 86;
enum R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD = 87;
enum R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD = 88;
enum R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD = 89;
enum R_TILEGX_IMM16_X0_HW0_TLS_IE = 92;
enum R_TILEGX_IMM16_X1_HW0_TLS_IE = 93;
enum R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL = 94;
enum R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL = 95;
enum R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL = 96;
enum R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL = 97;
enum R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL = 98;
enum R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL = 99;
enum R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE = 100;
enum R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE = 101;
enum R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE = 102;
enum R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE = 103;
enum R_TILEGX_TLS_DTPMOD64 = 106;
enum R_TILEGX_TLS_DTPOFF64 = 107;
enum R_TILEGX_TLS_TPOFF64 = 108;
enum R_TILEGX_TLS_DTPMOD32 = 109;
enum R_TILEGX_TLS_DTPOFF32 = 110;
enum R_TILEGX_TLS_TPOFF32 = 111;
enum R_TILEGX_TLS_GD_CALL = 112;
enum R_TILEGX_IMM8_X0_TLS_GD_ADD = 113;
enum R_TILEGX_IMM8_X1_TLS_GD_ADD = 114;
enum R_TILEGX_IMM8_Y0_TLS_GD_ADD = 115;
enum R_TILEGX_IMM8_Y1_TLS_GD_ADD = 116;
enum R_TILEGX_TLS_IE_LOAD = 117;
enum R_TILEGX_IMM8_X0_TLS_ADD = 118;
enum R_TILEGX_IMM8_X1_TLS_ADD = 119;
enum R_TILEGX_IMM8_Y0_TLS_ADD = 120;
enum R_TILEGX_IMM8_Y1_TLS_ADD = 121;
enum R_TILEGX_GNU_VTINHERIT = 128;
enum R_TILEGX_GNU_VTENTRY = 129;
enum R_TILEGX_NUM = 130;
|
D
|
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Supplements.build/Debug-iphonesimulator/Supplements.build/Objects-normal/x86_64/ConstructureTableViewCell.o : /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/Views/CustomTextField.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/Views/PickerTextField.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/HealthService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/UserNetworkService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/PagesNetworkService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Extensions/Extension+Date.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/AppDelegate.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/UIImage+imageResize.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/BlogModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/FormModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/LoginModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/SymptomsModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/tableViewModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/ConstructureViewModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/TodayModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/PageCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/QuestionCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/Views/PillsCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/Views/ConstructureTableViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitTableViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/Views/CustomCollectionViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/ConstructureViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/BlogViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/FormViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/LoginViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/QuestionsCollectionViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/SymptomsViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/TodayViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Googleuser.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Errors.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constants.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/Views/PillsHeaderVIew.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Extensions/Extension+ScrollView.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/Views/ContentView.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Enums/Enum+Sex.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Modules/CalendarHeatmap.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Modules/SwipeableTabBarController.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Modules/Popover.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/HealthKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/DeveloperToolsSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Modules/CollectionViewPagingLayout.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Modules/LinearProgressView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/Onboard-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Headers/CalendarHeatmap-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Headers/SwipeableTabBarController-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Headers/Popover-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Headers/CollectionViewPagingLayout-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Headers/LinearProgressView-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDProfileData.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDSignIn.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GoogleSignIn.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDAuthentication.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDSignInButton.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/OnboardingViewController.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/OnboardingContentViewController.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDGoogleUser.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Headers/CalendarHeatmap-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Headers/SwipeableTabBarController-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Headers/Popover-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Headers/CollectionViewPagingLayout-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Headers/LinearProgressView-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.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/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UniformTypeIdentifiers.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Supplements.build/Debug-iphonesimulator/Supplements.build/Objects-normal/x86_64/ConstructureTableViewCell~partial.swiftmodule : /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/Views/CustomTextField.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/Views/PickerTextField.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/HealthService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/UserNetworkService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/PagesNetworkService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Extensions/Extension+Date.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/AppDelegate.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/UIImage+imageResize.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/BlogModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/FormModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/LoginModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/SymptomsModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/tableViewModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/ConstructureViewModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/TodayModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/PageCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/QuestionCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/Views/PillsCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/Views/ConstructureTableViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitTableViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/Views/CustomCollectionViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/ConstructureViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/BlogViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/FormViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/LoginViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/QuestionsCollectionViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/SymptomsViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/TodayViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Googleuser.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Errors.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constants.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/Views/PillsHeaderVIew.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Extensions/Extension+ScrollView.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/Views/ContentView.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Enums/Enum+Sex.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Modules/CalendarHeatmap.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Modules/SwipeableTabBarController.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Modules/Popover.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/HealthKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/DeveloperToolsSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Modules/CollectionViewPagingLayout.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Modules/LinearProgressView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/Onboard-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Headers/CalendarHeatmap-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Headers/SwipeableTabBarController-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Headers/Popover-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Headers/CollectionViewPagingLayout-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Headers/LinearProgressView-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDProfileData.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDSignIn.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GoogleSignIn.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDAuthentication.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDSignInButton.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/OnboardingViewController.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/OnboardingContentViewController.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDGoogleUser.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Headers/CalendarHeatmap-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Headers/SwipeableTabBarController-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Headers/Popover-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Headers/CollectionViewPagingLayout-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Headers/LinearProgressView-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.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/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UniformTypeIdentifiers.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Supplements.build/Debug-iphonesimulator/Supplements.build/Objects-normal/x86_64/ConstructureTableViewCell~partial.swiftdoc : /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/Views/CustomTextField.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/Views/PickerTextField.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/HealthService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/UserNetworkService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/PagesNetworkService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Extensions/Extension+Date.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/AppDelegate.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/UIImage+imageResize.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/BlogModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/FormModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/LoginModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/SymptomsModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/tableViewModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/ConstructureViewModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/TodayModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/PageCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/QuestionCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/Views/PillsCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/Views/ConstructureTableViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitTableViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/Views/CustomCollectionViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/ConstructureViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/BlogViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/FormViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/LoginViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/QuestionsCollectionViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/SymptomsViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/TodayViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Googleuser.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Errors.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constants.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/Views/PillsHeaderVIew.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Extensions/Extension+ScrollView.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/Views/ContentView.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Enums/Enum+Sex.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Modules/CalendarHeatmap.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Modules/SwipeableTabBarController.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Modules/Popover.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/HealthKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/DeveloperToolsSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Modules/CollectionViewPagingLayout.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Modules/LinearProgressView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/Onboard-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Headers/CalendarHeatmap-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Headers/SwipeableTabBarController-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Headers/Popover-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Headers/CollectionViewPagingLayout-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Headers/LinearProgressView-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDProfileData.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDSignIn.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GoogleSignIn.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDAuthentication.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDSignInButton.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/OnboardingViewController.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/OnboardingContentViewController.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDGoogleUser.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Headers/CalendarHeatmap-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Headers/SwipeableTabBarController-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Headers/Popover-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Headers/CollectionViewPagingLayout-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Headers/LinearProgressView-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.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/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UniformTypeIdentifiers.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Supplements.build/Debug-iphonesimulator/Supplements.build/Objects-normal/x86_64/ConstructureTableViewCell~partial.swiftsourceinfo : /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/Views/CustomTextField.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/Views/PickerTextField.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/HealthService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/UserNetworkService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/PagesNetworkService.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Extensions/Extension+Date.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/AppDelegate.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/UIImage+imageResize.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/BlogModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/FormModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/LoginModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/SymptomsModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/tableViewModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/ConstructureViewModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/TodayModel.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/PageCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/QuestionCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/Views/PillsCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/Views/ConstructureTableViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitTableViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/Views/CustomCollectionViewCell.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constructure/ConstructureViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Blog/BlogViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/FormViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Login/LoginViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/QuestionsCollectionViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Symptoms/SymptomsViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Deficit/DeficitViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/TodayViewController.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Googleuser.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Errors.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Constants.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Today/Views/PillsHeaderVIew.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Extensions/Extension+ScrollView.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Form/Views/ContentView.swift /Users/sapientisat/Projects/Supplements/Supplements/Supplements/Enums/Enum+Sex.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Modules/CalendarHeatmap.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Modules/SwipeableTabBarController.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Modules/Popover.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/HealthKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/DeveloperToolsSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Modules/CollectionViewPagingLayout.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Modules/LinearProgressView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/Onboard-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Headers/CalendarHeatmap-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Headers/SwipeableTabBarController-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Headers/Popover-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Headers/CollectionViewPagingLayout-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Headers/LinearProgressView-umbrella.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDProfileData.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDSignIn.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GoogleSignIn.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDAuthentication.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDSignInButton.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/OnboardingViewController.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Headers/OnboardingContentViewController.h /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Headers/GIDGoogleUser.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Headers/CalendarHeatmap-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Headers/SwipeableTabBarController-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Headers/Popover-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Headers/CollectionViewPagingLayout-Swift.h /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Headers/LinearProgressView-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Onboard/Onboard.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CalendarHeatmap/CalendarHeatmap.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SwipeableTabBarController/SwipeableTabBarController.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/Popover/Popover.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/CollectionViewPagingLayout/CollectionViewPagingLayout.framework/Modules/module.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Products/Debug-iphonesimulator/LinearProgressView/LinearProgressView.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.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/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UniformTypeIdentifiers.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/lib.d, _lib.d)
* Documentation: https://dlang.org/phobos/dmd_lib.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/lib.d
*/
module dmd.lib;
import core.stdc.stdio;
import core.stdc.stdarg;
import dmd.globals;
import dmd.errors;
import dmd.utils;
import dmd.root.outbuffer;
import dmd.root.file;
import dmd.root.filename;
static if (TARGET.Windows)
{
import dmd.libomf;
import dmd.libmscoff;
}
else static if (TARGET.Linux || TARGET.FreeBSD || TARGET.OpenBSD || TARGET.Solaris || TARGET.DragonFlyBSD)
{
import dmd.libelf;
}
else static if (TARGET.OSX)
{
import dmd.libmach;
}
else
{
static assert(0, "unsupported system");
}
enum LOG = false;
class Library
{
static Library factory()
{
static if (TARGET.Windows)
{
return (global.params.mscoff || global.params.is64bit) ? LibMSCoff_factory() : LibOMF_factory();
}
else static if (TARGET.Linux || TARGET.FreeBSD || TARGET.OpenBSD || TARGET.Solaris || TARGET.DragonFlyBSD)
{
return LibElf_factory();
}
else static if (TARGET.OSX)
{
return LibMach_factory();
}
else
{
assert(0); // unsupported system
}
}
abstract void addObject(const(char)* module_name, const ubyte[] buf);
protected abstract void WriteLibToBuffer(OutBuffer* libbuf);
/***********************************
* Set the library file name based on the output directory
* and the filename.
* Add default library file name extension.
* Params:
* dir = path to file
* filename = name of file relative to `dir`
*/
final void setFilename(const(char)* dir, const(char)* filename)
{
static if (LOG)
{
printf("LibElf::setFilename(dir = '%s', filename = '%s')\n", dir ? dir : "", filename ? filename : "");
}
const(char)* arg = filename;
if (!arg || !*arg)
{
// Generate lib file name from first obj name
const(char)* n = global.params.objfiles[0];
n = FileName.name(n);
arg = FileName.forceExt(n, global.lib_ext);
}
if (!FileName.absolute(arg))
arg = FileName.combine(dir, arg);
loc.filename = FileName.defaultExt(arg, global.lib_ext);
loc.linnum = 0;
loc.charnum = 0;
}
final void write()
{
if (global.params.verbose)
message("library %s", loc.filename);
OutBuffer libbuf;
WriteLibToBuffer(&libbuf);
// Transfer image to file
File* libfile = File.create(loc.filename);
libfile.setbuffer(libbuf.data, libbuf.offset);
libbuf.extractData();
ensurePathToNameExists(Loc.initial, libfile.name.toChars());
writeFile(Loc.initial, libfile);
}
final void error(const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
.verror(loc, format, ap);
va_end(ap);
}
protected:
Loc loc; // the filename of the library
}
version (D_LP64)
alias cpp_size_t = size_t;
else version (OSX)
{
import core.stdc.config : cpp_ulong;
alias cpp_size_t = cpp_ulong;
}
else
alias cpp_size_t = size_t;
extern (C++) void addObjectToLibrary(Library lib, const(char)* module_name, const(ubyte)* buf, cpp_size_t buflen)
{
lib.addObject(module_name, buf[0 .. buflen]);
}
|
D
|
import std.stdio;
struct S
{
int x;
int y;
}
/********************************************/
void test1()
{
S s = S(1,2);
assert(s.x == 1);
assert(s.y == 2);
}
/********************************************/
void foo2(S s)
{
assert(s.x == 1);
assert(s.y == 2);
}
void test2()
{
foo2( S(1,2) );
}
/********************************************/
S foo3()
{
return S(1, 2);
}
void test3()
{
S s = foo3();
assert(s.x == 1);
assert(s.y == 2);
}
/********************************************/
struct S4
{
long x;
long y;
long z;
}
S4 foo4()
{
return S4(1, 2, 3);
}
void test4()
{
S4 s = foo4();
assert(s.x == 1);
assert(s.y == 2);
assert(s.z == 3);
}
/********************************************/
struct S5
{
long x;
char y;
long z;
}
S5 foo5()
{
return S5(1, 2, 3);
}
void test5()
{
S5 s = foo5();
assert(s.x == 1);
assert(s.y == 2);
assert(s.z == 3);
}
/********************************************/
struct S6
{
long x;
char y;
long z;
}
void test6()
{
S6 s1 = S6(1,2,3);
S6 s2 = S6(1,2,3);
assert(s1 == s2);
s1 = S6(4,5,6);
s2 = S6(4,5,6);
assert(s1 == s2);
S6* p1 = &s1;
S6* p2 = &s2;
*p1 = S6(7,8,9);
*p2 = S6(7,8,9);
assert(*p1 == *p2);
}
/********************************************/
struct S7
{
long x;
char y;
long z;
}
void test7()
{
static S7 s1 = S7(1,2,3);
static S7 s2 = S7(1,2,3);
assert(s1 == s2);
}
/********************************************/
struct S8
{
int i;
string s;
}
void test8()
{
S8 s = S8(3, "hello");
assert(s.i == 3);
assert(s.s == "hello");
static S8 t = S8(4, "betty");
assert(t.i == 4);
assert(t.s == "betty");
S8 u = S8(3, ['h','e','l','l','o']);
assert(u.i == 3);
assert(u.s == "hello");
static S8 v = S8(4, ['b','e','t','t','y']);
assert(v.i == 4);
assert(v.s == "betty");
}
/********************************************/
struct S9
{
int i;
char[5] s;
}
void test9()
{
S9 s = S9(3, "hello");
assert(s.i == 3);
assert(s.s == "hello");
static S9 t = S9(4, "betty");
assert(t.i == 4);
assert(t.s == "betty");
S9 u = S9(3, ['h','e','l','l','o']);
assert(u.i == 3);
assert(u.s == "hello");
static S9 v = S9(4, ['b','e','t','t','y']);
assert(v.i == 4);
assert(v.s == "betty");
}
/********************************************/
alias int myint10;
struct S10
{
int i;
union
{
int x = 2;
int y;
}
int j = 3;
myint10 k = 4;
}
void test10()
{
S10 s = S10( 1 );
assert(s.i == 1);
assert(s.x == 2);
assert(s.y == 2);
assert(s.j == 3);
assert(s.k == 4);
static S10 t = S10( 1 );
assert(t.i == 1);
assert(t.x == 2);
assert(t.y == 2);
assert(t.j == 3);
assert(t.k == 4);
S10 u = S10( 1, 5 );
assert(u.i == 1);
assert(u.x == 5);
assert(u.y == 5);
assert(u.j == 3);
assert(u.k == 4);
static S10 v = S10( 1, 6 );
assert(v.i == 1);
assert(v.x == 6);
assert(v.y == 6);
assert(v.j == 3);
assert(v.k == 4);
}
/********************************************/
struct S11
{
int i;
int j = 3;
}
void test11()
{
static const s = S11( 1, 5 );
static const i = s.i;
assert(i == 1);
static assert(s.j == 5);
}
/********************************************/
struct S12
{
int[5] x;
int[5] y = 3;
}
void test12()
{
S12 s = S12();
foreach (v; s.x)
assert(v == 0);
foreach (v; s.y)
assert(v == 3);
}
/********************************************/
struct S13
{
int[5] x;
int[5] y;
int[6][3] z;
}
void test13()
{
S13 s = S13(0,3,4);
foreach (v; s.x)
assert(v == 0);
foreach (v; s.y)
assert(v == 3);
for (int i = 0; i < 6; i++)
{
for (int j = 0; j < 3; j++)
{
assert(s.z[j][i] == 4);
}
}
}
/********************************************/
struct S14a { int n; }
struct S14b { this(int n){} }
void foo14(ref S14a s) {}
void foo14(ref S14b s) {}
void hoo14()(ref S14a s) {}
void hoo14()(ref S14b s) {}
void poo14(S)(ref S s) {}
void bar14(S14a s) {}
void bar14(S14b s) {}
void var14()(S14a s) {}
void var14()(S14b s) {}
void war14(S)(S s) {}
int baz14( S14a s) { return 1; }
int baz14(ref S14a s) { return 2; }
int baz14( S14b s) { return 1; }
int baz14(ref S14b s) { return 2; }
int vaz14()( S14a s) { return 1; }
int vaz14()(ref S14a s) { return 2; }
int vaz14()( S14b s) { return 1; }
int vaz14()(ref S14b s) { return 2; }
int waz14(S)( S s) { return 1; }
int waz14(S)(ref S s) { return 2; }
void test14()
{
// can not bind rvalue-sl with ref
static assert(!__traits(compiles, foo14(S14a(0))));
static assert(!__traits(compiles, foo14(S14b(0))));
static assert(!__traits(compiles, hoo14(S14a(0))));
static assert(!__traits(compiles, hoo14(S14b(0))));
static assert(!__traits(compiles, poo14(S14a(0))));
static assert(!__traits(compiles, poo14(S14b(0))));
// still can bind rvalue-sl with non-ref
bar14(S14a(0));
bar14(S14b(0));
var14(S14a(0));
var14(S14b(0));
war14(S14a(0));
war14(S14b(0));
// preferred binding of rvalue-sl in overload resolution
assert(baz14(S14a(0)) == 1);
assert(baz14(S14b(0)) == 1);
assert(vaz14(S14a(0)) == 1);
assert(vaz14(S14b(0)) == 1);
assert(waz14(S14a(0)) == 1);
assert(waz14(S14b(0)) == 1);
}
/********************************************/
void check15(T, ubyte results, A...)(A args)
{
// m c i s sc
enum m = (results & 0b_1_0_0_0_0) != 0;
enum c = (results & 0b_0_1_0_0_0) != 0;
enum i = (results & 0b_0_0_1_0_0) != 0;
enum s = (results & 0b_0_0_0_1_0) != 0;
enum sc = (results & 0b_0_0_0_0_1) != 0;
// allocation on stack
static assert((is(typeof( T(args) ) U) && is(U == T )) == m);
static assert((is(typeof( const T(args) ) U) && is(U == const(T) )) == c);
static assert((is(typeof( immutable T(args) ) U) && is(U == immutable(T) )) == i);
static assert((is(typeof( shared T(args) ) U) && is(U == shared(T) )) == s);
static assert((is(typeof( shared const T(args) ) U) && is(U == shared(const T) )) == sc);
// allocation on heap
static assert((is(typeof( new T(args) ) U) && is(U == T *)) == m);
static assert((is(typeof( new const T(args) ) U) && is(U == const(T)*)) == c);
static assert((is(typeof( new immutable T(args) ) U) && is(U == immutable(T)*)) == i);
static assert((is(typeof( new shared T(args) ) U) && is(U == shared(T)*)) == s);
static assert((is(typeof( new shared const T(args) ) U) && is(U == shared(const T)*)) == sc);
}
void test15a()
{
static struct Foo1 { this(int v) {} int value; }
static struct Boo1 { this(int v) const {} int[] value; }
static struct Bar1 { this(int[] v) {} int[] value; }
static struct Baz1 { this(const int[] v) pure {} int[] value; } // unique ctor
static struct Coo1 { this(int[] v) immutable {} int[] value; }
static struct Car1 { this(int[] v) immutable {} immutable(int)[] value; }
check15!(Foo1, 0b_1_1_0_0_0)(1);
check15!(Boo1, 0b_0_1_0_0_0)(1);
check15!(Bar1, 0b_1_1_0_0_0)(null);
check15!(Baz1, 0b_1_1_1_1_1)(null);
check15!(Coo1, 0b_0_1_1_0_1)(null);
check15!(Car1, 0b_0_1_1_0_1)(null);
// m c i s sc
// Template constructor should work as same as non-template ones
static struct Foo2 { this()(int v) {} int value; }
static struct Boo2 { this()(int v) const {} int[] value; }
static struct Bar2 { this()(int[] v) {} int[] value; } // has mutable indieection
static struct Baz2 { this()(const int[] v) pure {} int[] value; } // unique ctor
static struct Coo2 { this()(int[] v) immutable {} int[] value; }
static struct Car2 { this()(int[] v) immutable {} immutable(int)[] value; }
check15!(Foo2, 0b_1_1_0_0_0)(1);
check15!(Boo2, 0b_0_1_0_0_0)(1);
check15!(Bar2, 0b_1_1_0_0_0)(null);
check15!(Baz2, 0b_1_1_1_1_1)(null);
check15!(Coo2, 0b_0_1_1_0_1)(null);
check15!(Car2, 0b_0_1_1_0_1)(null);
// m c i s sc
// Except Bar!().__ctor, their constructors are inferred to pure, then they become unique ctors.
static struct Foo3() { this(int v) {} int value; }
static struct Boo3() { this(int v) const {} int[] value; }
static struct Bar3() { this(int[] v) {} int[] value; } // has mutable indieection
static struct Baz3() { this(const int[] v) pure {} int[] value; } // unique ctor
static struct Coo3() { this(int[] v) immutable {} int[] value; }
static struct Car3() { this(int[] v) immutable {} immutable(int)[] value; }
check15!(Foo3!(), 0b_1_1_1_1_1)(1);
check15!(Boo3!(), 0b_1_1_1_1_1)(1);
check15!(Bar3!(), 0b_1_1_0_0_0)(null);
check15!(Baz3!(), 0b_1_1_1_1_1)(null);
check15!(Coo3!(), 0b_1_1_1_1_1)(null);
check15!(Car3!(), 0b_1_1_1_1_1)(null);
// m c i s sc
}
// inout constructor works as like unique constructor in many cases
void test15b()
{
static struct Nullable1
{
private int[] _value;
private bool _isNull = true;
this(inout int[] v) inout //pure
{
_value = v;
//static int g; auto x = g; // impure access
_isNull = false;
}
}
static assert( __traits(compiles, Nullable1([1,2,3])));
static assert(!__traits(compiles, Nullable1([1,2,3].idup)));
static assert(!__traits(compiles, immutable Nullable1([1,2,3])));
static assert( __traits(compiles, immutable Nullable1([1,2,3].idup)));
static assert(!__traits(compiles, shared Nullable1([1,2,3])));
static assert(!__traits(compiles, shared Nullable1([1,2,3].idup)));
static struct Nullable2(T)
{
private T _value;
private bool _isNull = true;
this(inout T v) inout //pure
{
_value = v;
//static int g; auto x = g; // impure access
_isNull = false;
}
}
static assert( __traits(compiles, Nullable2!(int[])([1,2,3])));
static assert(!__traits(compiles, Nullable2!(int[])([1,2,3].idup)));
static assert(!__traits(compiles, immutable Nullable2!(int[])([1,2,3])));
static assert( __traits(compiles, immutable Nullable2!(int[])([1,2,3].idup)));
static assert(!__traits(compiles, shared Nullable2!(int[])([1,2,3])));
static assert(!__traits(compiles, shared Nullable2!(int[])([1,2,3].idup)));
// ctor is inout pure, but cannot create unique object.
struct S
{
int[] marr;
const int[] carr;
immutable int[] iarr;
this(int[] m, const int[] c, immutable int[] i) inout pure
{
static assert(!__traits(compiles, marr = m));
static assert(!__traits(compiles, carr = c)); // cannot implicitly convertible const(int[]) to inout(const(int[]))
iarr = i;
}
}
static assert(!__traits(compiles, { int[] ma; immutable int[] ia; auto m = S(ma, ma, ia); }));
static assert( __traits(compiles, { int[] ma; immutable int[] ia; auto c = const S(ma, ma, ia); }));
static assert(!__traits(compiles, { int[] ma; immutable int[] ia; auto i = immutable S(ma, ma, ia); }));
}
// TemplateThisParameter with constructor should work
void test15c()
{
static class C
{
this(this This)()
{
static assert(is(This == immutable C));
}
this(T = void, this This)(int)
{
static assert(is(This == immutable C));
}
}
auto c1 = new immutable C;
auto c2 = new immutable C(1);
}
void test15d() // https://issues.dlang.org/show_bug.cgi?id=9974
{
class CM { this() {} }
auto cm = new CM();
const class CC { this() {} }
const cc = new const CC();
immutable class CI { this() {} }
immutable ci = new immutable CI();
shared class CS { this() {} }
shared cs = new shared CS();
shared const class CSC { this() {} }
shared const csc = new shared const CSC();
struct SM { this(int) {} }
auto sm = new SM(1);
const struct SC { this(int) {} }
const sc = new const SC(1);
immutable struct SI { this(int) {} }
immutable si = new immutable SI(1);
shared struct SS { this(int) {} }
shared ss = new shared SS(1);
shared const struct SSC { this(int) {} }
shared const ssc = new shared const SSC(1);
}
void test15e() // https://issues.dlang.org/show_bug.cgi?id=10005
{
// struct literal
static struct S
{
int[] a;
}
int[] marr = [1,2,3];
static assert( __traits(compiles, { S m = S(marr); }));
static assert( __traits(compiles, { const S c = S(marr); }));
static assert(!__traits(compiles, { immutable S i = S(marr); }));
immutable int[] iarr = [1,2,3];
static assert(!__traits(compiles, { S m = immutable S(iarr); }));
static assert( __traits(compiles, { const S c = immutable S(iarr); }));
static assert( __traits(compiles, { immutable S i = immutable S(iarr); }));
// mutable constructor
static struct MS
{
int[] a;
this(int n) { a = new int[](n); }
}
static assert( __traits(compiles, { MS m = MS(3); }));
static assert( __traits(compiles, { const MS c = MS(3); }));
static assert(!__traits(compiles, { immutable MS i = MS(3); }));
static assert(!__traits(compiles, { MS m = immutable MS(3); }));
static assert(!__traits(compiles, { const MS c = immutable MS(3); }));
static assert(!__traits(compiles, { immutable MS i = immutable MS(3); }));
// immutable constructor
static struct IS
{
int[] a;
this(int n) immutable { a = new int[](n); }
}
static assert(!__traits(compiles, { IS m = IS(3); }));
static assert(!__traits(compiles, { const IS c = IS(3); }));
static assert(!__traits(compiles, { immutable IS i = IS(3); }));
static assert(!__traits(compiles, { IS m = immutable IS(3); }));
static assert( __traits(compiles, { const IS c = immutable IS(3); }));
static assert( __traits(compiles, { immutable IS i = immutable IS(3); }));
}
struct Foo9984
{
int[] p;
// Prefix storage class and tempalte constructor
inout this()(inout int[] a) { p = a; }
auto foo() inout { return inout(Foo9984)(p); }
}
void test9993a()
{
static class A
{
int x;
this() { x = 13; }
this() immutable { x = 42; }
}
A ma = new A; assert(ma.x == 13);
immutable A ia = new immutable A; assert(ia.x == 42);
static assert(!__traits(compiles, { immutable A ia = new A; }));
static class B
{
int x;
this() { x = 13; }
this() const { x = 42; }
}
const B mb = new B; assert(mb.x == 13);
const B cb = new const B; assert(cb.x == 42);
static assert(!__traits(compiles, { immutable B ib = new B; }));
static class C
{
int x;
this() const { x = 13; }
this() immutable { x = 42; }
}
const C cc = new const C; assert(cc.x == 13);
immutable C ic = new immutable C; assert(ic.x == 42);
static assert(!__traits(compiles, { C mc = new C; }));
}
void test9993b()
{
static class A
{
int x;
this()() { x = 13; }
this()() immutable { x = 42; }
}
A ma = new A; assert(ma.x == 13);
immutable A ia = new immutable A; assert(ia.x == 42);
static assert(__traits(compiles, { immutable A ia = new A; }));
static class B
{
int x;
this()() { x = 13; }
this()() const { x = 42; }
}
const B mb = new B; assert(mb.x == 13);
const B cb = new const B; assert(cb.x == 42);
static assert(__traits(compiles, { immutable B ib = new B; }));
static class C
{
int x;
this()() const { x = 13; }
this()() immutable { x = 42; }
}
const C cc = new const C; assert(cc.x == 13);
immutable C ic = new immutable C; assert(ic.x == 42);
static assert(!__traits(compiles, { C mc = new C; }));
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=1914
struct Bug1914a
{
const char[10] i = [1,0,0,0,0,0,0,0,0,0];
char[10] x = i;
int y = 5;
}
struct Bug1914b
{
const char[10] i = [0,0,0,0,0,0,0,0,0,0];
char[10] x = i;
int y = 5;
}
struct Bug1914c
{
const char[2] i = ['a', 'b'];
const char[2][3] j = [['x', 'y'], ['p', 'q'], ['r', 's']];
const char[2][3] k = ["cd", "ef", "gh"];
const char[2][3] l = [['x', 'y'], ['p'], ['h', 'k']];
char[2][3] x = i;
int y = 5;
char[2][3] z = j;
char[2][3] w = k;
int v = 27;
char[2][3] u = l;
int t = 718;
}
struct T3198
{
int g = 1;
}
class Foo3198
{
int[5] x = 6;
T3198[5] y = T3198(4);
}
void test3198and1914()
{
Bug1914a a;
assert(a.y == 5, "bug 1914, non-zero init");
Bug1914b b;
assert(b.y == 5, "bug 1914, zero init");
Bug1914c c;
assert(c.y == 5, "bug 1914, multilevel init");
assert(c.v == 27, "bug 1914, multilevel init2");
assert(c.x[2][1] == 'b');
assert(c.t == 718, "bug 1914, multi3");
assert(c.u[1][0] == 'p');
assert(c.u[1][1] == char.init);
auto f = new Foo3198();
assert(f.x[0] == 6);
assert(f.y[0].g == 4, "bug 3198");
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=14996
enum E14996a : string { confirm = "confirm" }
enum E14996b : long[] { confirm = [1,2,3,4] }
struct S14996
{
E14996a[1] data1;
E14996b[1] data2;
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=2427
void test2427()
{
struct S
{
int x;
}
int foo(int i)
{
return i;
}
int i;
S s = { foo(i) };
}
/********************************************/
struct T5885 {
uint a, b;
}
double mulUintToDouble(T5885 t, double m) {
return t.a * m;
}
void test5885()
{
enum ae = mulUintToDouble(T5885(10, 0), 10.0);
enum be = mulUintToDouble(T5885(10, 20), 10.0);
static assert(ae == be);
auto a = mulUintToDouble(T5885(10, 0), 10.0);
auto b = mulUintToDouble(T5885(10, 20), 10.0);
assert(a == b);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=5889
struct S5889a { int n; }
struct S5889b { this(int n){} }
bool isLvalue(S)(auto ref S s){ return __traits(isRef, s); }
int foo(ref S5889a s) { return 1; }
int foo( S5889a s) { return 2; }
int foo(ref S5889b s) { return 1; }
int foo( S5889b s) { return 2; }
int goo(ref const(S5889a) s) { return 1; }
int goo( const(S5889a) s) { return 2; }
int goo(ref const(S5889b) s) { return 1; }
int goo( const(S5889b) s) { return 2; }
int too(S)(ref S s) { return 1; }
int too(S)( S s) { return 2; }
S makeRvalue(S)(){ S s; return s; }
void test5889()
{
S5889a sa;
S5889b sb;
assert( isLvalue(sa));
assert( isLvalue(sb));
assert(!isLvalue(S5889a(0)));
assert(!isLvalue(S5889b(0)));
assert(!isLvalue(makeRvalue!S5889a()));
assert(!isLvalue(makeRvalue!S5889b()));
assert(foo(sa) == 1);
assert(foo(sb) == 1);
assert(foo(S5889a(0)) == 2);
assert(foo(S5889b(0)) == 2);
assert(foo(makeRvalue!S5889a()) == 2);
assert(foo(makeRvalue!S5889b()) == 2);
assert(goo(sa) == 1);
assert(goo(sb) == 1);
assert(goo(S5889a(0)) == 2);
assert(goo(S5889b(0)) == 2);
assert(goo(makeRvalue!S5889a()) == 2);
assert(goo(makeRvalue!S5889b()) == 2);
assert(too(sa) == 1);
assert(too(sb) == 1);
assert(too(S5889a(0)) == 2);
assert(too(S5889b(0)) == 2);
assert(too(makeRvalue!S5889a()) == 2);
assert(too(makeRvalue!S5889b()) == 2);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=4147
struct S4247
{
int n = 1024;
this(int x) { n = x; }
}
void test4247()
{
auto p1 = S4247();
assert(p1.n == 1024);
auto p2 = S4247(1);
assert(p2.n == 1);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=6937
void test6937()
{
static struct S
{
int x, y;
}
auto s1 = S(1, 2);
auto ps1 = new S(1, 2);
assert(ps1.x == 1);
assert(ps1.y == 2);
assert(*ps1 == s1);
auto ps2 = new S(1);
assert(ps2.x == 1);
assert(ps2.y == 0);
assert(*ps2 == S(1, 0));
static assert(!__traits(compiles, new S(1,2,3)));
int v = 0;
struct NS
{
int x;
void foo() { v = x; }
}
auto ns = NS(1);
ns.foo();
assert(ns.x == 1);
assert(v == 1);
auto pns = new NS(2);
assert(pns.x == 2);
pns.foo();
assert(v == 2);
pns.x = 1;
assert(*pns == ns);
static struct X {
int v;
this(this) { ++v; }
}
static struct Y {
X x;
}
Y y = Y(X(1));
assert(y.x.v == 1);
auto py1 = new Y(X(1));
assert(py1.x.v == 1);
assert(*py1 == y);
auto py2 = new Y(y.x);
assert(py2.x.v == 2);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=12681
struct HasUnion12774
{
union
{
int a, b;
}
}
bool test12681()
{
immutable int x = 42;
static struct S1
{
immutable int *p;
}
immutable s1 = new S1(&x);
assert(s1.p == &x);
struct S2
{
immutable int *p;
void foo() {}
}
auto s2 = new S2(&x);
assert(s2.p == &x);
struct S3
{
immutable int *p;
int foo() { return x; }
}
auto s3 = new S3(&x);
assert(s3.p == &x);
assert(s3.foo() == 42);
auto x12774 = new HasUnion12774();
return true;
}
static assert(test12681());
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=3991
union X3991
{
int a = void;
dchar b = void;
}
union Y3991
{
int a = void;
dchar b = 'a';
}
union Z3991
{
int a = 123;
dchar b = void;
}
void test3991()
{
X3991 x;
Y3991 y;
assert(y.b == 'a');
Z3991 z;
assert(z.a == 123);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=7727
union U7727A1 { int i; double d; }
union U7727A2 { int i = 123; double d; }
//union U7727A3 { int i; double d = 2.5; }
union U7727B1 { double d; int i; }
union U7727B2 { double d = 2.5; int i; }
//union U7727B3 { double d; int i = 123; }
void test7727()
{
import core.stdc.math : isnan;
{ U7727A1 u; assert(u.i == 0); }
{ U7727A1 u = { i: 1024 }; assert(u.i == 1024); }
{ U7727A1 u = { d: 1.225 }; assert(u.d == 1.225); }
static assert(!__traits(compiles,
{ U7727A1 u = { i: 1024, d: 1.225 }; }
));
{ U7727A2 u; assert(u.i == 123); }
{ U7727A2 u = { i: 1024 }; assert(u.i == 1024); }
{ U7727A2 u = { d: 1.225 }; assert(u.d == 1.225); }
static assert(!__traits(compiles,
{ U7727A2 u = { i: 1024, d: 1.225 }; }
));
// Blocked by https://issues.dlang.org/show_bug.cgi?id=1432
// { U7727A3 u; assert(u.d == 2.5); }
// { U7727A3 u = { i: 1024 }; assert(u.i == 1024); }
// { U7727A3 u = { d: 1.225 }; assert(u.d == 1.225); }
// static assert(!__traits(compiles,
// { U7727A3 u = { i: 1024, d: 1.225 }; }
// ));
{ U7727B1 u; assert(isnan(u.d)); }
{ U7727B1 u = { i: 1024 }; assert(u.i == 1024); }
{ U7727B1 u = { d: 1.225 }; assert(u.d == 1.225); }
static assert(!__traits(compiles,
{ U7727B1 u = { i: 1024, d: 1.225 }; }
));
{ U7727B2 u; assert(u.d == 2.5); }
{ U7727B2 u = { i: 1024 }; assert(u.i == 1024); }
{ U7727B2 u = { d: 1.225 }; assert(u.d == 1.225); }
static assert(!__traits(compiles,
{ U7727B2 u = { i: 1024, d: 1.225 }; }
));
// Blocked by https://issues.dlang.org/show_bug.cgi?id=1432
// { U7727B3 u; assert(u.i == 123); }
// { U7727B3 u = { i: 1024 }; assert(u.i == 1024); }
// { U7727B3 u = { d: 1.225 }; assert(u.d == 1.225); }
// static assert(!__traits(compiles,
// { U7727B3 u = { i: 1024, d: 1.225 }; }
// ));
test7727a();
test7727b();
}
// --------
struct Foo7727a
{
ushort bar2;
}
struct Foo7727b
{
union
{
ubyte[2] bar1;
ushort bar2;
}
}
void test7727a()
{
immutable Foo7727a foo1 = { bar2: 100 }; // OK
immutable Foo7727b foo2 = { bar2: 100 }; // OK <-- error
}
// --------
struct S7727 { int i; double d; }
union U7727 { int i; double d; }
void test7727b()
{
S7727 s = { d: 5 }; // OK
U7727 u = { d: 5 }; // OK <-- Error: is not a static and cannot have static initializer
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=7929
void test7929()
{
static struct S
{
int [] numbers;
}
const int [] numbers = new int[2];
const S si = {numbers};
// Error: cannot implicitly convert expression (numbers) of type const(int[]) to int[]
const S se = const(S)(numbers);
// OK
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=7021
struct S7021
{
@disable this();
}
void test7021()
{
static assert(!is(typeof({
auto s = S7021();
})));
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=8738
void test8738()
{
int[3] a = [1, 2, 3];
struct S { int a, b, c; }
S s = S(1, 2, 3);
a = [4, a[0], 6];
s = S(4, s.a, 6);
assert(a == [4, 1, 6]);
assert(s == S(4, 1, 6));
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=8763
void test8763()
{
struct S
{
this(int) {}
}
void foo(T, Args...)(Args args)
{
T t = T(args);
// Error: constructor main.S.this (int) is not callable using argument types ()
}
S t = S(); // OK, initialize to S.init
foo!S();
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=8902
union U8902 { int a, b; }
enum U8902 u8902a = U8902.init; // No errors
U8902 u8902b; // No errors
U8902 u8902c = U8902.init; // Error: duplicate union initialization for b
void test8902()
{
U8902 u8902d = U8902.init; // No errors
immutable U8902 u8902e = U8902.init; // No errors
immutable static U8902 u8902f = U8902.init; // Error: duplicate union...
static U8902 u8902g = u8902e; // Error: duplicate union...
static U8902 u8902h = U8902.init; // Error: duplicate union...
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=9116
void test9116()
{
static struct X
{
int v;
this(this) { ++v; }
}
static struct Y
{
X x;
}
X x = X(1);
assert(x.v == 1);
Y y = Y(X(1));
//printf("y.x.v = %d\n", y.x.v); // print 2, but should 1
assert(y.x.v == 1); // fails
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=9293
void test9293()
{
static struct A
{
// enum A zero = A(); // This works as expected
enum A zero = {}; // Note the difference here
int opCmp(const ref A a) const
{
assert(0);
}
int opCmp(const A a) const
{
return 0;
}
}
A a;
auto b = a >= A.zero; // Error: A() is not an lvalue
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=9566
void test9566()
{
static struct ExpandData
{
ubyte[4096] window = 0;
}
ExpandData a;
auto b = ExpandData.init; // bug
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=9775
enum Month9775 : ubyte { jan = 1, }
struct Date9775
{
this(int year, int month, int day) pure
{
_year = cast(short)year;
_month = cast(Month9775)month;
_day = cast(ubyte)day;
}
short _year = 1;
Month9775 _month = Month9775.jan;
ubyte _day = 1;
}
const Date9775 date9775c1 = Date9775(2012, 12, 21);
const date9775c2 = Date9775(2012, 12, 21);
enum Date9775 date9775e1 = Date9775(2012, 12, 21);
enum date9775e2 = Date9775(2012, 12, 21);
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=11105
struct S11105
{
int[2][1] a21;
}
void test11105()
{
S11105 s = S11105([1, 2]);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=11147
struct V11147
{
union
{
struct
{
float x = 0;
float y = 0;
float z = 0;
}
struct
{
float r;
float g;
float b;
}
}
}
void test11147()
{
auto v = V11147.init;
assert(v.x == 0f);
assert(v.y == 0f);
assert(v.z == 0f);
assert(v.r == 0f);
assert(v.g == 0f);
assert(v.b == 0f);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=11256
struct S11256 { @disable this(); }
struct Z11256a(Ranges...)
{
Ranges ranges;
this(Ranges rs) { ranges = rs; }
}
struct Z11256b(Ranges...)
{
Ranges ranges = Ranges.init; // Internal error: e2ir.c 5321
this(Ranges rs) { ranges = rs; }
}
struct Z11256c(Ranges...)
{
Ranges ranges = void; // todt.c(475) v->type->ty == Tsarray && vsz == 0
this(Ranges rs) { ranges = rs; }
}
struct F11256(alias pred)
{
this(int[] = null) { }
}
Z!Ranges z11256(alias Z, Ranges...)(Ranges ranges)
{
return Z!Ranges(ranges);
}
void test11256()
{
z11256!Z11256a(S11256.init, F11256!(gv => true)());
z11256!Z11256b(S11256.init, F11256!(gv => true)());
z11256!Z11256c(S11256.init, F11256!(gv => true)());
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=11269
struct Atom
{
union
{
int i;
struct
{
ulong first, rest;
}
struct
{
uint a, b;
}
}
}
void test11269()
{
Atom a1;
Atom a2 = {i:1, rest:10, b:2};
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=11427
struct S11427
{
union
{
ubyte a;
int x;
}
void[] arr;
}
int foo11427() @safe
{
S11427 s1 = S11427();
S11427 s2;
return 0;
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=12011
struct S12011a
{
int f() { return i; }
enum e = this.init.f();
int i = 1, j = 2;
}
struct S12011b
{
int f() { return i; }
enum e = S12011b().f();
int i = 1, j = 2;
}
void test12011()
{
static assert(S12011a.e == 1);
static assert(S12011b.e == 1);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=13021
void test13021()
{
static union U1
{
float a;
int b;
}
static union U2
{
double a;
long b;
}
static union U3
{
real a;
struct B { long b1, b2; } // ICE happens only if B.sizeof == real.sizeof
B b;
}
static union U4
{
real a;
long[2] b; // ditto
}
auto f = U1(1.0); auto ok = f.b;
auto fail1 = U1(1.0).b; // OK <- Internal error: e2ir.c 1162
auto fail2 = U2(1.0).b; // OK <- Internal error: e2ir.c 1162
auto fail3 = U3(1.0).b; // OK <- Internal error: e2ir.c 1162
auto fail4 = U4(1.0).b; // OK <- Internal error: backend/el.c 2904
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=14556
enum E14556 { a = 1 }
struct S14556a
{
this(int) {}
E14556[1] data;
}
struct S14556b
{
this(int) {}
void[1] data;
}
void test14556()
{
auto sa = S14556a(0);
assert(sa.data == [E14556.a]);
auto sb = S14556b(0);
assert(sb.data[] == cast(ubyte[1])[0]);
}
/********************************************/
// https://issues.dlang.org/show_bug.cgi?id=17622
struct S17622
{
int i;
this(ubyte)
{
return;
}
void fun()
{
assert(i == 0);
}
}
S17622 make()
{
return S17622(0);
}
void test17622()
{
S17622 s = make();
auto rdg = (){ s.fun(); };
s.fun();
}
/********************************************/
int main()
{
test1();
test2();
test3();
test4();
test5();
test6();
test7();
test8();
test9();
test10();
test11();
test12();
test13();
test14();
test15a();
test15b();
test15c();
test15d();
test15e();
test9993a();
test9993b();
test3198and1914();
test2427();
test5885();
test5889();
test4247();
test6937();
test12681();
test3991();
test7727();
test7929();
test7021();
test8738();
test8763();
test8902();
test9116();
test9293();
test9566();
test11105();
test11147();
test11256();
test13021();
test14556();
test17622();
printf("Success\n");
return 0;
}
|
D
|
/Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/WithLatestFrom.o : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Deprecated.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Cancelable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObserverType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Reactive.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/RecursiveLock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Errors.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Event.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/First.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/Platform.Linux.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.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/RxSwift.build/Objects-normal/x86_64/WithLatestFrom~partial.swiftmodule : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Deprecated.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Cancelable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObserverType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Reactive.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/RecursiveLock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Errors.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Event.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/First.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/Platform.Linux.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.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/RxSwift.build/Objects-normal/x86_64/WithLatestFrom~partial.swiftdoc : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Deprecated.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Cancelable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObserverType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Reactive.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/RecursiveLock.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Errors.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Event.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/First.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Rx.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/Platform/Platform.Linux.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.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
|
(of words) meaning the same or nearly the same
|
D
|
/home/cypher/Desktop/solana_NFT/smart_contracts/nft-vault/target/rls/debug/build/rustversion-7b6264f2c8fe4a50/build_script_build-7b6264f2c8fe4a50: /home/cypher/.cargo/registry/src/github.com-1ecc6299db9ec823/rustversion-1.0.5/build/build.rs /home/cypher/.cargo/registry/src/github.com-1ecc6299db9ec823/rustversion-1.0.5/build/rustc.rs
/home/cypher/Desktop/solana_NFT/smart_contracts/nft-vault/target/rls/debug/build/rustversion-7b6264f2c8fe4a50/build_script_build-7b6264f2c8fe4a50.d: /home/cypher/.cargo/registry/src/github.com-1ecc6299db9ec823/rustversion-1.0.5/build/build.rs /home/cypher/.cargo/registry/src/github.com-1ecc6299db9ec823/rustversion-1.0.5/build/rustc.rs
/home/cypher/.cargo/registry/src/github.com-1ecc6299db9ec823/rustversion-1.0.5/build/build.rs:
/home/cypher/.cargo/registry/src/github.com-1ecc6299db9ec823/rustversion-1.0.5/build/rustc.rs:
|
D
|
/// PNG file handling for color.d's Image interfaces
module arsd.png;
import core.memory;
/// Easily reads a png file into a MemoryImage
MemoryImage readPng(string filename) {
import std.file;
return imageFromPng(readPng(cast(ubyte[]) read(filename)));
}
/// Saves a MemoryImage to a png. See also: writeImageToPngFile which uses memory a little more efficiently
void writePng(string filename, MemoryImage mi) {
// FIXME: it would be nice to write the file lazily so we don't have so many intermediate buffers here
PNG* png;
if(auto p = cast(IndexedImage) mi)
png = pngFromImage(p);
else if(auto p = cast(TrueColorImage) mi)
png = pngFromImage(p);
else assert(0);
import std.file;
std.file.write(filename, writePng(png));
}
///
enum PngType {
greyscale = 0, /// The data must be `depth` bits per pixel
truecolor = 2, /// The data will be RGB triples, so `depth * 3` bits per pixel. Depth must be 8 or 16.
indexed = 3, /// The data must be `depth` bits per pixel, with a palette attached. Use [writePng] with [IndexedImage] for this mode. Depth must be <= 8.
greyscale_with_alpha = 4, /// The data must be (grey, alpha) byte pairs for each pixel. Thus `depth * 2` bits per pixel. Depth must be 8 or 16.
truecolor_with_alpha = 6 /// The data must be RGBA quads for each pixel. Thus, `depth * 4` bits per pixel. Depth must be 8 or 16.
}
/// Saves an image from an existing array. Note that depth other than 8 may not be implemented yet. Also note depth of 16 must be stored big endian
void writePng(string filename, const ubyte[] data, int width, int height, PngType type, ubyte depth = 8) {
PngHeader h;
h.width = width;
h.height = height;
h.type = cast(ubyte) type;
h.depth = depth;
auto png = blankPNG(h);
addImageDatastreamToPng(data, png);
import std.file;
std.file.write(filename, writePng(png));
}
/*
//Here's a simple test program that shows how to write a quick image viewer with simpledisplay:
import arsd.png;
import arsd.simpledisplay;
import std.file;
void main(string[] args) {
// older api, the individual functions give you more control if you need it
//auto img = imageFromPng(readPng(cast(ubyte[]) read(args[1])));
// newer api, simpler but less control
auto img = readPng(args[1]);
// displayImage is from simpledisplay and just pops up a window to show the image
// simpledisplay's Images are a little different than MemoryImages that this loads,
// but conversion is easy
displayImage(Image.fromMemoryImage(img));
}
*/
// By Adam D. Ruppe, 2009-2010, released into the public domain
//import std.file;
//import std.zlib;
public import arsd.color;
/**
The return value should be casted to indexed or truecolor depending on what the file is. You can
also use getAsTrueColorImage to forcibly convert it if needed.
To get an image from a png file, do something like this:
auto i = cast(TrueColorImage) imageFromPng(readPng(cast(ubyte)[]) std.file.read("file.png")));
*/
MemoryImage imageFromPng(PNG* png) {
PngHeader h = getHeader(png);
/** Types from the PNG spec:
0 - greyscale
2 - truecolor
3 - indexed color
4 - grey with alpha
6 - true with alpha
1, 5, and 7 are invalid.
There's a kind of bitmask going on here:
If type&1, it has a palette.
If type&2, it is in color.
If type&4, it has an alpha channel in the datastream.
*/
MemoryImage i;
ubyte[] idata;
// FIXME: some duplication with the lazy reader below in the module
switch(h.type) {
case 0: // greyscale
case 4: // greyscale with alpha
// this might be a different class eventually...
auto a = new TrueColorImage(h.width, h.height);
idata = a.imageData.bytes;
i = a;
break;
case 2: // truecolor
case 6: // truecolor with alpha
auto a = new TrueColorImage(h.width, h.height);
idata = a.imageData.bytes;
i = a;
break;
case 3: // indexed
auto a = new IndexedImage(h.width, h.height);
a.palette = fetchPalette(png);
a.hasAlpha = true; // FIXME: don't be so conservative here
idata = a.data;
i = a;
break;
default:
assert(0, "invalid png");
}
size_t idataIdx = 0;
auto file = LazyPngFile!(Chunk[])(png.chunks);
immutable(ubyte)[] previousLine;
auto bpp = bytesPerPixel(h);
foreach(line; file.rawDatastreamByChunk()) {
auto filter = line[0];
auto data = unfilter(filter, line[1 .. $], previousLine, bpp);
previousLine = data;
convertPngData(h.type, h.depth, data, h.width, idata, idataIdx);
}
assert(idataIdx == idata.length, "not all filled, wtf");
assert(i !is null);
return i;
}
// idata needs to be already sized for the image! width * height if indexed, width*height*4 if not.
void convertPngData(ubyte type, ubyte depth, const(ubyte)[] data, int width, ubyte[] idata, ref size_t idataIdx) {
ubyte consumeOne() {
ubyte ret = data[0];
data = data[1 .. $];
return ret;
}
import std.conv;
loop: for(int pixel = 0; pixel < width; pixel++)
switch(type) {
case 0: // greyscale
case 4: // greyscale with alpha
case 3: // indexed
void acceptPixel(ubyte p) {
if(type == 3) {
idata[idataIdx++] = p;
} else {
if(depth == 1) {
p = p ? 0xff : 0;
} else if (depth == 2) {
p |= p << 2;
p |= p << 4;
}
else if (depth == 4) {
p |= p << 4;
}
idata[idataIdx++] = p;
idata[idataIdx++] = p;
idata[idataIdx++] = p;
if(type == 0)
idata[idataIdx++] = 255;
else if(type == 4)
idata[idataIdx++] = consumeOne();
}
}
auto b = consumeOne();
switch(depth) {
case 1:
acceptPixel((b >> 7) & 0x01);
pixel++; if(pixel == width) break loop;
acceptPixel((b >> 6) & 0x01);
pixel++; if(pixel == width) break loop;
acceptPixel((b >> 5) & 0x01);
pixel++; if(pixel == width) break loop;
acceptPixel((b >> 4) & 0x01);
pixel++; if(pixel == width) break loop;
acceptPixel((b >> 3) & 0x01);
pixel++; if(pixel == width) break loop;
acceptPixel((b >> 2) & 0x01);
pixel++; if(pixel == width) break loop;
acceptPixel((b >> 1) & 0x01);
pixel++; if(pixel == width) break loop;
acceptPixel(b & 0x01);
break;
case 2:
acceptPixel((b >> 6) & 0x03);
pixel++; if(pixel == width) break loop;
acceptPixel((b >> 4) & 0x03);
pixel++; if(pixel == width) break loop;
acceptPixel((b >> 2) & 0x03);
pixel++; if(pixel == width) break loop;
acceptPixel(b & 0x03);
break;
case 4:
acceptPixel((b >> 4) & 0x0f);
pixel++; if(pixel == width) break loop;
acceptPixel(b & 0x0f);
break;
case 8:
acceptPixel(b);
break;
case 16:
assert(type != 3); // 16 bit indexed isn't supported per png spec
acceptPixel(b);
consumeOne(); // discarding the least significant byte as we can't store it anyway
break;
default:
assert(0, "bit depth not implemented");
}
break;
case 2: // truecolor
case 6: // true with alpha
if(depth == 8) {
idata[idataIdx++] = consumeOne();
idata[idataIdx++] = consumeOne();
idata[idataIdx++] = consumeOne();
idata[idataIdx++] = (type == 6) ? consumeOne() : 255;
} else if(depth == 16) {
idata[idataIdx++] = consumeOne();
consumeOne();
idata[idataIdx++] = consumeOne();
consumeOne();
idata[idataIdx++] = consumeOne();
consumeOne();
idata[idataIdx++] = (type == 6) ? consumeOne() : 255;
if(type == 6)
consumeOne();
} else assert(0, "unsupported truecolor bit depth " ~ to!string(depth));
break;
default: assert(0);
}
assert(data.length == 0, "not all consumed, wtf " ~ to!string(data));
}
/*
struct PngHeader {
uint width;
uint height;
ubyte depth = 8;
ubyte type = 6; // 0 - greyscale, 2 - truecolor, 3 - indexed color, 4 - grey with alpha, 6 - true with alpha
ubyte compressionMethod = 0; // should be zero
ubyte filterMethod = 0; // should be zero
ubyte interlaceMethod = 0; // bool
}
*/
PNG* pngFromImage(IndexedImage i) {
PngHeader h;
h.width = i.width;
h.height = i.height;
h.type = 3;
if(i.numColors() <= 2)
h.depth = 1;
else if(i.numColors() <= 4)
h.depth = 2;
else if(i.numColors() <= 16)
h.depth = 4;
else if(i.numColors() <= 256)
h.depth = 8;
else throw new Exception("can't save this as an indexed png");
auto png = blankPNG(h);
// do palette and alpha
// FIXME: if there is only one transparent color, set it as the special chunk for that
// FIXME: we'd get a smaller file size if the transparent pixels were arranged first
Chunk palette;
palette.type = ['P', 'L', 'T', 'E'];
palette.size = cast(int) i.palette.length * 3;
palette.payload.length = palette.size;
Chunk alpha;
if(i.hasAlpha) {
alpha.type = ['t', 'R', 'N', 'S'];
alpha.size = cast(uint) i.palette.length;
alpha.payload.length = alpha.size;
}
for(int a = 0; a < i.palette.length; a++) {
palette.payload[a*3+0] = i.palette[a].r;
palette.payload[a*3+1] = i.palette[a].g;
palette.payload[a*3+2] = i.palette[a].b;
if(i.hasAlpha)
alpha.payload[a] = i.palette[a].a;
}
palette.checksum = crc("PLTE", palette.payload);
png.chunks ~= palette;
if(i.hasAlpha) {
alpha.checksum = crc("tRNS", alpha.payload);
png.chunks ~= alpha;
}
// do the datastream
if(h.depth == 8) {
addImageDatastreamToPng(i.data, png);
} else {
// gotta convert it
ubyte[] datastream = new ubyte[cast(size_t)i.width * i.height * h.depth / 8]; // FIXME?
int shift = 0;
switch(h.depth) {
default: assert(0);
case 1: shift = 7; break;
case 2: shift = 6; break;
case 4: shift = 4; break;
case 8: shift = 0; break;
}
size_t dsp = 0;
size_t dpos = 0;
bool justAdvanced;
for(int y = 0; y < i.height; y++) {
for(int x = 0; x < i.width; x++) {
datastream[dsp] |= i.data[dpos++] << shift;
switch(h.depth) {
default: assert(0);
case 1: shift-= 1; break;
case 2: shift-= 2; break;
case 4: shift-= 4; break;
case 8: shift-= 8; break;
}
justAdvanced = shift < 0;
if(shift < 0) {
dsp++;
switch(h.depth) {
default: assert(0);
case 1: shift = 7; break;
case 2: shift = 6; break;
case 4: shift = 4; break;
case 8: shift = 0; break;
}
}
}
if(!justAdvanced)
dsp++;
switch(h.depth) {
default: assert(0);
case 1: shift = 7; break;
case 2: shift = 6; break;
case 4: shift = 4; break;
case 8: shift = 0; break;
}
}
addImageDatastreamToPng(datastream, png);
}
return png;
}
PNG* pngFromImage(TrueColorImage i) {
PngHeader h;
h.width = i.width;
h.height = i.height;
// FIXME: optimize it if it is greyscale or doesn't use alpha alpha
auto png = blankPNG(h);
addImageDatastreamToPng(i.imageData.bytes, png);
return png;
}
/*
void main(string[] args) {
auto a = readPng(cast(ubyte[]) read(args[1]));
auto f = getDatastream(a);
foreach(i; f) {
writef("%d ", i);
}
writefln("\n\n%d", f.length);
}
*/
struct PNG {
uint length;
ubyte[8] header;
Chunk[] chunks;
Chunk* getChunk(string what) {
foreach(ref c; chunks) {
if(c.stype == what)
return &c;
}
throw new Exception("no such chunk " ~ what);
}
Chunk* getChunkNullable(string what) {
foreach(ref c; chunks) {
if(c.stype == what)
return &c;
}
return null;
}
// Insert chunk before IDAT. PNG specs allows to drop all chunks after IDAT,
// so we have to insert our custom chunks right before it.
// Use `Chunk.create()` to create new chunk, and then `insertChunk()` to add it.
// Return `true` if we did replacement.
bool insertChunk (Chunk* chk, bool replaceExisting=false) {
if (chk is null) return false; // just in case
// use reversed loop, as "IDAT" is usually present, and it is usually the last,
// so we will somewhat amortize painter's algorithm here.
foreach_reverse (immutable idx, ref cc; chunks) {
if (replaceExisting && cc.type == chk.type) {
// replace existing chunk, the easiest case
chunks[idx] = *chk;
return true;
}
if (cc.stype == "IDAT") {
// ok, insert it; and don't use phobos
chunks.length += 1;
foreach_reverse (immutable c; idx+1..chunks.length) chunks.ptr[c] = chunks.ptr[c-1];
chunks.ptr[idx] = *chk;
return false;
}
}
chunks ~= *chk;
return false;
}
// Convenient wrapper for `insertChunk()`.
bool replaceChunk (Chunk* chk) { return insertChunk(chk, true); }
}
// this is just like writePng(filename, pngFromImage(image)), but it manages
// is own memory and writes straight to the file instead of using intermediate buffers that might not get gc'd right
void writeImageToPngFile(in char[] filename, TrueColorImage image) {
PNG* png;
ubyte[] com;
{
import std.zlib;
PngHeader h;
h.width = image.width;
h.height = image.height;
png = blankPNG(h);
size_t bytesPerLine = cast(size_t)h.width * 4;
if(h.type == 3)
bytesPerLine = cast(size_t)h.width * 8 / h.depth;
Chunk dat;
dat.type = ['I', 'D', 'A', 'T'];
size_t pos = 0;
auto compressor = new Compress();
import core.stdc.stdlib;
auto lineBuffer = (cast(ubyte*)malloc(1 + bytesPerLine))[0 .. 1+bytesPerLine];
scope(exit) free(lineBuffer.ptr);
while(pos+bytesPerLine <= image.imageData.bytes.length) {
lineBuffer[0] = 0;
lineBuffer[1..1+bytesPerLine] = image.imageData.bytes[pos.. pos+bytesPerLine];
com ~= cast(ubyte[]) compressor.compress(lineBuffer);
pos += bytesPerLine;
}
com ~= cast(ubyte[]) compressor.flush();
assert(com.length <= uint.max);
dat.size = cast(uint) com.length;
dat.payload = com;
dat.checksum = crc("IDAT", dat.payload);
png.chunks ~= dat;
Chunk c;
c.size = 0;
c.type = ['I', 'E', 'N', 'D'];
c.checksum = crc("IEND", c.payload);
png.chunks ~= c;
}
assert(png !is null);
import core.stdc.stdio;
import std.string;
FILE* fp = fopen(toStringz(filename), "wb");
if(fp is null)
throw new Exception("Couldn't open png file for writing.");
scope(exit) fclose(fp);
fwrite(png.header.ptr, 1, 8, fp);
foreach(c; png.chunks) {
fputc((c.size & 0xff000000) >> 24, fp);
fputc((c.size & 0x00ff0000) >> 16, fp);
fputc((c.size & 0x0000ff00) >> 8, fp);
fputc((c.size & 0x000000ff) >> 0, fp);
fwrite(c.type.ptr, 1, 4, fp);
fwrite(c.payload.ptr, 1, c.size, fp);
fputc((c.checksum & 0xff000000) >> 24, fp);
fputc((c.checksum & 0x00ff0000) >> 16, fp);
fputc((c.checksum & 0x0000ff00) >> 8, fp);
fputc((c.checksum & 0x000000ff) >> 0, fp);
}
{ import core.memory : GC; GC.free(com.ptr); } // there is a reference to this in the PNG struct, but it is going out of scope here too, so who cares
// just wanna make sure this crap doesn't stick around
}
ubyte[] writePng(PNG* p) {
ubyte[] a;
if(p.length)
a.length = p.length;
else {
a.length = 8;
foreach(c; p.chunks)
a.length += c.size + 12;
}
size_t pos;
a[0..8] = p.header[0..8];
pos = 8;
foreach(c; p.chunks) {
a[pos++] = (c.size & 0xff000000) >> 24;
a[pos++] = (c.size & 0x00ff0000) >> 16;
a[pos++] = (c.size & 0x0000ff00) >> 8;
a[pos++] = (c.size & 0x000000ff) >> 0;
a[pos..pos+4] = c.type[0..4];
pos += 4;
a[pos..pos+c.size] = c.payload[0..c.size];
pos += c.size;
a[pos++] = (c.checksum & 0xff000000) >> 24;
a[pos++] = (c.checksum & 0x00ff0000) >> 16;
a[pos++] = (c.checksum & 0x0000ff00) >> 8;
a[pos++] = (c.checksum & 0x000000ff) >> 0;
}
return a;
}
PngHeader getHeaderFromFile(string filename) {
import std.stdio;
auto file = File(filename, "rb");
ubyte[12] initialBuffer; // file header + size of first chunk (should be IHDR)
auto data = file.rawRead(initialBuffer[]);
if(data.length != 12)
throw new Exception("couldn't get png file header off " ~ filename);
if(data[0..8] != [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])
throw new Exception("file " ~ filename ~ " is not a png");
size_t pos = 8;
size_t size;
size |= data[pos++] << 24;
size |= data[pos++] << 16;
size |= data[pos++] << 8;
size |= data[pos++] << 0;
size += 4; // chunk type
size += 4; // checksum
ubyte[] more;
more.length = size;
auto chunk = file.rawRead(more);
if(chunk.length != size)
throw new Exception("couldn't get png image header off " ~ filename);
more = data ~ chunk;
auto png = readPng(more);
return getHeader(png);
}
PNG* readPng(in ubyte[] data) {
auto p = new PNG;
p.length = cast(int) data.length;
p.header[0..8] = data[0..8];
if(p.header != [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])
throw new Exception("not a png, header wrong");
size_t pos = 8;
while(pos < data.length) {
Chunk n;
n.size |= data[pos++] << 24;
n.size |= data[pos++] << 16;
n.size |= data[pos++] << 8;
n.size |= data[pos++] << 0;
n.type[0..4] = data[pos..pos+4];
pos += 4;
n.payload.length = n.size;
if(pos + n.size > data.length)
throw new Exception(format("malformed png, chunk '%s' %d @ %d longer than data %d", n.type, n.size, pos, data.length));
if(pos + n.size < pos)
throw new Exception("uint overflow: chunk too large");
n.payload[0..n.size] = data[pos..pos+n.size];
pos += n.size;
n.checksum |= data[pos++] << 24;
n.checksum |= data[pos++] << 16;
n.checksum |= data[pos++] << 8;
n.checksum |= data[pos++] << 0;
p.chunks ~= n;
}
return p;
}
PNG* blankPNG(PngHeader h) {
auto p = new PNG;
p.header = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
Chunk c;
c.size = 13;
c.type = ['I', 'H', 'D', 'R'];
c.payload.length = 13;
size_t pos = 0;
c.payload[pos++] = h.width >> 24;
c.payload[pos++] = (h.width >> 16) & 0xff;
c.payload[pos++] = (h.width >> 8) & 0xff;
c.payload[pos++] = h.width & 0xff;
c.payload[pos++] = h.height >> 24;
c.payload[pos++] = (h.height >> 16) & 0xff;
c.payload[pos++] = (h.height >> 8) & 0xff;
c.payload[pos++] = h.height & 0xff;
c.payload[pos++] = h.depth;
c.payload[pos++] = h.type;
c.payload[pos++] = h.compressionMethod;
c.payload[pos++] = h.filterMethod;
c.payload[pos++] = h.interlaceMethod;
c.checksum = crc("IHDR", c.payload);
p.chunks ~= c;
return p;
}
// should NOT have any idata already.
// FIXME: doesn't handle palettes
void addImageDatastreamToPng(const(ubyte)[] data, PNG* png) {
// we need to go through the lines and add the filter byte
// then compress it into an IDAT chunk
// then add the IEND chunk
import std.zlib;
PngHeader h = getHeader(png);
size_t bytesPerLine;
switch(h.type) {
case 0:
// FIXME: < 8 depth not supported here but should be
bytesPerLine = cast(size_t)h.width * 1 * h.depth / 8;
break;
case 2:
bytesPerLine = cast(size_t)h.width * 3 * h.depth / 8;
break;
case 3:
bytesPerLine = cast(size_t)h.width * 1 * h.depth / 8;
break;
case 4:
// FIXME: < 8 depth not supported here but should be
bytesPerLine = cast(size_t)h.width * 2 * h.depth / 8;
break;
case 6:
bytesPerLine = cast(size_t)h.width * 4 * h.depth / 8;
break;
default: assert(0);
}
Chunk dat;
dat.type = ['I', 'D', 'A', 'T'];
size_t pos = 0;
const(ubyte)[] output;
while(pos+bytesPerLine <= data.length) {
output ~= 0;
output ~= data[pos..pos+bytesPerLine];
pos += bytesPerLine;
}
auto com = cast(ubyte[]) compress(output);
dat.size = cast(int) com.length;
dat.payload = com;
dat.checksum = crc("IDAT", dat.payload);
png.chunks ~= dat;
Chunk c;
c.size = 0;
c.type = ['I', 'E', 'N', 'D'];
c.checksum = crc("IEND", c.payload);
png.chunks ~= c;
}
deprecated alias PngHeader PNGHeader;
// bKGD - palette entry for background or the RGB (16 bits each) for that. or 16 bits of grey
ubyte[] getDatastream(PNG* p) {
import std.zlib;
ubyte[] compressed;
foreach(c; p.chunks) {
if(c.stype != "IDAT")
continue;
compressed ~= c.payload;
}
return cast(ubyte[]) uncompress(compressed);
}
// FIXME: Assuming 8 bits per pixel
ubyte[] getUnfilteredDatastream(PNG* p) {
PngHeader h = getHeader(p);
assert(h.filterMethod == 0);
assert(h.type == 3); // FIXME
assert(h.depth == 8); // FIXME
ubyte[] data = getDatastream(p);
ubyte[] ufdata = new ubyte[data.length - h.height];
int bytesPerLine = cast(int) ufdata.length / h.height;
int pos = 0, pos2 = 0;
for(int a = 0; a < h.height; a++) {
assert(data[pos2] == 0);
ufdata[pos..pos+bytesPerLine] = data[pos2+1..pos2+bytesPerLine+1];
pos+= bytesPerLine;
pos2+= bytesPerLine + 1;
}
return ufdata;
}
ubyte[] getFlippedUnfilteredDatastream(PNG* p) {
PngHeader h = getHeader(p);
assert(h.filterMethod == 0);
assert(h.type == 3); // FIXME
assert(h.depth == 8 || h.depth == 4); // FIXME
ubyte[] data = getDatastream(p);
ubyte[] ufdata = new ubyte[data.length - h.height];
int bytesPerLine = cast(int) ufdata.length / h.height;
int pos = cast(int) ufdata.length - bytesPerLine, pos2 = 0;
for(int a = 0; a < h.height; a++) {
assert(data[pos2] == 0);
ufdata[pos..pos+bytesPerLine] = data[pos2+1..pos2+bytesPerLine+1];
pos-= bytesPerLine;
pos2+= bytesPerLine + 1;
}
return ufdata;
}
ubyte getHighNybble(ubyte a) {
return cast(ubyte)(a >> 4); // FIXME
}
ubyte getLowNybble(ubyte a) {
return a & 0x0f;
}
// Takes the transparency info and returns
ubyte[] getANDMask(PNG* p) {
PngHeader h = getHeader(p);
assert(h.filterMethod == 0);
assert(h.type == 3); // FIXME
assert(h.depth == 8 || h.depth == 4); // FIXME
assert(h.width % 8 == 0); // might actually be %2
ubyte[] data = getDatastream(p);
ubyte[] ufdata = new ubyte[h.height*((((h.width+7)/8)+3)&~3)]; // gotta pad to DWORDs...
Color[] colors = fetchPalette(p);
int pos = 0, pos2 = (h.width/((h.depth == 8) ? 1 : 2)+1)*(h.height-1);
bool bits = false;
for(int a = 0; a < h.height; a++) {
assert(data[pos2++] == 0);
for(int b = 0; b < h.width; b++) {
if(h.depth == 4) {
ufdata[pos/8] |= ((colors[bits? getLowNybble(data[pos2]) : getHighNybble(data[pos2])].a <= 30) << (7-(pos%8)));
} else
ufdata[pos/8] |= ((colors[data[pos2]].a == 0) << (7-(pos%8)));
pos++;
if(h.depth == 4) {
if(bits) {
pos2++;
}
bits = !bits;
} else
pos2++;
}
int pad = 0;
for(; pad < ((pos/8) % 4); pad++) {
ufdata[pos/8] = 0;
pos+=8;
}
if(h.depth == 4)
pos2 -= h.width + 2;
else
pos2-= 2*(h.width) +2;
}
return ufdata;
}
// Done with assumption
PngHeader getHeader(PNG* p) {
PngHeader h;
ubyte[] data = p.getChunk("IHDR").payload;
int pos = 0;
h.width |= data[pos++] << 24;
h.width |= data[pos++] << 16;
h.width |= data[pos++] << 8;
h.width |= data[pos++] << 0;
h.height |= data[pos++] << 24;
h.height |= data[pos++] << 16;
h.height |= data[pos++] << 8;
h.height |= data[pos++] << 0;
h.depth = data[pos++];
h.type = data[pos++];
h.compressionMethod = data[pos++];
h.filterMethod = data[pos++];
h.interlaceMethod = data[pos++];
return h;
}
/*
struct Color {
ubyte r;
ubyte g;
ubyte b;
ubyte a;
}
*/
/+
class Image {
Color[][] trueColorData;
ubyte[] indexData;
Color[] palette;
uint width;
uint height;
this(uint w, uint h) {}
}
Image fromPNG(PNG* p) {
}
PNG* toPNG(Image i) {
}
+/ struct RGBQUAD {
ubyte rgbBlue;
ubyte rgbGreen;
ubyte rgbRed;
ubyte rgbReserved;
}
RGBQUAD[] fetchPaletteWin32(PNG* p) {
RGBQUAD[] colors;
auto palette = p.getChunk("PLTE");
colors.length = (palette.size) / 3;
for(int i = 0; i < colors.length; i++) {
colors[i].rgbRed = palette.payload[i*3+0];
colors[i].rgbGreen = palette.payload[i*3+1];
colors[i].rgbBlue = palette.payload[i*3+2];
colors[i].rgbReserved = 0;
}
return colors;
}
Color[] fetchPalette(PNG* p) {
Color[] colors;
auto header = getHeader(p);
if(header.type == 0) { // greyscale
colors.length = 256;
foreach(i; 0..256)
colors[i] = Color(cast(ubyte) i, cast(ubyte) i, cast(ubyte) i);
return colors;
}
// assuming this is indexed
assert(header.type == 3);
auto palette = p.getChunk("PLTE");
Chunk* alpha = p.getChunkNullable("tRNS");
colors.length = palette.size / 3;
for(int i = 0; i < colors.length; i++) {
colors[i].r = palette.payload[i*3+0];
colors[i].g = palette.payload[i*3+1];
colors[i].b = palette.payload[i*3+2];
if(alpha !is null && i < alpha.size)
colors[i].a = alpha.payload[i];
else
colors[i].a = 255;
//writefln("%2d: %3d %3d %3d %3d", i, colors[i].r, colors[i].g, colors[i].b, colors[i].a);
}
return colors;
}
void replacePalette(PNG* p, Color[] colors) {
auto palette = p.getChunk("PLTE");
auto alpha = p.getChunkNullable("tRNS");
//import std.string;
//assert(0, format("%s %s", colors.length, alpha.size));
//assert(colors.length == alpha.size);
if(alpha) {
alpha.size = cast(int) colors.length;
alpha.payload.length = colors.length; // we make sure there's room for our simple method below
}
p.length = 0; // so write will recalculate
for(int i = 0; i < colors.length; i++) {
palette.payload[i*3+0] = colors[i].r;
palette.payload[i*3+1] = colors[i].g;
palette.payload[i*3+2] = colors[i].b;
if(alpha)
alpha.payload[i] = colors[i].a;
}
palette.checksum = crc("PLTE", palette.payload);
if(alpha)
alpha.checksum = crc("tRNS", alpha.payload);
}
uint update_crc(in uint crc, in ubyte[] buf){
static const uint[256] crc_table = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918000, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117];
uint c = crc;
foreach(b; buf)
c = crc_table[(c ^ b) & 0xff] ^ (c >> 8);
return c;
}
// lol is just the chunk name
uint crc(in string lol, in ubyte[] buf){
uint c = update_crc(0xffffffffL, cast(ubyte[]) lol);
return update_crc(c, buf) ^ 0xffffffffL;
}
/* former module arsd.lazypng follows */
// this is like png.d but all range based so more complicated...
// and I don't remember how to actually use it.
// some day I'll prolly merge it with png.d but for now just throwing it up there
//module arsd.lazypng;
//import arsd.color;
//import std.stdio;
import std.range;
import std.traits;
import std.exception;
import std.string;
//import std.conv;
/*
struct Color {
ubyte r;
ubyte g;
ubyte b;
ubyte a;
string toString() {
return format("#%2x%2x%2x %2x", r, g, b, a);
}
}
*/
//import arsd.simpledisplay;
struct RgbaScanline {
Color[] pixels;
}
auto convertToGreyscale(ImageLines)(ImageLines lines)
if(isInputRange!ImageLines && is(ElementType!ImageLines == RgbaScanline))
{
struct GreyscaleLines {
ImageLines lines;
bool isEmpty;
this(ImageLines lines) {
this.lines = lines;
if(!empty())
popFront(); // prime
}
int length() {
return lines.length;
}
bool empty() {
return isEmpty;
}
RgbaScanline current;
RgbaScanline front() {
return current;
}
void popFront() {
if(lines.empty()) {
isEmpty = true;
return;
}
auto old = lines.front();
current.pixels.length = old.pixels.length;
foreach(i, c; old.pixels) {
ubyte v = cast(ubyte) (
cast(int) c.r * 0.30 +
cast(int) c.g * 0.59 +
cast(int) c.b * 0.11);
current.pixels[i] = Color(v, v, v, c.a);
}
lines.popFront;
}
}
return GreyscaleLines(lines);
}
/// Lazily breaks the buffered input range into
/// png chunks, as defined in the PNG spec
///
/// Note: bufferedInputRange is defined in this file too.
LazyPngChunks!(Range) readPngChunks(Range)(Range r)
if(isBufferedInputRange!(Range) && is(ElementType!(Range) == ubyte[]))
{
// First, we need to check the header
// Then we'll lazily pull the chunks
while(r.front.length < 8) {
enforce(!r.empty(), "This isn't big enough to be a PNG file");
r.appendToFront();
}
enforce(r.front[0..8] == PNG_MAGIC_NUMBER,
"The file's magic number doesn't look like PNG");
r.consumeFromFront(8);
return LazyPngChunks!Range(r);
}
/// Same as above, but takes a regular input range instead of a buffered one.
/// Provided for easier compatibility with standard input ranges
/// (for example, std.stdio.File.byChunk)
auto readPngChunks(Range)(Range r)
if(!isBufferedInputRange!(Range) && isInputRange!(Range))
{
return readPngChunks(BufferedInputRange!Range(r));
}
/// Given an input range of bytes, return a lazy PNG file
auto pngFromBytes(Range)(Range r)
if(isInputRange!(Range) && is(ElementType!Range == ubyte[]))
{
auto chunks = readPngChunks(r);
auto file = LazyPngFile!(typeof(chunks))(chunks);
return file;
}
struct LazyPngChunks(T)
if(isBufferedInputRange!(T) && is(ElementType!T == ubyte[]))
{
T bytes;
Chunk current;
this(T range) {
bytes = range;
popFront(); // priming it
}
Chunk front() {
return current;
}
bool empty() {
return (bytes.front.length == 0 && bytes.empty);
}
void popFront() {
enforce(!empty());
while(bytes.front().length < 4) {
enforce(!bytes.empty,
format("Malformed PNG file - chunk size too short (%s < 4)",
bytes.front().length));
bytes.appendToFront();
}
Chunk n;
n.size |= bytes.front()[0] << 24;
n.size |= bytes.front()[1] << 16;
n.size |= bytes.front()[2] << 8;
n.size |= bytes.front()[3] << 0;
bytes.consumeFromFront(4);
while(bytes.front().length < n.size + 8) {
enforce(!bytes.empty,
format("Malformed PNG file - chunk too short (%s < %s)",
bytes.front.length, n.size));
bytes.appendToFront();
}
n.type[0 .. 4] = bytes.front()[0 .. 4];
bytes.consumeFromFront(4);
n.payload.length = n.size;
n.payload[0 .. n.size] = bytes.front()[0 .. n.size];
bytes.consumeFromFront(n.size);
n.checksum |= bytes.front()[0] << 24;
n.checksum |= bytes.front()[1] << 16;
n.checksum |= bytes.front()[2] << 8;
n.checksum |= bytes.front()[3] << 0;
bytes.consumeFromFront(4);
enforce(n.checksum == crcPng(n.stype, n.payload), "Chunk checksum didn't match");
current = n;
}
}
/// Lazily reads out basic info from a png (header, palette, image data)
/// It will only allocate memory to read a palette, and only copies on
/// the header and the palette. It ignores everything else.
///
/// FIXME: it doesn't handle interlaced files.
struct LazyPngFile(LazyPngChunksProvider)
if(isInputRange!(LazyPngChunksProvider) &&
is(ElementType!(LazyPngChunksProvider) == Chunk))
{
LazyPngChunksProvider chunks;
this(LazyPngChunksProvider chunks) {
enforce(!chunks.empty(), "There are no chunks in this png");
header = PngHeader.fromChunk(chunks.front());
chunks.popFront();
// And now, find the datastream so we're primed for lazy
// reading, saving the palette and transparency info, if
// present
chunkLoop:
while(!chunks.empty()) {
auto chunk = chunks.front();
switch(chunks.front.stype) {
case "PLTE":
// if it is in color, palettes are
// always stored as 8 bit per channel
// RGB triplets Alpha is stored elsewhere.
// FIXME: doesn't do greyscale palettes!
enforce(chunk.size % 3 == 0);
palette.length = chunk.size / 3;
auto offset = 0;
foreach(i; 0 .. palette.length) {
palette[i] = Color(
chunk.payload[offset+0],
chunk.payload[offset+1],
chunk.payload[offset+2],
255);
offset += 3;
}
break;
case "tRNS":
// 8 bit channel in same order as
// palette
if(chunk.size > palette.length)
palette.length = chunk.size;
foreach(i, a; chunk.payload)
palette[i].a = a;
break;
case "IDAT":
// leave the datastream for later
break chunkLoop;
default:
// ignore chunks we don't care about
}
chunks.popFront();
}
this.chunks = chunks;
enforce(!chunks.empty() && chunks.front().stype == "IDAT",
"Malformed PNG file - no image data is present");
}
/// Lazily reads and decompresses the image datastream, returning chunkSize bytes of
/// it per front. It does *not* change anything, so the filter byte is still there.
///
/// If chunkSize == 0, it automatically calculates chunk size to give you data by line.
auto rawDatastreamByChunk(int chunkSize = 0) {
assert(chunks.front().stype == "IDAT");
if(chunkSize == 0)
chunkSize = bytesPerLine();
struct DatastreamByChunk(T) {
private import etc.c.zlib;
z_stream* zs; // we have to malloc this too, as dmd can move the struct, and zlib 1.2.10 is intolerant to that
int chunkSize;
int bufpos;
int plpos; // bytes eaten in current chunk payload
T chunks;
bool eoz;
this(int cs, T chunks) {
import core.stdc.stdlib : malloc;
import core.stdc.string : memset;
this.chunkSize = cs;
this.chunks = chunks;
assert(chunkSize > 0);
buffer = (cast(ubyte*)malloc(chunkSize))[0..chunkSize];
pkbuf = (cast(ubyte*)malloc(32768))[0..32768]; // arbitrary number
zs = cast(z_stream*)malloc(z_stream.sizeof);
memset(zs, 0, z_stream.sizeof);
zs.avail_in = 0;
zs.avail_out = 0;
auto res = inflateInit2(zs, 15);
assert(res == Z_OK);
popFront(); // priming
}
~this () {
version(arsdpng_debug) { import core.stdc.stdio : printf; printf("destroying lazy PNG reader...\n"); }
import core.stdc.stdlib : free;
if (zs !is null) { inflateEnd(zs); free(zs); }
if (pkbuf.ptr !is null) free(pkbuf.ptr);
if (buffer.ptr !is null) free(buffer.ptr);
}
@disable this (this); // no copies!
ubyte[] front () { return (bufpos > 0 ? buffer[0..bufpos] : null); }
ubyte[] buffer;
ubyte[] pkbuf; // we will keep some packed data here in case payload moves, lol
void popFront () {
bufpos = 0;
while (plpos != plpos.max && bufpos < chunkSize) {
// do we have some bytes in zstream?
if (zs.avail_in > 0) {
// just unpack
zs.next_out = cast(typeof(zs.next_out))(buffer.ptr+bufpos);
int rd = chunkSize-bufpos;
zs.avail_out = rd;
auto err = inflate(zs, Z_SYNC_FLUSH);
if (err != Z_STREAM_END && err != Z_OK) throw new Exception("PNG unpack error");
if (err == Z_STREAM_END) {
assert(zs.avail_in == 0);
eoz = true;
}
bufpos += rd-zs.avail_out;
continue;
}
// no more zstream bytes; do we have something in current chunk?
if (plpos == plpos.max || plpos >= chunks.front.payload.length) {
// current chunk is complete, do we have more chunks?
if (chunks.front.stype != "IDAT") break; // this chunk is not IDAT, that means that... alas
chunks.popFront(); // remove current IDAT
plpos = 0;
if (chunks.empty || chunks.front.stype != "IDAT") plpos = plpos.max; // special value
continue;
}
if (plpos < chunks.front.payload.length) {
// current chunk is not complete, get some more bytes from it
int rd = cast(int)(chunks.front.payload.length-plpos <= pkbuf.length ? chunks.front.payload.length-plpos : pkbuf.length);
assert(rd > 0);
pkbuf[0..rd] = chunks.front.payload[plpos..plpos+rd];
plpos += rd;
if (eoz) {
// we did hit end-of-stream, reinit zlib (well, well, i know that we can reset it... meh)
inflateEnd(zs);
zs.avail_in = 0;
zs.avail_out = 0;
auto res = inflateInit2(zs, 15);
assert(res == Z_OK);
eoz = false;
}
// setup read pointer
zs.next_in = cast(typeof(zs.next_in))pkbuf.ptr;
zs.avail_in = cast(uint)rd;
continue;
}
assert(0, "wtf?! we should not be here!");
}
}
bool empty () { return (bufpos == 0); }
}
return DatastreamByChunk!(typeof(chunks))(chunkSize, chunks);
}
// FIXME: no longer compiles
version(none)
auto byRgbaScanline() {
static struct ByRgbaScanline {
ReturnType!(rawDatastreamByChunk) datastream;
RgbaScanline current;
PngHeader header;
int bpp;
Color[] palette;
bool isEmpty = false;
bool empty() {
return isEmpty;
}
@property int length() {
return header.height;
}
// This is needed for the filter algorithms
immutable(ubyte)[] previousLine;
// FIXME: I think my range logic got screwed somewhere
// in the stack... this is messed up.
void popFront() {
assert(!empty());
if(datastream.empty()) {
isEmpty = true;
return;
}
current.pixels.length = header.width;
// ensure it is primed
if(datastream.front.length == 0)
datastream.popFront;
auto rawData = datastream.front();
auto filter = rawData[0];
auto data = unfilter(filter, rawData[1 .. $], previousLine, bpp);
if(data.length == 0) {
isEmpty = true;
return;
}
assert(data.length);
previousLine = data;
// FIXME: if it's rgba, this could probably be faster
assert(header.depth == 8,
"Sorry, depths other than 8 aren't implemented yet.");
auto offset = 0;
foreach(i; 0 .. header.width) {
switch(header.type) {
case 0: // greyscale
case 4: // grey with alpha
auto value = data[offset++];
current.pixels[i] = Color(
value,
value,
value,
(header.type == 4)
? data[offset++] : 255
);
break;
case 3: // indexed
current.pixels[i] = palette[data[offset++]];
break;
case 2: // truecolor
case 6: // true with alpha
current.pixels[i] = Color(
data[offset++],
data[offset++],
data[offset++],
(header.type == 6)
? data[offset++] : 255
);
break;
default:
throw new Exception("invalid png file");
}
}
assert(offset == data.length);
if(!datastream.empty())
datastream.popFront();
}
RgbaScanline front() {
return current;
}
}
assert(chunks.front.stype == "IDAT");
ByRgbaScanline range;
range.header = header;
range.bpp = bytesPerPixel;
range.palette = palette;
range.datastream = rawDatastreamByChunk(bytesPerLine());
range.popFront();
return range;
}
int bytesPerPixel() {
return .bytesPerPixel(header);
}
int bytesPerLine() {
return .bytesPerLineOfPng(header.depth, header.type, header.width);
}
PngHeader header;
Color[] palette;
}
// FIXME: doesn't handle interlacing... I think
// note it returns the length including the filter byte!!
@nogc @safe pure nothrow
int bytesPerLineOfPng(ubyte depth, ubyte type, uint width) {
immutable bitsPerChannel = depth;
int bitsPerPixel = bitsPerChannel;
if(type & 2 && !(type & 1)) // in color, but no palette
bitsPerPixel *= 3;
if(type & 4) // has alpha channel
bitsPerPixel += bitsPerChannel;
immutable int sizeInBits = width * bitsPerPixel;
// need to round up to the nearest byte
int sizeInBytes = (sizeInBits + 7) / 8;
return sizeInBytes + 1; // the +1 is for the filter byte that precedes all lines
}
/**************************************************
* Buffered input range - generic, non-image code
***************************************************/
/// Is the given range a buffered input range? That is, an input range
/// that also provides consumeFromFront(int) and appendToFront()
template isBufferedInputRange(R) {
enum bool isBufferedInputRange =
isInputRange!(R) && is(typeof(
{
R r;
r.consumeFromFront(0);
r.appendToFront();
}()));
}
/// Allows appending to front on a regular input range, if that range is
/// an array. It appends to the array rather than creating an array of
/// arrays; it's meant to make the illusion of one continuous front rather
/// than simply adding capability to walk backward to an existing input range.
///
/// I think something like this should be standard; I find File.byChunk
/// to be almost useless without this capability.
// FIXME: what if Range is actually an array itself? We should just use
// slices right into it... I guess maybe r.front() would be the whole
// thing in that case though, so we would indeed be slicing in right now.
// Gotta check it though.
struct BufferedInputRange(Range)
if(isInputRange!(Range) && isArray!(ElementType!(Range)))
{
private Range underlyingRange;
private ElementType!(Range) buffer;
/// Creates a buffer for the given range. You probably shouldn't
/// keep using the underlying range directly.
///
/// It assumes the underlying range has already been primed.
this(Range r) {
underlyingRange = r;
// Is this really correct? Want to make sure r.front
// is valid but it doesn't necessarily need to have
// more elements...
enforce(!r.empty());
buffer = r.front();
usingUnderlyingBuffer = true;
}
/// Forwards to the underlying range's empty function
bool empty() {
return underlyingRange.empty();
}
/// Returns the current buffer
ElementType!(Range) front() {
return buffer;
}
// actually, not terribly useful IMO. appendToFront calls it
// implicitly when necessary
/// Discard the current buffer and get the next item off the
/// underlying range. Be sure to call at least once to prime
/// the range (after checking if it is empty, of course)
void popFront() {
enforce(!empty());
underlyingRange.popFront();
buffer = underlyingRange.front();
usingUnderlyingBuffer = true;
}
bool usingUnderlyingBuffer = false;
/// Remove the first count items from the buffer
void consumeFromFront(int count) {
buffer = buffer[count .. $];
}
/// Append the next item available on the underlying range to
/// our buffer.
void appendToFront() {
if(buffer.length == 0) {
// may let us reuse the underlying range's buffer,
// hopefully avoiding an extra allocation
popFront();
} else {
enforce(!underlyingRange.empty());
// need to make sure underlyingRange.popFront doesn't overwrite any
// of our buffer...
if(usingUnderlyingBuffer) {
buffer = buffer.dup;
usingUnderlyingBuffer = false;
}
underlyingRange.popFront();
buffer ~= underlyingRange.front();
}
}
}
/**************************************************
* Lower level implementations of image formats.
* and associated helper functions.
*
* Related to the module, but not particularly
* interesting, so it's at the bottom.
***************************************************/
/* PNG file format implementation */
//import std.zlib;
import std.math;
/// All PNG files are supposed to open with these bytes according to the spec
enum immutable(ubyte[]) PNG_MAGIC_NUMBER = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
/// A PNG file consists of the magic number then a stream of chunks. This
/// struct represents those chunks.
struct Chunk {
uint size;
ubyte[4] type;
ubyte[] payload;
uint checksum;
/// returns the type as a string for easier comparison with literals
const(char)[] stype() return const {
return cast(const(char)[]) type;
}
static Chunk* create(string type, ubyte[] payload)
in {
assert(type.length == 4);
}
body {
Chunk* c = new Chunk;
c.size = cast(int) payload.length;
c.type[] = (cast(ubyte[]) type)[];
c.payload = payload;
c.checksum = crcPng(type, payload);
return c;
}
/// Puts it into the format for outputting to a file
ubyte[] toArray() {
ubyte[] a;
a.length = size + 12;
int pos = 0;
a[pos++] = (size & 0xff000000) >> 24;
a[pos++] = (size & 0x00ff0000) >> 16;
a[pos++] = (size & 0x0000ff00) >> 8;
a[pos++] = (size & 0x000000ff) >> 0;
a[pos .. pos + 4] = type[0 .. 4];
pos += 4;
a[pos .. pos + size] = payload[0 .. size];
pos += size;
assert(checksum);
a[pos++] = (checksum & 0xff000000) >> 24;
a[pos++] = (checksum & 0x00ff0000) >> 16;
a[pos++] = (checksum & 0x0000ff00) >> 8;
a[pos++] = (checksum & 0x000000ff) >> 0;
return a;
}
}
/// The first chunk in a PNG file is a header that contains this info
struct PngHeader {
/// Width of the image, in pixels.
uint width;
/// Height of the image, in pixels.
uint height;
/**
This is bits per channel - per color for truecolor or grey
and per pixel for palette.
Indexed ones can have depth of 1,2,4, or 8,
Greyscale can be 1,2,4,8,16
Everything else must be 8 or 16.
*/
ubyte depth = 8;
/** Types from the PNG spec:
0 - greyscale
2 - truecolor
3 - indexed color
4 - grey with alpha
6 - true with alpha
1, 5, and 7 are invalid.
There's a kind of bitmask going on here:
If type&1, it has a palette.
If type&2, it is in color.
If type&4, it has an alpha channel in the datastream.
*/
ubyte type = 6;
ubyte compressionMethod = 0; /// should be zero
ubyte filterMethod = 0; /// should be zero
/// 0 is non interlaced, 1 if Adam7. No more are defined in the spec
ubyte interlaceMethod = 0;
static PngHeader fromChunk(in Chunk c) {
enforce(c.stype == "IHDR",
"The chunk is not an image header");
PngHeader h;
auto data = c.payload;
int pos = 0;
enforce(data.length == 13,
"Malformed PNG file - the IHDR is the wrong size");
h.width |= data[pos++] << 24;
h.width |= data[pos++] << 16;
h.width |= data[pos++] << 8;
h.width |= data[pos++] << 0;
h.height |= data[pos++] << 24;
h.height |= data[pos++] << 16;
h.height |= data[pos++] << 8;
h.height |= data[pos++] << 0;
h.depth = data[pos++];
h.type = data[pos++];
h.compressionMethod = data[pos++];
h.filterMethod = data[pos++];
h.interlaceMethod = data[pos++];
return h;
}
Chunk* toChunk() {
ubyte[] data;
data.length = 13;
int pos = 0;
data[pos++] = width >> 24;
data[pos++] = (width >> 16) & 0xff;
data[pos++] = (width >> 8) & 0xff;
data[pos++] = width & 0xff;
data[pos++] = height >> 24;
data[pos++] = (height >> 16) & 0xff;
data[pos++] = (height >> 8) & 0xff;
data[pos++] = height & 0xff;
data[pos++] = depth;
data[pos++] = type;
data[pos++] = compressionMethod;
data[pos++] = filterMethod;
data[pos++] = interlaceMethod;
assert(pos == 13);
return Chunk.create("IHDR", data);
}
}
void writePngLazy(OutputRange, InputRange)(ref OutputRange where, InputRange image)
if(
isOutputRange!(OutputRange, ubyte[]) &&
isInputRange!(InputRange) &&
is(ElementType!InputRange == RgbaScanline))
{
import std.zlib;
where.put(PNG_MAGIC_NUMBER);
PngHeader header;
assert(!image.empty());
// using the default values for header here... FIXME not super clear
header.width = image.front.pixels.length;
header.height = image.length;
enforce(header.width > 0, "Image width <= 0");
enforce(header.height > 0, "Image height <= 0");
where.put(header.toChunk().toArray());
auto compressor = new std.zlib.Compress();
const(void)[] compressedData;
int cnt;
foreach(line; image) {
// YOU'VE GOT TO BE FUCKING KIDDING ME!
// I have to /cast/ to void[]!??!?
ubyte[] data;
data.length = 1 + header.width * 4;
data[0] = 0; // filter type
int offset = 1;
foreach(pixel; line.pixels) {
data[offset++] = pixel.r;
data[offset++] = pixel.g;
data[offset++] = pixel.b;
data[offset++] = pixel.a;
}
compressedData ~= compressor.compress(cast(void[])
data);
if(compressedData.length > 2_000) {
where.put(Chunk.create("IDAT", cast(ubyte[])
compressedData).toArray());
compressedData = null;
}
cnt++;
}
assert(cnt == header.height, format("Got %d lines instead of %d", cnt, header.height));
compressedData ~= compressor.flush();
if(compressedData.length)
where.put(Chunk.create("IDAT", cast(ubyte[])
compressedData).toArray());
where.put(Chunk.create("IEND", null).toArray());
}
// bKGD - palette entry for background or the RGB (16 bits each) for that. or 16 bits of grey
uint crcPng(in string chunkName, in ubyte[] buf){
uint c = update_crc(0xffffffffL, cast(ubyte[]) chunkName);
return update_crc(c, buf) ^ 0xffffffffL;
}
immutable(ubyte)[] unfilter(ubyte filterType, in ubyte[] data, in ubyte[] previousLine, int bpp) {
// Note: the overflow arithmetic on the ubytes in here is intentional
switch(filterType) {
case 0:
return data.idup; // FIXME is copying really necessary?
case 1:
auto arr = data.dup;
// first byte gets zero added to it so nothing special
foreach(i; bpp .. arr.length) {
arr[i] += arr[i - bpp];
}
return assumeUnique(arr);
case 2:
auto arr = data.dup;
if(previousLine.length)
foreach(i; 0 .. arr.length) {
arr[i] += previousLine[i];
}
return assumeUnique(arr);
case 3:
auto arr = data.dup;
if(previousLine.length)
foreach(i; 0 .. arr.length) {
auto prev = i < bpp ? 0 : arr[i - bpp];
arr[i] += cast(ubyte)
/*std.math.floor*/( cast(int) (prev + previousLine[i]) / 2);
}
return assumeUnique(arr);
case 4:
auto arr = data.dup;
foreach(i; 0 .. arr.length) {
ubyte prev = i < bpp ? 0 : arr[i - bpp];
ubyte prevLL = i < bpp ? 0 : (i < previousLine.length ? previousLine[i - bpp] : 0);
arr[i] += PaethPredictor(prev, (i < previousLine.length ? previousLine[i] : 0), prevLL);
}
return assumeUnique(arr);
default:
throw new Exception("invalid PNG file, bad filter type");
}
}
ubyte PaethPredictor(ubyte a, ubyte b, ubyte c) {
int p = cast(int) a + b - c;
auto pa = abs(p - a);
auto pb = abs(p - b);
auto pc = abs(p - c);
if(pa <= pb && pa <= pc)
return a;
if(pb <= pc)
return b;
return c;
}
int bytesPerPixel(PngHeader header) {
immutable bitsPerChannel = header.depth;
int bitsPerPixel = bitsPerChannel;
if(header.type & 2 && !(header.type & 1)) // in color, but no palette
bitsPerPixel *= 3;
if(header.type & 4) // has alpha channel
bitsPerPixel += bitsPerChannel;
return (bitsPerPixel + 7) / 8;
}
|
D
|
/Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/Bits.build/Objects-normal/x86_64/Bytes+Hex.o : /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Base64.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Convenience.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Data+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/String+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/UnsignedInteger+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+PatternMatching.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/UnsignedInteger+Shifting.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Random.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Base64Encoder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/HexEncoder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Aliases.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/ByteSequence+Conversions.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+UTF8Numbers.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+ControlCharacters.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Operators.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Alphabet.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Percent.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Hex.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/Bits.build/Objects-normal/x86_64/Bytes+Hex~partial.swiftmodule : /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Base64.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Convenience.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Data+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/String+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/UnsignedInteger+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+PatternMatching.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/UnsignedInteger+Shifting.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Random.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Base64Encoder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/HexEncoder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Aliases.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/ByteSequence+Conversions.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+UTF8Numbers.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+ControlCharacters.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Operators.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Alphabet.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Percent.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Hex.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/Bits.build/Objects-normal/x86_64/Bytes+Hex~partial.swiftdoc : /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Base64.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Convenience.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Data+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/String+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/UnsignedInteger+BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/BytesConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+PatternMatching.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/UnsignedInteger+Shifting.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Random.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Base64Encoder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/HexEncoder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Aliases.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/ByteSequence+Conversions.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+UTF8Numbers.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+ControlCharacters.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Operators.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Byte+Alphabet.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Percent.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/bits.git-9196587591774126515/Sources/Bits/Bytes+Hex.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/*
REQUIRED_ARGS: -preview=dip1000
TEST_OUTPUT:
---
fail_compilation/test16193.d(38): Error: function `test16193.abc` is `@nogc` yet allocates closures with the GC
fail_compilation/test16193.d(40): test16193.abc.__foreachbody1 closes over variable x at fail_compilation/test16193.d(39)
---
*/
//fail_compilation/test16193.d(22): To enforce `@safe`, the compiler allocates a closure unless `opApply()` uses `scope`
//fail_compilation/test16193.d(34): To enforce `@safe`, the compiler allocates a closure unless `opApply()` uses `scope`
//fail_compilation/test16193.d(41): To enforce `@safe`, the compiler allocates a closure unless `opApply()` uses `scope`
// https://issues.dlang.org/show_bug.cgi?id=16193
struct S {
int opApply(int delegate(int) dg) @nogc;
}
void foo() {
int x = 0;
foreach(i; S.init) {
x++;
}
}
struct T {
int opApply(scope int delegate(int) dg) @nogc;
}
void bar() @nogc {
int x = 0;
foreach(i; T.init) {
x++;
}
}
void abc() @nogc {
int x = 0;
foreach(i; S.init) {
x++;
}
}
|
D
|
//////////////////////////////////////////////////////////////////////
//
// Crytek Source code
// Copyright (c) Crytek 2001-2004
//
// File: CREOcclusionQuery.h
// Description: Occlusion query Renderer element.
//
// History:
// - File created by Khonich Andrey
// - February 2005: Modified by Marco Corbetta for SDK release
//
//////////////////////////////////////////////////////////////////////
#ifndef __CREOCCLUSIONQUERY_H__
#define __CREOCCLUSIONQUERY_H__
//////////////////////////////////////////////////////////////////////
class CREOcclusionQuery : public CRendElement
{
friend class CRender3D;
public:
int m_nVisSamples;
int m_nCheckFrame;
int m_nDrawFrame;
Vec3 m_vBoxMin;
Vec3 m_vBoxMax;
#ifdef OPENGL
uint m_nOcclusionID;
#if defined(WIN64) || defined(LINUX64)
uint m_nOcclusionID2; // this is the safety dummy value to make the occlusion id extendable to 64-bit
#endif
#else
UINT_PTR m_nOcclusionID; // this will carry a pointer LPDIRECT3DQUERY9, so it needs to be 64-bit on WIN64
#endif
CREOcclusionQuery()
{
m_nOcclusionID = 0;
m_nVisSamples = 800*600;
m_nCheckFrame = 0;
m_nDrawFrame = 0;
m_vBoxMin=Vec3(0,0,0);
m_vBoxMax=Vec3(0,0,0);
mfSetType(eDATA_OcclusionQuery);
mfUpdateFlags(FCEF_TRANSFORM);
}
virtual ~CREOcclusionQuery();
virtual void mfPrepare();
virtual bool mfDraw(SShader *ef, SShaderPass *sfm);
virtual void mfReset();
};
#endif // __CREOCCLUSIONQUERY_H__
|
D
|
module UnrealScript.Engine.MaterialExpressionCompound;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Engine.MaterialExpression;
extern(C++) interface MaterialExpressionCompound : MaterialExpression
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.MaterialExpressionCompound")); }
private static __gshared MaterialExpressionCompound mDefaultProperties;
@property final static MaterialExpressionCompound DefaultProperties() { mixin(MGDPC("MaterialExpressionCompound", "MaterialExpressionCompound Engine.Default__MaterialExpressionCompound")); }
@property final
{
auto ref
{
ScriptArray!(MaterialExpression) MaterialExpressions() { mixin(MGPC("ScriptArray!(MaterialExpression)", 108)); }
ScriptString Caption() { mixin(MGPC("ScriptString", 120)); }
}
bool bExpanded() { mixin(MGBPC(132, 0x1)); }
bool bExpanded(bool val) { mixin(MSBPC(132, 0x1)); }
}
}
|
D
|
// ************************************************************
// EXIT
// ************************************************************
INSTANCE DIA_Sengrath_EXIT(C_INFO)
{
npc = PAL_267_Sengrath;
nr = 999;
condition = DIA_Sengrath_EXIT_Condition;
information = DIA_Sengrath_EXIT_Info;
permanent = TRUE;
description = DIALOG_ENDE;
};
FUNC INT DIA_Sengrath_EXIT_Condition()
{
return TRUE;
};
FUNC VOID DIA_Sengrath_EXIT_Info()
{
AI_StopProcessInfos (self);
};
// ************************************************************
// Hallo
// ************************************************************
INSTANCE DIA_Sengrath_Hello (C_INFO)
{
npc = PAL_267_Sengrath;
nr = 2;
condition = DIA_Sengrath_Hello_Condition;
information = DIA_Sengrath_Hello_Info;
permanent = FALSE;
IMPORTANT = TRUE;
};
FUNC INT DIA_Sengrath_Hello_Condition()
{
return TRUE;
};
FUNC VOID DIA_Sengrath_Hello_Info()
{
AI_Output (self ,other,"DIA_Sengrath_Hello_03_00"); //Vędęl jsem to! Vędęl jsem, že se to nękomu musí podaâit!
AI_Output (self ,other,"DIA_Sengrath_Hello_03_01"); //Prošel jsi skrz průsmyk? Náš posel tedy proklouzl?
AI_Output (other ,self,"DIA_Sengrath_Hello_15_02"); //Ne, posel se pâes průsmyk nedostal. Pâišel jsem na rozkaz lorda Hagena.
AI_Output (self ,other,"DIA_Sengrath_Hello_03_03"); //(zavrčí) Prokletí skâeti...
AI_Output (self ,other,"DIA_Sengrath_Hello_03_04"); //No, velitel Garond si s tebou určitę bude chtít promluvit. Najdeš ho v té velké budovę hlídané dvęma rytíâi.
};
// ************************************************************
// Equipment
// ************************************************************
INSTANCE DIA_Sengrath_Equipment (C_INFO)
{
npc = PAL_267_Sengrath;
nr = 2;
condition = DIA_Sengrath_Equipment_Condition;
information = DIA_Sengrath_Equipment_Info;
permanent = FALSE;
description = "Kde tady najdu nęjakou výbavu?";
};
FUNC INT DIA_Sengrath_Equipment_Condition()
{
return TRUE;
};
FUNC VOID DIA_Sengrath_Equipment_Info()
{
AI_Output (other ,self,"DIA_Sengrath_Equipment_15_00"); //Kde tady najdu nęjakou výbavu?
AI_Output (self ,other,"DIA_Sengrath_Equipment_03_01"); //Zbranę vydává Tandor. Za všechno ostatní zodpovídá správce Engor.
AI_Output (other ,self,"DIA_Sengrath_Equipment_15_02"); //A co magické vęci?
AI_Output (self ,other,"DIA_Sengrath_Equipment_03_03"); //Máme kouzelné svitky. Pokud bys nęjaké chtęl, obraă se na mę.
Log_CreateTopic (TOPIC_Trader_OC,LOG_NOTE);
B_LogEntry (TOPIC_Trader_OC,"Sengrath na hradę prodává magické svitky.");
};
// ************************************************************
// Lehrer
// ************************************************************
INSTANCE DIA_Sengrath_Perm (C_INFO)
{
npc = PAL_267_Sengrath;
nr = 2;
condition = DIA_Sengrath_Perm_Condition;
information = DIA_Sengrath_Perm_Info;
permanent = FALSE;
description = "Kdo mę tady může nęco naučit?";
};
FUNC INT DIA_Sengrath_Perm_Condition()
{
return TRUE;
};
FUNC VOID DIA_Sengrath_Perm_Info()
{
AI_Output (other ,self,"DIA_Sengrath_Perm_15_00"); //Kdo mę tady může nęco naučit?
if (other.guild == GIL_KDF)
&& (Kapitel == 2)
{
AI_Output (self ,other,"DIA_Sengrath_Perm_03_01"); //Promluv si s Miltenem - je to náš jediný mág.
}
else
{
AI_Output (self ,other,"DIA_Sengrath_Perm_03_02"); //Zeptej se Kerolotha. Učí chlapce bojovat s mečem. Možná by mohl nęco naučit i tebe.
Log_CreateTopic (TOPIC_Teacher_OC,LOG_NOTE);
B_LogEntry (TOPIC_Teacher_OC,"Keroloth na hradę trénuje bojovníky s mečem.");
};
};
// ************************************************************
// Scrolls
// ************************************************************
INSTANCE DIA_Sengrath_Scrolls (C_INFO)
{
npc = PAL_267_Sengrath;
nr = 9;
condition = DIA_Sengrath_Scrolls_Condition;
information = DIA_Sengrath_Scrolls_Info;
permanent = TRUE;
trade = TRUE;
description = "Ukaž mi ty svitky.";
};
FUNC INT DIA_Sengrath_Scrolls_Condition()
{
if Npc_KnowsInfo (other,DIA_Sengrath_Equipment)
{
return TRUE;
};
};
FUNC VOID DIA_Sengrath_Scrolls_Info()
{
B_GiveTradeInv (self);
AI_Output (other ,self,"DIA_Sengrath_Scrolls_15_00"); //Ukaž mi ty svitky.
};
// ************************************************************
// PICK POCKET
// ************************************************************
INSTANCE DIA_Sengrath_PICKPOCKET (C_INFO)
{
npc = PAL_267_Sengrath;
nr = 900;
condition = DIA_Sengrath_PICKPOCKET_Condition;
information = DIA_Sengrath_PICKPOCKET_Info;
permanent = TRUE;
description = Pickpocket_40;
};
FUNC INT DIA_Sengrath_PICKPOCKET_Condition()
{
C_Beklauen (32, 35);
};
FUNC VOID DIA_Sengrath_PICKPOCKET_Info()
{
Info_ClearChoices (DIA_Sengrath_PICKPOCKET);
Info_AddChoice (DIA_Sengrath_PICKPOCKET, DIALOG_BACK ,DIA_Sengrath_PICKPOCKET_BACK);
Info_AddChoice (DIA_Sengrath_PICKPOCKET, DIALOG_PICKPOCKET ,DIA_Sengrath_PICKPOCKET_DoIt);
};
func void DIA_Sengrath_PICKPOCKET_DoIt()
{
B_Beklauen ();
Info_ClearChoices (DIA_Sengrath_PICKPOCKET);
};
func void DIA_Sengrath_PICKPOCKET_BACK()
{
Info_ClearChoices (DIA_Sengrath_PICKPOCKET);
};
|
D
|
/**
* Handle introspection functionality of the `__traits()` construct.
*
* Specification: $(LINK2 https://dlang.org/spec/traits.html, Traits)
*
* Copyright: Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/traits.d, _traits.d)
* Documentation: https://dlang.org/phobos/dmd_traits.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/traits.d
*/
module dmd.traits;
import core.stdc.stdio;
import dmd.aggregate;
import dmd.arraytypes;
import dmd.astcodegen;
import dmd.astenums;
import dmd.attrib;
import dmd.canthrow;
import dmd.dclass;
import dmd.declaration;
import dmd.dimport;
import dmd.dmangle;
import dmd.dmodule;
import dmd.dscope;
import dmd.dsymbol;
import dmd.dsymbolsem;
import dmd.dtemplate;
import dmd.errors;
import dmd.expression;
import dmd.expressionsem;
import dmd.func;
import dmd.globals;
import dmd.hdrgen;
import dmd.id;
import dmd.identifier;
import dmd.mtype;
import dmd.nogc;
import dmd.parse;
import dmd.root.array;
import dmd.root.speller;
import dmd.root.stringtable;
import dmd.target;
import dmd.tokens;
import dmd.typesem;
import dmd.visitor;
import dmd.root.rootobject;
import dmd.common.outbuffer;
import dmd.root.string;
enum LOGSEMANTIC = false;
/************************ TraitsExp ************************************/
/**************************************
* Convert `Expression` or `Type` to corresponding `Dsymbol`, additionally
* stripping off expression contexts.
*
* Some symbol related `__traits` ignore arguments expression contexts.
* For example:
* ----
* struct S { void f() {} }
* S s;
* pragma(msg, __traits(isNested, s.f));
* // s.f is `DotVarExp`, but `__traits(isNested)`` needs a `FuncDeclaration`.
* ----
*
* This is used for that common `__traits` behavior.
*
* Input:
* oarg object to get the symbol for
* Returns:
* Dsymbol the corresponding symbol for oarg
*/
private Dsymbol getDsymbolWithoutExpCtx(RootObject oarg)
{
if (auto e = isExpression(oarg))
{
if (auto dve = e.isDotVarExp())
return dve.var;
if (auto dte = e.isDotTemplateExp())
return dte.td;
}
return getDsymbol(oarg);
}
private const StringTable!bool traitsStringTable;
shared static this()
{
static immutable string[] names =
[
"isAbstractClass",
"isArithmetic",
"isAssociativeArray",
"isDisabled",
"isDeprecated",
"isFuture",
"isFinalClass",
"isPOD",
"isNested",
"isFloating",
"isIntegral",
"isScalar",
"isStaticArray",
"isUnsigned",
"isVirtualFunction",
"isVirtualMethod",
"isAbstractFunction",
"isFinalFunction",
"isOverrideFunction",
"isStaticFunction",
"isModule",
"isPackage",
"isRef",
"isOut",
"isLazy",
"isReturnOnStack",
"hasMember",
"identifier",
"getProtection",
"getVisibility",
"parent",
"child",
"getLinkage",
"getMember",
"getOverloads",
"getVirtualFunctions",
"getVirtualMethods",
"classInstanceSize",
"classInstanceAlignment",
"allMembers",
"derivedMembers",
"isSame",
"compiles",
"getAliasThis",
"getAttributes",
"getFunctionAttributes",
"getFunctionVariadicStyle",
"getParameterStorageClasses",
"getUnitTests",
"getVirtualIndex",
"getPointerBitmap",
"isZeroInit",
"getTargetInfo",
"getLocation",
"hasPostblit",
"hasCopyConstructor",
"isCopyable",
"parameters"
];
StringTable!(bool)* stringTable = cast(StringTable!(bool)*) &traitsStringTable;
stringTable._init(names.length);
foreach (s; names)
{
auto sv = stringTable.insert(s, true);
assert(sv);
}
}
/**
* get an array of size_t values that indicate possible pointer words in memory
* if interpreted as the type given as argument
* Returns: the size of the type in bytes, ulong.max on error
*/
ulong getTypePointerBitmap(Loc loc, Type t, Array!(ulong)* data)
{
ulong sz;
if (t.ty == Tclass && !(cast(TypeClass)t).sym.isInterfaceDeclaration())
sz = (cast(TypeClass)t).sym.AggregateDeclaration.size(loc);
else
sz = t.size(loc);
if (sz == SIZE_INVALID)
return ulong.max;
const sz_size_t = Type.tsize_t.size(loc);
if (sz > sz.max - sz_size_t)
{
error(loc, "size overflow for type `%s`", t.toChars());
return ulong.max;
}
ulong bitsPerWord = sz_size_t * 8;
ulong cntptr = (sz + sz_size_t - 1) / sz_size_t;
ulong cntdata = (cntptr + bitsPerWord - 1) / bitsPerWord;
data.setDim(cast(size_t)cntdata);
data.zero();
extern (C++) final class PointerBitmapVisitor : Visitor
{
alias visit = Visitor.visit;
public:
extern (D) this(Array!(ulong)* _data, ulong _sz_size_t)
{
this.data = _data;
this.sz_size_t = _sz_size_t;
}
void setpointer(ulong off)
{
ulong ptroff = off / sz_size_t;
(*data)[cast(size_t)(ptroff / (8 * sz_size_t))] |= 1L << (ptroff % (8 * sz_size_t));
}
override void visit(Type t)
{
Type tb = t.toBasetype();
if (tb != t)
tb.accept(this);
}
override void visit(TypeError t)
{
visit(cast(Type)t);
}
override void visit(TypeNext t)
{
assert(0);
}
override void visit(TypeBasic t)
{
if (t.ty == Tvoid)
setpointer(offset);
}
override void visit(TypeVector t)
{
}
override void visit(TypeArray t)
{
assert(0);
}
override void visit(TypeSArray t)
{
ulong arrayoff = offset;
ulong nextsize = t.next.size();
if (nextsize == SIZE_INVALID)
error = true;
ulong dim = t.dim.toInteger();
for (ulong i = 0; i < dim; i++)
{
offset = arrayoff + i * nextsize;
t.next.accept(this);
}
offset = arrayoff;
}
override void visit(TypeDArray t)
{
setpointer(offset + sz_size_t);
}
// dynamic array is {length,ptr}
override void visit(TypeAArray t)
{
setpointer(offset);
}
override void visit(TypePointer t)
{
if (t.nextOf().ty != Tfunction) // don't mark function pointers
setpointer(offset);
}
override void visit(TypeReference t)
{
setpointer(offset);
}
override void visit(TypeClass t)
{
setpointer(offset);
}
override void visit(TypeFunction t)
{
}
override void visit(TypeDelegate t)
{
setpointer(offset);
}
// delegate is {context, function}
override void visit(TypeQualified t)
{
assert(0);
}
// assume resolved
override void visit(TypeIdentifier t)
{
assert(0);
}
override void visit(TypeInstance t)
{
assert(0);
}
override void visit(TypeTypeof t)
{
assert(0);
}
override void visit(TypeReturn t)
{
assert(0);
}
override void visit(TypeEnum t)
{
visit(cast(Type)t);
}
override void visit(TypeTuple t)
{
visit(cast(Type)t);
}
override void visit(TypeSlice t)
{
assert(0);
}
override void visit(TypeNull t)
{
// always a null pointer
}
override void visit(TypeStruct t)
{
ulong structoff = offset;
foreach (v; t.sym.fields)
{
offset = structoff + v.offset;
if (v.type.ty == Tclass)
setpointer(offset);
else
v.type.accept(this);
}
offset = structoff;
}
// a "toplevel" class is treated as an instance, while TypeClass fields are treated as references
void visitClass(TypeClass t)
{
ulong classoff = offset;
// skip vtable-ptr and monitor
if (t.sym.baseClass)
visitClass(cast(TypeClass)t.sym.baseClass.type);
foreach (v; t.sym.fields)
{
offset = classoff + v.offset;
v.type.accept(this);
}
offset = classoff;
}
Array!(ulong)* data;
ulong offset;
ulong sz_size_t;
bool error;
}
scope PointerBitmapVisitor pbv = new PointerBitmapVisitor(data, sz_size_t);
if (t.ty == Tclass)
pbv.visitClass(cast(TypeClass)t);
else
t.accept(pbv);
return pbv.error ? ulong.max : sz;
}
/**
* get an array of size_t values that indicate possible pointer words in memory
* if interpreted as the type given as argument
* the first array element is the size of the type for independent interpretation
* of the array
* following elements bits represent one word (4/8 bytes depending on the target
* architecture). If set the corresponding memory might contain a pointer/reference.
*
* Returns: [T.sizeof, pointerbit0-31/63, pointerbit32/64-63/128, ...]
*/
private Expression pointerBitmap(TraitsExp e)
{
if (!e.args || e.args.dim != 1)
{
error(e.loc, "a single type expected for trait pointerBitmap");
return ErrorExp.get();
}
Type t = getType((*e.args)[0]);
if (!t)
{
error(e.loc, "`%s` is not a type", (*e.args)[0].toChars());
return ErrorExp.get();
}
Array!(ulong) data;
ulong sz = getTypePointerBitmap(e.loc, t, &data);
if (sz == ulong.max)
return ErrorExp.get();
auto exps = new Expressions(data.dim + 1);
(*exps)[0] = new IntegerExp(e.loc, sz, Type.tsize_t);
foreach (size_t i; 1 .. exps.dim)
(*exps)[i] = new IntegerExp(e.loc, data[cast(size_t) (i - 1)], Type.tsize_t);
auto ale = new ArrayLiteralExp(e.loc, Type.tsize_t.sarrayOf(data.dim + 1), exps);
return ale;
}
Expression semanticTraits(TraitsExp e, Scope* sc)
{
static if (LOGSEMANTIC)
{
printf("TraitsExp::semantic() %s\n", e.toChars());
}
if (e.ident != Id.compiles &&
e.ident != Id.isSame &&
e.ident != Id.identifier &&
e.ident != Id.getProtection && e.ident != Id.getVisibility &&
e.ident != Id.getAttributes)
{
// Pretend we're in a deprecated scope so that deprecation messages
// aren't triggered when checking if a symbol is deprecated
const save = sc.stc;
if (e.ident == Id.isDeprecated)
sc.stc |= STC.deprecated_;
if (!TemplateInstance.semanticTiargs(e.loc, sc, e.args, 1))
{
sc.stc = save;
return ErrorExp.get();
}
sc.stc = save;
}
size_t dim = e.args ? e.args.dim : 0;
Expression dimError(int expected)
{
e.error("expected %d arguments for `%s` but had %d", expected, e.ident.toChars(), cast(int)dim);
return ErrorExp.get();
}
static IntegerExp True()
{
return IntegerExp.createBool(true);
}
static IntegerExp False()
{
return IntegerExp.createBool(false);
}
/********
* Gets the function type from a given AST node
* if the node is a function of some sort.
* Params:
* o = an AST node to check for a `TypeFunction`
* fdp = if `o` is a FuncDeclaration then fdp is set to that, otherwise `null`
* Returns:
* a type node if `o` is a declaration of
* a delegate, function, function-pointer or a variable of the former.
* Otherwise, `null`.
*/
static TypeFunction toTypeFunction(RootObject o, out FuncDeclaration fdp)
{
Type t;
if (auto s = getDsymbolWithoutExpCtx(o))
{
if (auto fd = s.isFuncDeclaration())
{
t = fd.type;
fdp = fd;
}
else if (auto vd = s.isVarDeclaration())
t = vd.type;
else
t = isType(o);
}
else
t = isType(o);
if (t)
{
if (auto tf = t.isFunction_Delegate_PtrToFunction())
return tf;
}
return null;
}
IntegerExp isX(T)(bool delegate(T) fp)
{
if (!dim)
return False();
foreach (o; *e.args)
{
static if (is(T == Type))
auto y = getType(o);
static if (is(T : Dsymbol))
{
auto s = getDsymbolWithoutExpCtx(o);
if (!s)
return False();
}
static if (is(T == Dsymbol))
alias y = s;
static if (is(T == Declaration))
auto y = s.isDeclaration();
static if (is(T == FuncDeclaration))
auto y = s.isFuncDeclaration();
if (!y || !fp(y))
return False();
}
return True();
}
alias isTypeX = isX!Type;
alias isDsymX = isX!Dsymbol;
alias isDeclX = isX!Declaration;
alias isFuncX = isX!FuncDeclaration;
Expression isPkgX(bool function(Package) fp)
{
return isDsymX((Dsymbol sym) {
Package p = resolveIsPackage(sym);
return (p !is null) && fp(p);
});
}
if (e.ident == Id.isArithmetic)
{
return isTypeX(t => t.isintegral() || t.isfloating());
}
if (e.ident == Id.isFloating)
{
return isTypeX(t => t.isfloating());
}
if (e.ident == Id.isIntegral)
{
return isTypeX(t => t.isintegral());
}
if (e.ident == Id.isScalar)
{
return isTypeX(t => t.isscalar());
}
if (e.ident == Id.isUnsigned)
{
return isTypeX(t => t.isunsigned());
}
if (e.ident == Id.isAssociativeArray)
{
return isTypeX(t => t.toBasetype().ty == Taarray);
}
if (e.ident == Id.isDeprecated)
{
if (isTypeX(t => t.iscomplex() || t.isimaginary()).toBool().hasValue(true))
return True();
return isDsymX(t => t.isDeprecated());
}
if (e.ident == Id.isFuture)
{
return isDeclX(t => t.isFuture());
}
if (e.ident == Id.isStaticArray)
{
return isTypeX(t => t.toBasetype().ty == Tsarray);
}
if (e.ident == Id.isAbstractClass)
{
return isTypeX(t => t.toBasetype().ty == Tclass &&
(cast(TypeClass)t.toBasetype()).sym.isAbstract());
}
if (e.ident == Id.isFinalClass)
{
return isTypeX(t => t.toBasetype().ty == Tclass &&
((cast(TypeClass)t.toBasetype()).sym.storage_class & STC.final_) != 0);
}
if (e.ident == Id.isTemplate)
{
if (dim != 1)
return dimError(1);
return isDsymX((s)
{
if (!s.toAlias().isOverloadable())
return false;
return overloadApply(s,
sm => sm.isTemplateDeclaration() !is null) != 0;
});
}
if (e.ident == Id.isPOD)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto t = isType(o);
if (!t)
{
e.error("type expected as second argument of __traits `%s` instead of `%s`",
e.ident.toChars(), o.toChars());
return ErrorExp.get();
}
Type tb = t.baseElemOf();
if (auto sd = tb.ty == Tstruct ? (cast(TypeStruct)tb).sym : null)
{
return sd.isPOD() ? True() : False();
}
return True();
}
if (e.ident == Id.hasCopyConstructor || e.ident == Id.hasPostblit)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto t = isType(o);
if (!t)
{
e.error("type expected as second argument of __traits `%s` instead of `%s`",
e.ident.toChars(), o.toChars());
return ErrorExp.get();
}
Type tb = t.baseElemOf();
if (auto sd = tb.ty == Tstruct ? (cast(TypeStruct)tb).sym : null)
{
return (e.ident == Id.hasPostblit) ? (sd.postblit ? True() : False())
: (sd.hasCopyCtor ? True() : False());
}
return False();
}
if (e.ident == Id.isCopyable)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto t = isType(o);
if (!t)
{
e.error("type expected as second argument of __traits `%s` instead of `%s`",
e.ident.toChars(), o.toChars());
return ErrorExp.get();
}
t = t.toBasetype(); // get the base in case `t` is an `enum`
if (auto ts = t.isTypeStruct())
{
ts.sym.dsymbolSemantic(sc);
}
return isCopyable(t) ? True() : False();
}
if (e.ident == Id.isNested)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto s = getDsymbolWithoutExpCtx(o);
if (!s)
{
}
else if (auto ad = s.isAggregateDeclaration())
{
return ad.isNested() ? True() : False();
}
else if (auto fd = s.isFuncDeclaration())
{
return fd.isNested() ? True() : False();
}
e.error("aggregate or function expected instead of `%s`", o.toChars());
return ErrorExp.get();
}
if (e.ident == Id.isDisabled)
{
if (dim != 1)
return dimError(1);
return isDeclX(f => f.isDisabled());
}
if (e.ident == Id.isAbstractFunction)
{
if (dim != 1)
return dimError(1);
return isFuncX(f => f.isAbstract());
}
if (e.ident == Id.isVirtualFunction)
{
if (dim != 1)
return dimError(1);
return isFuncX(f => f.isVirtual());
}
if (e.ident == Id.isVirtualMethod)
{
if (dim != 1)
return dimError(1);
return isFuncX(f => f.isVirtualMethod());
}
if (e.ident == Id.isFinalFunction)
{
if (dim != 1)
return dimError(1);
return isFuncX(f => f.isFinalFunc());
}
if (e.ident == Id.isOverrideFunction)
{
if (dim != 1)
return dimError(1);
return isFuncX(f => f.isOverride());
}
if (e.ident == Id.isStaticFunction)
{
if (dim != 1)
return dimError(1);
return isFuncX(f => !f.needThis() && !f.isNested());
}
if (e.ident == Id.isModule)
{
if (dim != 1)
return dimError(1);
return isPkgX(p => p.isModule() || p.isPackageMod());
}
if (e.ident == Id.isPackage)
{
if (dim != 1)
return dimError(1);
return isPkgX(p => p.isModule() is null);
}
if (e.ident == Id.isRef)
{
if (dim != 1)
return dimError(1);
return isDeclX(d => d.isRef());
}
if (e.ident == Id.isOut)
{
if (dim != 1)
return dimError(1);
return isDeclX(d => d.isOut());
}
if (e.ident == Id.isLazy)
{
if (dim != 1)
return dimError(1);
return isDeclX(d => (d.storage_class & STC.lazy_) != 0);
}
if (e.ident == Id.identifier)
{
// Get identifier for symbol as a string literal
/* Specify 0 for bit 0 of the flags argument to semanticTiargs() so that
* a symbol should not be folded to a constant.
* Bit 1 means don't convert Parameter to Type if Parameter has an identifier
*/
if (!TemplateInstance.semanticTiargs(e.loc, sc, e.args, 2))
return ErrorExp.get();
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
Identifier id;
if (auto po = isParameter(o))
{
if (!po.ident)
{
e.error("argument `%s` has no identifier", po.type.toChars());
return ErrorExp.get();
}
id = po.ident;
}
else
{
Dsymbol s = getDsymbolWithoutExpCtx(o);
if (!s || !s.ident)
{
e.error("argument `%s` has no identifier", o.toChars());
return ErrorExp.get();
}
id = s.ident;
}
auto se = new StringExp(e.loc, id.toString());
return se.expressionSemantic(sc);
}
if (e.ident == Id.getProtection || e.ident == Id.getVisibility)
{
if (dim != 1)
return dimError(1);
Scope* sc2 = sc.push();
sc2.flags = sc.flags | SCOPE.noaccesscheck | SCOPE.ignoresymbolvisibility;
bool ok = TemplateInstance.semanticTiargs(e.loc, sc2, e.args, 1);
sc2.pop();
if (!ok)
return ErrorExp.get();
auto o = (*e.args)[0];
auto s = getDsymbolWithoutExpCtx(o);
if (!s)
{
if (!isError(o))
e.error("argument `%s` has no visibility", o.toChars());
return ErrorExp.get();
}
if (s.semanticRun == PASS.initial)
s.dsymbolSemantic(null);
auto protName = visibilityToString(s.visible().kind); // TODO: How about package(names)
assert(protName);
auto se = new StringExp(e.loc, protName);
return se.expressionSemantic(sc);
}
if (e.ident == Id.parent)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto s = getDsymbolWithoutExpCtx(o);
if (s)
{
// https://issues.dlang.org/show_bug.cgi?id=12496
// Consider:
// class T1
// {
// class C(uint value) { }
// }
// __traits(parent, T1.C!2)
if (auto ad = s.isAggregateDeclaration()) // `s` is `C`
{
if (ad.isNested()) // `C` is nested
{
if (auto p = s.toParent()) // `C`'s parent is `C!2`, believe it or not
{
if (p.isTemplateInstance()) // `C!2` is a template instance
{
s = p; // `C!2`'s parent is `T1`
auto td = (cast(TemplateInstance)p).tempdecl;
if (td)
s = td; // get the declaration context just in case there's two contexts
}
}
}
}
if (auto fd = s.isFuncDeclaration()) // https://issues.dlang.org/show_bug.cgi?id=8943
s = fd.toAliasFunc();
if (!s.isImport()) // https://issues.dlang.org/show_bug.cgi?id=8922
s = s.toParent();
}
if (!s || s.isImport())
{
e.error("argument `%s` has no parent", o.toChars());
return ErrorExp.get();
}
if (auto f = s.isFuncDeclaration())
{
if (auto td = getFuncTemplateDecl(f))
{
if (td.overroot) // if not start of overloaded list of TemplateDeclaration's
td = td.overroot; // then get the start
Expression ex = new TemplateExp(e.loc, td, f);
ex = ex.expressionSemantic(sc);
return ex;
}
if (auto fld = f.isFuncLiteralDeclaration())
{
// Directly translate to VarExp instead of FuncExp
Expression ex = new VarExp(e.loc, fld, true);
return ex.expressionSemantic(sc);
}
}
return symbolToExp(s, e.loc, sc, false);
}
if (e.ident == Id.child)
{
if (dim != 2)
return dimError(2);
Expression ex;
auto op = (*e.args)[0];
if (auto symp = getDsymbol(op))
ex = new DsymbolExp(e.loc, symp);
else if (auto exp = op.isExpression())
ex = exp;
else
{
e.error("symbol or expression expected as first argument of __traits `child` instead of `%s`", op.toChars());
return ErrorExp.get();
}
ex = ex.expressionSemantic(sc);
auto oc = (*e.args)[1];
auto symc = getDsymbol(oc);
if (!symc)
{
e.error("symbol expected as second argument of __traits `child` instead of `%s`", oc.toChars());
return ErrorExp.get();
}
if (auto d = symc.isDeclaration())
ex = new DotVarExp(e.loc, ex, d);
else if (auto td = symc.isTemplateDeclaration())
ex = new DotExp(e.loc, ex, new TemplateExp(e.loc, td));
else if (auto ti = symc.isScopeDsymbol())
ex = new DotExp(e.loc, ex, new ScopeExp(e.loc, ti));
else
assert(0);
ex = ex.expressionSemantic(sc);
return ex;
}
if (e.ident == Id.toType)
{
if (dim != 1)
return dimError(1);
auto ex = isExpression((*e.args)[0]);
if (!ex)
{
e.error("expression expected as second argument of __traits `%s`", e.ident.toChars());
return ErrorExp.get();
}
ex = ex.ctfeInterpret();
StringExp se = semanticString(sc, ex, "__traits(toType, string)");
if (!se)
{
return ErrorExp.get();
}
Type t = decoToType(se.toUTF8(sc).peekString());
if (!t)
{
e.error("cannot determine `%s`", e.toChars());
return ErrorExp.get();
}
return (new TypeExp(e.loc, t)).expressionSemantic(sc);
}
if (e.ident == Id.hasMember ||
e.ident == Id.getMember ||
e.ident == Id.getOverloads ||
e.ident == Id.getVirtualMethods ||
e.ident == Id.getVirtualFunctions)
{
if (dim != 2 && !(dim == 3 && e.ident == Id.getOverloads))
return dimError(2);
auto o = (*e.args)[0];
auto ex = isExpression((*e.args)[1]);
if (!ex)
{
e.error("expression expected as second argument of __traits `%s`", e.ident.toChars());
return ErrorExp.get();
}
ex = ex.ctfeInterpret();
bool includeTemplates = false;
if (dim == 3 && e.ident == Id.getOverloads)
{
auto b = isExpression((*e.args)[2]);
b = b.ctfeInterpret();
if (!b.type.equals(Type.tbool))
{
e.error("`bool` expected as third argument of `__traits(getOverloads)`, not `%s` of type `%s`", b.toChars(), b.type.toChars());
return ErrorExp.get();
}
includeTemplates = b.toBool().get();
}
StringExp se = ex.toStringExp();
if (!se || se.len == 0)
{
e.error("string expected as second argument of __traits `%s` instead of `%s`", e.ident.toChars(), ex.toChars());
return ErrorExp.get();
}
se = se.toUTF8(sc);
if (se.sz != 1)
{
e.error("string must be chars");
return ErrorExp.get();
}
auto id = Identifier.idPool(se.peekString());
/* Prefer a Type, because getDsymbol(Type) can lose type modifiers.
Then a Dsymbol, because it might need some runtime contexts.
*/
Dsymbol sym = getDsymbol(o);
if (auto t = isType(o))
ex = typeDotIdExp(e.loc, t, id);
else if (sym)
{
if (e.ident == Id.hasMember)
{
if (auto sm = sym.search(e.loc, id))
return True();
}
ex = new DsymbolExp(e.loc, sym);
ex = new DotIdExp(e.loc, ex, id);
}
else if (auto ex2 = isExpression(o))
ex = new DotIdExp(e.loc, ex2, id);
else
{
e.error("invalid first argument");
return ErrorExp.get();
}
// ignore symbol visibility and disable access checks for these traits
Scope* scx = sc.push();
scx.flags |= SCOPE.ignoresymbolvisibility | SCOPE.noaccesscheck;
scope (exit) scx.pop();
if (e.ident == Id.hasMember)
{
/* Take any errors as meaning it wasn't found
*/
ex = ex.trySemantic(scx);
return ex ? True() : False();
}
else if (e.ident == Id.getMember)
{
if (auto die = ex.isDotIdExp())
// Prevent semantic() from replacing Symbol with its initializer
die.wantsym = true;
ex = ex.expressionSemantic(scx);
return ex;
}
else if (e.ident == Id.getVirtualFunctions ||
e.ident == Id.getVirtualMethods ||
e.ident == Id.getOverloads)
{
uint errors = global.errors;
Expression eorig = ex;
ex = ex.expressionSemantic(scx);
if (errors < global.errors)
e.error("`%s` cannot be resolved", eorig.toChars());
/* Create tuple of functions of ex
*/
auto exps = new Expressions();
Dsymbol f;
if (auto ve = ex.isVarExp)
{
if (ve.var.isFuncDeclaration() || ve.var.isOverDeclaration())
f = ve.var;
ex = null;
}
else if (auto dve = ex.isDotVarExp)
{
if (dve.var.isFuncDeclaration() || dve.var.isOverDeclaration())
f = dve.var;
if (dve.e1.op == EXP.dotType || dve.e1.op == EXP.this_)
ex = null;
else
ex = dve.e1;
}
else if (auto te = ex.isTemplateExp)
{
auto td = te.td;
f = td;
if (td && td.funcroot)
f = td.funcroot;
ex = null;
}
else if (auto dte = ex.isDotTemplateExp)
{
auto td = dte.td;
f = td;
if (td && td.funcroot)
f = td.funcroot;
ex = null;
if (dte.e1.op != EXP.dotType && dte.e1.op != EXP.this_)
ex = dte.e1;
}
bool[string] funcTypeHash;
/* Compute the function signature and insert it in the
* hashtable, if not present. This is needed so that
* traits(getOverlods, F3, "visit") does not count `int visit(int)`
* twice in the following example:
*
* =============================================
* interface F1 { int visit(int);}
* interface F2 { int visit(int); void visit(); }
* interface F3 : F2, F1 {}
*==============================================
*/
void insertInterfaceInheritedFunction(FuncDeclaration fd, Expression e)
{
auto signature = fd.type.toString();
//printf("%s - %s\n", fd.toChars, signature);
if (signature !in funcTypeHash)
{
funcTypeHash[signature] = true;
exps.push(e);
}
}
int dg(Dsymbol s)
{
auto fd = s.isFuncDeclaration();
if (!fd)
{
if (includeTemplates)
{
if (auto td = s.isTemplateDeclaration())
{
// if td is part of an overload set we must take a copy
// which shares the same `instances` cache but without
// `overroot` and `overnext` set to avoid overload
// behaviour in the result.
if (td.overnext !is null)
{
if (td.instances is null)
{
// create an empty AA just to copy it
scope ti = new TemplateInstance(Loc.initial, Id.empty, null);
auto tib = TemplateInstanceBox(ti);
td.instances[tib] = null;
td.instances.clear();
}
td = td.syntaxCopy(null);
import core.stdc.string : memcpy;
memcpy(cast(void*) td, cast(void*) s,
__traits(classInstanceSize, TemplateDeclaration));
td.overroot = null;
td.overnext = null;
}
auto e = ex ? new DotTemplateExp(Loc.initial, ex, td)
: new DsymbolExp(Loc.initial, td);
exps.push(e);
}
}
return 0;
}
if (e.ident == Id.getVirtualFunctions && !fd.isVirtual())
return 0;
if (e.ident == Id.getVirtualMethods && !fd.isVirtualMethod())
return 0;
auto fa = new FuncAliasDeclaration(fd.ident, fd, false);
fa.visibility = fd.visibility;
auto e = ex ? new DotVarExp(Loc.initial, ex, fa, false)
: new DsymbolExp(Loc.initial, fa, false);
// if the parent is an interface declaration
// we must check for functions with the same signature
// in different inherited interfaces
if (sym && sym.isInterfaceDeclaration())
insertInterfaceInheritedFunction(fd, e);
else
exps.push(e);
return 0;
}
InterfaceDeclaration ifd = null;
if (sym)
ifd = sym.isInterfaceDeclaration();
// If the symbol passed as a parameter is an
// interface that inherits other interfaces
overloadApply(f, &dg);
if (ifd && ifd.interfaces && f)
{
// check the overloads of each inherited interface individually
foreach (bc; ifd.interfaces)
{
if (auto fd = bc.sym.search(e.loc, f.ident))
overloadApply(fd, &dg);
}
}
auto tup = new TupleExp(e.loc, exps);
return tup.expressionSemantic(scx);
}
else
assert(0);
}
if (e.ident == Id.classInstanceSize || e.ident == Id.classInstanceAlignment)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto s = getDsymbol(o);
auto cd = s ? s.isClassDeclaration() : null;
if (!cd)
{
e.error("first argument is not a class");
return ErrorExp.get();
}
if (cd.sizeok != Sizeok.done)
{
cd.size(e.loc);
}
if (cd.sizeok != Sizeok.done)
{
e.error("%s `%s` is forward referenced", cd.kind(), cd.toChars());
return ErrorExp.get();
}
return new IntegerExp(e.loc, e.ident == Id.classInstanceSize ? cd.structsize : cd.alignsize, Type.tsize_t);
}
if (e.ident == Id.getAliasThis)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto s = getDsymbol(o);
auto ad = s ? s.isAggregateDeclaration() : null;
auto exps = new Expressions();
if (ad && ad.aliasthis)
exps.push(new StringExp(e.loc, ad.aliasthis.ident.toString()));
Expression ex = new TupleExp(e.loc, exps);
ex = ex.expressionSemantic(sc);
return ex;
}
if (e.ident == Id.getAttributes)
{
/* Specify 0 for bit 0 of the flags argument to semanticTiargs() so that
* a symbol should not be folded to a constant.
* Bit 1 means don't convert Parameter to Type if Parameter has an identifier
*/
if (!TemplateInstance.semanticTiargs(e.loc, sc, e.args, 3))
return ErrorExp.get();
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto po = isParameter(o);
auto s = getDsymbolWithoutExpCtx(o);
UserAttributeDeclaration udad = null;
if (po)
{
udad = po.userAttribDecl;
}
else if (s)
{
if (s.isImport())
{
s = s.isImport().mod;
}
//printf("getAttributes %s, attrs = %p, scope = %p\n", s.toChars(), s.userAttribDecl, s._scope);
udad = s.userAttribDecl;
}
else
{
version (none)
{
Expression x = isExpression(o);
Type t = isType(o);
if (x)
printf("e = %s %s\n", EXPtoString(x.op).ptr, x.toChars());
if (t)
printf("t = %d %s\n", t.ty, t.toChars());
}
e.error("first argument is not a symbol");
return ErrorExp.get();
}
auto exps = udad ? udad.getAttributes() : new Expressions();
auto tup = new TupleExp(e.loc, exps);
return tup.expressionSemantic(sc);
}
if (e.ident == Id.getFunctionAttributes)
{
/* Extract all function attributes as a tuple (const/shared/inout/pure/nothrow/etc) except UDAs.
* https://dlang.org/spec/traits.html#getFunctionAttributes
*/
if (dim != 1)
return dimError(1);
FuncDeclaration fd;
TypeFunction tf = toTypeFunction((*e.args)[0], fd);
if (!tf)
{
e.error("first argument is not a function");
return ErrorExp.get();
}
auto mods = new Expressions();
void addToMods(string str)
{
mods.push(new StringExp(Loc.initial, str));
}
tf.modifiersApply(&addToMods);
tf.attributesApply(&addToMods, TRUSTformatSystem);
auto tup = new TupleExp(e.loc, mods);
return tup.expressionSemantic(sc);
}
if (e.ident == Id.isReturnOnStack)
{
/* Extract as a boolean if function return value is on the stack
* https://dlang.org/spec/traits.html#isReturnOnStack
*/
if (dim != 1)
return dimError(1);
RootObject o = (*e.args)[0];
FuncDeclaration fd;
TypeFunction tf = toTypeFunction(o, fd);
if (!tf)
{
e.error("argument to `__traits(isReturnOnStack, %s)` is not a function", o.toChars());
return ErrorExp.get();
}
bool value = target.isReturnOnStack(tf, fd && fd.needThis());
return IntegerExp.createBool(value);
}
if (e.ident == Id.getFunctionVariadicStyle)
{
/* Accept a symbol or a type. Returns one of the following:
* "none" not a variadic function
* "argptr" extern(D) void dstyle(...), use `__argptr` and `__arguments`
* "stdarg" extern(C) void cstyle(int, ...), use core.stdc.stdarg
* "typesafe" void typesafe(T[] ...)
*/
// get symbol linkage as a string
if (dim != 1)
return dimError(1);
LINK link;
VarArg varargs;
auto o = (*e.args)[0];
FuncDeclaration fd;
TypeFunction tf = toTypeFunction(o, fd);
if (tf)
{
link = tf.linkage;
varargs = tf.parameterList.varargs;
}
else
{
if (!fd)
{
e.error("argument to `__traits(getFunctionVariadicStyle, %s)` is not a function", o.toChars());
return ErrorExp.get();
}
link = fd._linkage;
varargs = fd.getParameterList().varargs;
}
string style;
final switch (varargs)
{
case VarArg.none: style = "none"; break;
case VarArg.variadic: style = (link == LINK.d)
? "argptr"
: "stdarg"; break;
case VarArg.typesafe: style = "typesafe"; break;
}
auto se = new StringExp(e.loc, style);
return se.expressionSemantic(sc);
}
if (e.ident == Id.getParameterStorageClasses)
{
/* Accept a function symbol or a type, followed by a parameter index.
* Returns a tuple of strings of the parameter's storage classes.
*/
// get symbol linkage as a string
if (dim != 2)
return dimError(2);
auto o = (*e.args)[0];
auto o1 = (*e.args)[1];
ParameterList fparams;
CallExp ce;
if (auto exp = isExpression(o))
ce = exp.isCallExp();
if (ce)
{
fparams = ce.f.getParameterList();
}
else
{
FuncDeclaration fd;
auto tf = toTypeFunction(o, fd);
if (tf)
fparams = tf.parameterList;
else if (fd)
fparams = fd.getParameterList();
else
{
e.error("first argument to `__traits(getParameterStorageClasses, %s, %s)` is not a function or a function call",
o.toChars(), o1.toChars());
return ErrorExp.get();
}
}
// Avoid further analysis for invalid functions leading to misleading error messages
if (!fparams.parameters)
return ErrorExp.get();
StorageClass stc;
// Set stc to storage class of the ith parameter
auto ex = isExpression((*e.args)[1]);
if (!ex)
{
e.error("expression expected as second argument of `__traits(getParameterStorageClasses, %s, %s)`",
o.toChars(), o1.toChars());
return ErrorExp.get();
}
ex = ex.ctfeInterpret();
auto ii = ex.toUInteger();
if (ii >= fparams.length)
{
e.error("parameter index must be in range 0..%u not %s", cast(uint)fparams.length, ex.toChars());
return ErrorExp.get();
}
uint n = cast(uint)ii;
Parameter p = fparams[n];
stc = p.storageClass;
// This mirrors hdrgen.visit(Parameter p)
if (p.type && p.type.mod & MODFlags.shared_)
stc &= ~STC.shared_;
auto exps = new Expressions;
void push(string s)
{
exps.push(new StringExp(e.loc, s));
}
if (stc & STC.auto_)
push("auto");
if (stc & STC.return_)
push("return");
if (stc & STC.out_)
push("out");
else if (stc & STC.in_)
push("in");
else if (stc & STC.ref_)
push("ref");
else if (stc & STC.lazy_)
push("lazy");
else if (stc & STC.alias_)
push("alias");
if (stc & STC.const_)
push("const");
if (stc & STC.immutable_)
push("immutable");
if (stc & STC.wild)
push("inout");
if (stc & STC.shared_)
push("shared");
if (stc & STC.scope_ && !(stc & STC.scopeinferred))
push("scope");
auto tup = new TupleExp(e.loc, exps);
return tup.expressionSemantic(sc);
}
if (e.ident == Id.getLinkage)
{
// get symbol linkage as a string
if (dim != 1)
return dimError(1);
LINK link;
auto o = (*e.args)[0];
FuncDeclaration fd;
TypeFunction tf = toTypeFunction(o, fd);
if (tf)
{
link = fd ? fd.toAliasFunc()._linkage : tf.linkage;
}
else
{
auto s = getDsymbol(o);
Declaration d;
AggregateDeclaration agg;
if (!s || ((d = s.isDeclaration()) is null && (agg = s.isAggregateDeclaration()) is null))
{
e.error("argument to `__traits(getLinkage, %s)` is not a declaration", o.toChars());
return ErrorExp.get();
}
if (d !is null)
link = d._linkage;
else
{
// Resolves forward references
if (agg.sizeok != Sizeok.done)
{
agg.size(e.loc);
if (agg.sizeok != Sizeok.done)
{
e.error("%s `%s` is forward referenced", agg.kind(), agg.toChars());
return ErrorExp.get();
}
}
final switch (agg.classKind)
{
case ClassKind.d:
link = LINK.d;
break;
case ClassKind.cpp:
link = LINK.cpp;
break;
case ClassKind.objc:
link = LINK.objc;
break;
case ClassKind.c:
link = LINK.c;
break;
}
}
}
auto linkage = linkageToChars(link);
auto se = new StringExp(e.loc, linkage.toDString());
return se.expressionSemantic(sc);
}
if (e.ident == Id.allMembers ||
e.ident == Id.derivedMembers)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto s = getDsymbol(o);
if (!s)
{
e.error("in expression `%s` `%s` can't have members", e.toChars(), o.toChars());
e.errorSupplemental("`%s` must evaluate to either a module, a struct, an union, a class, an interface or a template instantiation", o.toChars());
return ErrorExp.get();
}
if (auto imp = s.isImport())
{
// https://issues.dlang.org/show_bug.cgi?id=9692
s = imp.mod;
}
// https://issues.dlang.org/show_bug.cgi?id=16044
if (auto p = s.isPackage())
{
if (auto pm = p.isPackageMod())
s = pm;
}
auto sds = s.isScopeDsymbol();
if (!sds || sds.isTemplateDeclaration())
{
e.error("in expression `%s` %s `%s` has no members", e.toChars(), s.kind(), s.toChars());
e.errorSupplemental("`%s` must evaluate to either a module, a struct, an union, a class, an interface or a template instantiation", s.toChars());
return ErrorExp.get();
}
auto idents = new Identifiers();
int pushIdentsDg(size_t n, Dsymbol sm)
{
if (!sm)
return 1;
// skip local symbols, such as static foreach loop variables
if (auto decl = sm.isDeclaration())
{
if (decl.storage_class & STC.local)
{
return 0;
}
// skip 'this' context pointers
else if (decl.isThisDeclaration())
return 0;
}
// https://issues.dlang.org/show_bug.cgi?id=20915
// skip version and debug identifiers
if (sm.isVersionSymbol() || sm.isDebugSymbol())
return 0;
//printf("\t[%i] %s %s\n", i, sm.kind(), sm.toChars());
if (sm.ident)
{
// https://issues.dlang.org/show_bug.cgi?id=10096
// https://issues.dlang.org/show_bug.cgi?id=10100
// Skip over internal members in __traits(allMembers)
if ((sm.isCtorDeclaration() && sm.ident != Id.ctor) ||
(sm.isDtorDeclaration() && sm.ident != Id.dtor) ||
(sm.isPostBlitDeclaration() && sm.ident != Id.postblit) ||
sm.isInvariantDeclaration() ||
sm.isUnitTestDeclaration())
{
return 0;
}
if (sm.ident == Id.empty)
{
return 0;
}
if (sm.isTypeInfoDeclaration()) // https://issues.dlang.org/show_bug.cgi?id=15177
return 0;
if ((!sds.isModule() && !sds.isPackage()) && sm.isImport()) // https://issues.dlang.org/show_bug.cgi?id=17057
return 0;
//printf("\t%s\n", sm.ident.toChars());
/* Skip if already present in idents[]
*/
foreach (id; *idents)
{
if (id == sm.ident)
return 0;
// Avoid using strcmp in the first place due to the performance impact in an O(N^2) loop.
debug
{
import core.stdc.string : strcmp;
assert(strcmp(id.toChars(), sm.ident.toChars()) != 0);
}
}
idents.push(sm.ident);
}
else if (auto ed = sm.isEnumDeclaration())
{
ScopeDsymbol._foreach(null, ed.members, &pushIdentsDg);
}
return 0;
}
ScopeDsymbol._foreach(sc, sds.members, &pushIdentsDg);
auto cd = sds.isClassDeclaration();
if (cd && e.ident == Id.allMembers)
{
if (cd.semanticRun < PASS.semanticdone)
cd.dsymbolSemantic(null); // https://issues.dlang.org/show_bug.cgi?id=13668
// Try to resolve forward reference
void pushBaseMembersDg(ClassDeclaration cd)
{
for (size_t i = 0; i < cd.baseclasses.dim; i++)
{
auto cb = (*cd.baseclasses)[i].sym;
assert(cb);
ScopeDsymbol._foreach(null, cb.members, &pushIdentsDg);
if (cb.baseclasses.dim)
pushBaseMembersDg(cb);
}
}
pushBaseMembersDg(cd);
}
// Turn Identifiers into StringExps reusing the allocated array
assert(Expressions.sizeof == Identifiers.sizeof);
auto exps = cast(Expressions*)idents;
foreach (i, id; *idents)
{
auto se = new StringExp(e.loc, id.toString());
(*exps)[i] = se;
}
/* Making this a tuple is more flexible, as it can be statically unrolled.
* To make an array literal, enclose __traits in [ ]:
* [ __traits(allMembers, ...) ]
*/
Expression ex = new TupleExp(e.loc, exps);
ex = ex.expressionSemantic(sc);
return ex;
}
if (e.ident == Id.compiles)
{
/* Determine if all the objects - types, expressions, or symbols -
* compile without error
*/
if (!dim)
return False();
foreach (o; *e.args)
{
uint errors = global.startGagging();
Scope* sc2 = sc.push();
sc2.tinst = null;
sc2.minst = null;
sc2.flags = (sc.flags & ~(SCOPE.ctfe | SCOPE.condition)) | SCOPE.compile | SCOPE.fullinst;
bool err = false;
auto t = isType(o);
auto ex = isExpression(o);
if (t)
{
Dsymbol s;
t.resolve(e.loc, sc2, ex, t, s);
if (t)
{
t.typeSemantic(e.loc, sc2);
if (t.ty == Terror)
err = true;
}
else if (s && s.errors)
err = true;
}
if (ex)
{
ex = ex.expressionSemantic(sc2);
ex = resolvePropertiesOnly(sc2, ex);
ex = ex.optimize(WANTvalue);
if (sc2.func && sc2.func.type.ty == Tfunction)
{
const tf = cast(TypeFunction)sc2.func.type;
err |= tf.isnothrow && canThrow(ex, sc2.func, false);
}
ex = checkGC(sc2, ex);
if (ex.op == EXP.error)
err = true;
}
// Carefully detach the scope from the parent and throw it away as
// we only need it to evaluate the expression
// https://issues.dlang.org/show_bug.cgi?id=15428
sc2.detach();
if (global.endGagging(errors) || err)
{
return False();
}
}
return True();
}
if (e.ident == Id.isSame)
{
/* Determine if two symbols are the same
*/
if (dim != 2)
return dimError(2);
// https://issues.dlang.org/show_bug.cgi?id=20761
// tiarg semantic may expand in place the list of arguments, for example:
//
// before tiarg sema: __traits(isSame, seq!(0,0), seq!(1,1))
// after : __traits(isSame, 0, 0, 1, 1)
//
// so we split in two lists
Objects ob1;
ob1.push((*e.args)[0]);
Objects ob2;
ob2.push((*e.args)[1]);
if (!TemplateInstance.semanticTiargs(e.loc, sc, &ob1, 0))
return ErrorExp.get();
if (!TemplateInstance.semanticTiargs(e.loc, sc, &ob2, 0))
return ErrorExp.get();
if (ob1.dim != ob2.dim)
return False();
foreach (immutable i; 0 .. ob1.dim)
if (!ob1[i].isSame(ob2[i], sc))
return False();
return True();
}
if (e.ident == Id.getUnitTests)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto s = getDsymbolWithoutExpCtx(o);
if (!s)
{
e.error("argument `%s` to __traits(getUnitTests) must be a module or aggregate",
o.toChars());
return ErrorExp.get();
}
if (auto imp = s.isImport()) // https://issues.dlang.org/show_bug.cgi?id=10990
s = imp.mod;
auto sds = s.isScopeDsymbol();
if (!sds || sds.isTemplateDeclaration())
{
e.error("argument `%s` to __traits(getUnitTests) must be a module or aggregate, not a %s",
s.toChars(), s.kind());
return ErrorExp.get();
}
auto exps = new Expressions();
if (global.params.useUnitTests)
{
bool[void*] uniqueUnitTests;
void symbolDg(Dsymbol s)
{
if (auto ad = s.isAttribDeclaration())
{
ad.include(null).foreachDsymbol(&symbolDg);
}
else if (auto tm = s.isTemplateMixin())
{
tm.members.foreachDsymbol(&symbolDg);
}
else if (auto ud = s.isUnitTestDeclaration())
{
if (cast(void*)ud in uniqueUnitTests)
return;
uniqueUnitTests[cast(void*)ud] = true;
auto ad = new FuncAliasDeclaration(ud.ident, ud, false);
ad.visibility = ud.visibility;
auto e = new DsymbolExp(Loc.initial, ad, false);
exps.push(e);
}
}
sds.members.foreachDsymbol(&symbolDg);
}
auto te = new TupleExp(e.loc, exps);
return te.expressionSemantic(sc);
}
if (e.ident == Id.getVirtualIndex)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto s = getDsymbolWithoutExpCtx(o);
auto fd = s ? s.isFuncDeclaration() : null;
if (!fd)
{
e.error("first argument to __traits(getVirtualIndex) must be a function");
return ErrorExp.get();
}
fd = fd.toAliasFunc(); // Necessary to support multiple overloads.
return new IntegerExp(e.loc, fd.vtblIndex, Type.tptrdiff_t);
}
if (e.ident == Id.getPointerBitmap)
{
return pointerBitmap(e);
}
if (e.ident == Id.initSymbol)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
Type t = isType(o);
AggregateDeclaration ad = t ? isAggregate(t) : null;
// Interfaces don't have an init symbol and hence cause linker errors
if (!ad || ad.isInterfaceDeclaration())
{
e.error("struct / class type expected as argument to __traits(initSymbol) instead of `%s`", o.toChars());
return ErrorExp.get();
}
Declaration d = new SymbolDeclaration(ad.loc, ad);
d.type = Type.tvoid.arrayOf().constOf();
d.storage_class |= STC.rvalue;
return new VarExp(e.loc, d);
}
if (e.ident == Id.isZeroInit)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
Type t = isType(o);
if (!t)
{
e.error("type expected as second argument of __traits `%s` instead of `%s`",
e.ident.toChars(), o.toChars());
return ErrorExp.get();
}
Type tb = t.baseElemOf();
return tb.isZeroInit(e.loc) ? True() : False();
}
if (e.ident == Id.getTargetInfo)
{
if (dim != 1)
return dimError(1);
auto ex = isExpression((*e.args)[0]);
StringExp se = ex ? ex.ctfeInterpret().toStringExp() : null;
if (!ex || !se || se.len == 0)
{
e.error("string expected as argument of __traits `%s` instead of `%s`", e.ident.toChars(), ex.toChars());
return ErrorExp.get();
}
se = se.toUTF8(sc);
const slice = se.peekString();
Expression r = target.getTargetInfo(slice.ptr, e.loc); // BUG: reliance on terminating 0
if (!r)
{
e.error("`getTargetInfo` key `\"%.*s\"` not supported by this implementation",
cast(int)slice.length, slice.ptr);
return ErrorExp.get();
}
return r.expressionSemantic(sc);
}
if (e.ident == Id.getLocation)
{
if (dim != 1)
return dimError(1);
auto arg0 = (*e.args)[0];
Dsymbol s = getDsymbolWithoutExpCtx(arg0);
if (!s || !s.loc.isValid())
{
e.error("can only get the location of a symbol, not `%s`", arg0.toChars());
return ErrorExp.get();
}
const fd = s.isFuncDeclaration();
// FIXME:td.overnext is always set, even when using an index on it
//const td = s.isTemplateDeclaration();
if ((fd && fd.overnext) /*|| (td && td.overnext)*/)
{
e.error("cannot get location of an overload set, " ~
"use `__traits(getOverloads, ..., \"%s\"%s)[N]` " ~
"to get the Nth overload",
arg0.toChars(), /*td ? ", true".ptr :*/ "".ptr);
return ErrorExp.get();
}
auto exps = new Expressions(3);
(*exps)[0] = new StringExp(e.loc, s.loc.filename.toDString());
(*exps)[1] = new IntegerExp(e.loc, s.loc.linnum,Type.tint32);
(*exps)[2] = new IntegerExp(e.loc, s.loc.charnum,Type.tint32);
auto tup = new TupleExp(e.loc, exps);
return tup.expressionSemantic(sc);
}
if (e.ident == Id.getCppNamespaces)
{
auto o = (*e.args)[0];
auto s = getDsymbolWithoutExpCtx(o);
auto exps = new Expressions(0);
if (auto d = s.isDeclaration())
{
if (d.inuse)
{
d.error("circular reference in `__traits(GetCppNamespaces,...)`");
return ErrorExp.get();
}
d.inuse = 1;
}
/**
Prepend the namespaces in the linked list `ns` to `es`.
Returns: true if `ns` contains an `ErrorExp`.
*/
bool prependNamespaces(Expressions* es, CPPNamespaceDeclaration ns)
{
// Semantic processing will convert `extern(C++, "a", "b", "c")`
// into `extern(C++, "a") extern(C++, "b") extern(C++, "c")`,
// creating a linked list what `a`'s `cppnamespace` points to `b`,
// and `b`'s points to `c`. Our entry point is `a`.
for (; ns !is null; ns = ns.cppnamespace)
{
ns.dsymbolSemantic(sc);
if (ns.exp.isErrorExp())
return true;
auto se = ns.exp.toStringExp();
// extern(C++, (emptyTuple))
// struct D {}
// will produce a blank ident
if (!se.len)
continue;
es.insert(0, se);
}
return false;
}
for (auto p = s; !p.isModule(); p = p.toParent())
{
p.dsymbolSemantic(sc);
auto pp = p.toParent();
if (pp.isTemplateInstance())
{
if (!p.cppnamespace)
continue;
//if (!p.toParent().cppnamespace)
// continue;
auto inner = new Expressions(0);
auto outer = new Expressions(0);
if (prependNamespaces(inner, p.cppnamespace)) return ErrorExp.get();
if (prependNamespaces(outer, pp.cppnamespace)) return ErrorExp.get();
size_t i = 0;
while(i < outer.dim && ((*inner)[i]) == (*outer)[i])
i++;
foreach_reverse (ns; (*inner)[][i .. $])
exps.insert(0, ns);
continue;
}
if (p.isNspace())
exps.insert(0, new StringExp(p.loc, p.ident.toString()));
if (prependNamespaces(exps, p.cppnamespace))
return ErrorExp.get();
}
if (auto d = s.isDeclaration())
d.inuse = 0;
auto tup = new TupleExp(e.loc, exps);
return tup.expressionSemantic(sc);
}
//https://issues.dlang.org/show_bug.cgi?id=22291
if (e.ident == Id.parameters)
{
//No args are valid
if (e.args)
{
char[] contents = cast(char[]) e.args.toString();
contents = contents[1..$];
contents[$-1] = '\0';
e.error("`__traits(parameters)` cannot have arguments, but `%s` was supplied", contents.ptr);
return ErrorExp.get();
}
auto fd = sc.getEnclosingFunction();
if (!fd)
{
e.error("`__traits(parameters)` may only be used inside a function");
return ErrorExp.get();
}
auto tf = fd.type.isTypeFunction();
assert(tf);
auto exps = new Expressions(0);
int addParameterDG(size_t idx, Parameter x)
{
assert(x.ident);
exps.push(new IdentifierExp(e.loc, x.ident));
return 0;
}
/*
This is required since not all "parameters" actually have a name
until they (tuples) are expanded e.g. an anonymous tuple parameter's
contents get given names but not the tuple itself.
*/
Parameter._foreach(tf.parameterList.parameters, &addParameterDG);
auto tup = new TupleExp(e.loc, exps);
return tup.expressionSemantic(sc);
}
static const(char)[] trait_search_fp(const(char)[] seed, out int cost)
{
//printf("trait_search_fp('%s')\n", seed);
if (!seed.length)
return null;
cost = 0; // all the same cost
const sv = traitsStringTable.lookup(seed);
return sv ? sv.toString() : null;
}
if (auto sub = speller!trait_search_fp(e.ident.toString()))
e.error("unrecognized trait `%s`, did you mean `%.*s`?", e.ident.toChars(), cast(int) sub.length, sub.ptr);
else
e.error("unrecognized trait `%s`", e.ident.toChars());
return ErrorExp.get();
}
/// compare arguments of __traits(isSame)
private bool isSame(RootObject o1, RootObject o2, Scope* sc)
{
static FuncLiteralDeclaration isLambda(RootObject oarg)
{
if (auto t = isDsymbol(oarg))
{
if (auto td = t.isTemplateDeclaration())
{
if (td.members && td.members.dim == 1)
{
if (auto fd = (*td.members)[0].isFuncLiteralDeclaration())
return fd;
}
}
}
else if (auto ea = isExpression(oarg))
{
if (ea.op == EXP.function_)
{
if (auto fe = ea.isFuncExp())
return fe.fd;
}
}
return null;
}
auto l1 = isLambda(o1);
auto l2 = isLambda(o2);
if (l1 && l2)
{
import dmd.lambdacomp : isSameFuncLiteral;
if (isSameFuncLiteral(l1, l2, sc))
return true;
}
// issue 12001, allow isSame, <BasicType>, <BasicType>
Type t1 = isType(o1);
Type t2 = isType(o2);
if (t1 && t2 && t1.equals(t2))
return true;
auto s1 = getDsymbol(o1);
auto s2 = getDsymbol(o2);
//printf("isSame: %s, %s\n", o1.toChars(), o2.toChars());
version (none)
{
printf("o1: %p\n", o1);
printf("o2: %p\n", o2);
if (!s1)
{
if (auto ea = isExpression(o1))
printf("%s\n", ea.toChars());
if (auto ta = isType(o1))
printf("%s\n", ta.toChars());
return false;
}
else
printf("%s %s\n", s1.kind(), s1.toChars());
}
if (!s1 && !s2)
{
auto ea1 = isExpression(o1);
auto ea2 = isExpression(o2);
if (ea1 && ea2)
{
if (ea1.equals(ea2))
return true;
}
}
if (!s1 || !s2)
return false;
s1 = s1.toAlias();
s2 = s2.toAlias();
if (auto fa1 = s1.isFuncAliasDeclaration())
s1 = fa1.toAliasFunc();
if (auto fa2 = s2.isFuncAliasDeclaration())
s2 = fa2.toAliasFunc();
// https://issues.dlang.org/show_bug.cgi?id=11259
// compare import symbol to a package symbol
static bool cmp(Dsymbol s1, Dsymbol s2)
{
auto imp = s1.isImport();
return imp && imp.pkg && imp.pkg == s2.isPackage();
}
if (cmp(s1,s2) || cmp(s2,s1))
return true;
if (s1 == s2)
return true;
// https://issues.dlang.org/show_bug.cgi?id=18771
// OverloadSets are equal if they contain the same functions
auto overSet1 = s1.isOverloadSet();
if (!overSet1)
return false;
auto overSet2 = s2.isOverloadSet();
if (!overSet2)
return false;
if (overSet1.a.dim != overSet2.a.dim)
return false;
// OverloadSets contain array of Dsymbols => O(n*n)
// to compare for equality as the order of overloads
// might not be the same
Lnext:
foreach(overload1; overSet1.a)
{
foreach(overload2; overSet2.a)
{
if (overload1 == overload2)
continue Lnext;
}
return false;
}
return true;
}
|
D
|
/Users/miladmehrpoo/Desktop/Helloworld/.build/debug/Core.build/Strand.swift.o : /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Array.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Bool+String.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Box.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Collection+Safe.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Dispatch.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/DispatchTime+Utilities.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Equatable.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Extractable.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/FileProtocol.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Lock.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/PercentEncoding.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Portal.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Result.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/RFC1123.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Semaphore.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Sequence.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/StaticDataBuffer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Strand.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/String+CaseInsensitiveCompare.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/String.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/UnsignedInteger.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Byte+Random.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Byte.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/ByteAliases.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Bytes+Base64.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Bytes.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/BytesConvertible.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/miladmehrpoo/Desktop/Helloworld/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/miladmehrpoo/Desktop/Helloworld/.build/debug/Core.build/Strand~partial.swiftmodule : /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Array.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Bool+String.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Box.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Collection+Safe.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Dispatch.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/DispatchTime+Utilities.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Equatable.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Extractable.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/FileProtocol.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Lock.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/PercentEncoding.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Portal.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Result.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/RFC1123.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Semaphore.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Sequence.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/StaticDataBuffer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Strand.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/String+CaseInsensitiveCompare.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/String.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/UnsignedInteger.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Byte+Random.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Byte.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/ByteAliases.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Bytes+Base64.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Bytes.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/BytesConvertible.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/miladmehrpoo/Desktop/Helloworld/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/miladmehrpoo/Desktop/Helloworld/.build/debug/Core.build/Strand~partial.swiftdoc : /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Array.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Bool+String.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Box.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Collection+Safe.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Dispatch.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/DispatchTime+Utilities.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Equatable.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Extractable.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/FileProtocol.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Lock.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/PercentEncoding.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Portal.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Result.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/RFC1123.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Semaphore.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Sequence.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/StaticDataBuffer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Strand.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/String+CaseInsensitiveCompare.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/String.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/UnsignedInteger.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Byte+Random.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Byte.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/ByteAliases.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Bytes+Base64.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/Bytes.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/BytesConvertible.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Core-1.0.0/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/miladmehrpoo/Desktop/Helloworld/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.