code stringlengths 3 10M | language stringclasses 31 values |
|---|---|
/home/zyphen/Projects/rustlings/rustlings/target/release/build/parking_lot_core-74dd0bf1b2e30b9e/build_script_build-74dd0bf1b2e30b9e: /home/zyphen/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.6.2/build.rs
/home/zyphen/Projects/rustlings/rustlings/target/release/build/parking_lot_core-74dd0bf1b2e30b9e/build_script_build-74dd0bf1b2e30b9e.d: /home/zyphen/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.6.2/build.rs
/home/zyphen/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.6.2/build.rs:
| D |
module io.protocol.NativeProtocol;
private import io.Buffer;
private import io.protocol.model;
class ПротоколНатив : ИПротокол
{
protected бул prefix_;
protected ИБуфер buffer_;
this (ИПровод провод, бул префикс=да);
ИБуфер буфер ();
проц[] читай (ук приёмн, бцел байты, Тип тип);
проц пиши (ук ист, бцел байты, Тип тип);
проц[] читайМассив (ук приёмн, бцел байты, Тип тип, Разместитель размести);
проц пишиМассив (ук ист, бцел байты, Тип тип);
}
| D |
# FIXED
modules/TOUCH/touch_api.obj: C:/Users/Prajeeth/Downloads/Airzai_Application_V6\ (+TOF)/airzai_prototype_CC3220SF_LAUNCHXL_tirtos_ccs/modules/TOUCH/touch_api.c
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/stdint.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/stdint.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/cdefs.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/_types.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/machine/_types.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/machine/_stdint.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/_stdint.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/stddef.h
modules/TOUCH/touch_api.obj: C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/pthread.h
modules/TOUCH/touch_api.obj: C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/sys/types.h
modules/TOUCH/touch_api.obj: C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/sys/_internal.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/../include/time.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/_ti_config.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/linkage.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/abi_prefix.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/xlocale/_time.h
modules/TOUCH/touch_api.obj: C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/time.h
modules/TOUCH/touch_api.obj: C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/signal.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/../include/signal.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/../include/sys/timespec.h
modules/TOUCH/touch_api.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/_timespec.h
modules/TOUCH/touch_api.obj: C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/sched.h
modules/TOUCH/touch_api.obj: C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/semaphore.h
modules/TOUCH/touch_api.obj: C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/drivers/GPIO.h
modules/TOUCH/touch_api.obj: C:/Users/Prajeeth/OneDrive\ -\ Airzai/Airzai\ Firmware/Airzai_Application_V6\ (+TOF)/airzai_prototype_CC3220SF_LAUNCHXL_tirtos_ccs/modules/Board.h
modules/TOUCH/touch_api.obj: C:/Users/Prajeeth/OneDrive\ -\ Airzai/Airzai\ Firmware/Airzai_Application_V6\ (+TOF)/airzai_prototype_CC3220SF_LAUNCHXL_tirtos_ccs/modules/CC3220SF_LAUNCHXL.h
modules/TOUCH/touch_api.obj: C:/Users/Prajeeth/Downloads/Airzai_Application_V6\ (+TOF)/airzai_prototype_CC3220SF_LAUNCHXL_tirtos_ccs/modules/TOUCH/touch_api.h
C:/Users/Prajeeth/Downloads/Airzai_Application_V6\ (+TOF)/airzai_prototype_CC3220SF_LAUNCHXL_tirtos_ccs/modules/TOUCH/touch_api.c:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/cdefs.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/_types.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/machine/_types.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/machine/_stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/_stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/stddef.h:
C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/pthread.h:
C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/sys/types.h:
C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/sys/_internal.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/../include/time.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/_ti_config.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/linkage.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/abi_prefix.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/xlocale/_time.h:
C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/time.h:
C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/signal.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/../include/signal.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/../include/sys/timespec.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/sys/_timespec.h:
C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/sched.h:
C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/posix/ccs/semaphore.h:
C:/ti/simplelink_cc32xx_sdk_2_30_00_05/source/ti/drivers/GPIO.h:
C:/Users/Prajeeth/OneDrive\ -\ Airzai/Airzai\ Firmware/Airzai_Application_V6\ (+TOF)/airzai_prototype_CC3220SF_LAUNCHXL_tirtos_ccs/modules/Board.h:
C:/Users/Prajeeth/OneDrive\ -\ Airzai/Airzai\ Firmware/Airzai_Application_V6\ (+TOF)/airzai_prototype_CC3220SF_LAUNCHXL_tirtos_ccs/modules/CC3220SF_LAUNCHXL.h:
C:/Users/Prajeeth/Downloads/Airzai_Application_V6\ (+TOF)/airzai_prototype_CC3220SF_LAUNCHXL_tirtos_ccs/modules/TOUCH/touch_api.h:
| D |
module UnrealScript.Engine.NavigationMeshBase;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Core.UObject;
extern(C++) interface NavigationMeshBase : UObject
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.NavigationMeshBase")); }
private static __gshared NavigationMeshBase mDefaultProperties;
@property final static NavigationMeshBase DefaultProperties() { mixin(MGDPC("NavigationMeshBase", "NavigationMeshBase Engine.Default__NavigationMeshBase")); }
}
| D |
import std.algorithm;
import std.array;
import std.ascii;
import std.conv;
import std.stdio;
import std.string;
class Ball
{
int val;
Ball less;
Ball more;
this(int v)
{
this.val = v;
}
}
struct Rack
{
Ball root;
void add(int val)
{
if (root is null)
{
root = new Ball(val);
}
else
{
addBall(root, new Ball(val));
}
}
void addBall(ref Ball currBall, Ball newBall)
{
if (newBall.val <= currBall.val)
{
if (currBall.less is null)
{
currBall.less = newBall;
}
else
{
addBall(currBall.less, newBall);
}
}
else
{
if (currBall.more is null)
{
currBall.more = newBall;
}
else
{
addBall(currBall.more, newBall);
}
}
}
@property int[] balls()
{
return traverse(root);
}
int[] traverse(Ball currBall)
{
if (currBall is null)
{
return [];
}
else
{
return traverse(currBall.less) ~
[currBall.val] ~
traverse(currBall.more);
}
}
}
string charSort(string input)
{
char[] filtered = input.toLower.dup
.filter!(a => isAlpha(a))()
.array
.map!(a => to!char(a))
.array;
char[] sorted;
foreach (letter; 'a'..'z')
{
foreach (c; filtered)
{
if (letter == c)
{
sorted ~= c;
}
}
}
return sorted.idup;
}
void main()
{
Rack r;
int[] empty = [];
assert(equal(empty, r.balls));
r.add(20);
assert(equal([20], r.balls));
r.add(10);
assert(equal([10, 20], r.balls));
r.add(30);
assert(equal([10, 20, 30], r.balls));
assert(charSort("When not studying nuclear physics, Bambi likes to play beach volleyball.")
== "aaaaabbbbcccdeeeeeghhhiiiiklllllllmnnnnooopprsssstttuuvwyyyy");
}
| D |
instance NOV_1318_Novize(Npc_Default)
{
name[0] = NAME_Novize;
npcType = npctype_ambient;
guild = GIL_NOV;
level = 3;
voice = 3;
id = 1318;
attribute[ATR_STRENGTH] = 10;
attribute[ATR_DEXTERITY] = 10;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 76;
attribute[ATR_HITPOINTS] = 76;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",1,1,"Hum_Head_Psionic",33,2,nov_armor_l);
B_Scale(self);
Mdl_SetModelFatness(self,-1);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,ItMw_1H_Hatchet_01);
daily_routine = Rtn_start_1318;
};
func void Rtn_start_1318()
{
TA_Sleep(0,0,8,0,"PSI_10_HUT_IN_BED");
TA_Smalltalk(8,0,24,0,"PSI_TALK_AT_11_HUT");
};
| D |
import std.stdio
import std.array
import std.string
extern (C++)
/*Creating string*/
Data[string] = Logger;
/*Defining Data with Traffic*/
Data = Traffic;
Traffic = {""}
/*Using Find function to Find integers
relating to the Traffic*/
foreach (find; "Logging" Traffic, %s / 1
GenFile) {
immutable Traffic = [uint](T)(T) .. $;
}
/*Posting Data to The Generated File*/
foreach (Data, %s / 1 GenFile) {
Data.post(Genfile);
}
void main() {
/*****Commands
*******/
foreach (list; %s %u .. $) {
/*Lists everything Within those folders*/
list* = sys .. /Programs .. /Applications .. %s;
if (sys.call = list){
writeln(list);
return true;
}
foreach (Log; %s [real]%u .. $ ..
Traffic) {
writeln(Genfile);
}
foreach (send; Data .. %s; GenFile,
search.Traffic) {
Data.send(GenFile);
}
immutable Traffic(uint IP; Port);
Data.search(Response);
Data.post(Response);
/*Sending response towards specific IP &
Port*/
auto Response(3)[uint][string] = IP;
auto Response(3)[uint][string] = Port;
/*Sends Response as Packet*/
Packet.post(Response);
/*Response Relies on The strings within the
traffic If there are none then it won't
proceed*/
if (Response .. %s)
/*Calling all Variables*/
foreach (Response; Data; IP; Port; Traffic;
Logger){
/*Outputs the packets*/
writeln(Packet);
}
| D |
////VERR - SKIE TOB
CHAIN IF ~InParty("L#2SDSkie")
See("L#2SDSkie")
!StateCheck("L#2SDSkie",CD_STATE_NOTVALID)
!StateCheck("L#2VERR",CD_STATE_NOTVALID)
CombatCounter(0)
Global("L#2SDSkieVerrToB","GLOBAL",0)~ THEN L#2VE25B Verr2SkieToB01
@10 /* I thought you would be dead again by now, Silvershield. */
DO ~SetGlobal("L#2SDSkieVerrToB","GLOBAL",1)~
== l#2sd25B @11 /* Okay, are you telling me a compliment or insulting me, Verr'Sza? Sometimes it's hard to tell a difference. */
== L#2VE25B @12 /* Hah! I'm just saying that you somehow managed to astound me. Once a fool who got herself killed. And now someone who works on stopping this fuss about Bhaalspawns. */
== l#2sd25B @13 /* Perhaps I'm not so "foolish", after all, Verr. */
== l#2sd25B @14 /* Heh, maybe not. */
EXIT
////PHALH - SKIE TOB
CHAIN IF ~InParty("L#2SDSkie")
See("L#2SDSkie")
!StateCheck("L#2SDSkie",CD_STATE_NOTVALID)
!StateCheck("L#2PHAL",CD_STATE_NOTVALID)
CombatCounter(0)
Global("L#2SDSkiePhalhToB","GLOBAL",0)~ THEN L#2PH25B Phalh2SkieToB01
@24 /* Skie, you're looking at me again. */
DO ~SetGlobal("L#2SDSkiePhalhToB","GLOBAL",1)~
== l#2sd25B @25 /* Because you look even more manly now. Have you been working out or did your arms got bigger only because of our work? */
== L#2PH25B @26 /* I work out sometimes but not much. I guess it's mostly our work. */
== l#2sd25B @27 /* I see. Well, you look REALLY good now! I bet you will impress a girl or two with such arms and your character. */
== L#2PH25B @28 /* It's not only about muscles, you know, but I must say you're nice. And helpful. You indeed helped me a lot in the battle. */
EXIT
| D |
int main() {
string a;
string b;
string c;
a = "saba";
b = " va rosta va mehraneh";
c = " are happy";
Print(a + b, c + " or not");
}
| D |
/**
* The semaphore module provides a general use semaphore for synchronization.
*
* 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/_semaphore.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.semaphore;
public import core.sync.exception;
public import core.time;
version (OSX)
version = Darwin;
else version (iOS)
version = Darwin;
else version (TVOS)
version = Darwin;
else version (WatchOS)
version = Darwin;
version (Windows)
{
import core.sys.windows.basetsd /+: HANDLE+/;
import core.sys.windows.winbase /+: CloseHandle, CreateSemaphoreA, INFINITE,
ReleaseSemaphore, WAIT_OBJECT_0, WaitForSingleObject+/;
import core.sys.windows.windef /+: BOOL, DWORD+/;
import core.sys.windows.winerror /+: WAIT_TIMEOUT+/;
}
else version (Darwin)
{
import core.sync.config;
import core.stdc.errno;
import core.sys.posix.time;
import core.sys.darwin.mach.semaphore;
}
else version (Posix)
{
import core.sync.config;
import core.stdc.errno;
import core.sys.posix.pthread;
import core.sys.posix.semaphore;
}
else
{
static assert(false, "Platform not supported");
}
////////////////////////////////////////////////////////////////////////////////
// Semaphore
//
// void wait();
// void notify();
// bool tryWait();
////////////////////////////////////////////////////////////////////////////////
/**
* This class represents a general counting semaphore as concieved by Edsger
* Dijkstra. As per Mesa type monitors however, "signal" has been replaced
* with "notify" to indicate that control is not transferred to the waiter when
* a notification is sent.
*/
class Semaphore
{
////////////////////////////////////////////////////////////////////////////
// Initialization
////////////////////////////////////////////////////////////////////////////
/**
* Initializes a semaphore object with the specified initial count.
*
* Params:
* count = The initial count for the semaphore.
*
* Throws:
* SyncError on error.
*/
this( uint count = 0 )
{
version (Windows)
{
m_hndl = CreateSemaphoreA( null, count, int.max, null );
if ( m_hndl == m_hndl.init )
throw new SyncError( "Unable to create semaphore" );
}
else version (Darwin)
{
auto rc = semaphore_create( mach_task_self(), &m_hndl, SYNC_POLICY_FIFO, count );
if ( rc )
throw new SyncError( "Unable to create semaphore" );
}
else version (Posix)
{
int rc = sem_init( &m_hndl, 0, count );
if ( rc )
throw new SyncError( "Unable to create semaphore" );
}
}
~this()
{
version (Windows)
{
BOOL rc = CloseHandle( m_hndl );
assert( rc, "Unable to destroy semaphore" );
}
else version (Darwin)
{
auto rc = semaphore_destroy( mach_task_self(), m_hndl );
assert( !rc, "Unable to destroy semaphore" );
}
else version (Posix)
{
int rc = sem_destroy( &m_hndl );
assert( !rc, "Unable to destroy semaphore" );
}
}
////////////////////////////////////////////////////////////////////////////
// General Actions
////////////////////////////////////////////////////////////////////////////
/**
* Wait until the current count is above zero, then atomically decrement
* the count by one and return.
*
* Throws:
* SyncError on error.
*/
void wait()
{
version (Windows)
{
DWORD rc = WaitForSingleObject( m_hndl, INFINITE );
if ( rc != WAIT_OBJECT_0 )
throw new SyncError( "Unable to wait for semaphore" );
}
else version (Darwin)
{
while ( true )
{
auto rc = semaphore_wait( m_hndl );
if ( !rc )
return;
if ( rc == KERN_ABORTED && errno == EINTR )
continue;
throw new SyncError( "Unable to wait for semaphore" );
}
}
else version (Posix)
{
while ( true )
{
if ( !sem_wait( &m_hndl ) )
return;
if ( errno != EINTR )
throw new SyncError( "Unable to wait for semaphore" );
}
}
}
/**
* Suspends the calling thread until the current count moves above zero or
* until the supplied time period has elapsed. If the count moves above
* zero in this interval, then atomically decrement the count by one and
* return true. Otherwise, return false.
*
* Params:
* period = The time to wait.
*
* In:
* period must be non-negative.
*
* Throws:
* SyncError on error.
*
* Returns:
* true if notified before the timeout and false if not.
*/
bool wait( Duration period )
in
{
assert( !period.isNegative );
}
do
{
version (Windows)
{
auto maxWaitMillis = dur!("msecs")( uint.max - 1 );
while ( period > maxWaitMillis )
{
auto rc = WaitForSingleObject( m_hndl, cast(uint)
maxWaitMillis.total!"msecs" );
switch ( rc )
{
case WAIT_OBJECT_0:
return true;
case WAIT_TIMEOUT:
period -= maxWaitMillis;
continue;
default:
throw new SyncError( "Unable to wait for semaphore" );
}
}
switch ( WaitForSingleObject( m_hndl, cast(uint) period.total!"msecs" ) )
{
case WAIT_OBJECT_0:
return true;
case WAIT_TIMEOUT:
return false;
default:
throw new SyncError( "Unable to wait for semaphore" );
}
}
else version (Darwin)
{
mach_timespec_t t = void;
(cast(byte*) &t)[0 .. t.sizeof] = 0;
if ( period.total!"seconds" > t.tv_sec.max )
{
t.tv_sec = t.tv_sec.max;
t.tv_nsec = cast(typeof(t.tv_nsec)) period.split!("seconds", "nsecs")().nsecs;
}
else
period.split!("seconds", "nsecs")(t.tv_sec, t.tv_nsec);
while ( true )
{
auto rc = semaphore_timedwait( m_hndl, t );
if ( !rc )
return true;
if ( rc == KERN_OPERATION_TIMED_OUT )
return false;
if ( rc != KERN_ABORTED || errno != EINTR )
throw new SyncError( "Unable to wait for semaphore" );
}
}
else version (Posix)
{
import core.sys.posix.time : clock_gettime, CLOCK_REALTIME;
timespec t = void;
clock_gettime( CLOCK_REALTIME, &t );
mvtspec( t, period );
while ( true )
{
if ( !sem_timedwait( &m_hndl, &t ) )
return true;
if ( errno == ETIMEDOUT )
return false;
if ( errno != EINTR )
throw new SyncError( "Unable to wait for semaphore" );
}
}
}
/**
* Atomically increment the current count by one. This will notify one
* waiter, if there are any in the queue.
*
* Throws:
* SyncError on error.
*/
void notify()
{
version (Windows)
{
if ( !ReleaseSemaphore( m_hndl, 1, null ) )
throw new SyncError( "Unable to notify semaphore" );
}
else version (Darwin)
{
auto rc = semaphore_signal( m_hndl );
if ( rc )
throw new SyncError( "Unable to notify semaphore" );
}
else version (Posix)
{
int rc = sem_post( &m_hndl );
if ( rc )
throw new SyncError( "Unable to notify semaphore" );
}
}
/**
* If the current count is equal to zero, return. Otherwise, atomically
* decrement the count by one and return true.
*
* Throws:
* SyncError on error.
*
* Returns:
* true if the count was above zero and false if not.
*/
bool tryWait()
{
version (Windows)
{
switch ( WaitForSingleObject( m_hndl, 0 ) )
{
case WAIT_OBJECT_0:
return true;
case WAIT_TIMEOUT:
return false;
default:
throw new SyncError( "Unable to wait for semaphore" );
}
}
else version (Darwin)
{
return wait( dur!"hnsecs"(0) );
}
else version (Posix)
{
while ( true )
{
if ( !sem_trywait( &m_hndl ) )
return true;
if ( errno == EAGAIN )
return false;
if ( errno != EINTR )
throw new SyncError( "Unable to wait for semaphore" );
}
}
}
protected:
/// Aliases the operating-system-specific semaphore type.
version (Windows) alias Handle = HANDLE;
/// ditto
else version (Darwin) alias Handle = semaphore_t;
/// ditto
else version (Posix) alias Handle = sem_t;
/// Handle to the system-specific semaphore.
Handle m_hndl;
}
////////////////////////////////////////////////////////////////////////////////
// Unit Tests
////////////////////////////////////////////////////////////////////////////////
unittest
{
import core.thread, core.atomic;
void testWait()
{
auto semaphore = new Semaphore;
shared bool stopConsumption = false;
immutable numToProduce = 20;
immutable numConsumers = 10;
shared size_t numConsumed;
shared size_t numComplete;
void consumer()
{
while (true)
{
semaphore.wait();
if (atomicLoad(stopConsumption))
break;
atomicOp!"+="(numConsumed, 1);
}
atomicOp!"+="(numComplete, 1);
}
void producer()
{
assert(!semaphore.tryWait());
foreach (_; 0 .. numToProduce)
semaphore.notify();
// wait until all items are consumed
while (atomicLoad(numConsumed) != numToProduce)
Thread.yield();
// mark consumption as finished
atomicStore(stopConsumption, true);
// wake all consumers
foreach (_; 0 .. numConsumers)
semaphore.notify();
// wait until all consumers completed
while (atomicLoad(numComplete) != numConsumers)
Thread.yield();
assert(!semaphore.tryWait());
semaphore.notify();
assert(semaphore.tryWait());
assert(!semaphore.tryWait());
}
auto group = new ThreadGroup;
for ( int i = 0; i < numConsumers; ++i )
group.create(&consumer);
group.create(&producer);
group.joinAll();
}
void testWaitTimeout()
{
auto sem = new Semaphore;
shared bool semReady;
bool alertedOne, alertedTwo;
void waiter()
{
while (!atomicLoad(semReady))
Thread.yield();
alertedOne = sem.wait(dur!"msecs"(1));
alertedTwo = sem.wait(dur!"msecs"(1));
assert(alertedOne && !alertedTwo);
}
auto thread = new Thread(&waiter);
thread.start();
sem.notify();
atomicStore(semReady, true);
thread.join();
assert(alertedOne && !alertedTwo);
}
testWait();
testWaitTimeout();
}
| D |
instance STRF_8122_Addon_Ferd(Npc_Default)
{
name[0] = "Ферд";
guild = GIL_STRF;
id = 8122;
voice = 3;
flags = 0;
npcType = npctype_main;
aivar[AIV_NoFightParker] = TRUE;
aivar[AIV_IgnoresArmor] = TRUE;
aivar[AIV_ToughGuy] = TRUE;
aivar[AIV_ToughGuyNewsOverride] = TRUE;
B_SetAttributesToChapter(self,2);
EquipItem(self,ItMw_StoneHammer);
fight_tactic = FAI_HUMAN_COWARD;
B_SetNpcVisual(self,MALE,"Hum_Head_Thief",Face_B_Normal01,BodyTex_B,ItAr_OrcMine_Slave);
Mdl_SetModelFatness(self,-1);
Mdl_ApplyOverlayMds(self,"Humans_Tired.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,30);
daily_routine = Rtn_Start_8122;
};
func void Rtn_Start_8122()
{
TA_Pick_Iron(8,0,23,0,"RT_MINE_8122");
TA_Pick_Iron(23,0,8,0,"RT_MINE_8122");
};
func void Rtn_Tot_8122()
{
TA_Sleep(8,0,23,0,"TOT");
TA_Sleep(23,0,8,0,"TOT");
}; | D |
/*******************************************************************************
@file IWriter.d
Copyright (c) 2004 Kris Bell
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for damages
of any kind arising from the use of this software.
Permission is hereby granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and/or
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment within documentation of
said product would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any distribution
of the source.
4. Derivative works are permitted, but they must carry this notice
in full and credit the original source.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@version Initial version; March 2004
@author Kris
@author Ivan Senji (the "alias put" idea)
*******************************************************************************/
module mango.io.model.IWriter;
public import mango.io.model.IBuffer;
private import mango.io.model.IConduit;
/*******************************************************************************
Interface to make any class compatible with any IWriter.
*******************************************************************************/
interface IWritable
{
abstract void write (IWriter input);
}
/*******************************************************************************
Make a signature for IWritable classes to use when they wish to
avoid being processed by decorating writers, such as TextWriter.
*******************************************************************************/
abstract class IPhantomWriter : IWritable
{
abstract void write (IWriter input);
}
/*******************************************************************************
Make a signature for Newline classes
*******************************************************************************/
abstract class INewlineWriter : IPhantomWriter {}
/*******************************************************************************
IWriter interface. IWriter provides the means to append formatted
data to an IBuffer, and exposes a convenient method of handling a
variety of data types. In addition to writing native types such
as integer and char[], writers also process any class which has
implemented the IWritable interface (one method).
*******************************************************************************/
abstract class IWriter // could be an interface, but that causes poor codegen
{
// alias the put() methods for IOStream and Whisper styles
alias newline cr;
alias put opShl;
alias put opCall;
/***********************************************************************
These are the basic writer methods
***********************************************************************/
abstract IWriter put (bool x);
abstract IWriter put (ubyte x);
abstract IWriter put (byte x);
abstract IWriter put (ushort x);
abstract IWriter put (short x);
abstract IWriter put (uint x);
abstract IWriter put (int x);
abstract IWriter put (ulong x);
abstract IWriter put (long x);
abstract IWriter put (float x);
abstract IWriter put (double x);
abstract IWriter put (real x);
abstract IWriter put (char x);
abstract IWriter put (wchar x);
abstract IWriter put (dchar x);
abstract IWriter put (byte[] x);
abstract IWriter put (short[] x);
abstract IWriter put (int[] x);
abstract IWriter put (long[] x);
abstract IWriter put (ubyte[] x);
abstract IWriter put (ushort[] x);
abstract IWriter put (uint[] x);
abstract IWriter put (ulong[] x);
abstract IWriter put (float[] x);
abstract IWriter put (double[] x);
abstract IWriter put (real[] x);
abstract IWriter put (char[] x);
abstract IWriter put (wchar[] x);
abstract IWriter put (dchar[] x);
/***********************************************************************
This is the mechanism used for binding arbitrary classes
to the IO system. If a class implements IWritable, it can
be used as a target for IWriter put() operations. That is,
implementing IWritable is intended to transform any class
into an IWriter adaptor for the content held therein.
***********************************************************************/
abstract IWriter put (IWritable);
/***********************************************************************
Bind an IEncoder to the writer. Encoders are intended to
be used as a conversion mechanism between various character
representations (encodings). Each writer may be configured
with a distinct encoder.
***********************************************************************/
abstract void setEncoder (AbstractEncoder);
/***********************************************************************
Return the current encoder type (Type.Raw if not set)
***********************************************************************/
abstract int getEncoderType ();
/***********************************************************************
Output a newline. Do this indirectly so that it can be
intercepted by subclasses.
***********************************************************************/
abstract IWriter newline ();
/***********************************************************************
Flush the output of this writer. Throws an IOException
if the operation fails. These are aliases for each other.
***********************************************************************/
abstract IWriter put ();
abstract IWriter flush ();
/***********************************************************************
Return the associated buffer
***********************************************************************/
abstract IBuffer getBuffer ();
}
| D |
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright linse 2020.
// 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 flow.engine.repository.NativeProcessDefinitionQuery;
import flow.common.api.query.NativeQuery;
import flow.engine.repository.ProcessDefinition;
/**
* Allows querying of {@link flow.engine.repository.ProcessDefinition}s via native (SQL) queries
*
* @author Henry Yan(http://www.kafeitu.me)
*/
interface NativeProcessDefinitionQuery : NativeQuery!(NativeProcessDefinitionQuery, ProcessDefinition) {
}
| D |
/Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/IBDesignables/Intermediates/SwiftStudy.build/Debug-iphonesimulator/CustomKit.build/Objects-normal/x86_64/DemoView.o : /Users/kevin/Documents/workspace_Xcode/SwiftStudy/CustomKit/DemoView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Users/kevin/Documents/workspace_Xcode/SwiftStudy/CustomKit/CustomKit.h /Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/IBDesignables/Intermediates/SwiftStudy.build/Debug-iphonesimulator/CustomKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule
/Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/IBDesignables/Intermediates/SwiftStudy.build/Debug-iphonesimulator/CustomKit.build/Objects-normal/x86_64/DemoView~partial.swiftmodule : /Users/kevin/Documents/workspace_Xcode/SwiftStudy/CustomKit/DemoView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Users/kevin/Documents/workspace_Xcode/SwiftStudy/CustomKit/CustomKit.h /Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/IBDesignables/Intermediates/SwiftStudy.build/Debug-iphonesimulator/CustomKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule
/Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/IBDesignables/Intermediates/SwiftStudy.build/Debug-iphonesimulator/CustomKit.build/Objects-normal/x86_64/DemoView~partial.swiftdoc : /Users/kevin/Documents/workspace_Xcode/SwiftStudy/CustomKit/DemoView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Users/kevin/Documents/workspace_Xcode/SwiftStudy/CustomKit/CustomKit.h /Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/IBDesignables/Intermediates/SwiftStudy.build/Debug-iphonesimulator/CustomKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule
| D |
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* Authors: Stewart Gordon
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC core/sys/windows/_mciavi.d)
*/
module core.sys.windows.mciavi;
version (Windows):
import core.sys.windows.mmsystem;
// FIXME: check types and grouping of constants
enum MCI_MCIAVI_PLAY_WINDOW = 0x01000000;
enum MCI_MCIAVI_PLAY_FULLSCREEN = 0x02000000;
enum MCI_MCIAVI_PLAY_FULLBY2 = 0x04000000;
enum {
MCI_AVI_STATUS_FRAMES_SKIPPED = 0x00008001,
MCI_AVI_STATUS_LAST_PLAY_SPEED = 0x00008002,
MCI_AVI_STATUS_AUDIO_BREAKS = 0x00008003,
MCI_AVI_SETVIDEO_DRAW_PROCEDURE = 0x00008000,
MCI_AVI_SETVIDEO_PALETTE_COLOR = 0x00008100,
MCI_AVI_SETVIDEO_PALETTE_HALFTONE = 0x0000FFFF
}
enum {
MCIERR_AVI_OLDAVIFORMAT = MCIERR_CUSTOM_DRIVER_BASE + 100,
MCIERR_AVI_NOTINTERLEAVED,
MCIERR_AVI_NODISPDIB,
MCIERR_AVI_CANTPLAYFULLSCREEN,
MCIERR_AVI_TOOBIGFORVGA,
MCIERR_AVI_NOCOMPRESSOR,
MCIERR_AVI_DISPLAYERROR,
MCIERR_AVI_AUDIOERROR,
MCIERR_AVI_BADPALETTE // = MCIERR_CUSTOM_DRIVER_BASE + 108
}
| D |
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1999-2018 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/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 core.stdc.string;
import dmd.aggregate;
import dmd.arraytypes;
import dmd.canthrow;
import dmd.dclass;
import dmd.declaration;
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.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;
enum LOGSEMANTIC = false;
/************************ TraitsExp ************************************/
// callback for TypeFunction::attributesApply
struct PushAttributes
{
Expressions* mods;
extern (C++) static int fp(void* param, const(char)* str)
{
PushAttributes* p = cast(PushAttributes*)param;
p.mods.push(new StringExp(Loc.initial, cast(char*)str));
return 0;
}
}
/**************************************
* 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 (e.op == TOK.dotVariable)
return (cast(DotVarExp)e).var;
if (e.op == TOK.dotTemplateDeclaration)
return (cast(DotTemplateExp)e).td;
}
return getDsymbol(oarg);
}
extern (C++) __gshared StringTable 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",
"isRef",
"isOut",
"isLazy",
"isReturnOnStack",
"hasMember",
"identifier",
"getProtection",
"parent",
"getLinkage",
"getMember",
"getOverloads",
"getVirtualFunctions",
"getVirtualMethods",
"classInstanceSize",
"allMembers",
"derivedMembers",
"isSame",
"compiles",
"parameters",
"getAliasThis",
"getAttributes",
"getFunctionAttributes",
"getFunctionVariadicStyle",
"getParameterStorageClasses",
"getUnitTests",
"getVirtualIndex",
"getPointerBitmap",
];
traitsStringTable._init(40);
foreach (s; names)
{
auto sv = traitsStringTable.insert(s.ptr, s.length, cast(void*)s.ptr);
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, d_uns64.max on error
*/
extern (C++) d_uns64 getTypePointerBitmap(Loc loc, Type t, Array!(d_uns64)* data)
{
d_uns64 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 d_uns64.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 d_uns64.max;
}
d_uns64 bitsPerWord = sz_size_t * 8;
d_uns64 cntptr = (sz + sz_size_t - 1) / sz_size_t;
d_uns64 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!(d_uns64)* _data, d_uns64 _sz_size_t)
{
this.data = _data;
this.sz_size_t = _sz_size_t;
}
void setpointer(d_uns64 off)
{
d_uns64 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)
{
d_uns64 arrayoff = offset;
d_uns64 nextsize = t.next.size();
if (nextsize == SIZE_INVALID)
error = true;
d_uns64 dim = t.dim.toInteger();
for (d_uns64 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)
{
d_uns64 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)
{
d_uns64 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!(d_uns64)* data;
d_uns64 offset;
d_uns64 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 ? d_uns64.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, ...]
*/
extern (C++) Expression pointerBitmap(TraitsExp e)
{
if (!e.args || e.args.dim != 1)
{
error(e.loc, "a single type expected for trait pointerBitmap");
return new ErrorExp();
}
Type t = getType((*e.args)[0]);
if (!t)
{
error(e.loc, "`%s` is not a type", (*e.args)[0].toChars());
return new ErrorExp();
}
Array!(d_uns64) data;
d_uns64 sz = getTypePointerBitmap(e.loc, t, &data);
if (sz == d_uns64.max)
return new ErrorExp();
auto exps = new Expressions();
exps.push(new IntegerExp(e.loc, sz, Type.tsize_t));
foreach (d_uns64 i; 0 .. data.dim)
exps.push(new IntegerExp(e.loc, data[cast(size_t)i], Type.tsize_t));
auto ale = new ArrayLiteralExp(e.loc, exps);
ale.type = Type.tsize_t.sarrayOf(data.dim + 1);
return ale;
}
extern (C++) 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)
{
if (!TemplateInstance.semanticTiargs(e.loc, sc, e.args, 1))
return new ErrorExp();
}
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 new ErrorExp();
}
IntegerExp True()
{
return new IntegerExp(e.loc, true, Type.tbool);
}
IntegerExp False()
{
return new IntegerExp(e.loc, false, Type.tbool);
}
/********
* 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 (t.ty == Tfunction)
return cast(TypeFunction)t;
else if (t.ty == Tdelegate)
return cast(TypeFunction)t.nextOf();
else if (t.ty == Tpointer && t.nextOf().ty == Tfunction)
return cast(TypeFunction)t.nextOf();
}
return null;
}
IntegerExp isX(T)(bool function(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;
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 (global.params.vcomplex)
{
if (isTypeX(t => t.iscomplex() || t.isimaginary()).isBool(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 new ErrorExp();
}
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.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 new ErrorExp();
}
if (e.ident == Id.isDisabled)
{
if (dim != 1)
return dimError(1);
return isFuncX(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.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 new ErrorExp();
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
Identifier id;
if (auto po = isParameter(o))
{
id = po.ident;
assert(id);
}
else
{
Dsymbol s = getDsymbolWithoutExpCtx(o);
if (!s || !s.ident)
{
e.error("argument `%s` has no identifier", o.toChars());
return new ErrorExp();
}
id = s.ident;
}
auto se = new StringExp(e.loc, cast(char*)id.toChars());
return se.expressionSemantic(sc);
}
if (e.ident == Id.getProtection)
{
if (dim != 1)
return dimError(1);
Scope* sc2 = sc.push();
sc2.flags = sc.flags | SCOPE.noaccesscheck;
bool ok = TemplateInstance.semanticTiargs(e.loc, sc2, e.args, 1);
sc2.pop();
if (!ok)
return new ErrorExp();
auto o = (*e.args)[0];
auto s = getDsymbolWithoutExpCtx(o);
if (!s)
{
if (!isError(o))
e.error("argument `%s` has no protection", o.toChars());
return new ErrorExp();
}
if (s.semanticRun == PASS.init)
s.dsymbolSemantic(null);
auto protName = protectionToChars(s.prot().kind); // TODO: How about package(names)
assert(protName);
auto se = new StringExp(e.loc, cast(char*)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`
}
}
}
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 new ErrorExp();
}
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 resolve(e.loc, sc, s, false);
}
if (e.ident == Id.hasMember ||
e.ident == Id.getMember ||
e.ident == Id.getOverloads ||
e.ident == Id.getVirtualMethods ||
e.ident == Id.getVirtualFunctions)
{
if (dim != 2)
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 new ErrorExp();
}
ex = ex.ctfeInterpret();
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 new ErrorExp();
}
se = se.toUTF8(sc);
if (se.sz != 1)
{
e.error("string must be chars");
return new ErrorExp();
}
auto id = Identifier.idPool(se.peekSlice());
/* Prefer dsymbol, because it might need some runtime contexts.
*/
Dsymbol sym = getDsymbol(o);
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 t = isType(o))
ex = typeDotIdExp(e.loc, t, id);
else if (auto ex2 = isExpression(o))
ex = new DotIdExp(e.loc, ex2, id);
else
{
e.error("invalid first argument");
return new ErrorExp();
}
// ignore symbol visibility for these traits, should disable access checks as well
Scope* scx = sc.push();
scx.flags |= SCOPE.ignoresymbolvisibility;
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 (ex.op == TOK.dotIdentifier)
// Prevent semantic() from replacing Symbol with its initializer
(cast(DotIdExp)ex).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());
//ex.print();
/* Create tuple of functions of ex
*/
auto exps = new Expressions();
FuncDeclaration f;
if (ex.op == TOK.variable)
{
VarExp ve = cast(VarExp)ex;
f = ve.var.isFuncDeclaration();
ex = null;
}
else if (ex.op == TOK.dotVariable)
{
DotVarExp dve = cast(DotVarExp)ex;
f = dve.var.isFuncDeclaration();
if (dve.e1.op == TOK.dotType || dve.e1.op == TOK.this_)
ex = null;
else
ex = dve.e1;
}
overloadApply(f, (Dsymbol s)
{
auto fd = s.isFuncDeclaration();
if (!fd)
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.protection = fd.protection;
auto e = ex ? new DotVarExp(Loc.initial, ex, fa, false)
: new DsymbolExp(Loc.initial, fa, false);
exps.push(e);
return 0;
});
auto tup = new TupleExp(e.loc, exps);
return tup.expressionSemantic(scx);
}
else
assert(0);
}
if (e.ident == Id.classInstanceSize)
{
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 new ErrorExp();
}
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 new ErrorExp();
}
return new IntegerExp(e.loc, cd.structsize, 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;
if (!ad)
{
e.error("argument is not an aggregate type");
return new ErrorExp();
}
auto exps = new Expressions();
if (ad.aliasthis)
exps.push(new StringExp(e.loc, cast(char*)ad.aliasthis.ident.toChars()));
Expression ex = new TupleExp(e.loc, exps);
ex = ex.expressionSemantic(sc);
return ex;
}
if (e.ident == Id.getAttributes)
{
if (dim != 1)
return dimError(1);
auto o = (*e.args)[0];
auto s = getDsymbolWithoutExpCtx(o);
if (!s)
{
version (none)
{
Expression x = isExpression(o);
Type t = isType(o);
if (x)
printf("e = %s %s\n", Token.toChars(x.op), x.toChars());
if (t)
printf("t = %d %s\n", t.ty, t.toChars());
}
e.error("first argument is not a symbol");
return new ErrorExp();
}
if (auto imp = s.isImport())
{
s = imp.mod;
}
//printf("getAttributes %s, attrs = %p, scope = %p\n", s.toChars(), s.userAttribDecl, s.scope);
auto udad = s.userAttribDecl;
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 new ErrorExp();
}
auto mods = new Expressions();
PushAttributes pa;
pa.mods = mods;
tf.modifiersApply(&pa, &PushAttributes.fp);
tf.attributesApply(&pa, &PushAttributes.fp, 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 new ErrorExp();
}
bool value = Target.isReturnOnStack(tf);
return new IntegerExp(e.loc, value, Type.tbool);
}
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;
int varargs;
auto o = (*e.args)[0];
FuncDeclaration fd;
TypeFunction tf = toTypeFunction(o, fd);
if (tf)
{
link = tf.linkage;
varargs = tf.varargs;
}
else
{
if (!fd)
{
e.error("argument to `__traits(getFunctionVariadicStyle, %s)` is not a function", o.toChars());
return new ErrorExp();
}
link = fd.linkage;
fd.getParameters(&varargs);
}
string style;
switch (varargs)
{
case 0: style = "none"; break;
case 1: style = (link == LINK.d) ? "argptr"
: "stdarg"; break;
case 2: style = "typesafe"; break;
default:
assert(0);
}
auto se = new StringExp(e.loc, cast(char*)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];
FuncDeclaration fd;
TypeFunction tf = toTypeFunction(o, fd);
Parameters* fparams;
if (tf)
{
fparams = tf.parameters;
}
else
{
if (!fd)
{
e.error("first argument to `__traits(getParameterStorageClasses, %s, %s)` is not a function",
o.toChars(), o1.toChars());
return new ErrorExp();
}
fparams = fd.getParameters(null);
}
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 new ErrorExp();
}
ex = ex.ctfeInterpret();
auto ii = ex.toUInteger();
if (ii >= Parameter.dim(fparams))
{
e.error("parameter index must be in range 0..%u not %s", cast(uint)Parameter.dim(fparams), ex.toChars());
return new ErrorExp();
}
uint n = cast(uint)ii;
Parameter p = Parameter.getNth(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, cast(char*)s.ptr, cast(uint)s.length));
}
if (stc & STC.auto_)
push("auto");
if (stc & STC.return_)
push("return");
if (stc & STC.out_)
push("out");
else if (stc & STC.ref_)
push("ref");
else if (stc & STC.in_)
push("in");
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 = tf.linkage;
else
{
auto s = getDsymbol(o);
Declaration d;
if (!s || (d = s.isDeclaration()) is null)
{
e.error("argument to `__traits(getLinkage, %s)` is not a declaration", o.toChars());
return new ErrorExp();
}
link = d.linkage;
}
auto linkage = linkageToChars(link);
auto se = new StringExp(e.loc, cast(char*)linkage);
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("argument has no members");
return new ErrorExp();
}
if (auto imp = s.isImport())
{
// https://issues.dlang.org/show_bug.cgi?id=9692
s = imp.mod;
}
auto sds = s.isScopeDsymbol();
if (!sds || sds.isTemplateDeclaration())
{
e.error("%s `%s` has no members", s.kind(), s.toChars());
return new ErrorExp();
}
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;
}
}
//printf("\t[%i] %s %s\n", i, sm.kind(), sm.toChars());
if (sm.ident)
{
const idx = sm.ident.toChars();
if (idx[0] == '_' &&
idx[1] == '_' &&
sm.ident != Id.ctor &&
sm.ident != Id.dtor &&
sm.ident != Id.__xdtor &&
sm.ident != Id.postblit &&
sm.ident != Id.__xpostblit)
{
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() && 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 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, cast(char*)id.toChars());
(*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 = t ? t.typeToExpression() : isExpression(o);
if (!ex && 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 == TOK.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.freeFieldinit();
sc2.enclosing = null;
sc2.pop();
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);
if (!TemplateInstance.semanticTiargs(e.loc, sc, e.args, 0))
return new ErrorExp();
auto o1 = (*e.args)[0];
auto o2 = (*e.args)[1];
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 == TOK.function_)
{
if (auto fe = cast(FuncExp)ea)
return fe.fd;
}
}
return null;
}
auto l1 = isLambda(o1);
auto l2 = isLambda(o2);
if (l1 && l2)
{
const(char)* getSerialization(FuncLiteralDeclaration fld)
{
import dmd.lambdacomp : SerializeVisitor;
auto serVisitor = new SerializeVisitor(sc);
fld.accept(serVisitor);
if (serVisitor.buf.offset == 0)
return "uncomparable";
else
return serVisitor.buf.extractString();
}
if (!l1.serialization)
l1.serialization = getSerialization(l1);
if (!l2.serialization)
l2.serialization = getSerialization(l2);
//printf("serialization1: %s\n", l1.serialization);
//printf("serialization2: %s\n", l2.serialization);
if (strcmp(l1.serialization, l2.serialization) == 0 &&
strcmp(l1.serialization, "uncomparable") != 0)
{
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();
return (s1 == s2) ? True() : False();
}
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 new ErrorExp();
}
if (auto imp = s.isImport()) // https://issues.dlang.org/show_bug.cgi?id=10990
s = imp.mod;
auto sds = s.isScopeDsymbol();
if (!sds)
{
e.error("argument `%s` to __traits(getUnitTests) must be a module or aggregate, not a %s",
s.toChars(), s.kind());
return new ErrorExp();
}
auto exps = new Expressions();
if (global.params.useUnitTests)
{
bool[void*] uniqueUnitTests;
void collectUnitTests(Dsymbols* a)
{
if (!a)
return;
foreach (s; *a)
{
if (auto atd = s.isAttribDeclaration())
{
collectUnitTests(atd.include(null));
continue;
}
if (auto ud = s.isUnitTestDeclaration())
{
if (cast(void*)ud in uniqueUnitTests)
continue;
auto ad = new FuncAliasDeclaration(ud.ident, ud, false);
ad.protection = ud.protection;
auto e = new DsymbolExp(Loc.initial, ad, false);
exps.push(e);
uniqueUnitTests[cast(void*)ud] = true;
}
}
}
collectUnitTests(sds.members);
}
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 new ErrorExp();
}
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);
}
extern (D) void* trait_search_fp(const(char)* seed, ref int cost)
{
//printf("trait_search_fp('%s')\n", seed);
size_t len = strlen(seed);
if (!len)
return null;
cost = 0;
StringValue* sv = traitsStringTable.lookup(seed, len);
return sv ? sv.ptrvalue : null;
}
if (auto sub = cast(const(char)*)speller(e.ident.toChars(), &trait_search_fp, idchars))
e.error("unrecognized trait `%s`, did you mean `%s`?", e.ident.toChars(), sub);
else
e.error("unrecognized trait `%s`", e.ident.toChars());
return new ErrorExp();
}
| D |
reflect deeply on a subject
deeply or seriously thoughtful
| D |
var int BuecherRegal_01;
var int BuecherRegal_02;
var int BuecherRegal_03;
var int BuecherRegal_04;
var int BuecherRegal_05;
var int BuecherRegal_06;
var int BuecherRegal_07;
FUNC VOID B_FindItem_BuecherRegal ()
{
var int rnd;
rnd = Hlp_Random(1);
if (rnd == 0)
{
CreateInvItems (hero, ItWr_Paper, 1);
Print ("1 Blatt Papier gefunden");
B_Say_Overlay (hero, NULL, "$BUECHERREGALFINDPAPER");
}
else if (rnd == 1)
{
CreateInvItems (hero, ItWr_Paper, 1);
Print ("1 Blatt Papier gefunden");
B_Say_Overlay (hero, NULL, "$BUECHERREGALFINDPAPER");
}
else
{
B_Say_Overlay (hero, NULL, "$BUECHERREGALNOTHING");
};
};
FUNC VOID B_BUECHERREGAL_01_S1 ()
{
if (BuecherRegal_01 == 0)
{
BuecherRegal_01 = 1;
B_FindItem_BuecherRegal();
}
else
{
B_Say_Overlay (hero, NULL, "$BUECHERREGALNO");
};
AI_Wait (hero, 20);
AI_UseMob (hero, "BOOKSHELF", -1);
};
FUNC VOID B_BUECHERREGAL_02_S1 ()
{
if (BuecherRegal_02 == 0)
{
BuecherRegal_02 = 1;
B_FindItem_BuecherRegal();
}
else
{
B_Say_Overlay (hero, NULL, "$BUECHERREGALNO");
};
AI_Wait (hero, 20);
AI_UseMob (hero, "BOOKSHELF", -1);
};
FUNC VOID B_BUECHERREGAL_03_S1 ()
{
if (BuecherRegal_03 == 0)
{
BuecherRegal_03 = 1;
B_FindItem_BuecherRegal();
}
else
{
B_Say_Overlay (hero, NULL, "$BUECHERREGALNO");
};
AI_Wait (hero, 20);
AI_UseMob (hero, "BOOKSHELF", -1);
};
FUNC VOID B_BUECHERREGAL_04_S1 ()
{
if (BuecherRegal_04 == 0)
{
BuecherRegal_04 = 1;
B_FindItem_BuecherRegal();
}
else
{
B_Say_Overlay (hero, NULL, "$BUECHERREGALNO");
};
AI_Wait (hero, 20);
AI_UseMob (hero, "BOOKSHELF", -1);
};
FUNC VOID B_BUECHERREGAL_05_S1 ()
{
if (BuecherRegal_05 == 0)
{
BuecherRegal_05 = 1;
B_FindItem_BuecherRegal();
}
else
{
B_Say_Overlay (hero, NULL, "$BUECHERREGALNO");
};
AI_Wait (hero, 20);
AI_UseMob (hero, "BOOKSHELF", -1);
};
FUNC VOID B_BUECHERREGAL_06_S1 ()
{
if (BuecherRegal_06 == 0)
{
BuecherRegal_06 = 1;
B_FindItem_BuecherRegal();
}
else
{
B_Say_Overlay (hero, NULL, "$BUECHERREGALNO");
};
AI_Wait (hero, 20);
AI_UseMob (hero, "BOOKSHELF", -1);
};
FUNC VOID B_BUECHERREGAL_07_S1 ()
{
if (BuecherRegal_07 == 0)
{
BuecherRegal_07 = 1;
Print ("Alte Notiz gefunden");
CreateInvItems (hero, ItWr_ErolNotiz4, 1);
}
else
{
B_Say_Overlay (hero, NULL, "$BUECHERREGALNO");
};
AI_Wait (hero, 20);
AI_UseMob (hero, "BOOKSHELF", -1);
}; | D |
the outcome of a complex sequence of events
the final resolution of the main complication of a literary or dramatic work
| D |
// Written in the D programming language.
/**
This module implements a variety of type constructors, i.e., templates
that allow construction of new, useful general-purpose types.
Source: $(PHOBOSSRC std/_typecons.d)
Macros:
WIKI = Phobos/StdVariant
Synopsis:
----
// value tuples
alias Tuple!(float, "x", float, "y", float, "z") Coord;
Coord c;
c[1] = 1; // access by index
c.z = 1; // access by given name
alias Tuple!(string, string) DicEntry; // names can be omitted
// Rebindable references to const and immutable objects
void bar()
{
const w1 = new Widget, w2 = new Widget;
w1.foo();
// w1 = w2 would not work; can't rebind const object
auto r = Rebindable!(const Widget)(w1);
// invoke method as if r were a Widget object
r.foo();
// rebind r to refer to another object
r = w2;
}
----
Copyright: Copyright the respective authors, 2008-
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB erdani.org, Andrei Alexandrescu),
$(WEB bartoszmilewski.wordpress.com, Bartosz Milewski),
Don Clugston,
Shin Fujishiro,
Kenji Hara
*/
module std.typecons;
import core.memory, core.stdc.stdlib;
import std.algorithm, std.array, std.conv, std.exception, std.format,
std.string, std.traits, std.typetuple, std.range;
debug(Unique) import std.stdio;
/**
Encapsulates unique ownership of a resource. Resource of type T is
deleted at the end of the scope, unless it is transferred. The
transfer can be explicit, by calling $(D release), or implicit, when
returning Unique from a function. The resource can be a polymorphic
class object, in which case Unique behaves polymorphically too.
Example:
*/
struct Unique(T)
{
static if (is(T:Object))
alias T RefT;
else
alias T * RefT;
public:
/+ Doesn't work yet
/**
The safe constructor. It creates the resource and
guarantees unique ownership of it (unless the constructor
of $(D T) publishes aliases of $(D this)),
*/
this(A...)(A args)
{
_p = new T(args);
}
+/
/**
Constructor that takes an rvalue.
It will ensure uniqueness, as long as the rvalue
isn't just a view on an lvalue (e.g., a cast)
Typical usage:
----
Unique!(Foo) f = new Foo;
----
*/
this(RefT p)
{
debug(Unique) writeln("Unique constructor with rvalue");
_p = p;
}
/**
Constructor that takes an lvalue. It nulls its source.
The nulling will ensure uniqueness as long as there
are no previous aliases to the source.
*/
this(ref RefT p)
{
_p = p;
debug(Unique) writeln("Unique constructor nulling source");
p = null;
assert(p is null);
}
/+ Doesn't work yet
/**
Constructor that takes a Unique of a type that is convertible to our type:
Disallow construction from lvalue (force the use of release on the source Unique)
If the source is an rvalue, null its content, so the destrutctor doesn't delete it
Typically used by the compiler to return $(D Unique) of derived type as $(D Unique)
of base type.
Example:
----
Unique!(Base) create()
{
Unique!(Derived) d = new Derived;
return d; // Implicit Derived->Base conversion
}
----
*/
this(U)(ref Unique!(U) u) = null;
this(U)(Unique!(U) u)
{
_p = u._p;
u._p = null;
}
+/
~this()
{
debug(Unique) writeln("Unique destructor of ", (_p is null)? null: _p);
delete _p;
_p = null;
}
bool isEmpty() const
{
return _p is null;
}
/** Returns a unique rvalue. Nullifies the current contents */
Unique release()
{
debug(Unique) writeln("Release");
auto u = Unique(_p);
assert(_p is null);
debug(Unique) writeln("return from Release");
return u;
}
/** Forwards member access to contents */
RefT opDot() { return _p; }
/+ doesn't work yet!
/**
Postblit operator is undefined to prevent the cloning of $(D Unique) objects
*/
this(this) = null;
+/
private:
RefT _p;
}
/+ doesn't work yet
unittest
{
writeln("Unique class");
class Bar
{
~this() { writefln(" Bar destructor"); }
int val() const { return 4; }
}
alias Unique!(Bar) UBar;
UBar g(UBar u)
{
return u;
}
auto ub = UBar(new Bar);
assert(!ub.isEmpty);
assert(ub.val == 4);
// should not compile
// auto ub3 = g(ub);
writeln("Calling g");
auto ub2 = g(ub.release);
assert(ub.isEmpty);
assert(!ub2.isEmpty);
}
unittest
{
writeln("Unique struct");
struct Foo
{
~this() { writefln(" Bar destructor"); }
int val() const { return 3; }
}
alias Unique!(Foo) UFoo;
UFoo f(UFoo u)
{
writeln("inside f");
return u;
}
auto uf = UFoo(new Foo);
assert(!uf.isEmpty);
assert(uf.val == 3);
// should not compile
// auto uf3 = f(uf);
writeln("Unique struct: calling f");
auto uf2 = f(uf.release);
assert(uf.isEmpty);
assert(!uf2.isEmpty);
}
+/
/**
Tuple of values, for example $(D Tuple!(int, string)) is a record that
stores an $(D int) and a $(D string). $(D Tuple) can be used to bundle
values together, notably when returning multiple values from a
function. If $(D obj) is a tuple, the individual members are
accessible with the syntax $(D obj[0]) for the first field, $(D obj[1])
for the second, and so on.
The choice of zero-based indexing instead of one-base indexing was
motivated by the ability to use value tuples with various compile-time
loop constructs (e.g. type tuple iteration), all of which use
zero-based indexing.
Example:
----
Tuple!(int, int) point;
// assign coordinates
point[0] = 5;
point[1] = 6;
// read coordinates
auto x = point[0];
auto y = point[1];
----
Tuple members can be named. It is legal to mix named and unnamed
members. The method above is still applicable to all fields.
Example:
----
alias Tuple!(int, "index", string, "value") Entry;
Entry e;
e.index = 4;
e.value = "Hello";
assert(e[1] == "Hello");
assert(e[0] == 4);
----
Tuples with named fields are distinct types from tuples with unnamed
fields, i.e. each naming imparts a separate type for the tuple. Two
tuple differing in naming only are still distinct, even though they
might have the same structure.
Example:
----
Tuple!(int, "x", int, "y") point1;
Tuple!(int, int) point2;
assert(!is(typeof(point1) == typeof(point2))); // passes
----
*/
template Tuple(Specs...)
{
// Parse (type,name) pairs (FieldSpecs) out of the specified
// arguments. Some fields would have name, others not.
template parseSpecs(Specs...)
{
static if (Specs.length == 0)
{
alias TypeTuple!() parseSpecs;
}
else static if (is(Specs[0]))
{
static if (is(typeof(Specs[1]) : string))
{
alias TypeTuple!(FieldSpec!(Specs[0 .. 2]),
parseSpecs!(Specs[2 .. $])) parseSpecs;
}
else
{
alias TypeTuple!(FieldSpec!(Specs[0]),
parseSpecs!(Specs[1 .. $])) parseSpecs;
}
}
else
{
static assert(0, "Attempted to instantiate Tuple with an "
~"invalid argument: "~ Specs[0].stringof);
}
}
template FieldSpec(T, string s = "")
{
alias T Type;
alias s name;
}
alias parseSpecs!Specs fieldSpecs;
// Used with staticMap.
template extractType(alias spec) { alias spec.Type extractType; }
template extractName(alias spec) { alias spec.name extractName; }
// Generates named fields as follows:
// alias Identity!(field[0]) name_0;
// alias Identity!(field[1]) name_1;
// :
// NOTE: field[k] is an expression (which yields a symbol of a
// variable) and can't be aliased directly.
string injectNamedFields()
{
string decl = "";
foreach (i, name; staticMap!(extractName, fieldSpecs))
{
decl ~= format("alias Identity!(field[%s]) _%s;", i, i);
if (name.length != 0)
{
decl ~= format("alias _%s %s;", i, name);
}
}
return decl;
}
// Returns Specs for a subtuple this[from .. to] preserving field
// names if any.
template sliceSpecs(size_t from, size_t to)
{
alias staticMap!(expandSpec,
fieldSpecs[from .. to]) sliceSpecs;
}
template expandSpec(alias spec)
{
static if (spec.name.length == 0)
{
alias TypeTuple!(spec.Type) expandSpec;
}
else
{
alias TypeTuple!(spec.Type, spec.name) expandSpec;
}
}
template areCompatibleTuples(Tup1, Tup2, string op)
{
enum areCompatibleTuples = isTuple!Tup2 && is(typeof(
{
Tup1 tup1 = void;
Tup2 tup2 = void;
static assert(tup1.field.length == tup2.field.length);
foreach (i, _; Tup1.Types)
{
auto lhs = typeof(tup1.field[i]).init;
auto rhs = typeof(tup2.field[i]).init;
auto result = mixin("lhs "~op~" rhs");
}
}));
}
struct Tuple
{
/**
* The type of the tuple's components.
*/
alias staticMap!(extractType, fieldSpecs) Types;
/**
* Use $(D t.expand) for a tuple $(D t) to expand it into its
* components. The result of $(D expand) acts as if the tuple components
* were listed as a list of values. (Ordinarily, a $(D Tuple) acts as a
* single value.)
*
* Examples:
* ----
* auto t = tuple(1, " hello ", 2.3);
* writeln(t); // Tuple!(int, string, double)(1, " hello ", 2.3)
* writeln(t.expand); // 1 hello 2.3
* ----
*/
Types expand;
mixin(injectNamedFields());
static if (is(Specs))
{
// This is mostly to make t[n] work.
alias expand this;
}
else
{
@property
ref inout(Tuple!Types) _Tuple_super() inout @trusted
{
foreach (i, _; Types) // Rely on the field layout
{
static assert(typeof(return).init.tupleof[i].offsetof ==
expand[i].offsetof);
}
return *cast(typeof(return)*) &(field[0]);
}
// This is mostly to make t[n] work.
alias _Tuple_super this;
}
// backwards compatibility
alias field = expand;
/**
* Constructor taking one value for each field. Each argument must be
* implicitly assignable to the respective element of the target.
*/
this()(Types values)
{
field[] = values[];
}
/**
* Constructor taking a compatible array. The array element type must
* be implicitly assignable to each element of the target.
*
* Examples:
* ----
* int[2] ints;
* Tuple!(int, int) t = ints;
* ----
*/
this(U, size_t n)(U[n] values)
if (n == Types.length &&
is(typeof({ foreach (i, _; Types) field[i] = values[i]; })))
{
foreach (i, _; Types)
{
field[i] = values[i];
}
}
/**
* Constructor taking a compatible tuple. Each element of the source
* must be implicitly assignable to the respective element of the
* target.
*/
this(U)(U another)
if (areCompatibleTuples!(typeof(this), U, "="))
{
field[] = another.field[];
}
/**
* Comparison for equality.
*/
bool opEquals(R)(R rhs)
if (areCompatibleTuples!(typeof(this), R, "=="))
{
return field[] == rhs.field[];
}
/// ditto
bool opEquals(R)(R rhs) const
if (areCompatibleTuples!(typeof(this), R, "=="))
{
return field[] == rhs.field[];
}
/**
* Comparison for ordering.
*/
int opCmp(R)(R rhs)
if (areCompatibleTuples!(typeof(this), R, "<"))
{
foreach (i, Unused; Types)
{
if (field[i] != rhs.field[i])
{
return field[i] < rhs.field[i] ? -1 : 1;
}
}
return 0;
}
/// ditto
int opCmp(R)(R rhs) const
if (areCompatibleTuples!(typeof(this), R, "<"))
{
foreach (i, Unused; Types)
{
if (field[i] != rhs.field[i])
{
return field[i] < rhs.field[i] ? -1 : 1;
}
}
return 0;
}
/**
* Assignment from another tuple. Each element of the source must be
* implicitly assignable to the respective element of the target.
*/
void opAssign(R)(auto ref R rhs)
if (areCompatibleTuples!(typeof(this), R, "="))
{
static if (is(R : Tuple!Types) && !__traits(isRef, rhs))
{
if (__ctfe)
{
// Cannot use swap at compile time
field[] = rhs.field[];
}
else
{
// Use swap-and-destroy to optimize rvalue assignment
swap!(Tuple!Types)(this, rhs);
}
}
else
{
// Do not swap; opAssign should be called on the fields.
field[] = rhs.field[];
}
}
/**
* Takes a slice of the tuple.
*
* Examples:
* ----
* Tuple!(int, string, float, double) a;
* a[1] = "abc";
* a[2] = 4.5;
* auto s = a.slice!(1, 3);
* static assert(is(typeof(s) == Tuple!(string, float)));
* assert(s[0] == "abc" && s[1] == 4.5);
* ----
*/
@property
ref Tuple!(sliceSpecs!(from, to)) slice(size_t from, size_t to)() @trusted
if (from <= to && to <= Types.length)
{
return *cast(typeof(return)*) &(field[from]);
}
/**
* Converts to string.
*/
string toString()
{
enum header = typeof(this).stringof ~ "(",
footer = ")",
separator = ", ";
Appender!string w;
w.put(header);
foreach (i, Unused; Types)
{
static if (i > 0)
{
w.put(separator);
}
// TODO: Change this once toString() works for shared objects.
static if (is(Unused == class) && is(Unused == shared))
formattedWrite(w, "%s", field[i].stringof);
else
{
FormatSpec!char f; // "%s"
formatElement(w, field[i], f);
}
}
w.put(footer);
return w.data;
}
}
}
private template Identity(alias T)
{
alias T Identity;
}
unittest
{
{
Tuple!(int, "a", int, "b") nosh;
static assert(nosh.length == 2);
nosh.a = 5;
nosh.b = 6;
assert(nosh.a == 5);
assert(nosh.b == 6);
}
{
Tuple!(short, double) b;
static assert(b.length == 2);
b[1] = 5;
auto a = Tuple!(int, real)(b);
assert(a[0] == 0 && a[1] == 5);
a = Tuple!(int, real)(1, 2);
assert(a[0] == 1 && a[1] == 2);
auto c = Tuple!(int, "a", double, "b")(a);
assert(c[0] == 1 && c[1] == 2);
}
{
Tuple!(int, real) nosh;
nosh[0] = 5;
nosh[1] = 0;
assert(nosh[0] == 5 && nosh[1] == 0);
assert(nosh.toString() == "Tuple!(int, real)(5, 0)", nosh.toString());
Tuple!(int, int) yessh;
nosh = yessh;
}
{
Tuple!(int, string) t;
t[0] = 10;
t[1] = "str";
assert(t[0] == 10 && t[1] == "str");
assert(t.toString() == `Tuple!(int, string)(10, "str")`, t.toString());
}
{
Tuple!(int, "a", double, "b") x;
static assert(x.a.offsetof == x[0].offsetof);
static assert(x.b.offsetof == x[1].offsetof);
x.b = 4.5;
x.a = 5;
assert(x[0] == 5 && x[1] == 4.5);
assert(x.a == 5 && x.b == 4.5);
}
// indexing
{
Tuple!(int, real) t;
static assert(is(typeof(t[0]) == int));
static assert(is(typeof(t[1]) == real));
int* p0 = &t[0];
real* p1 = &t[1];
t[0] = 10;
t[1] = -200.0L;
assert(*p0 == t[0]);
assert(*p1 == t[1]);
}
// slicing
{
Tuple!(int, "x", real, "y", double, "z", string) t;
t[0] = 10;
t[1] = 11;
t[2] = 12;
t[3] = "abc";
auto a = t.slice!(0, 3);
assert(a.length == 3);
assert(a.x == t.x);
assert(a.y == t.y);
assert(a.z == t.z);
auto b = t.slice!(2, 4);
assert(b.length == 2);
assert(b.z == t.z);
assert(b[1] == t[3]);
}
// nesting
{
Tuple!(Tuple!(int, real), Tuple!(string, "s")) t;
static assert(is(typeof(t[0]) == Tuple!(int, real)));
static assert(is(typeof(t[1]) == Tuple!(string, "s")));
static assert(is(typeof(t[0][0]) == int));
static assert(is(typeof(t[0][1]) == real));
static assert(is(typeof(t[1].s) == string));
t[0] = tuple(10, 20.0L);
t[1].s = "abc";
assert(t[0][0] == 10);
assert(t[0][1] == 20.0L);
assert(t[1].s == "abc");
}
// non-POD
{
static struct S
{
int count;
this(this) { ++count; }
~this() { --count; }
void opAssign(S rhs) { count = rhs.count; }
}
Tuple!(S, S) ss;
Tuple!(S, S) ssCopy = ss;
assert(ssCopy[0].count == 1);
assert(ssCopy[1].count == 1);
ssCopy[1] = ssCopy[0];
assert(ssCopy[1].count == 2);
}
// bug 2800
{
static struct R
{
Tuple!(int, int) _front;
@property ref Tuple!(int, int) front() { return _front; }
@property bool empty() { return _front[0] >= 10; }
void popFront() { ++_front[0]; }
}
foreach (a; R())
{
static assert(is(typeof(a) == Tuple!(int, int)));
assert(0 <= a[0] && a[0] < 10);
assert(a[1] == 0);
}
}
// Construction with compatible elements
{
auto t1 = Tuple!(int, double)(1, 1);
// 8702
auto t8702a = tuple(tuple(1));
auto t8702b = Tuple!(Tuple!(int))(Tuple!(int)(1));
}
// Construction with compatible tuple
{
Tuple!(int, int) x;
x[0] = 10;
x[1] = 20;
Tuple!(int, "a", double, "b") y = x;
assert(y.a == 10);
assert(y.b == 20);
// incompatible
static assert(!__traits(compiles, Tuple!(int, int)(y)));
}
// 6275
{
const int x = 1;
auto t1 = tuple(x);
alias Tuple!(const(int)) T;
auto t2 = T(1);
}
// 9431
{
alias T = Tuple!(int[1][]);
auto t = T([[10]]);
}
}
unittest
{
// opEquals
{
struct Equ1 { bool opEquals(Equ1) { return true; } }
auto tm1 = tuple(Equ1.init);
const tc1 = tuple(Equ1.init);
static assert( is(typeof(tm1 == tm1)));
static assert(!is(typeof(tm1 == tc1)));
static assert(!is(typeof(tc1 == tm1)));
static assert(!is(typeof(tc1 == tc1)));
struct Equ2 { bool opEquals(const Equ2) const { return true; } }
auto tm2 = tuple(Equ2.init);
const tc2 = tuple(Equ2.init);
static assert( is(typeof(tm2 == tm2)));
static assert( is(typeof(tm2 == tc2)));
static assert( is(typeof(tc2 == tm2)));
static assert( is(typeof(tc2 == tc2)));
struct Equ3 { bool opEquals(T)(T) { return true; } }
auto tm3 = tuple(Equ3.init); // bugzilla 8686
const tc3 = tuple(Equ3.init);
static assert( is(typeof(tm3 == tm3)));
static assert( is(typeof(tm3 == tc3)));
static assert(!is(typeof(tc3 == tm3)));
static assert(!is(typeof(tc3 == tc3)));
struct Equ4 { bool opEquals(T)(T) const { return true; } }
auto tm4 = tuple(Equ4.init);
const tc4 = tuple(Equ4.init);
static assert( is(typeof(tm4 == tm4)));
static assert( is(typeof(tm4 == tc4)));
static assert( is(typeof(tc4 == tm4)));
static assert( is(typeof(tc4 == tc4)));
}
// opCmp
{
struct Cmp1 { int opCmp(Cmp1) { return 0; } }
auto tm1 = tuple(Cmp1.init);
const tc1 = tuple(Cmp1.init);
static assert( is(typeof(tm1 < tm1)));
static assert(!is(typeof(tm1 < tc1)));
static assert(!is(typeof(tc1 < tm1)));
static assert(!is(typeof(tc1 < tc1)));
struct Cmp2 { int opCmp(const Cmp2) const { return 0; } }
auto tm2 = tuple(Cmp2.init);
const tc2 = tuple(Cmp2.init);
static assert( is(typeof(tm2 < tm2)));
static assert( is(typeof(tm2 < tc2)));
static assert( is(typeof(tc2 < tm2)));
static assert( is(typeof(tc2 < tc2)));
struct Cmp3 { int opCmp(T)(T) { return 0; } }
auto tm3 = tuple(Cmp3.init);
const tc3 = tuple(Cmp3.init);
static assert( is(typeof(tm3 < tm3)));
static assert( is(typeof(tm3 < tc3)));
static assert(!is(typeof(tc3 < tm3)));
static assert(!is(typeof(tc3 < tc3)));
struct Cmp4 { int opCmp(T)(T) const { return 0; } }
auto tm4 = tuple(Cmp4.init);
const tc4 = tuple(Cmp4.init);
static assert( is(typeof(tm4 < tm4)));
static assert( is(typeof(tm4 < tc4)));
static assert( is(typeof(tc4 < tm4)));
static assert( is(typeof(tc4 < tc4)));
}
{
int[2] ints = [ 1, 2 ];
Tuple!(int, int) t = ints;
assert(t[0] == 1 && t[1] == 2);
Tuple!(long, uint) t2 = ints;
assert(t2[0] == 1 && t2[1] == 2);
}
}
@safe unittest
{
auto t1 = Tuple!(int, "x", string, "y")(1, "a");
assert(t1.x == 1);
assert(t1.y == "a");
void foo(Tuple!(int, string) t2) {}
foo(t1);
Tuple!(int, int)[] arr;
arr ~= tuple(10, 20); // OK
arr ~= Tuple!(int, "x", int, "y")(10, 20); // NG -> OK
static assert(is(typeof(Tuple!(int, "x", string, "y").tupleof) ==
typeof(Tuple!(int, string ).tupleof)));
}
unittest
{
// Bugzilla 10686
immutable Tuple!(int) t1;
auto r1 = t1[0]; // OK
immutable Tuple!(int, "x") t2;
auto r2 = t2[0]; // error
}
unittest
{
// Bugzilla 10218
assertCTFEable!(
{
auto t = tuple(1);
t = tuple(2); // assignment
});
}
/**
Returns a $(D Tuple) object instantiated and initialized according to
the arguments.
Example:
----
auto value = tuple(5, 6.7, "hello");
assert(value[0] == 5);
assert(value[1] == 6.7);
assert(value[2] == "hello");
----
*/
Tuple!T tuple(T...)(T args)
{
return typeof(return)(args);
}
/**
Returns $(D true) if and only if $(D T) is an instance of the
$(D Tuple) struct template.
*/
template isTuple(T)
{
static if (is(Unqual!T Unused : Tuple!Specs, Specs...))
{
enum isTuple = true;
}
else
{
enum isTuple = false;
}
}
unittest
{
static assert(isTuple!(Tuple!()));
static assert(isTuple!(Tuple!(int)));
static assert(isTuple!(Tuple!(int, real, string)));
static assert(isTuple!(Tuple!(int, "x", real, "y")));
static assert(isTuple!(Tuple!(int, Tuple!(real), string)));
static assert(isTuple!(const Tuple!(int)));
static assert(isTuple!(immutable Tuple!(int)));
static assert(!isTuple!(int));
static assert(!isTuple!(const int));
struct S {}
static assert(!isTuple!(S));
}
/**
$(D Rebindable!(T)) is a simple, efficient wrapper that behaves just
like an object of type $(D T), except that you can reassign it to
refer to another object. For completeness, $(D Rebindable!(T)) aliases
itself away to $(D T) if $(D T) is a non-const object type. However,
$(D Rebindable!(T)) does not compile if $(D T) is a non-class type.
Regular $(D const) object references cannot be reassigned:
----
class Widget { int x; int y() const { return x; } }
const a = new Widget;
a.y(); // fine
a.x = 5; // error! can't modify const a
a = new Widget; // error! can't modify const a
----
However, $(D Rebindable!(Widget)) does allow reassignment, while
otherwise behaving exactly like a $(D const Widget):
----
auto a = Rebindable!(const Widget)(new Widget);
a.y(); // fine
a.x = 5; // error! can't modify const a
a = new Widget; // fine
----
You may want to use $(D Rebindable) when you want to have mutable
storage referring to $(D const) objects, for example an array of
references that must be sorted in place. $(D Rebindable) does not
break the soundness of D's type system and does not incur any of the
risks usually associated with $(D cast).
*/
template Rebindable(T) if (is(T == class) || is(T == interface) || isArray!T)
{
static if (!is(T X == const U, U) && !is(T X == immutable U, U))
{
alias T Rebindable;
}
else static if (isArray!T)
{
alias const(ElementType!T)[] Rebindable;
}
else
{
struct Rebindable
{
private union
{
T original;
U stripped;
}
void opAssign(T another) pure nothrow
{
stripped = cast(U) another;
}
void opAssign(Rebindable another) pure nothrow
{
stripped = another.stripped;
}
static if (is(T == const U))
{
// safely assign immutable to const
void opAssign(Rebindable!(immutable U) another) pure nothrow
{
stripped = another.stripped;
}
}
this(T initializer) pure nothrow
{
opAssign(initializer);
}
@property ref inout(T) get() inout pure nothrow
{
return original;
}
alias get this;
}
}
}
/**
Convenience function for creating a $(D Rebindable) using automatic type
inference.
*/
Rebindable!T rebindable(T)(T obj)
if (is(T == class) || is(T == interface) || isArray!T)
{
typeof(return) ret;
ret = obj;
return ret;
}
/**
This function simply returns the $(D Rebindable) object passed in. It's useful
in generic programming cases when a given object may be either a regular
$(D class) or a $(D Rebindable).
*/
Rebindable!T rebindable(T)(Rebindable!T obj)
{
return obj;
}
unittest
{
interface CI { const int foo(); }
class C : CI {
int foo() const { return 42; }
@property int bar() const { return 23; }
}
Rebindable!(C) obj0;
static assert(is(typeof(obj0) == C));
Rebindable!(const(C)) obj1;
static assert(is(typeof(obj1.get) == const(C)), typeof(obj1.get).stringof);
static assert(is(typeof(obj1.stripped) == C));
obj1 = new C;
assert(obj1.get !is null);
obj1 = new const(C);
assert(obj1.get !is null);
Rebindable!(immutable(C)) obj2;
static assert(is(typeof(obj2.get) == immutable(C)));
static assert(is(typeof(obj2.stripped) == C));
obj2 = new immutable(C);
assert(obj1.get !is null);
// test opDot
assert(obj2.foo() == 42);
assert(obj2.bar == 23);
interface I { final int foo() const { return 42; } }
Rebindable!(I) obj3;
static assert(is(typeof(obj3) == I));
Rebindable!(const I) obj4;
static assert(is(typeof(obj4.get) == const I));
static assert(is(typeof(obj4.stripped) == I));
static assert(is(typeof(obj4.foo()) == int));
obj4 = new class I {};
Rebindable!(immutable C) obj5i;
Rebindable!(const C) obj5c;
obj5c = obj5c;
obj5c = obj5i;
obj5i = obj5i;
static assert(!__traits(compiles, obj5i = obj5c));
// Test the convenience functions.
auto obj5convenience = rebindable(obj5i);
assert(obj5convenience is obj5i);
auto obj6 = rebindable(new immutable(C));
static assert(is(typeof(obj6) == Rebindable!(immutable C)));
assert(obj6.foo() == 42);
auto obj7 = rebindable(new C);
CI interface1 = obj7;
auto interfaceRebind1 = rebindable(interface1);
assert(interfaceRebind1.foo() == 42);
const interface2 = interface1;
auto interfaceRebind2 = rebindable(interface2);
assert(interfaceRebind2.foo() == 42);
auto arr = [1,2,3,4,5];
const arrConst = arr;
assert(rebindable(arr) == arr);
assert(rebindable(arrConst) == arr);
}
/**
Order the provided members to minimize size while preserving alignment.
Returns a declaration to be mixed in.
Example:
---
struct Banner {
mixin(alignForSize!(byte[6], double)(["name", "height"]));
}
---
Alignment is not always optimal for 80-bit reals, nor for structs declared
as align(1).
*/
string alignForSize(E...)(string[] names...)
{
// Sort all of the members by .alignof.
// BUG: Alignment is not always optimal for align(1) structs
// or 80-bit reals or 64-bit primitives on x86.
// TRICK: Use the fact that .alignof is always a power of 2,
// and maximum 16 on extant systems. Thus, we can perform
// a very limited radix sort.
// Contains the members with .alignof = 64,32,16,8,4,2,1
assert(E.length == names.length,
"alignForSize: There should be as many member names as the types");
string[7] declaration = ["", "", "", "", "", "", ""];
foreach (i, T; E)
{
auto a = T.alignof;
auto k = a>=64? 0 : a>=32? 1 : a>=16? 2 : a>=8? 3 : a>=4? 4 : a>=2? 5 : 6;
declaration[k] ~= T.stringof ~ " " ~ names[i] ~ ";\n";
}
auto s = "";
foreach (decl; declaration)
s ~= decl;
return s;
}
unittest
{
enum x = alignForSize!(int[], char[3], short, double[5])("x", "y","z", "w");
struct Foo { int x; }
enum y = alignForSize!(ubyte, Foo, cdouble)("x", "y", "z");
enum passNormalX = x == "double[5] w;\nint[] x;\nshort z;\nchar[3] y;\n";
enum passNormalY = y == "cdouble z;\nFoo y;\nubyte x;\n";
enum passAbnormalX = x == "int[] x;\ndouble[5] w;\nshort z;\nchar[3] y;\n";
enum passAbnormalY = y == "Foo y;\ncdouble z;\nubyte x;\n";
// ^ blame http://d.puremagic.com/issues/show_bug.cgi?id=231
static assert(passNormalX || passAbnormalX && double.alignof <= (int[]).alignof);
static assert(passNormalY || passAbnormalY && double.alignof <= int.alignof);
}
/*--*
First-class reference type
*/
struct Ref(T)
{
private T * _p;
this(ref T value) { _p = &value; }
ref T opDot() { return *_p; }
/*ref*/ T opImplicitCastTo() { return *_p; }
@property ref T value() { return *_p; }
void opAssign(T value)
{
*_p = value;
}
void opAssign(T * value)
{
_p = value;
}
}
unittest
{
Ref!(int) x;
int y = 42;
x = &y;
assert(x.value == 42);
x = 5;
assert(x.value == 5);
assert(y == 5);
}
/**
Defines a value paired with a distinctive "null" state that denotes
the absence of a value. If default constructed, a $(D
Nullable!T) object starts in the null state. Assigning it renders it
non-null. Calling $(D nullify) can nullify it again.
Example:
----
Nullable!int a;
assert(a.isNull);
a = 5;
assert(!a.isNull);
assert(a == 5);
----
Practically $(D Nullable!T) stores a $(D T) and a $(D bool).
*/
struct Nullable(T)
{
private T _value;
private bool _isNull = true;
/**
Constructor initializing $(D this) with $(D value).
*/
//this()(inout T value) inout // proper signature
this(U:T)(inout U value) inout // workaround for BUG 10313
{
_value = value;
_isNull = false;
}
/**
Returns $(D true) if and only if $(D this) is in the null state.
*/
@property bool isNull() const pure nothrow @safe
{
return _isNull;
}
/**
Forces $(D this) to the null state.
*/
void nullify()()
{
.destroy(_value);
_isNull = true;
}
/**
Assigns $(D value) to the internally-held state. If the assignment
succeeds, $(D this) becomes non-null.
*/
void opAssign()(T value)
{
_value = value;
_isNull = false;
}
/**
Gets the value. $(D this) must not be in the null state.
This function is also called for the implicit conversion to $(D T).
*/
@property ref inout(T) get() inout pure nothrow @safe
{
enum message = "Called `get' on null Nullable!" ~ T.stringof ~ ".";
assert(!isNull, message);
return _value;
}
/**
Implicitly converts to $(D T).
$(D this) must not be in the null state.
*/
alias get this;
}
unittest
{
Nullable!int a;
assert(a.isNull);
assertThrown!Throwable(a.get);
a = 5;
assert(!a.isNull);
assert(a == 5);
assert(a != 3);
assert(a.get != 3);
a.nullify();
assert(a.isNull);
a = 3;
assert(a == 3);
a *= 6;
assert(a == 18);
a = a;
assert(a == 18);
a.nullify();
assertThrown!Throwable(a += 2);
}
unittest
{
auto k = Nullable!int(74);
assert(k == 74);
k.nullify();
assert(k.isNull);
}
unittest
{
static int f(in Nullable!int x) {
return x.isNull ? 42 : x.get;
}
Nullable!int a;
assert(f(a) == 42);
a = 8;
assert(f(a) == 8);
a.nullify();
assert(f(a) == 42);
}
unittest
{
static struct S { int x; }
Nullable!S s;
assert(s.isNull);
s = S(6);
assert(s == S(6));
assert(s != S(0));
assert(s.get != S(0));
s.x = 9190;
assert(s.x == 9190);
s.nullify();
assertThrown!Throwable(s.x = 9441);
}
unittest
{
// Ensure Nullable can be used in pure/nothrow/@safe environment.
function() pure nothrow @safe
{
Nullable!int n;
assert(n.isNull);
n = 4;
assert(!n.isNull);
assert(n == 4);
n.nullify();
assert(n.isNull);
}();
}
unittest
{
// Ensure Nullable can be used when the value is not pure/nothrow/@safe
static struct S
{
int x;
this(this) @system {}
}
Nullable!S s;
assert(s.isNull);
s = S(5);
assert(!s.isNull);
assert(s.x == 5);
s.nullify();
assert(s.isNull);
}
unittest
{
// Bugzilla 9404
alias N = Nullable!int;
void foo(N a)
{
N b;
b = a; // `N b = a;` works fine
}
N n;
foo(n);
}
unittest
{
//Check nullable immutable is constructable
{
auto a1 = Nullable!(immutable int)();
auto a2 = Nullable!(immutable int)(1);
auto i = a2.get;
}
//Check immutable nullable is constructable
{
auto a1 = immutable (Nullable!int)();
auto a2 = immutable (Nullable!int)(1);
auto i = a2.get;
}
}
unittest
{
alias NInt = Nullable!int;
//Construct tests
{
//from other Nullable null
NInt a1;
NInt b1 = a1;
assert(b1.isNull);
//from other Nullable non-null
NInt a2 = NInt(1);
NInt b2 = a2;
assert(b2 == 1);
//Construct from similar nullable
auto a3 = immutable(NInt)();
NInt b3 = a3;
assert(b3.isNull);
}
//Assign tests
{
//from other Nullable null
NInt a1;
NInt b1;
b1 = a1;
assert(b1.isNull);
//from other Nullable non-null
NInt a2 = NInt(1);
NInt b2;
b2 = a2;
assert(b2 == 1);
//Construct from similar nullable
auto a3 = immutable(NInt)();
NInt b3 = a3;
b3 = a3;
assert(b3.isNull);
}
}
unittest
{
//Check nullable is nicelly embedable in a struct
static struct S1
{
Nullable!int ni;
}
static struct S2 //inspired from 9404
{
Nullable!int ni;
this(S2 other)
{
ni = other.ni;
}
void opAssign(S2 other)
{
ni = other.ni;
}
}
foreach (S; TypeTuple!(S1, S2))
{
S a;
S b = a;
S c;
c = a;
}
}
unittest
{
// Bugzilla 10268
import std.json;
JSONValue value = void;
value.type = JSON_TYPE.NULL;
auto na = Nullable!JSONValue(value);
struct S1 { int val; }
struct S2 { int* val; }
struct S3 { immutable int* val; }
{
auto sm = S1(1);
immutable si = immutable S1(1);
static assert( __traits(compiles, { auto x1 = Nullable!S1(sm); }));
static assert( __traits(compiles, { auto x2 = immutable Nullable!S1(sm); }));
static assert( __traits(compiles, { auto x3 = Nullable!S1(si); }));
static assert( __traits(compiles, { auto x4 = immutable Nullable!S1(si); }));
}
auto nm = 10;
immutable ni = 10;
{
auto sm = S2(&nm);
immutable si = immutable S2(&ni);
static assert( __traits(compiles, { auto x = Nullable!S2(sm); }));
static assert(!__traits(compiles, { auto x = immutable Nullable!S2(sm); }));
static assert(!__traits(compiles, { auto x = Nullable!S2(si); }));
static assert( __traits(compiles, { auto x = immutable Nullable!S2(si); }));
}
{
auto sm = S3(&ni);
immutable si = immutable S3(&ni);
static assert( __traits(compiles, { auto x = Nullable!S3(sm); }));
static assert( __traits(compiles, { auto x = immutable Nullable!S3(sm); }));
static assert( __traits(compiles, { auto x = Nullable!S3(si); }));
static assert( __traits(compiles, { auto x = immutable Nullable!S3(si); }));
}
}
unittest
{
// Bugzila 10357
import std.datetime;
Nullable!SysTime time = SysTime(0);
}
/**
Just like $(D Nullable!T), except that the null state is defined as a
particular value. For example, $(D Nullable!(uint, uint.max)) is an
$(D uint) that sets aside the value $(D uint.max) to denote a null
state. $(D Nullable!(T, nullValue)) is more storage-efficient than $(D
Nullable!T) because it does not need to store an extra $(D bool).
*/
struct Nullable(T, T nullValue)
{
private T _value = nullValue;
/**
Constructor initializing $(D this) with $(D value).
*/
this()(T value)
{
_value = value;
}
/**
Returns $(D true) if and only if $(D this) is in the null state.
*/
@property bool isNull()() const
{
return _value == nullValue;
}
/**
Forces $(D this) to the null state.
*/
void nullify()()
{
_value = nullValue;
}
/**
Assigns $(D value) to the internally-held state. No null checks are
made. Note that the assignment may leave $(D this) in the null state.
*/
void opAssign()(T value)
{
_value = value;
}
/**
Gets the value. $(D this) must not be in the null state.
This function is also called for the implicit conversion to $(D T).
*/
@property ref inout(T) get()() inout
{
//@@@6169@@@: We avoid any call that might evaluate nullValue's %s,
//Because it might messup get's purity and safety inference.
enum message = "Called `get' on null Nullable!(" ~ T.stringof ~ ",nullValue).";
assert(!isNull, message);
return _value;
}
/**
Implicitly converts to $(D T).
Gets the value. $(D this) must not be in the null state.
*/
alias get this;
}
unittest
{
Nullable!(int, int.min) a;
assert(a.isNull);
assertThrown!Throwable(a.get);
a = 5;
assert(!a.isNull);
assert(a == 5);
static assert(a.sizeof == int.sizeof);
}
unittest
{
auto a = Nullable!(int, int.min)(8);
assert(a == 8);
a.nullify();
assert(a.isNull);
}
unittest
{
static int f(in Nullable!(int, int.min) x) {
return x.isNull ? 42 : x.get;
}
Nullable!(int, int.min) a;
assert(f(a) == 42);
a = 8;
assert(f(a) == 8);
a.nullify();
assert(f(a) == 42);
}
unittest
{
// Ensure Nullable can be used in pure/nothrow/@safe environment.
function() pure nothrow @safe
{
Nullable!(int, int.min) n;
assert(n.isNull);
n = 4;
assert(!n.isNull);
assert(n == 4);
n.nullify();
assert(n.isNull);
}();
}
unittest
{
// Ensure Nullable can be used when the value is not pure/nothrow/@safe
static struct S
{
int x;
bool opEquals(const S s) const @system { return s.x == x; }
}
Nullable!(S, S(711)) s;
assert(s.isNull);
s = S(5);
assert(!s.isNull);
assert(s.x == 5);
s.nullify();
assert(s.isNull);
}
unittest
{
//Check nullable is nicelly embedable in a struct
static struct S1
{
Nullable!(int, 0) ni;
}
static struct S2 //inspired from 9404
{
Nullable!(int, 0) ni;
this(S2 other)
{
ni = other.ni;
}
void opAssign(S2 other)
{
ni = other.ni;
}
}
foreach (S; TypeTuple!(S1, S2))
{
S a;
S b = a;
S c;
c = a;
}
}
/**
Just like $(D Nullable!T), except that the object refers to a value
sitting elsewhere in memory. This makes assignments overwrite the
initially assigned value. Internally $(D NullableRef!T) only stores a
pointer to $(D T) (i.e., $(D Nullable!T.sizeof == (T*).sizeof)).
*/
struct NullableRef(T)
{
private T* _value;
/**
Constructor binding $(D this) with $(D value).
*/
this(T* value) pure nothrow @safe
{
_value = value;
}
/**
Binds the internal state to $(D value).
*/
void bind(T* value) pure nothrow @safe
{
_value = value;
}
/**
Returns $(D true) if and only if $(D this) is in the null state.
*/
@property bool isNull() const pure nothrow @safe
{
return _value is null;
}
/**
Forces $(D this) to the null state.
*/
void nullify() pure nothrow @safe
{
_value = null;
}
/**
Assigns $(D value) to the internally-held state.
*/
void opAssign()(T value)
if (isAssignable!T) //@@@9416@@@
{
enum message = "Called `opAssign' on null NullableRef!" ~ T.stringof ~ ".";
assert(!isNull, message);
*_value = value;
}
/**
Gets the value. $(D this) must not be in the null state.
This function is also called for the implicit conversion to $(D T).
*/
@property ref inout(T) get() inout pure nothrow @safe
{
enum message = "Called `get' on null NullableRef!" ~ T.stringof ~ ".";
assert(!isNull, message);
return *_value;
}
/**
Implicitly converts to $(D T).
$(D this) must not be in the null state.
*/
alias get this;
}
unittest
{
int x = 5, y = 7;
auto a = NullableRef!(int)(&x);
assert(!a.isNull);
assert(a == 5);
assert(x == 5);
a = 42;
assert(x == 42);
assert(!a.isNull);
assert(a == 42);
a.nullify();
assert(x == 42);
assert(a.isNull);
assertThrown!Throwable(a.get);
assertThrown!Throwable(a = 71);
a.bind(&y);
assert(a == 7);
y = 135;
assert(a == 135);
}
unittest
{
static int f(in NullableRef!int x) {
return x.isNull ? 42 : x.get;
}
int x = 5;
auto a = NullableRef!int(&x);
assert(f(a) == 5);
a.nullify();
assert(f(a) == 42);
}
unittest
{
// Ensure NullableRef can be used in pure/nothrow/@safe environment.
function() pure nothrow @safe
{
auto storage = new int;
*storage = 19902;
NullableRef!int n;
assert(n.isNull);
n.bind(storage);
assert(!n.isNull);
assert(n == 19902);
n = 2294;
assert(n == 2294);
assert(*storage == 2294);
n.nullify();
assert(n.isNull);
}();
}
unittest
{
// Ensure NullableRef can be used when the value is not pure/nothrow/@safe
static struct S
{
int x;
this(this) @system {}
bool opEquals(const S s) const @system { return s.x == x; }
}
auto storage = S(5);
NullableRef!S s;
assert(s.isNull);
s.bind(&storage);
assert(!s.isNull);
assert(s.x == 5);
s.nullify();
assert(s.isNull);
}
unittest
{
//Check nullable is nicelly embedable in a struct
static struct S1
{
NullableRef!int ni;
}
static struct S2 //inspired from 9404
{
NullableRef!int ni;
this(S2 other)
{
ni = other.ni;
}
void opAssign(S2 other)
{
ni = other.ni;
}
}
foreach (S; TypeTuple!(S1, S2))
{
S a;
S b = a;
S c;
c = a;
}
}
/**
$(D BlackHole!Base) is a subclass of $(D Base) which automatically implements
all abstract member functions in $(D Base) as do-nothing functions. Each
auto-implemented function just returns the default value of the return type
without doing anything.
The name came from
$(WEB search.cpan.org/~sburke/Class-_BlackHole-0.04/lib/Class/_BlackHole.pm, Class::_BlackHole)
Perl module by Sean M. Burke.
Example:
--------------------
abstract class C
{
int m_value;
this(int v) { m_value = v; }
int value() @property { return m_value; }
abstract real realValue() @property;
abstract void doSomething();
}
void main()
{
auto c = new BlackHole!C(42);
writeln(c.value); // prints "42"
// Abstract functions are implemented as do-nothing:
writeln(c.realValue); // prints "NaN"
c.doSomething(); // does nothing
}
--------------------
See_Also:
AutoImplement, generateEmptyFunction
*/
template BlackHole(Base)
{
alias AutoImplement!(Base, generateEmptyFunction, isAbstractFunction)
BlackHole;
}
unittest
{
// return default
{
interface I_1 { real test(); }
auto o = new BlackHole!I_1;
assert(o.test() !<>= 0); // NaN
}
// doc example
{
static class C
{
int m_value;
this(int v) { m_value = v; }
int value() @property { return m_value; }
abstract real realValue() @property;
abstract void doSomething();
}
auto c = new BlackHole!C(42);
assert(c.value == 42);
assert(c.realValue !<>= 0); // NaN
c.doSomething();
}
}
/**
$(D WhiteHole!Base) is a subclass of $(D Base) which automatically implements
all abstract member functions as throw-always functions. Each auto-implemented
function fails with throwing an $(D Error) and does never return. Useful for
trapping use of not-yet-implemented functions.
The name came from
$(WEB search.cpan.org/~mschwern/Class-_WhiteHole-0.04/lib/Class/_WhiteHole.pm, Class::_WhiteHole)
Perl module by Michael G Schwern.
Example:
--------------------
class C
{
abstract void notYetImplemented();
}
void main()
{
auto c = new WhiteHole!C;
c.notYetImplemented(); // throws an Error
}
--------------------
BUGS:
Nothrow functions cause program to abort in release mode because the trap is
implemented with $(D assert(0)) for nothrow functions.
See_Also:
AutoImplement, generateAssertTrap
*/
template WhiteHole(Base)
{
alias AutoImplement!(Base, generateAssertTrap, isAbstractFunction)
WhiteHole;
}
// / ditto
class NotImplementedError : Error
{
this(string method)
{
super(method ~ " is not implemented");
}
}
unittest
{
// nothrow
debug // see the BUGS above
{
interface I_1
{
void foo();
void bar() nothrow;
}
auto o = new WhiteHole!I_1;
uint trap;
try { o.foo(); } catch (Error e) { ++trap; }
assert(trap == 1);
try { o.bar(); } catch (Error e) { ++trap; }
assert(trap == 2);
}
// doc example
{
static class C
{
abstract void notYetImplemented();
}
auto c = new WhiteHole!C;
try
{
c.notYetImplemented();
assert(0);
}
catch (Error e) {}
}
}
/**
$(D AutoImplement) automatically implements (by default) all abstract member
functions in the class or interface $(D Base) in specified way.
Params:
how = template which specifies _how functions will be implemented/overridden.
Two arguments are passed to $(D how): the type $(D Base) and an alias
to an implemented function. Then $(D how) must return an implemented
function body as a string.
The generated function body can use these keywords:
$(UL
$(LI $(D a0), $(D a1), …: arguments passed to the function;)
$(LI $(D args): a tuple of the arguments;)
$(LI $(D self): an alias to the function itself;)
$(LI $(D parent): an alias to the overridden function (if any).)
)
You may want to use templated property functions (instead of Implicit
Template Properties) to generate complex functions:
--------------------
// Prints log messages for each call to overridden functions.
string generateLogger(C, alias fun)() @property
{
import std.traits;
enum qname = C.stringof ~ "." ~ __traits(identifier, fun);
string stmt;
stmt ~= q{ struct Importer { import std.stdio; } };
stmt ~= `Importer.writeln$(LPAREN)"Log: ` ~ qname ~ `(", args, ")"$(RPAREN);`;
static if (!__traits(isAbstractFunction, fun))
{
static if (is(ReturnType!fun == void))
stmt ~= q{ parent(args); };
else
stmt ~= q{
auto r = parent(args);
Importer.writeln("--> ", r);
return r;
};
}
return stmt;
}
--------------------
what = template which determines _what functions should be
implemented/overridden.
An argument is passed to $(D what): an alias to a non-final member
function in $(D Base). Then $(D what) must return a boolean value.
Return $(D true) to indicate that the passed function should be
implemented/overridden.
--------------------
// Sees if fun returns something.
template hasValue(alias fun)
{
enum bool hasValue = !is(ReturnType!(fun) == void);
}
--------------------
Note:
Generated code is inserted in the scope of $(D std.typecons) module. Thus,
any useful functions outside $(D std.typecons) cannot be used in the generated
code. To workaround this problem, you may $(D import) necessary things in a
local struct, as done in the $(D generateLogger()) template in the above
example.
BUGS:
$(UL
$(LI Variadic arguments to constructors are not forwarded to super.)
$(LI Deep interface inheritance causes compile error with messages like
"Error: function std.typecons._AutoImplement!(Foo)._AutoImplement.bar
does not override any function". [$(BUGZILLA 2525), $(BUGZILLA 3525)] )
$(LI The $(D parent) keyword is actually a delegate to the super class'
corresponding member function. [$(BUGZILLA 2540)] )
$(LI Using alias template parameter in $(D how) and/or $(D what) may cause
strange compile error. Use template tuple parameter instead to workaround
this problem. [$(BUGZILLA 4217)] )
)
*/
class AutoImplement(Base, alias how, alias what = isAbstractFunction) : Base
{
private alias AutoImplement_Helper!(
"autoImplement_helper_", "Base", Base, how, what )
autoImplement_helper_;
mixin(autoImplement_helper_.code);
}
/*
* Code-generating stuffs are encupsulated in this helper template so that
* namespace pollusion, which can cause name confliction with Base's public
* members, should be minimized.
*/
private template AutoImplement_Helper(string myName, string baseName,
Base, alias generateMethodBody, alias cherrypickMethod)
{
private static:
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Internal stuffs
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// this would be deprecated by std.typelist.Filter
template staticFilter(alias pred, lst...)
{
static if (lst.length > 0)
{
alias staticFilter!(pred, lst[1 .. $]) tail;
//
static if (pred!(lst[0]))
alias TypeTuple!(lst[0], tail) staticFilter;
else
alias tail staticFilter;
}
else
alias TypeTuple!() staticFilter;
}
// Returns function overload sets in the class C, filtered with pred.
template enumerateOverloads(C, alias pred)
{
template Impl(names...)
{
static if (names.length > 0)
{
alias staticFilter!(pred, MemberFunctionsTuple!(C, names[0])) methods;
alias Impl!(names[1 .. $]) next;
static if (methods.length > 0)
alias TypeTuple!(OverloadSet!(names[0], methods), next) Impl;
else
alias next Impl;
}
else
alias TypeTuple!() Impl;
}
alias Impl!(__traits(allMembers, C)) enumerateOverloads;
}
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Target functions
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Add a non-final check to the cherrypickMethod.
template canonicalPicker(fun.../+[BUG 4217]+/)
{
enum bool canonicalPicker = !__traits(isFinalFunction, fun[0]) &&
cherrypickMethod!(fun);
}
/*
* A tuple of overload sets, each item of which consists of functions to be
* implemented by the generated code.
*/
alias enumerateOverloads!(Base, canonicalPicker) targetOverloadSets;
/*
* A tuple of the super class' constructors. Used for forwarding
* constructor calls.
*/
static if (__traits(hasMember, Base, "__ctor"))
alias OverloadSet!("__ctor", __traits(getOverloads, Base, "__ctor"))
ctorOverloadSet;
else
alias OverloadSet!("__ctor") ctorOverloadSet; // empty
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Type information
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/*
* The generated code will be mixed into AutoImplement, which will be
* instantiated in this module's scope. Thus, any user-defined types are
* out of scope and cannot be used directly (i.e. by their names).
*
* We will use FuncInfo instances for accessing return types and parameter
* types of the implemented functions. The instances will be populated to
* the AutoImplement's scope in a certain way; see the populate() below.
*/
// Returns the preferred identifier for the FuncInfo instance for the i-th
// overloaded function with the name.
template INTERNAL_FUNCINFO_ID(string name, size_t i)
{
enum string INTERNAL_FUNCINFO_ID = format("F_%s_%s", name, i);
}
/*
* Insert FuncInfo instances about all the target functions here. This
* enables the generated code to access type information via, for example,
* "autoImplement_helper_.F_foo_1".
*/
template populate(overloads...)
{
static if (overloads.length > 0)
{
mixin populate!(overloads[0].name, overloads[0].contents);
mixin populate!(overloads[1 .. $]);
}
}
template populate(string name, methods...)
{
static if (methods.length > 0)
{
mixin populate!(name, methods[0 .. $ - 1]);
//
alias methods[$ - 1] target;
enum ith = methods.length - 1;
mixin( "alias FuncInfo!(target) " ~
INTERNAL_FUNCINFO_ID!(name, ith) ~ ";" );
}
}
public mixin populate!(targetOverloadSets);
public mixin populate!( ctorOverloadSet );
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Code-generating policies
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/* Common policy configurations for generating constructors and methods. */
template CommonGeneratingPolicy()
{
// base class identifier which generated code should use
enum string BASE_CLASS_ID = baseName;
// FuncInfo instance identifier which generated code should use
template FUNCINFO_ID(string name, size_t i)
{
enum string FUNCINFO_ID =
myName ~ "." ~ INTERNAL_FUNCINFO_ID!(name, i);
}
}
/* Policy configurations for generating constructors. */
template ConstructorGeneratingPolicy()
{
mixin CommonGeneratingPolicy;
/* Generates constructor body. Just forward to the base class' one. */
string generateFunctionBody(ctor.../+[BUG 4217]+/)() @property
{
enum varstyle = variadicFunctionStyle!(typeof(&ctor[0]));
static if (varstyle & (Variadic.c | Variadic.d))
{
// the argptr-forwarding problem
pragma(msg, "Warning: AutoImplement!(", Base, ") ",
"ignored variadic arguments to the constructor ",
FunctionTypeOf!(typeof(&ctor[0])) );
}
return "super(args);";
}
}
/* Policy configurations for genearting target methods. */
template MethodGeneratingPolicy()
{
mixin CommonGeneratingPolicy;
/* Geneartes method body. */
string generateFunctionBody(func.../+[BUG 4217]+/)() @property
{
return generateMethodBody!(Base, func); // given
}
}
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Generated code
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
alias MemberFunctionGenerator!( ConstructorGeneratingPolicy!() )
ConstructorGenerator;
alias MemberFunctionGenerator!( MethodGeneratingPolicy!() )
MethodGenerator;
public enum string code =
ConstructorGenerator.generateCode!( ctorOverloadSet ) ~ "\n" ~
MethodGenerator.generateCode!(targetOverloadSets);
debug (SHOW_GENERATED_CODE)
{
pragma(msg, "-------------------- < ", Base, " >");
pragma(msg, code);
pragma(msg, "--------------------");
}
}
//debug = SHOW_GENERATED_CODE;
version(unittest) import core.vararg;
unittest
{
// no function to implement
{
interface I_1 {}
auto o = new BlackHole!I_1;
}
// parameters
{
interface I_3 { void test(int, in int, out int, ref int, lazy int); }
auto o = new BlackHole!I_3;
}
// use of user-defined type
{
struct S {}
interface I_4 { S test(); }
auto o = new BlackHole!I_4;
}
// overloads
{
interface I_5
{
void test(string);
real test(real);
int test();
}
auto o = new BlackHole!I_5;
}
// constructor forwarding
{
static class C_6
{
this(int n) { assert(n == 42); }
this(string s) { assert(s == "Deeee"); }
this(...) {}
}
auto o1 = new BlackHole!C_6(42);
auto o2 = new BlackHole!C_6("Deeee");
auto o3 = new BlackHole!C_6(1, 2, 3, 4);
}
// attributes
{
interface I_7
{
ref int test_ref();
int test_pure() pure;
int test_nothrow() nothrow;
int test_property() @property;
int test_safe() @safe;
int test_trusted() @trusted;
int test_system() @system;
int test_pure_nothrow() pure nothrow;
}
auto o = new BlackHole!I_7;
}
// storage classes
{
interface I_8
{
void test_const() const;
void test_immutable() immutable;
void test_shared() shared;
void test_shared_const() shared const;
}
auto o = new BlackHole!I_8;
}
/+ // deep inheritance
{
// XXX [BUG 2525,3525]
// NOTE: [r494] func.c(504-571) FuncDeclaration::semantic()
interface I { void foo(); }
interface J : I {}
interface K : J {}
static abstract class C_9 : K {}
auto o = new BlackHole!C_9;
}+/
}
version(unittest)
{
// Issue 10647
private string generateDoNothing(C, alias fun)() @property
{
string stmt;
static if (is(ReturnType!fun == void))
stmt ~= "";
else
{
string returnType = ReturnType!fun.stringof;
stmt ~= "return "~returnType~".init;";
}
return stmt;
}
private template isAlwaysTrue(alias fun)
{
enum isAlwaysTrue = true;
}
// Do nothing template
private template DoNothing(Base)
{
alias DoNothing = AutoImplement!(Base, generateDoNothing, isAlwaysTrue);
}
// A class to be overridden
private class Foo{
void bar(int a) { }
}
}
unittest
{
auto foo = new DoNothing!Foo();
foo.bar(13);
}
/*
Used by MemberFunctionGenerator.
*/
package template OverloadSet(string nam, T...)
{
enum string name = nam;
alias T contents;
}
/*
Used by MemberFunctionGenerator.
*/
package template FuncInfo(alias func, /+[BUG 4217 ?]+/ T = typeof(&func))
{
alias ReturnType!(T) RT;
alias ParameterTypeTuple!(T) PT;
}
package template FuncInfo(Func)
{
alias ReturnType!(Func) RT;
alias ParameterTypeTuple!(Func) PT;
}
/*
General-purpose member function generator.
--------------------
template GeneratingPolicy()
{
// [optional] the name of the class where functions are derived
enum string BASE_CLASS_ID;
// [optional] define this if you have only function types
enum bool WITHOUT_SYMBOL;
// [optional] Returns preferred identifier for i-th parameter.
template PARAMETER_VARIABLE_ID(size_t i);
// Returns the identifier of the FuncInfo instance for the i-th overload
// of the specified name. The identifier must be accessible in the scope
// where generated code is mixed.
template FUNCINFO_ID(string name, size_t i);
// Returns implemented function body as a string. When WITHOUT_SYMBOL is
// defined, the latter is used.
template generateFunctionBody(alias func);
template generateFunctionBody(string name, FuncType);
}
--------------------
*/
package template MemberFunctionGenerator(alias Policy)
{
private static:
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Internal stuffs
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
enum CONSTRUCTOR_NAME = "__ctor";
// true if functions are derived from a base class
enum WITH_BASE_CLASS = __traits(hasMember, Policy, "BASE_CLASS_ID");
// true if functions are specified as types, not symbols
enum WITHOUT_SYMBOL = __traits(hasMember, Policy, "WITHOUT_SYMBOL");
// preferred identifier for i-th parameter variable
static if (__traits(hasMember, Policy, "PARAMETER_VARIABLE_ID"))
{
alias Policy.PARAMETER_VARIABLE_ID PARAMETER_VARIABLE_ID;
}
else
{
template PARAMETER_VARIABLE_ID(size_t i)
{
enum string PARAMETER_VARIABLE_ID = format("a%s", i);
// default: a0, a1, ...
}
}
// Returns a tuple consisting of 0,1,2,...,n-1. For static foreach.
template CountUp(size_t n)
{
static if (n > 0)
alias TypeTuple!(CountUp!(n - 1), n - 1) CountUp;
else
alias TypeTuple!() CountUp;
}
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Code generator
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/*
* Runs through all the target overload sets and generates D code which
* implements all the functions in the overload sets.
*/
public string generateCode(overloads...)() @property
{
string code = "";
// run through all the overload sets
foreach (i_; CountUp!(0 + overloads.length)) // workaround
{
enum i = 0 + i_; // workaround
alias overloads[i] oset;
code ~= generateCodeForOverloadSet!(oset);
static if (WITH_BASE_CLASS && oset.name != CONSTRUCTOR_NAME)
{
// The generated function declarations may hide existing ones
// in the base class (cf. HiddenFuncError), so we put an alias
// declaration here to reveal possible hidden functions.
code ~= format("alias %s.%s %s;\n",
Policy.BASE_CLASS_ID, // [BUG 2540] super.
oset.name, oset.name );
}
}
return code;
}
// handle each overload set
private string generateCodeForOverloadSet(alias oset)() @property
{
string code = "";
foreach (i_; CountUp!(0 + oset.contents.length)) // workaround
{
enum i = 0 + i_; // workaround
code ~= generateFunction!(
Policy.FUNCINFO_ID!(oset.name, i), oset.name,
oset.contents[i]) ~ "\n";
}
return code;
}
/*
* Returns D code which implements the function func. This function
* actually generates only the declarator part; the function body part is
* generated by the functionGenerator() policy.
*/
public string generateFunction(
string myFuncInfo, string name, func... )() @property
{
enum isCtor = (name == CONSTRUCTOR_NAME);
string code; // the result
/*** Function Declarator ***/
{
alias FunctionTypeOf!(func) Func;
alias FunctionAttribute FA;
enum atts = functionAttributes!(func);
enum realName = isCtor ? "this" : name;
// FIXME?? Make it so that these aren't CTFE funcs any more, since
// Format is deprecated, and format works at compile time?
/* Made them CTFE funcs just for the sake of Format!(...) */
// return type with optional "ref"
static string make_returnType()
{
string rtype = "";
if (!isCtor)
{
if (atts & FA.ref_) rtype ~= "ref ";
rtype ~= myFuncInfo ~ ".RT";
}
return rtype;
}
enum returnType = make_returnType();
// function attributes attached after declaration
static string make_postAtts()
{
string poatts = "";
if (atts & FA.pure_ ) poatts ~= " pure";
if (atts & FA.nothrow_) poatts ~= " nothrow";
if (atts & FA.property) poatts ~= " @property";
if (atts & FA.safe ) poatts ~= " @safe";
if (atts & FA.trusted ) poatts ~= " @trusted";
return poatts;
}
enum postAtts = make_postAtts();
// function storage class
static string make_storageClass()
{
string postc = "";
if (is(Func == shared)) postc ~= " shared";
if (is(Func == const)) postc ~= " const";
if (is(Func == immutable)) postc ~= " immutable";
return postc;
}
enum storageClass = make_storageClass();
//
if (__traits(isVirtualMethod, func))
code ~= "override ";
code ~= format("extern(%s) %s %s(%s) %s %s\n",
functionLinkage!(func),
returnType,
realName,
generateParameters!(myFuncInfo, func)(),
postAtts, storageClass );
}
/*** Function Body ***/
code ~= "{\n";
{
enum nparams = ParameterTypeTuple!(func).length;
/* Declare keywords: args, self and parent. */
string preamble;
preamble ~= "alias TypeTuple!(" ~ enumerateParameters!(nparams) ~ ") args;\n";
if (!isCtor)
{
preamble ~= "alias " ~ name ~ " self;\n";
if (WITH_BASE_CLASS && !__traits(isAbstractFunction, func))
//preamble ~= "alias super." ~ name ~ " parent;\n"; // [BUG 2540]
preamble ~= "auto parent = &super." ~ name ~ ";\n";
}
// Function body
static if (WITHOUT_SYMBOL)
enum fbody = Policy.generateFunctionBody!(name, func);
else
enum fbody = Policy.generateFunctionBody!(func);
code ~= preamble;
code ~= fbody;
}
code ~= "}";
return code;
}
/*
* Returns D code which declares function parameters.
* "ref int a0, real a1, ..."
*/
private string generateParameters(string myFuncInfo, func...)()
{
alias ParameterStorageClass STC;
alias ParameterStorageClassTuple!(func) stcs;
enum nparams = stcs.length;
string params = ""; // the result
foreach (i, stc; stcs)
{
if (i > 0) params ~= ", ";
// Parameter storage classes.
if (stc & STC.scope_) params ~= "scope ";
if (stc & STC.out_ ) params ~= "out ";
if (stc & STC.ref_ ) params ~= "ref ";
if (stc & STC.lazy_ ) params ~= "lazy ";
// Take parameter type from the FuncInfo.
params ~= format("%s.PT[%s]", myFuncInfo, i);
// Declare a parameter variable.
params ~= " " ~ PARAMETER_VARIABLE_ID!(i);
}
// Add some ellipsis part if needed.
final switch (variadicFunctionStyle!(func))
{
case Variadic.no:
break;
case Variadic.c, Variadic.d:
// (...) or (a, b, ...)
params ~= (nparams == 0) ? "..." : ", ...";
break;
case Variadic.typesafe:
params ~= " ...";
break;
}
return params;
}
// Returns D code which enumerates n parameter variables using comma as the
// separator. "a0, a1, a2, a3"
private string enumerateParameters(size_t n)() @property
{
string params = "";
foreach (i_; CountUp!(n))
{
enum i = 0 + i_; // workaround
if (i > 0) params ~= ", ";
params ~= PARAMETER_VARIABLE_ID!(i);
}
return params;
}
}
/**
Predefined how-policies for $(D AutoImplement). These templates are used by
$(D BlackHole) and $(D WhiteHole), respectively.
*/
template generateEmptyFunction(C, func.../+[BUG 4217]+/)
{
static if (is(ReturnType!(func) == void))
enum string generateEmptyFunction = q{
};
else static if (functionAttributes!(func) & FunctionAttribute.ref_)
enum string generateEmptyFunction = q{
static typeof(return) dummy;
return dummy;
};
else
enum string generateEmptyFunction = q{
return typeof(return).init;
};
}
/// ditto
template generateAssertTrap(C, func.../+[BUG 4217]+/)
{
static if (functionAttributes!(func) & FunctionAttribute.nothrow_) //XXX
{
pragma(msg, "Warning: WhiteHole!(", C, ") used assert(0) instead "
"of Error for the auto-implemented nothrow function ",
C, ".", __traits(identifier, func));
enum string generateAssertTrap =
`assert(0, "` ~ C.stringof ~ "." ~ __traits(identifier, func)
~ ` is not implemented");`;
}
else
enum string generateAssertTrap =
`throw new NotImplementedError("` ~ C.stringof ~ "."
~ __traits(identifier, func) ~ `");`;
}
private
{
pragma(mangle, "_d_toObject")
extern(C) pure nothrow Object typecons_d_toObject(void* p);
}
/*
* Avoids opCast operator overloading.
*/
private template dynamicCast(T)
if (is(T == class) || is(T == interface))
{
@trusted
T dynamicCast(S)(inout S source)
if (is(S == class) || is(S == interface))
{
static if (is(Unqual!S : Unqual!T))
{
import std.traits : QualifierOf;
alias Qual = QualifierOf!S; // SharedOf or MutableOf
alias TmpT = Qual!(Unqual!T);
inout(TmpT) tmp = source; // bypass opCast by implicit conversion
return *cast(T*)(&tmp); // + variable pointer cast + dereference
}
else
{
return cast(T)typecons_d_toObject(*cast(void**)(&source));
}
}
}
unittest
{
class C { @disable opCast(T)() {} }
auto c = new C;
static assert(!__traits(compiles, cast(Object)c));
auto o = dynamicCast!Object(c);
assert(c is o);
interface I { @disable opCast(T)() {} Object instance(); }
interface J { @disable opCast(T)() {} Object instance(); }
class D : I, J { Object instance() { return this; } }
I i = new D();
static assert(!__traits(compiles, cast(J)i));
J j = dynamicCast!J(i);
assert(i.instance() is j.instance());
}
/**
* Supports structural based typesafe conversion.
*
* If $(D Source) has structural conformance with the $(D interface) $(D Targets),
* wrap creates internal wrapper class which inherits $(D Targets) and
* wrap $(D src) object, then return it.
*/
template wrap(Targets...)
if (Targets.length >= 1 && allSatisfy!(isMutable, Targets))
{
// strict upcast
auto wrap(Source)(inout Source src) @trusted pure nothrow
if (Targets.length == 1 && is(Source : Targets[0]))
{
alias T = Select!(is(Source == shared), shared Targets[0], Targets[0]);
return dynamicCast!(inout T)(src);
}
// structural upcast
template wrap(Source)
if (!allSatisfy!(Bind!(isImplicitlyConvertible, Source), Targets))
{
auto wrap(inout Source src)
{
static assert(hasRequireMethods!(),
"Source "~Source.stringof~
" does not have structural conformance to "~
Targets.stringof);
alias T = Select!(is(Source == shared), shared Impl, Impl);
return new inout T(src);
}
template FuncInfo(string s, F)
{
enum name = s;
alias type = F;
}
// Concat all Targets function members into one tuple
template Concat(size_t i = 0)
{
static if (i >= Targets.length)
alias Concat = TypeTuple!();
else
{
alias Concat = TypeTuple!(GetOverloadedMethods!(Targets[i]), Concat!(i + 1));
}
}
// Remove duplicated functions based on the identifier name and function type covariance
template Uniq(members...)
{
static if (members.length == 0)
alias Uniq = TypeTuple!();
else
{
alias func = members[0];
enum name = __traits(identifier, func);
alias type = FunctionTypeOf!func;
template check(size_t i, mem...)
{
static if (i >= mem.length)
enum ptrdiff_t check = -1;
else
{
enum ptrdiff_t check =
__traits(identifier, func) == __traits(identifier, mem[i]) &&
!is(DerivedFunctionType!(type, FunctionTypeOf!(mem[i])) == void)
? i : check!(i + 1, mem);
}
}
enum ptrdiff_t x = 1 + check!(0, members[1 .. $]);
static if (x >= 1)
{
alias typex = DerivedFunctionType!(type, FunctionTypeOf!(members[x]));
alias remain = Uniq!(members[1 .. x], members[x + 1 .. $]);
static if (remain.length >= 1 && remain[0].name == name &&
!is(DerivedFunctionType!(typex, remain[0].type) == void))
{
alias F = DerivedFunctionType!(typex, remain[0].type);
alias Uniq = TypeTuple!(FuncInfo!(name, F), remain[1 .. $]);
}
else
alias Uniq = TypeTuple!(FuncInfo!(name, typex), remain);
}
else
{
alias Uniq = TypeTuple!(FuncInfo!(name, type), Uniq!(members[1 .. $]));
}
}
}
alias TargetMembers = Uniq!(Concat!()); // list of FuncInfo
alias SourceMembers = GetOverloadedMethods!Source; // list of function symbols
// Check whether all of SourceMembers satisfy covariance target in TargetMembers
template hasRequireMethods(size_t i = 0)
{
static if (i >= TargetMembers.length)
enum hasRequireMethods = true;
else
{
enum hasRequireMethods =
findCovariantFunction!(TargetMembers[i], Source, SourceMembers) != -1 &&
hasRequireMethods!(i + 1);
}
}
// Internal wrapper class
final class Impl : Structural, Targets
{
private:
Source _wrap_source;
this( inout Source s) inout @safe pure nothrow { _wrap_source = s; }
this(shared inout Source s) shared inout @safe pure nothrow { _wrap_source = s; }
// BUG: making private should work with NVI.
protected final inout(Object) _wrap_getSource() inout @trusted
{
return dynamicCast!(inout Object)(_wrap_source);
}
import std.conv : to;
import std.algorithm : forward;
template generateFun(size_t i)
{
enum name = TargetMembers[i].name;
enum fa = functionAttributes!(TargetMembers[i].type);
static @property stc()
{
string r;
if (fa & FunctionAttribute.property) r ~= "@property ";
if (fa & FunctionAttribute.ref_) r ~= "ref ";
if (fa & FunctionAttribute.pure_) r ~= "pure ";
if (fa & FunctionAttribute.nothrow_) r ~= "nothrow ";
if (fa & FunctionAttribute.trusted) r ~= "@trusted ";
if (fa & FunctionAttribute.safe) r ~= "@safe ";
return r;
}
static @property mod()
{
alias TypeTuple!(TargetMembers[i].type)[0] type;
string r;
static if (is(type == immutable)) r ~= " immutable";
else
{
static if (is(type == shared)) r ~= " shared";
static if (is(type == const)) r ~= " const";
else static if (is(type == inout)) r ~= " inout";
//else --> mutable
}
return r;
}
enum n = to!string(i);
static if (fa & FunctionAttribute.property)
{
static if (ParameterTypeTuple!(TargetMembers[i].type).length == 0)
enum fbody = "_wrap_source."~name;
else
enum fbody = "_wrap_source."~name~" = forward!args";
}
else
{
enum fbody = "_wrap_source."~name~"(forward!args)";
}
enum generateFun =
"override "~stc~"ReturnType!(TargetMembers["~n~"].type) "
~ name~"(ParameterTypeTuple!(TargetMembers["~n~"].type) args) "~mod~
"{ return "~fbody~"; }";
}
public:
mixin mixinAll!(
staticMap!(generateFun, staticIota!(0, TargetMembers.length)));
}
}
}
/// ditto
template wrap(Targets...)
if (Targets.length >= 1 && !allSatisfy!(isMutable, Targets))
{
alias wrap = .wrap!(staticMap!(Unqual, Targets));
}
// Internal class to support dynamic cross-casting
private interface Structural
{
inout(Object) _wrap_getSource() inout @safe pure nothrow;
}
/**
* Extract object which wrapped by $(D wrap).
*/
template unwrap(Target)
if (isMutable!Target)
{
// strict downcast
auto unwrap(Source)(inout Source src) @trusted pure nothrow
if (is(Target : Source))
{
alias T = Select!(is(Source == shared), shared Target, Target);
return dynamicCast!(inout T)(src);
}
// structural downcast
auto unwrap(Source)(inout Source src) @trusted pure nothrow
if (!is(Target : Source))
{
alias T = Select!(is(Source == shared), shared Target, Target);
Object o = dynamicCast!(Object)(src); // remove qualifier
do
{
if (auto a = dynamicCast!(Structural)(o))
{
if (auto d = dynamicCast!(inout T)(o = a._wrap_getSource()))
return d;
}
else if (auto d = dynamicCast!(inout T)(o))
return d;
else
break;
} while (o);
return null;
}
}
/// ditto
template unwrap(Target)
if (!isMutable!Target)
{
alias unwrap = .unwrap!(Unqual!Target);
}
///
unittest
{
interface Quack
{
int quack();
@property int height();
}
interface Flyer
{
@property int height();
}
class Duck : Quack
{
int quack() { return 1; }
@property int height() { return 10; }
}
class Human
{
int quack() { return 2; }
@property int height() { return 20; }
}
Duck d1 = new Duck();
Human h1 = new Human();
interface Refleshable
{
int reflesh();
}
// does not have structural conformance
static assert(!__traits(compiles, d1.wrap!Refleshable));
static assert(!__traits(compiles, h1.wrap!Refleshable));
// strict upcast
Quack qd = d1.wrap!Quack;
assert(qd is d1);
assert(qd.quack() == 1); // calls Duck.quack
// strict downcast
Duck d2 = qd.unwrap!Duck;
assert(d2 is d1);
// structural upcast
Quack qh = h1.wrap!Quack;
assert(qh.quack() == 2); // calls Human.quack
// structural downcast
Human h2 = qh.unwrap!Human;
assert(h2 is h1);
// structural upcast (two steps)
Quack qx = h1.wrap!Quack; // Human -> Quack
Flyer fx = qx.wrap!Flyer; // Quack -> Flyer
assert(fx.height == 20); // calls Human.height
// strucural downcast (two steps)
Quack qy = fx.unwrap!Quack; // Flyer -> Quack
Human hy = qy.unwrap!Human; // Quack -> Human
assert(hy is h1);
// strucural downcast (one step)
Human hz = fx.unwrap!Human; // Flyer -> Human
assert(hz is h1);
}
///
unittest
{
interface A { int run(); }
interface B { int stop(); @property int status(); }
class X
{
int run() { return 1; }
int stop() { return 2; }
@property int status() { return 3; }
}
auto x = new X();
auto ab = x.wrap!(A, B);
A a = ab;
B b = ab;
assert(a.run() == 1);
assert(b.stop() == 2);
assert(b.status == 3);
static assert(functionAttributes!(typeof(ab).status) & FunctionAttribute.property);
}
unittest
{
class A
{
int draw() { return 1; }
int draw(int v) { return v; }
int draw() const { return 2; }
int draw() shared { return 3; }
int draw() shared const { return 4; }
int draw() immutable { return 5; }
}
interface Drawable
{
int draw();
int draw() const;
int draw() shared;
int draw() shared const;
int draw() immutable;
}
interface Drawable2
{
int draw(int v);
}
auto ma = new A();
auto sa = new shared A();
auto ia = new immutable A();
{
Drawable md = ma.wrap!Drawable;
const Drawable cd = ma.wrap!Drawable;
shared Drawable sd = sa.wrap!Drawable;
shared const Drawable scd = sa.wrap!Drawable;
immutable Drawable id = ia.wrap!Drawable;
assert( md.draw() == 1);
assert( cd.draw() == 2);
assert( sd.draw() == 3);
assert(scd.draw() == 4);
assert( id.draw() == 5);
}
{
Drawable2 d = ma.wrap!Drawable2;
static assert(!__traits(compiles, d.draw()));
assert(d.draw(10) == 10);
}
}
unittest
{
// Bugzilla 10377
import std.range, std.algorithm;
interface MyInputRange(T)
{
@property T front();
void popFront();
@property bool empty();
}
//auto o = iota(0,10,1).inputRangeObject();
//pragma(msg, __traits(allMembers, typeof(o)));
auto r = iota(0,10,1).inputRangeObject().wrap!(MyInputRange!int)();
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
}
unittest
{
// Bugzilla 10536
interface Interface
{
int foo();
}
class Pluggable
{
int foo() { return 1; }
@disable void opCast(T, this X)(); // !
}
Interface i = new Pluggable().wrap!Interface;
assert(i.foo() == 1);
}
unittest
{
// Enhancement 10538
interface Interface
{
int foo();
int bar(int);
}
class Pluggable
{
int opDispatch(string name, A...)(A args) { return 100; }
}
Interface i = wrap!Interface(new Pluggable());
assert(i.foo() == 100);
assert(i.bar(10) == 100);
}
// Make a tuple of non-static function symbols
private template GetOverloadedMethods(T)
{
alias allMembers = TypeTuple!(__traits(allMembers, T));
template follows(size_t i = 0)
{
static if (i >= allMembers.length)
{
alias follows = TypeTuple!();
}
else static if (!__traits(compiles, mixin("T."~allMembers[i])))
{
alias follows = follows!(i + 1);
}
else
{
enum name = allMembers[i];
template isMethod(alias f)
{
static if (is(typeof(&f) F == F*) && is(F == function))
enum isMethod = !__traits(isStaticFunction, f);
else
enum isMethod = false;
}
alias follows = TypeTuple!(
std.typetuple.Filter!(isMethod, __traits(getOverloads, T, name)),
follows!(i + 1));
}
}
alias GetOverloadedMethods = follows!();
}
// find a function from Fs that has same identifier and covariant type with f
private template findCovariantFunction(alias finfo, Source, Fs...)
{
template check(size_t i = 0)
{
static if (i >= Fs.length)
enum ptrdiff_t check = -1;
else
{
enum ptrdiff_t check =
(finfo.name == __traits(identifier, Fs[i])) &&
isCovariantWith!(FunctionTypeOf!(Fs[i]), finfo.type)
? i : check!(i + 1);
}
}
enum x = check!();
static if (x == -1 && is(typeof(Source.opDispatch)))
{
alias Params = ParameterTypeTuple!(finfo.type);
enum ptrdiff_t findCovariantFunction =
is(typeof(( Source).init.opDispatch!(finfo.name)(Params.init))) ||
is(typeof(( const Source).init.opDispatch!(finfo.name)(Params.init))) ||
is(typeof(( immutable Source).init.opDispatch!(finfo.name)(Params.init))) ||
is(typeof(( shared Source).init.opDispatch!(finfo.name)(Params.init))) ||
is(typeof((shared const Source).init.opDispatch!(finfo.name)(Params.init)))
? ptrdiff_t.max : -1;
}
else
enum ptrdiff_t findCovariantFunction = x;
}
private enum TypeModifier
{
mutable = 0, // type is mutable
const_ = 1, // type is const
immutable_ = 2, // type is immutable
shared_ = 4, // type is shared
inout_ = 8, // type is wild
}
private template TypeMod(T)
{
static if (is(T == immutable))
{
enum mod1 = TypeModifier.immutable_;
enum mod2 = 0;
}
else
{
enum mod1 = is(T == shared) ? TypeModifier.shared_ : 0;
static if (is(T == const))
enum mod2 = TypeModifier.const_;
else static if (is(T == inout))
enum mod2 = TypeModifier.inout_;
else
enum mod2 = TypeModifier.mutable;
}
enum TypeMod = cast(TypeModifier)(mod1 | mod2);
}
version(unittest)
{
private template UnittestFuncInfo(alias f)
{
enum name = __traits(identifier, f);
alias type = FunctionTypeOf!f;
}
}
unittest
{
class A
{
int draw() { return 1; }
@property int value() { return 2; }
final int run() { return 3; }
}
alias methods = GetOverloadedMethods!A;
alias int F1();
alias @property int F2();
alias string F3();
alias nothrow @trusted uint F4();
alias int F5(Object);
alias bool F6(Object);
static assert(methods.length == 3 + 4);
static assert(__traits(identifier, methods[0]) == "draw" && is(typeof(&methods[0]) == F1*));
static assert(__traits(identifier, methods[1]) == "value" && is(typeof(&methods[1]) == F2*));
static assert(__traits(identifier, methods[2]) == "run" && is(typeof(&methods[2]) == F1*));
int draw() { return 0; }
@property int value() { return 0; }
void opEquals() {}
int nomatch() { return 0; }
static assert(findCovariantFunction!(UnittestFuncInfo!draw, A, methods) == 0);
static assert(findCovariantFunction!(UnittestFuncInfo!value, A, methods) == 1);
static assert(findCovariantFunction!(UnittestFuncInfo!opEquals, A, methods) == -1);
static assert(findCovariantFunction!(UnittestFuncInfo!nomatch, A, methods) == -1);
// considering opDispatch
class B
{
void opDispatch(string name, A...)(A) {}
}
alias methodsB = GetOverloadedMethods!B;
static assert(findCovariantFunction!(UnittestFuncInfo!draw, B, methodsB) == ptrdiff_t.max);
static assert(findCovariantFunction!(UnittestFuncInfo!value, B, methodsB) == ptrdiff_t.max);
static assert(findCovariantFunction!(UnittestFuncInfo!opEquals, B, methodsB) == ptrdiff_t.max);
static assert(findCovariantFunction!(UnittestFuncInfo!nomatch, B, methodsB) == ptrdiff_t.max);
}
private template DerivedFunctionType(T...)
{
static if (!T.length)
{
alias DerivedFunctionType = void;
}
else static if (T.length == 1)
{
static if (is(T[0] == function))
{
alias DerivedFunctionType = T[0];
}
else
{
alias DerivedFunctionType = void;
}
}
else static if (is(T[0] P0 == function) && is(T[1] P1 == function))
{
alias FA = FunctionAttribute;
alias F0 = T[0], R0 = ReturnType!F0, PSTC0 = ParameterStorageClassTuple!F0;
alias F1 = T[1], R1 = ReturnType!F1, PSTC1 = ParameterStorageClassTuple!F1;
enum FA0 = functionAttributes!F0;
enum FA1 = functionAttributes!F1;
template CheckParams(size_t i = 0)
{
static if (i >= P0.length)
enum CheckParams = true;
else
{
enum CheckParams = (is(P0[i] == P1[i]) && PSTC0[i] == PSTC1[i]) &&
CheckParams!(i + 1);
}
}
static if (R0.sizeof == R1.sizeof && !is(CommonType!(R0, R1) == void) &&
P0.length == P1.length && CheckParams!() && TypeMod!F0 == TypeMod!F1 &&
variadicFunctionStyle!F0 == variadicFunctionStyle!F1 &&
functionLinkage!F0 == functionLinkage!F1 &&
((FA0 ^ FA1) & (FA.ref_ | FA.property)) == 0)
{
alias R = Select!(is(R0 : R1), R0, R1);
alias FX = FunctionTypeOf!(R function(P0));
alias FY = SetFunctionAttributes!(FX, functionLinkage!F0, FA0 | FA1);
alias DerivedFunctionType = DerivedFunctionType!(FY, T[2 .. $]);
}
else
alias DerivedFunctionType = void;
}
else
alias DerivedFunctionType = void;
}
unittest
{
// attribute covariance
alias int F1();
static assert(is(DerivedFunctionType!(F1, F1) == F1));
alias int F2() pure nothrow;
static assert(is(DerivedFunctionType!(F1, F2) == F2));
alias int F3() @safe;
alias int F23() pure nothrow @safe;
static assert(is(DerivedFunctionType!(F2, F3) == F23));
// return type covariance
alias long F4();
static assert(is(DerivedFunctionType!(F1, F4) == void));
class C {}
class D : C {}
alias C F5();
alias D F6();
static assert(is(DerivedFunctionType!(F5, F6) == F6));
alias typeof(null) F7();
alias int[] F8();
alias int* F9();
static assert(is(DerivedFunctionType!(F5, F7) == F7));
static assert(is(DerivedFunctionType!(F7, F8) == void));
static assert(is(DerivedFunctionType!(F7, F9) == F7));
// variadic type equality
alias int F10(int);
alias int F11(int...);
alias int F12(int, ...);
static assert(is(DerivedFunctionType!(F10, F11) == void));
static assert(is(DerivedFunctionType!(F10, F12) == void));
static assert(is(DerivedFunctionType!(F11, F12) == void));
// linkage equality
alias extern(C) int F13(int);
alias extern(D) int F14(int);
alias extern(Windows) int F15(int);
static assert(is(DerivedFunctionType!(F13, F14) == void));
static assert(is(DerivedFunctionType!(F13, F15) == void));
static assert(is(DerivedFunctionType!(F14, F15) == void));
// ref & @property equality
alias int F16(int);
alias ref int F17(int);
alias @property int F18(int);
static assert(is(DerivedFunctionType!(F16, F17) == void));
static assert(is(DerivedFunctionType!(F16, F18) == void));
static assert(is(DerivedFunctionType!(F17, F18) == void));
}
private template staticIota(int beg, int end, int step = 1) if (step != 0)
{
static if (beg + 1 >= end)
{
static if (beg >= end)
{
alias TypeTuple!() staticIota;
}
else
{
alias TypeTuple!(+beg) staticIota;
}
}
else
{
enum mid = beg + (end - beg) / 2;
alias staticIota = TypeTuple!(staticIota!(beg, mid), staticIota!(mid, end));
}
}
private template mixinAll(mixins...)
{
static if (mixins.length == 1)
{
static if (is(typeof(mixins[0]) == string))
{
mixin(mixins[0]);
}
else
{
alias mixins[0] it;
mixin it;
}
}
else static if (mixins.length >= 2)
{
mixin mixinAll!(mixins[ 0 .. $/2]);
mixin mixinAll!(mixins[$/2 .. $ ]);
}
}
private template Bind(alias Template, args1...)
{
template Bind(args2...)
{
alias Bind = Template!(args1, args2);
}
}
/**
Options regarding auto-initialization of a $(D RefCounted) object (see
the definition of $(D RefCounted) below).
*/
enum RefCountedAutoInitialize
{
/// Do not auto-initialize the object
no,
/// Auto-initialize the object
yes,
}
/**
Defines a reference-counted object containing a $(D T) value as
payload. $(D RefCounted) keeps track of all references of an object,
and when the reference count goes down to zero, frees the underlying
store. $(D RefCounted) uses $(D malloc) and $(D free) for operation.
$(D RefCounted) is unsafe and should be used with care. No references
to the payload should be escaped outside the $(D RefCounted) object.
The $(D autoInit) option makes the object ensure the store is
automatically initialized. Leaving $(D autoInit ==
RefCountedAutoInitialize.yes) (the default option) is convenient but
has the cost of a test whenever the payload is accessed. If $(D
autoInit == RefCountedAutoInitialize.no), user code must call either
$(D refCountedStore.isInitialized) or $(D refCountedStore.ensureInitialized)
before attempting to access the payload. Not doing so results in null
pointer dereference.
Example:
----
// A pair of an $(D int) and a $(D size_t) - the latter being the
// reference count - will be dynamically allocated
auto rc1 = RefCounted!int(5);
assert(rc1 == 5);
// No more allocation, add just one extra reference count
auto rc2 = rc1;
// Reference semantics
rc2 = 42;
assert(rc1 == 42);
// the pair will be freed when rc1 and rc2 go out of scope
----
*/
struct RefCounted(T, RefCountedAutoInitialize autoInit =
RefCountedAutoInitialize.yes)
if (!is(T == class))
{
/// $(D RefCounted) storage implementation.
struct RefCountedStore
{
private struct Impl
{
T _payload;
size_t _count;
}
private Impl* _store;
private void initialize(A...)(auto ref A args)
{
_store = cast(Impl*) enforce(malloc(Impl.sizeof));
static if (hasIndirections!T)
GC.addRange(&_store._payload, T.sizeof);
emplace(&_store._payload, args);
_store._count = 1;
}
/**
Returns $(D true) if and only if the underlying store has been
allocated and initialized.
*/
@property nothrow @safe
bool isInitialized() const
{
return _store !is null;
}
/**
Returns underlying reference count if it is allocated and initialized
(a positive integer), and $(D 0) otherwise.
*/
@property nothrow @safe
size_t refCount() const
{
return isInitialized ? _store._count : 0;
}
/**
Makes sure the payload was properly initialized. Such a
call is typically inserted before using the payload.
*/
void ensureInitialized()
{
if (!isInitialized) initialize();
}
}
RefCountedStore _refCounted;
/// Returns storage implementation struct.
@property nothrow @safe
ref inout(RefCountedStore) refCountedStore() inout
{
return _refCounted;
}
/**
Constructor that initializes the payload.
Postcondition: $(D refCountedStore.isInitialized)
*/
this(A...)(auto ref A args) if (A.length > 0)
{
_refCounted.initialize(args);
}
/**
Constructor that tracks the reference count appropriately. If $(D
!refCountedStore.isInitialized), does nothing.
*/
this(this)
{
if (!_refCounted.isInitialized) return;
++_refCounted._store._count;
}
/**
Destructor that tracks the reference count appropriately. If $(D
!refCountedStore.isInitialized), does nothing. When the reference count goes
down to zero, calls $(D destroy) agaist the payload and calls $(D free)
to deallocate the corresponding resource.
*/
~this()
{
if (!_refCounted.isInitialized) return;
assert(_refCounted._store._count > 0);
if (--_refCounted._store._count)
return;
// Done, deallocate
.destroy(_refCounted._store._payload);
static if (hasIndirections!T)
GC.removeRange(&_refCounted._store._payload);
free(_refCounted._store);
_refCounted._store = null;
}
/**
Assignment operators
*/
void opAssign(typeof(this) rhs)
{
swap(_refCounted._store, rhs._refCounted._store);
}
/// Ditto
void opAssign(T rhs)
{
static if (autoInit == RefCountedAutoInitialize.yes)
{
_refCounted.ensureInitialized();
}
else
{
assert(_refCounted.isInitialized);
}
move(rhs, _refCounted._store._payload);
}
//version to have a single properly ddoc'ed function (w/ correct sig)
version(StdDdoc)
{
/**
Returns a reference to the payload. If (autoInit ==
RefCountedAutoInitialize.yes), calls $(D
refCountedStore.ensureInitialized). Otherwise, just issues $(D
assert(refCountedStore.isInitialized)). Used with $(D alias
refCountedPayload this;), so callers can just use the $(D RefCounted)
object as a $(D T).
$(BLUE The first overload exists only if $(D autoInit == RefCountedAutoInitialize.yes).)
So if $(D autoInit == RefCountedAutoInitialize.no)
or called for a constant or immutable object, then
$(D refCountedPayload) will also be qualified as safe and nothrow
(but will still assert if not initialized).
*/
@property
ref T refCountedPayload();
/// ditto
@property nothrow @safe
ref inout(T) refCountedPayload() inout;
}
else
{
static if (autoInit == RefCountedAutoInitialize.yes)
{
//Can't use inout here because of potential mutation
@property
ref T refCountedPayload()
{
_refCounted.ensureInitialized();
return _refCounted._store._payload;
}
}
@property nothrow @safe
ref inout(T) refCountedPayload() inout
{
assert(_refCounted.isInitialized, "Attempted to access an uninitialized payload.");
return _refCounted._store._payload;
}
}
/**
Returns a reference to the payload. If (autoInit ==
RefCountedAutoInitialize.yes), calls $(D
refCountedStore.ensureInitialized). Otherwise, just issues $(D
assert(refCountedStore.isInitialized)).
*/
alias refCountedPayload this;
}
unittest
{
RefCounted!int* p;
{
auto rc1 = RefCounted!int(5);
p = &rc1;
assert(rc1 == 5);
assert(rc1._refCounted._store._count == 1);
auto rc2 = rc1;
assert(rc1._refCounted._store._count == 2);
// Reference semantics
rc2 = 42;
assert(rc1 == 42);
rc2 = rc2;
assert(rc2._refCounted._store._count == 2);
rc1 = rc2;
assert(rc1._refCounted._store._count == 2);
}
assert(p._refCounted._store == null);
// RefCounted as a member
struct A
{
RefCounted!int x;
this(int y)
{
x._refCounted.initialize(y);
}
A copy()
{
auto another = this;
return another;
}
}
auto a = A(4);
auto b = a.copy();
assert(a.x._refCounted._store._count == 2, "BUG 4356 still unfixed");
}
unittest
{
RefCounted!int p1, p2;
swap(p1, p2);
}
// 6606
unittest
{
union U {
size_t i;
void* p;
}
struct S {
U u;
}
alias RefCounted!S SRC;
}
// 6436
unittest
{
struct S { this(ref int val) { assert(val == 3); ++val; } }
int val = 3;
auto s = RefCounted!S(val);
assert(val == 4);
}
unittest
{
RefCounted!int a;
a = 5; //This should not assert
assert(a == 5);
RefCounted!int b;
b = a; //This should not assert either
assert(b == 5);
}
/**
Make proxy for $(D a).
Example:
----
struct MyInt
{
private int value;
mixin Proxy!value;
this(int n){ value = n; }
}
MyInt n = 10;
// Enable operations that original type has.
++n;
assert(n == 11);
assert(n * 2 == 22);
void func(int n) { }
// Disable implicit conversions to original type.
//int x = n;
//func(n);
----
*/
mixin template Proxy(alias a)
{
auto ref opEquals(this X, B)(auto ref B b)
{
static if (is(immutable B == immutable typeof(this)))
{
import std.algorithm;
static assert(startsWith(a.stringof, "this."));
return a == mixin("b."~a.stringof[5..$]); // remove "this."
}
else
return a == b;
}
auto ref opCmp(this X, B)(auto ref B b)
if (!is(typeof(a.opCmp(b))) || !is(typeof(b.opCmp(a))))
{
static if (is(typeof(a.opCmp(b))))
return a.opCmp(b);
else static if (is(typeof(b.opCmp(a))))
return -b.opCmp(a);
else
return a < b ? -1 : a > b ? +1 : 0;
}
auto ref opCall(this X, Args...)(auto ref Args args) { return a(args); }
auto ref opCast(T, this X)() { return cast(T)a; }
auto ref opIndex(this X, D...)(auto ref D i) { return a[i]; }
auto ref opSlice(this X )() { return a[]; }
auto ref opSlice(this X, B, E)(auto ref B b, auto ref E e) { return a[b..e]; }
auto ref opUnary (string op, this X )() { return mixin(op~"a"); }
auto ref opIndexUnary(string op, this X, D...)(auto ref D i) { return mixin(op~"a[i]"); }
auto ref opSliceUnary(string op, this X )() { return mixin(op~"a[]"); }
auto ref opSliceUnary(string op, this X, B, E)(auto ref B b, auto ref E e) { return mixin(op~"a[b..e]"); }
auto ref opBinary(string op, this X, B)(auto ref B b)
if (op == "in" && is(typeof(a in b)) || op != "in")
{
return mixin("a "~op~" b");
}
auto ref opBinaryRight(string op, this X, B)(auto ref B b) { return mixin("b "~op~" a"); }
static if (!is(typeof(this) == class))
{
private import std.traits;
static if (isAssignable!(typeof(a)))
{
auto ref opAssign(this X)(auto ref typeof(this) v)
{
a = mixin("v."~a.stringof[5..$]); // remove "this."
return this;
}
}
else
{
@disable void opAssign(this X)(auto ref typeof(this) v);
}
}
auto ref opAssign (this X, V )(auto ref V v) if (!is(V == typeof(this))) { return a = v; }
auto ref opIndexAssign(this X, V, D...)(auto ref V v, auto ref D i) { return a[i] = v; }
auto ref opSliceAssign(this X, V )(auto ref V v) { return a[] = v; }
auto ref opSliceAssign(this X, V, B, E)(auto ref V v, auto ref B b, auto ref E e) { return a[b..e] = v; }
auto ref opOpAssign (string op, this X, V )(auto ref V v) { return mixin("a " ~op~"= v"); }
auto ref opIndexOpAssign(string op, this X, V, D...)(auto ref V v, auto ref D i) { return mixin("a[i] " ~op~"= v"); }
auto ref opSliceOpAssign(string op, this X, V )(auto ref V v) { return mixin("a[] " ~op~"= v"); }
auto ref opSliceOpAssign(string op, this X, V, B, E)(auto ref V v, auto ref B b, auto ref E e) { return mixin("a[b..e] "~op~"= v"); }
template opDispatch(string name)
{
static if (is(typeof(__traits(getMember, a, name)) == function))
{
// non template function
auto ref opDispatch(this X, Args...)(auto ref Args args) { return mixin("a."~name~"(args)"); }
}
else static if (is(typeof({ enum x = mixin("a."~name); })))
{
// built-in type field, manifest constant, and static non-mutable field
enum opDispatch = mixin("a."~name);
}
else static if (is(typeof(mixin("a."~name))) || __traits(getOverloads, a, name).length != 0)
{
// field or property function
@property auto ref opDispatch(this X)() { return mixin("a."~name); }
@property auto ref opDispatch(this X, V)(auto ref V v) { return mixin("a."~name~" = v"); }
}
else
{
// member template
template opDispatch(T...)
{
auto ref opDispatch(this X, Args...)(auto ref Args args){ return mixin("a."~name~"!T(args)"); }
}
}
}
}
unittest
{
static struct MyInt
{
private int value;
mixin Proxy!value;
this(int n) inout { value = n; }
enum str = "str";
static immutable arr = [1,2,3];
}
foreach (T; TypeTuple!(MyInt, const MyInt, immutable MyInt))
{
T m = 10;
static assert(!__traits(compiles, { int x = m; }));
static assert(!__traits(compiles, { void func(int n){} func(m); }));
assert(m == 10);
assert(m != 20);
assert(m < 20);
assert(+m == 10);
assert(-m == -10);
assert(cast(double)m == 10.0);
assert(m + 10 == 20);
assert(m - 5 == 5);
assert(m * 20 == 200);
assert(m / 2 == 5);
assert(10 + m == 20);
assert(15 - m == 5);
assert(20 * m == 200);
assert(50 / m == 5);
static if (is(T == MyInt)) // mutable
{
assert(++m == 11);
assert(m++ == 11); assert(m == 12);
assert(--m == 11);
assert(m-- == 11); assert(m == 10);
m = m;
m = 20; assert(m == 20);
}
static assert(T.max == int.max);
static assert(T.min == int.min);
static assert(T.init == int.init);
static assert(T.str == "str");
static assert(T.arr == [1,2,3]);
}
}
unittest
{
static struct MyArray
{
private int[] value;
mixin Proxy!value;
this(int[] arr) { value = arr; }
this(immutable int[] arr) immutable { value = arr; }
}
foreach (T; TypeTuple!(MyArray, const MyArray, immutable MyArray))
{
static if (is(T == immutable) && !is(typeof({ T a = [1,2,3,4]; })))
T a = [1,2,3,4].idup; // workaround until qualified ctor is properly supported
else
T a = [1,2,3,4];
assert(a == [1,2,3,4]);
assert(a != [5,6,7,8]);
assert(+a[0] == 1);
version (LittleEndian)
assert(cast(ulong[])a == [0x0000_0002_0000_0001, 0x0000_0004_0000_0003]);
else
assert(cast(ulong[])a == [0x0000_0001_0000_0002, 0x0000_0003_0000_0004]);
assert(a ~ [10,11] == [1,2,3,4,10,11]);
assert(a[0] == 1);
assert(a[] == [1,2,3,4]);
assert(a[2..4] == [3,4]);
static if (is(T == MyArray)) // mutable
{
a = a;
a = [5,6,7,8]; assert(a == [5,6,7,8]);
a[0] = 0; assert(a == [0,6,7,8]);
a[] = 1; assert(a == [1,1,1,1]);
a[0..3] = 2; assert(a == [2,2,2,1]);
a[0] += 2; assert(a == [4,2,2,1]);
a[] *= 2; assert(a == [8,4,4,2]);
a[0..2] /= 2; assert(a == [4,2,4,2]);
}
}
}
unittest
{
class Foo
{
int field;
@property const int val1(){ return field; }
@property void val1(int n){ field = n; }
@property ref int val2(){ return field; }
const int func(int x, int y){ return x; }
void func1(ref int a){ a = 9; }
T opCast(T)(){ return T.init; }
T tempfunc(T)() { return T.init; }
}
class Hoge
{
Foo foo;
mixin Proxy!foo;
this(Foo f) { foo = f; }
}
auto h = new Hoge(new Foo());
int n;
static assert(!__traits(compiles, { Foo f = h; }));
// field
h.field = 1; // lhs of assign
n = h.field; // rhs of assign
assert(h.field == 1); // lhs of BinExp
assert(1 == h.field); // rhs of BinExp
assert(n == 1);
// getter/setter property function
h.val1 = 4;
n = h.val1;
assert(h.val1 == 4);
assert(4 == h.val1);
assert(n == 4);
// ref getter property function
h.val2 = 8;
n = h.val2;
assert(h.val2 == 8);
assert(8 == h.val2);
assert(n == 8);
// member function
assert(h.func(2,4) == 2);
h.func1(n);
assert(n == 9);
// bug5896 test
assert(h.opCast!int() == 0);
assert(cast(int)h == 0);
const ih = new const Hoge(new Foo());
static assert(!__traits(compiles, ih.opCast!int()));
static assert(!__traits(compiles, cast(int)ih));
// template member function
assert(h.tempfunc!int() == 0);
}
unittest
{
struct MyInt
{
int payload;
mixin Proxy!payload;
}
MyInt v;
v = v;
struct Foo
{
@disable void opAssign(typeof(this));
}
struct MyFoo
{
Foo payload;
mixin Proxy!payload;
}
MyFoo f;
static assert(!__traits(compiles, f = f));
struct MyFoo2
{
Foo payload;
mixin Proxy!payload;
// override default Proxy behavior
void opAssign(typeof(this) rhs){}
}
MyFoo2 f2;
f2 = f2;
}
unittest
{
// bug8613
static struct Name
{
mixin Proxy!val;
private string val;
this(string s) { val = s; }
}
bool[Name] names;
names[Name("a")] = true;
bool* b = Name("a") in names;
}
/**
Library typedef.
*/
template Typedef(T)
{
alias .Typedef!(T, T.init) Typedef;
}
/// ditto
struct Typedef(T, T init, string cookie=null)
{
private T Typedef_payload = init;
this(T init)
{
Typedef_payload = init;
}
mixin Proxy!Typedef_payload;
}
unittest
{
Typedef!int x = 10;
static assert(!__traits(compiles, { int y = x; }));
static assert(!__traits(compiles, { long z = x; }));
Typedef!int y = 10;
assert(x == y);
static assert(Typedef!int.init == int.init);
Typedef!(float, 1.0) z; // specifies the init
assert(z == 1.0);
static assert(typeof(z).init == 1.0);
alias Typedef!(int, 0, "dollar") Dollar;
alias Typedef!(int, 0, "yen") Yen;
static assert(!is(Dollar == Yen));
Typedef!(int[3]) sa;
static assert(sa.length == 3);
static assert(typeof(sa).length == 3);
}
unittest
{
// bug8655
import std.typecons;
import std.bitmanip;
static import core.stdc.config;
alias Typedef!(core.stdc.config.c_ulong) c_ulong;
static struct Foo
{
mixin(bitfields!(
c_ulong, "NameOffset", 31,
c_ulong, "NameIsString", 1
));
}
}
/**
Allocates a $(D class) object right inside the current scope,
therefore avoiding the overhead of $(D new). This facility is unsafe;
it is the responsibility of the user to not escape a reference to the
object outside the scope.
Note: it's illegal to move a class reference even if you are sure there
are no pointers to it. As such, it is illegal to move a scoped object.
*/
template scoped(T)
if (is(T == class))
{
// _d_newclass now use default GC alignment (looks like (void*).sizeof * 2 for
// small objects). We will just use the maximum of filed alignments.
alias classInstanceAlignment!T alignment;
alias _alignUp!alignment aligned;
static struct Scoped
{
// Addition of `alignment` is required as `Scoped_store` can be misaligned in memory.
private void[aligned(__traits(classInstanceSize, T) + size_t.sizeof) + alignment] Scoped_store = void;
@property inout(T) Scoped_payload() inout
{
void* alignedStore = cast(void*) aligned(cast(size_t) Scoped_store.ptr);
// As `Scoped` can be unaligned moved in memory class instance should be moved accordingly.
immutable size_t d = alignedStore - Scoped_store.ptr;
size_t* currD = cast(size_t*) &Scoped_store[$ - size_t.sizeof];
if(d != *currD)
{
import core.stdc.string;
memmove(alignedStore, Scoped_store.ptr + *currD, __traits(classInstanceSize, T));
*currD = d;
}
return cast(inout(T)) alignedStore;
}
alias Scoped_payload this;
@disable this();
@disable this(this);
~this()
{
// `destroy` will also write .init but we have no functions in druntime
// for deterministic finalization and memory releasing for now.
.destroy(Scoped_payload);
}
}
/// Returns the scoped object
@system auto scoped(Args...)(auto ref Args args)
{
Scoped result = void;
void* alignedStore = cast(void*) aligned(cast(size_t) result.Scoped_store.ptr);
immutable size_t d = alignedStore - result.Scoped_store.ptr;
*cast(size_t*) &result.Scoped_store[$ - size_t.sizeof] = d;
emplace!(Unqual!T)(result.Scoped_store[d .. $ - size_t.sizeof], args);
return result;
}
}
///
unittest
{
class A
{
int x;
this() {x = 0;}
this(int i){x = i;}
}
// Standard usage
auto a1 = scoped!A();
auto a2 = scoped!A(1);
a1.x = 42;
assert(a1.x == 42);
assert(a2.x == 1);
// Restrictions
static assert(!is(typeof({
auto e1 = a1; // illegal, scoped objects can't be copied
assert([a2][0].x == 42); // ditto
alias ScopedObject = typeof(a1);
auto e2 = ScopedObject(); //Illegal, must be built via scoped!A
auto e3 = ScopedObject(1); //Illegal, must be built via scoped!A
})));
// Use with alias
alias makeScopedA = scoped!A;
auto a6 = makeScopedA();
auto a7 = makeScopedA();
}
private size_t _alignUp(size_t alignment)(size_t n)
if(alignment > 0 && !((alignment - 1) & alignment))
{
enum badEnd = alignment - 1; // 0b11, 0b111, ...
return (n + badEnd) & ~badEnd;
}
unittest // Issue 6580 testcase
{
enum alignment = (void*).alignof;
static class C0 { }
static class C1 { byte b; }
static class C2 { byte[2] b; }
static class C3 { byte[3] b; }
static class C7 { byte[7] b; }
static assert(scoped!C0().sizeof % alignment == 0);
static assert(scoped!C1().sizeof % alignment == 0);
static assert(scoped!C2().sizeof % alignment == 0);
static assert(scoped!C3().sizeof % alignment == 0);
static assert(scoped!C7().sizeof % alignment == 0);
enum longAlignment = long.alignof;
static class C1long
{
long long_; byte byte_ = 4;
this() { }
this(long _long, ref int i) { long_ = _long; ++i; }
}
static class C2long { byte[2] byte_ = [5, 6]; long long_ = 7; }
static assert(scoped!C1long().sizeof % longAlignment == 0);
static assert(scoped!C2long().sizeof % longAlignment == 0);
void alignmentTest()
{
int var = 5;
auto c1long = scoped!C1long(3, var);
assert(var == 6);
auto c2long = scoped!C2long();
assert(cast(size_t)&c1long.long_ % longAlignment == 0);
assert(cast(size_t)&c2long.long_ % longAlignment == 0);
assert(c1long.long_ == 3 && c1long.byte_ == 4);
assert(c2long.byte_ == [5, 6] && c2long.long_ == 7);
}
alignmentTest();
version(DigitalMars)
{
void test(size_t size)
{
import core.stdc.stdlib;
alloca(size);
alignmentTest();
}
foreach(i; 0 .. 10)
test(i);
}
else
{
void test(size_t size)()
{
byte[size] arr;
alignmentTest();
}
foreach(i; TypeTuple!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
test!i();
}
}
unittest // Original Issue 6580 testcase
{
class C { int i; byte b; }
auto sa = [scoped!C(), scoped!C()];
assert(cast(size_t)&sa[0].i % int.alignof == 0);
assert(cast(size_t)&sa[1].i % int.alignof == 0); // fails
}
unittest
{
class A { int x = 1; }
auto a1 = scoped!A();
assert(a1.x == 1);
auto a2 = scoped!A();
a1.x = 42;
a2.x = 53;
assert(a1.x == 42);
}
unittest
{
class A { int x = 1; this() { x = 2; } }
auto a1 = scoped!A();
assert(a1.x == 2);
auto a2 = scoped!A();
a1.x = 42;
a2.x = 53;
assert(a1.x == 42);
}
unittest
{
class A { int x = 1; this(int y) { x = y; } ~this() {} }
auto a1 = scoped!A(5);
assert(a1.x == 5);
auto a2 = scoped!A(42);
a1.x = 42;
a2.x = 53;
assert(a1.x == 42);
}
unittest
{
class A { static bool dead; ~this() { dead = true; } }
class B : A { static bool dead; ~this() { dead = true; } }
{
auto b = scoped!B();
}
assert(B.dead, "asdasd");
assert(A.dead, "asdasd");
}
unittest // Issue 8039 testcase
{
static int dels;
static struct S { ~this(){ ++dels; } }
static class A { S s; }
dels = 0; { scoped!A(); }
assert(dels == 1);
static class B { S[2] s; }
dels = 0; { scoped!B(); }
assert(dels == 2);
static struct S2 { S[3] s; }
static class C { S2[2] s; }
dels = 0; { scoped!C(); }
assert(dels == 6);
static class D: A { S2[2] s; }
dels = 0; { scoped!D(); }
assert(dels == 1+6);
}
//GDC bug 52
/+
unittest
{
// bug4500
class A
{
this() { a = this; }
this(int i) { a = this; }
A a;
bool check() { return this is a; }
}
auto a1 = scoped!A();
assert(a1.check());
auto a2 = scoped!A(1);
assert(a2.check());
a1.a = a1;
assert(a1.check());
}
+/
unittest
{
static class A
{
static int sdtor;
this() { ++sdtor; assert(sdtor == 1); }
~this() { assert(sdtor == 1); --sdtor; }
}
interface Bob {}
static class ABob : A, Bob
{
this() { ++sdtor; assert(sdtor == 2); }
~this() { assert(sdtor == 2); --sdtor; }
}
A.sdtor = 0;
scope(exit) assert(A.sdtor == 0);
auto abob = scoped!ABob();
}
unittest
{
static class A { this(int) {} }
static assert(!__traits(compiles, scoped!A()));
}
unittest
{
static class A { @property inout(int) foo() inout { return 1; } }
auto a1 = scoped!A();
assert(a1.foo == 1);
static assert(is(typeof(a1.foo) == int));
auto a2 = scoped!(const(A))();
assert(a2.foo == 1);
static assert(is(typeof(a2.foo) == const(int)));
auto a3 = scoped!(immutable(A))();
assert(a3.foo == 1);
static assert(is(typeof(a3.foo) == immutable(int)));
const c1 = scoped!A();
assert(c1.foo == 1);
static assert(is(typeof(c1.foo) == const(int)));
const c2 = scoped!(const(A))();
assert(c2.foo == 1);
static assert(is(typeof(c2.foo) == const(int)));
const c3 = scoped!(immutable(A))();
assert(c3.foo == 1);
static assert(is(typeof(c3.foo) == immutable(int)));
}
unittest
{
class C { this(ref int val) { assert(val == 3); ++val; } }
int val = 3;
auto s = scoped!C(val);
assert(val == 4);
}
unittest
{
class C
{
this(){}
this(int){}
this(int, int){}
}
alias makeScopedC = scoped!C;
auto a = makeScopedC();
auto b = makeScopedC(1);
auto c = makeScopedC(1, 1);
static assert(is(typeof(a) == typeof(b)));
static assert(is(typeof(b) == typeof(c)));
}
/**
Defines a simple, self-documenting yes/no flag. This makes it easy for
APIs to define functions accepting flags without resorting to $(D
bool), which is opaque in calls, and without needing to define an
enumerated type separately. Using $(D Flag!"Name") instead of $(D
bool) makes the flag's meaning visible in calls. Each yes/no flag has
its own type, which makes confusions and mix-ups impossible.
Example:
----
// Before
string getLine(bool keepTerminator)
{
...
if (keepTerminator) ...
...
}
...
// Code calling getLine (usually far away from its definition) can't
// be understood without looking at the documentation, even by users
// familiar with the API. Assuming the reverse meaning
// (i.e. "ignoreTerminator") and inserting the wrong code compiles and
// runs with erroneous results.
auto line = getLine(false);
// After
string getLine(Flag!"KeepTerminator" keepTerminator)
{
...
if (keepTerminator) ...
...
}
...
// Code calling getLine can be easily read and understood even by
// people not fluent with the API.
auto line = getLine(Flag!"KeepTerminator".yes);
----
Passing categorical data by means of unstructured $(D bool)
parameters is classified under "simple-data coupling" by Steve
McConnell in the $(LUCKY Code Complete) book, along with three other
kinds of coupling. The author argues citing several studies that
coupling has a negative effect on code quality. $(D Flag) offers a
simple structuring method for passing yes/no flags to APIs.
As a perk, the flag's name may be any string and as such can include
characters not normally allowed in identifiers, such as
spaces and dashes.
*/
template Flag(string name) {
///
enum Flag : bool
{
/**
When creating a value of type $(D Flag!"Name"), use $(D
Flag!"Name".no) for the negative option. When using a value
of type $(D Flag!"Name"), compare it against $(D
Flag!"Name".no) or just $(D false) or $(D 0). */
no = false,
/** When creating a value of type $(D Flag!"Name"), use $(D
Flag!"Name".yes) for the affirmative option. When using a
value of type $(D Flag!"Name"), compare it against $(D
Flag!"Name".yes).
*/
yes = true
}
}
/**
Convenience names that allow using e.g. $(D Yes.encryption) instead of
$(D Flag!"encryption".yes) and $(D No.encryption) instead of $(D
Flag!"encryption".no).
*/
struct Yes
{
template opDispatch(string name)
{
enum opDispatch = Flag!name.yes;
}
}
//template yes(string name) { enum Flag!name yes = Flag!name.yes; }
/// Ditto
struct No
{
template opDispatch(string name)
{
enum opDispatch = Flag!name.no;
}
}
//template no(string name) { enum Flag!name no = Flag!name.no; }
unittest
{
Flag!"abc" flag1;
assert(flag1 == Flag!"abc".no);
assert(flag1 == No.abc);
assert(!flag1);
if (flag1) assert(false);
flag1 = Yes.abc;
assert(flag1);
if (!flag1) assert(false);
if (flag1) {} else assert(false);
assert(flag1 == Yes.abc);
}
| D |
/Users/denny/code/rust/my-redis/target/debug/deps/my_redis-5dba26b841a61de5.rmeta: src/main.rs
/Users/denny/code/rust/my-redis/target/debug/deps/my_redis-5dba26b841a61de5.d: src/main.rs
src/main.rs:
| D |
/**
* This module implements functionality helpful for writing integration tests
* as opposed to the unit variety where unit-tests are defined as not
* having global side-effects. In constrast, this module implements
* assertions that check for global side-effects such as writing to the
* file system.
*/
module unit_threaded.integration;
version(Windows) {
extern(C) int mkdir(char*);
extern(C) char* mktemp(char* template_);
char* mkdtemp(char* t) {
version(unitUnthreaded)
return mkdtempImpl(t);
else {
synchronized {
return mkdtempImpl(t);
}
}
}
char* mkdtempImpl(char* t) {
// mktemp can actually only return up to 26 unique names per
// the documentation at MSDN. To hack around this, I am just
// putting in some random letters at some YYYYYY defined below
// to make conflicts less likely.
import core.stdc.string : strstr;
import core.stdc.stdlib : rand;
char* where = strstr(t, "YYYYYY");
assert(where !is null);
while(*where == 'Y') {
*where++ = rand() % 26 + 'A';
}
char* result = mktemp(t);
if(result is null) return null;
if (mkdir(result)) return null;
return result;
}
} else {
extern(C) char* mkdtemp(char* template_);
}
shared static this() {
import std.file: exists, rmdirRecurse;
if(Sandbox.sandboxesPath.exists)
rmdirRecurse(Sandbox.sandboxesPath);
}
@safe:
/**
Responsible for creating a temporary directory to serve as a sandbox where
files can be created, written to or deleted.
*/
struct Sandbox {
import std.path;
enum defaultSandboxesPath = buildPath("tmp", "unit-threaded");
static string sandboxesPath = defaultSandboxesPath;
string testPath;
/// Instantiate a Sandbox object
static Sandbox opCall() {
Sandbox ret;
ret.testPath = newTestDir;
return ret;
}
static void setPath(string path) {
import std.file: exists, mkdirRecurse;
sandboxesPath = path;
if(!sandboxesPath.exists) () @trusted { mkdirRecurse(sandboxesPath); }();
}
static void resetPath() {
sandboxesPath = defaultSandboxesPath;
}
/// Write a file to the sandbox
void writeFile(in string fileName, in string output = "") const {
import std.stdio: File;
import std.path: buildPath, dirName;
import std.file: mkdirRecurse;
() @trusted { mkdirRecurse(buildPath(testPath, fileName.dirName)); }();
File(buildPath(testPath, fileName), "wb").writeln(output);
}
/// Write a file to the sandbox
void writeFile(in string fileName, in string[] lines) const {
import std.array;
writeFile(fileName, lines.join("\n"));
}
/// Assert that a file exists in the sandbox
void shouldExist(string fileName, in string file = __FILE__, in size_t line = __LINE__) const {
import std.file: exists;
import std.path: buildPath;
import unit_threaded.exception: fail;
fileName = buildPath(testPath, fileName);
if(!fileName.exists)
fail("Expected " ~ fileName ~ " to exist but it didn't", file, line);
}
/// Assert that a file does not exist in the sandbox
void shouldNotExist(string fileName, in string file = __FILE__, in size_t line = __LINE__) const {
import std.file: exists;
import std.path: buildPath;
import unit_threaded.exception: fail;
fileName = buildPath(testPath, fileName);
if(fileName.exists)
fail("Expected " ~ fileName ~ " to not exist but it did", file, line);
}
/// read a file in the test sandbox and verify its contents
void shouldEqualContent(in string fileName, in string content,
in string file = __FILE__, in size_t line = __LINE__)
const
{
import std.file: readText;
import std.string: chomp, splitLines;
import unit_threaded.assertions: shouldEqual;
readText(buildPath(testPath, fileName)).shouldEqual(content, file, line);
}
/// read a file in the test sandbox and verify its contents
void shouldEqualLines(in string fileName, in string[] lines,
string file = __FILE__, size_t line = __LINE__)
const
{
import std.file: readText;
import std.string: chomp, splitLines;
import unit_threaded.assertions: shouldEqual;
readText(buildPath(testPath, fileName)).chomp.splitLines
.shouldEqual(lines, file, line);
}
// `fileName` should contain `needle`
void fileShouldContain(in string fileName,
in string needle,
in string file = __FILE__,
in size_t line = __LINE__)
{
import std.file: readText;
import unit_threaded.assertions: shouldBeIn;
needle.shouldBeIn(readText(inSandboxPath(fileName)), file, line);
}
string sandboxPath() @safe @nogc pure nothrow const {
return testPath;
}
string inSandboxPath(in string fileName) @safe pure nothrow const {
import std.path: buildPath;
return buildPath(sandboxPath, fileName);
}
/**
Executing `args` should succeed
*/
void shouldSucceed(string file = __FILE__, size_t line = __LINE__)
(in string[] args...)
@safe const
{
import unit_threaded.exception: UnitTestException;
import std.process: ProcessException;
import std.conv: text;
import std.array: join;
try {
const res = executeInSandbox(args);
if(res.status != 0)
throw new UnitTestException(text("Could not execute `", args.join(" "), "`:\n", res.output),
file, line);
} catch (ProcessException e) {
throw new UnitTestException(text("Could not execute `", args.join(" "), "`:\n", e.msg),
file, line);
}
}
alias shouldExecuteOk = shouldSucceed;
/**
Executing `args` should fail
*/
void shouldFail(string file = __FILE__, size_t line = __LINE__)
(in string[] args...)
@safe const
{
import unit_threaded.exception: UnitTestException;
import std.process: ProcessException;
import std.conv: text;
import std.array: join;
try {
const res = executeInSandbox(args);
if(res.status == 0)
throw new UnitTestException(
text("`", args.join(" "), "` should have failed but didn't:\n", res.output),
file,
line);
} catch (ProcessException) {} // Allow failure by ProcessException.
}
private:
auto executeInSandbox(in string[] args) @safe const {
import std.process: execute, Config;
import std.algorithm: startsWith;
import std.array: replace;
const string[string] env = null;
const config = Config.none;
const maxOutput = size_t.max;
const workDir = testPath;
const executable = args[0].startsWith("./")
? inSandboxPath(args[0].replace("./", ""))
: args[0];
return execute(executable ~ args[1..$], env, config, maxOutput, workDir);
}
static string newTestDir() {
import std.file: exists, mkdirRecurse;
if(!sandboxesPath.exists) {
() @trusted { mkdirRecurse(sandboxesPath); }();
}
return makeTempDir();
}
static string makeTempDir() {
import std.algorithm: copy;
import std.exception: enforce;
import std.conv: to;
import std.string: fromStringz;
import core.stdc.string: strerror;
import core.stdc.errno: errno;
char[2048] template_;
// the YYYYYY is to give some randomness on systems
// where it is necessary to have more than 26 items
// harmless elsewhere; the name is random stuff anyway
copy(buildPath(sandboxesPath, "YYYYYYXXXXXX") ~ '\0', template_[]);
auto path = () @trusted { return mkdtemp(&template_[0]).to!string; }();
enforce(path != "",
"\n" ~
"Failed to create temporary directory name using template '" ~
() @trusted { return fromStringz(&template_[0]); }() ~ "': " ~
() @trusted { return strerror(errno).to!string; }());
return path.absolutePath;
}
}
| D |
///////////////////////////////////////////////////////////////////////
// Info EXIT
///////////////////////////////////////////////////////////////////////
INSTANCE DIA_Zuris_EXIT (C_INFO)
{
npc = VLK_409_Zuris;
nr = 999;
condition = DIA_Zuris_EXIT_Condition;
information = DIA_Zuris_EXIT_Info;
permanent = TRUE;
description = DIALOG_ENDE;
};
FUNC INT DIA_Zuris_EXIT_Condition()
{
return TRUE;
};
FUNC VOID DIA_Zuris_EXIT_Info()
{
AI_StopProcessInfos (self);
};
// ************************************************************
// PICK POCKET
// ************************************************************
INSTANCE DIA_Zuris_PICKPOCKET (C_INFO)
{
npc = VLK_409_Zuris;
nr = 900;
condition = DIA_Zuris_PICKPOCKET_Condition;
information = DIA_Zuris_PICKPOCKET_Info;
permanent = TRUE;
description = "(Es wäre einfach seinen Trank zu stehlen)";
};
FUNC INT DIA_Zuris_PICKPOCKET_Condition()
{
if (Npc_GetTalentSkill (other,NPC_TALENT_PICKPOCKET) == 1)
&& (self.aivar[AIV_PlayerHasPickedMyPocket] == FALSE)
&& (other.attribute[ATR_DEXTERITY] >= (40 - Theftdiff))
{
return TRUE;
};
};
FUNC VOID DIA_Zuris_PICKPOCKET_Info()
{
Info_ClearChoices (DIA_Zuris_PICKPOCKET);
Info_AddChoice (DIA_Zuris_PICKPOCKET, DIALOG_BACK ,DIA_Zuris_PICKPOCKET_BACK);
Info_AddChoice (DIA_Zuris_PICKPOCKET, DIALOG_PICKPOCKET ,DIA_Zuris_PICKPOCKET_DoIt);
};
func void DIA_Zuris_PICKPOCKET_DoIt()
{
if (other.attribute[ATR_DEXTERITY] >= 40)
{
CreateInvItems (self,ITPO_Health_03,1);
B_GiveInvItems (self, other, ITPO_Health_03, 1);
self.aivar[AIV_PlayerHasPickedMyPocket] = TRUE;
B_GiveThiefXP ();
Info_ClearChoices (DIA_Zuris_PICKPOCKET);
}
else
{
B_ResetThiefLevel();
AI_StopProcessInfos (self);
B_Attack (self, other, AR_Theft, 1); //reagiert trotz IGNORE_Theft mit NEWS
};
};
func void DIA_Zuris_PICKPOCKET_BACK()
{
Info_ClearChoices (DIA_Zuris_PICKPOCKET);
};
///////////////////////////////////////////////////////////////////////
// Info Sperre
///////////////////////////////////////////////////////////////////////
instance DIA_Zuris_Sperre (C_INFO)
{
npc = VLK_409_Zuris;
nr = 2;
condition = DIA_Zuris_Sperre_Condition;
information = DIA_Zuris_Sperre_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_Zuris_Sperre_Condition ()
{
if (Canthar_Sperre == TRUE)
&& (Npc_IsInState (self, ZS_Talk ))
{
return TRUE;
};
};
func void DIA_Zuris_Sperre_Info ()
{
AI_Output (self, other, "DIA_Zuris_Sperre_14_00"); //Du bist ein Sträfling aus der Minenkolonie. Verschwinde!
AI_StopProcessInfos (self);
};
///////////////////////////////////////////////////////////////////////
// Info GREET
///////////////////////////////////////////////////////////////////////
instance DIA_Zuris_GREET (C_INFO)
{
npc = VLK_409_Zuris;
nr = 2;
condition = DIA_Zuris_GREET_Condition;
information = DIA_Zuris_GREET_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Zuris_GREET_Condition ()
{
if Npc_IsInState (self, ZS_Talk)
&& (Canthar_Sperre == FALSE)
&& (self.aivar[AIV_TalkedToPlayer] == FALSE)
{
return TRUE;
};
};
func void DIA_Zuris_GREET_Info ()
{
AI_Output (self, other, "DIA_Zuris_GREET_14_00"); //Ich bin Zuris, Meister der Tränke.
AI_Output (self, other, "DIA_Zuris_GREET_14_01"); //Benötigst du eine Essenz der Heilung oder ein magisches Elixier? Dann bist du bei mir richtig.
Log_CreateTopic (Topic_CityTrader,LOG_NOTE);
B_LogEntry (Topic_CityTrader,"Zuris verkauft Tränke am Marktplatz.");
};
///////////////////////////////////////////////////////////////////////
// Info WAREZ
///////////////////////////////////////////////////////////////////////
var int Zuris_einmal;
instance DIA_Zuris_WAREZ (C_INFO)
{
npc = VLK_409_Zuris;
nr = 2;
condition = DIA_Zuris_WAREZ_Condition;
information = DIA_Zuris_WAREZ_Info;
permanent = TRUE;
trade = TRUE;
description = "Zeig mir deine Ware";
};
func int DIA_Zuris_WAREZ_Condition ()
{
return TRUE;
};
func void DIA_Zuris_WAREZ_Info ()
{
B_GiveTradeInv (self);
Npc_RemoveInvItems (self, ItPo_Health_01, Npc_HasItems (self, ItPo_Health_01));
Npc_RemoveInvItems (self, ItPo_Health_02, Npc_HasItems (self, ItPo_Health_02));
Npc_RemoveInvItems (self, ItPo_Health_03, Npc_HasItems (self, ItPo_Health_03));
Npc_RemoveInvItems (self, ItPo_Health_Addon_04, Npc_HasItems (self, ItPo_Health_Addon_04));
Npc_RemoveInvItems (self, ItPo_Mana_01, Npc_HasItems (self, ItPo_Mana_01));
Npc_RemoveInvItems (self, ItPo_Mana_02, Npc_HasItems (self, ItPo_Mana_02));
Npc_RemoveInvItems (self, ItPo_Mana_03, Npc_HasItems (self, ItPo_Mana_03));
Npc_RemoveInvItems (self, ItPo_Mana_Addon_04, Npc_HasItems (self, ItPo_Mana_Addon_04));
CreateInvItems (self, ItPo_Health_01, 20);
CreateInvItems (self, ItPo_Health_02, 15);
CreateInvItems (self, ItPo_Health_03, 10);
CreateInvItems (self, ItPo_Health_Addon_04, 5);
CreateInvItems (self, ItPo_Mana_01, 20);
CreateInvItems (self, ItPo_Mana_02, 15);
CreateInvItems (self, ItPo_Mana_03, 10);
CreateInvItems (self, ItPo_Mana_Addon_04, 5);
AI_Output (other, self, "DIA_Zuris_WAREZ_15_00"); //Zeig mir deine Ware.
if (Zuris_einmal == FALSE)
&& (!Npc_KnowsInfo (other, DIA_Zuris_Potions))
{
AI_Output (self, other, "DIA_Zuris_GREET_14_02"); //Gerade jetzt habe ich neue Tränke bekommen. Mein Gast, Meister Daron, der Feuermagier, hat sie mir aus dem Kloster mitgebracht.
Zuris_einmal = TRUE;
};
};
///////////////////////////////////////////////////////////////////////
// Info POTIONS
///////////////////////////////////////////////////////////////////////
instance DIA_Zuris_POTIONS (C_INFO)
{
npc = VLK_409_Zuris;
nr = 2;
condition = DIA_Zuris_POTIONS_Condition;
information = DIA_Zuris_POTIONS_Info;
permanent = FALSE;
description = "Stellst du deine Tränke selbst her?";
};
func int DIA_Zuris_POTIONS_Condition ()
{
if Npc_KnowsInfo (hero,DIA_Zuris_GREET)
{
return TRUE;
};
};
func void DIA_Zuris_POTIONS_Info ()
{
AI_Output (other, self, "DIA_Zuris_POTIONS_15_00"); //Stellst du deine Tränke selbst her?
AI_Output (self, other, "DIA_Zuris_POTIONS_14_01"); //Nein, ich beziehe sie entweder aus dem Kloster oder kaufe sie von Constantino, dem Alchimisten.
if (hero.guild == GIL_NONE)
{
AI_Output (self, other, "DIA_Zuris_POTIONS_14_02"); //Wenn du an der Herstellung von Tränken interessiert bist, dann sprich mit ihm. Er braucht einen Gehilfen.
AI_Output (self, other, "DIA_Zuris_POTIONS_14_03"); //Aber er ist zu eigensinnig, um selbst jemanden einzustellen. Er ist halt störrisch wie ein Maulesel.
};
AI_Output (self, other, "DIA_Zuris_Add_14_00"); //Er kommt immer bei mir vorbei, wenn er draussen vorm Osttor Pflanzen für seine Tränke sammelt.
};
// **************************************************
// Wo sammelt Constantino?
// **************************************************
instance DIA_Zuris_Kraut (C_INFO)
{
npc = VLK_409_Zuris;
nr = 2;
condition = DIA_Zuris_Kraut_Condition;
information = DIA_Zuris_Kraut_Info;
permanent = FALSE;
description = "Wo genau sammelt Constantino seine Kräuter?";
};
func int DIA_Zuris_Kraut_Condition ()
{
if (Npc_KnowsInfo (other, DIA_Zuris_POTIONS))
{
return TRUE;
};
};
func void DIA_Zuris_Kraut_Info ()
{
AI_Output (other, self, "DIA_Zuris_Add_15_01"); //Wo genau sammelt Constantino seine Kräuter?
AI_Output (self, other, "DIA_Zuris_Add_14_02"); //Er geht immer durch das östliche Stadttor hier und und verschwindet dann nach links in die Wildnis.
AI_Output (self, other, "DIA_Zuris_Add_14_03"); //Er hat mal erzählt, daß in der Gegend dort so ziemlich alles wächst bis auf Kronstöckel,
Wld_InsertItem (ItPl_Mana_Herb_01,"FP_ITEM_HERB_01");
Wld_InsertItem (ItPl_Mana_Herb_02,"FP_ITEM_HERB_02");
Wld_InsertItem (ItPl_Mana_Herb_03,"FP_ITEM_HERB_03");
Wld_InsertItem (ItPl_Health_Herb_01,"FP_ITEM_HERB_04");
Wld_InsertItem (ItPl_Health_Herb_02,"FP_ITEM_HERB_05");
Wld_InsertItem (ItPl_Health_Herb_03,"FP_ITEM_HERB_06");
Wld_InsertItem (ItPl_Speed_Herb_01,"FP_ITEM_HERB_07");
Wld_InsertItem (ItPl_Temp_Herb,"FP_ITEM_HERB_08");
Wld_InsertItem (ItPl_Strength_Herb_01,"FP_ITEM_HERB_09");
Wld_InsertItem (ItPl_Dex_Herb_01,"FP_ITEM_HERB_10");
};
// **************************************************
// Kronstöckel
// **************************************************
instance DIA_Zuris_Kronstoeckel (C_INFO)
{
npc = VLK_409_Zuris;
nr = 2;
condition = DIA_Zuris_Kronstoeckel_Condition;
information = DIA_Zuris_Kronstoeckel_Info;
permanent = FALSE;
description = "Hat Constantino auch erzählt, wo man Kronstöckel findet?";
};
func int DIA_Zuris_Kronstoeckel_Condition ()
{
if Npc_KnowsInfo (other, DIA_Zuris_Kraut)
{
return TRUE;
};
};
func void DIA_Zuris_Kronstoeckel_Info ()
{
AI_Output (other, self, "DIA_Zuris_Add_15_04"); //Hat Constantino auch erzählt, wo man Kronstöckel findet?
AI_Output (self, other, "DIA_Zuris_Add_14_05"); //Ich hab ihn mal sagen hören, daß das Zeug in der Nähe von Steinkreisen wächst.
AI_Output (self, other, "DIA_Zuris_Add_14_06"); //In der Nähe von Lobarts Hof, das ist der Hof draussen vor dem anderen Stadttor, ist einer dieser Steinkreise.
AI_Output (self, other, "DIA_Zuris_Add_14_07"); //Er liegt auf einem Hügel, glaube ich. War mal ein Grab oder sowas.
Wld_InsertItem (ItPl_Perm_Herb,"FP_ITEM_HERB_11");
};
///////////////////////////////////////////////////////////////////////
// Info WHERE
///////////////////////////////////////////////////////////////////////
instance DIA_Zuris_WHERE (C_INFO)
{
npc = VLK_409_Zuris;
condition = DIA_Zuris_WHERE_Condition;
information = DIA_Zuris_WHERE_Info;
permanent = FALSE;
description = "Wo finde ich Constantino?";
};
func int DIA_Zuris_WHERE_Condition ()
{
if (Npc_KnowsInfo (hero, DIA_Zuris_POTIONS))
&& (Constantino.aivar[AIV_TalkedToPlayer] == FALSE)
{
return TRUE;
};
};
func void DIA_Zuris_WHERE_Info ()
{
AI_Output (other, self, "DIA_Zuris_WHERE_15_00"); //Wo finde ich Constantino?
AI_Output (self, other, "DIA_Zuris_WHERE_14_01"); //Er hat seine Kammer im Tunnel bei Harads Schmiede. Sollte nicht schwierig zu finden sein.
};
///////////////////////////////////////////////////////////////////////
// Info Kloster
///////////////////////////////////////////////////////////////////////
instance DIA_Zuris_Kloster (C_INFO)
{
npc = VLK_409_Zuris;
nr = 2;
condition = DIA_Zuris_Kloster_Condition;
information = DIA_Zuris_Kloster_Info;
description = "Erzähl mir vom Kloster. ";
};
func int DIA_Zuris_Kloster_Condition ()
{
if (Zuris_einmal == TRUE)
{
return FALSE;
};
};
func void DIA_Zuris_Kloster_Info ()
{
AI_Output (other, self, "DIA_Zuris_Kloster_14_00"); //Erzähl mir vom Kloster.
AI_Output (self, other, "DIA_Zuris_Kloster_14_01"); //Da sprichst du am Besten mit Meister Daron selbst. Er weiß besser darüber Bescheid als ich.
};
// ************************************************************
// Minenanteil
// ************************************************************
INSTANCE DIA_Zuris_Minenanteil (C_INFO)
{
npc = VLK_409_Zuris;
nr = 3;
condition = DIA_Zuris_Minenanteil_Condition;
information = DIA_Zuris_Minenanteil_Info;
description = "Du verkaufst Minenanteile?";
};
FUNC INT DIA_Zuris_Minenanteil_Condition()
{
if (hero.guild == GIL_KDF)
&& (MIS_Serpentes_MinenAnteil_KDF == LOG_RUNNING)
{
return TRUE;
};
};
FUNC VOID DIA_Zuris_Minenanteil_Info()
{
AI_Output (other, self, "DIA_Zuris_Minenanteil_15_00"); //Du verkaufst Minenanteile?
AI_Output (self, other, "DIA_Zuris_Minenanteil_14_01"); //Ja. Was für ein Reinfall. Auf so eine windige Sache lasse ich mich nie wieder ein!
B_GivePlayerXP (XP_Ambient);
};
instance DIA_ZURIS_BOOK(C_Info)
{
npc = VLK_409_Zuris;
nr = 333;
condition = dia_zuris_book_condition;
information = dia_zuris_book_info;
important = TRUE;
};
func int dia_zuris_book_condition()
{
if (Kapitel >= 4)
{
return TRUE;
};
};
func void dia_zuris_book_info()
{
AI_Output (self, other, "DIA_z_Book"); //Hey, du, ich habe vor kurzem ein altes Buch erworben. Interesse?
};
| D |
// Written in the D programming language.
/**
This is a submodule of $(MREF std, algorithm).
It contains generic algorithms that implement set operations.
The functions $(LREF multiwayMerge), $(LREF multiwayUnion), $(LREF setDifference),
$(LREF setIntersection), $(LREF setSymmetricDifference) expect a range of sorted
ranges as input.
All algorithms are generalized to accept as input not only sets but also
$(HTTP https://en.wikipedia.org/wiki/Multiset, multisets). Each algorithm
documents behaviour in the presence of duplicated inputs.
$(SCRIPT inhibitQuickIndex = 1;)
$(BOOKTABLE Cheat Sheet,
$(TR $(TH Function Name) $(TH Description))
$(T2 cartesianProduct,
Computes Cartesian product of two ranges.)
$(T2 largestPartialIntersection,
Copies out the values that occur most frequently in a range of ranges.)
$(T2 largestPartialIntersectionWeighted,
Copies out the values that occur most frequently (multiplied by
per-value weights) in a range of ranges.)
$(T2 multiwayMerge,
Merges a range of sorted ranges.)
$(T2 multiwayUnion,
Computes the union of a range of sorted ranges.)
$(T2 setDifference,
Lazily computes the set difference of two or more sorted ranges.)
$(T2 setIntersection,
Lazily computes the intersection of two or more sorted ranges.)
$(T2 setSymmetricDifference,
Lazily computes the symmetric set difference of two or more sorted
ranges.)
)
Copyright: Andrei Alexandrescu 2008-.
License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(HTTP erdani.com, Andrei Alexandrescu)
Source: $(PHOBOSSRC std/algorithm/_setops.d)
Macros:
T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
*/
module std.algorithm.setops;
import std.range.primitives;
// FIXME
import std.functional; // : unaryFun, binaryFun;
import std.traits;
// FIXME
import std.meta; // : AliasSeq, staticMap, allSatisfy, anySatisfy;
import std.algorithm.sorting; // : Merge;
import std.typecons : No;
// cartesianProduct
/**
Lazily computes the Cartesian product of two or more ranges. The product is a
_range of tuples of elements from each respective range.
The conditions for the two-range case are as follows:
If both ranges are finite, then one must be (at least) a
$(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) and the
other an $(REF_ALTTEXT input range, isInputRange, std,range,primitives).
If one _range is infinite and the other finite, then the finite _range must
be a forward _range, and the infinite range can be an input _range.
If both ranges are infinite, then both must be forward ranges.
When there are more than two ranges, the above conditions apply to each
adjacent pair of ranges.
Params:
range1 = The first range
range2 = The second range
ranges = Two or more non-infinite forward ranges
otherRanges = Zero or more non-infinite forward ranges
Returns:
A forward range of $(REF Tuple, std,typecons) representing elements of the
cartesian product of the given ranges.
*/
auto cartesianProduct(R1, R2)(R1 range1, R2 range2)
if (!allSatisfy!(isForwardRange, R1, R2) ||
anySatisfy!(isInfinite, R1, R2))
{
import std.algorithm.iteration : map, joiner;
static if (isInfinite!R1 && isInfinite!R2)
{
static if (isForwardRange!R1 && isForwardRange!R2)
{
import std.range : zip, repeat, take, chain, sequence;
// This algorithm traverses the cartesian product by alternately
// covering the right and bottom edges of an increasing square area
// over the infinite table of combinations. This schedule allows us
// to require only forward ranges.
return zip(sequence!"n"(cast(size_t) 0), range1.save, range2.save,
repeat(range1), repeat(range2))
.map!(function(a) => chain(
zip(repeat(a[1]), take(a[4].save, a[0])),
zip(take(a[3].save, a[0]+1), repeat(a[2]))
))()
.joiner();
}
else static assert(0, "cartesianProduct of infinite ranges requires "~
"forward ranges");
}
else static if (isInputRange!R1 && isForwardRange!R2 && !isInfinite!R2)
{
import std.range : zip, repeat;
return joiner(map!((ElementType!R1 a) => zip(repeat(a), range2.save))
(range1));
}
else static if (isInputRange!R2 && isForwardRange!R1 && !isInfinite!R1)
{
import std.range : zip, repeat;
return joiner(map!((ElementType!R2 a) => zip(range1.save, repeat(a)))
(range2));
}
else static assert(0, "cartesianProduct involving finite ranges must "~
"have at least one finite forward range");
}
///
@safe unittest
{
import std.algorithm.searching : canFind;
import std.range;
import std.typecons : tuple;
auto N = sequence!"n"(0); // the range of natural numbers
auto N2 = cartesianProduct(N, N); // the range of all pairs of natural numbers
// Various arbitrary number pairs can be found in the range in finite time.
assert(canFind(N2, tuple(0, 0)));
assert(canFind(N2, tuple(123, 321)));
assert(canFind(N2, tuple(11, 35)));
assert(canFind(N2, tuple(279, 172)));
}
///
@safe unittest
{
import std.algorithm.searching : canFind;
import std.typecons : tuple;
auto B = [ 1, 2, 3 ];
auto C = [ 4, 5, 6 ];
auto BC = cartesianProduct(B, C);
foreach (n; [[1, 4], [2, 4], [3, 4], [1, 5], [2, 5], [3, 5], [1, 6],
[2, 6], [3, 6]])
{
assert(canFind(BC, tuple(n[0], n[1])));
}
}
@safe unittest
{
// Test cartesian product of two infinite ranges
import std.algorithm.searching : canFind;
import std.range;
import std.typecons : tuple;
auto Even = sequence!"2*n"(0);
auto Odd = sequence!"2*n+1"(0);
auto EvenOdd = cartesianProduct(Even, Odd);
foreach (pair; [[0, 1], [2, 1], [0, 3], [2, 3], [4, 1], [4, 3], [0, 5],
[2, 5], [4, 5], [6, 1], [6, 3], [6, 5]])
{
assert(canFind(EvenOdd, tuple(pair[0], pair[1])));
}
// This should terminate in finite time
assert(canFind(EvenOdd, tuple(124, 73)));
assert(canFind(EvenOdd, tuple(0, 97)));
assert(canFind(EvenOdd, tuple(42, 1)));
}
@safe unittest
{
// Test cartesian product of an infinite input range and a finite forward
// range.
import std.algorithm.searching : canFind;
import std.range;
import std.typecons : tuple;
auto N = sequence!"n"(0);
auto M = [100, 200, 300];
auto NM = cartesianProduct(N,M);
foreach (pair; [[0, 100], [0, 200], [0, 300], [1, 100], [1, 200], [1, 300],
[2, 100], [2, 200], [2, 300], [3, 100], [3, 200],
[3, 300]])
{
assert(canFind(NM, tuple(pair[0], pair[1])));
}
// We can't solve the halting problem, so we can only check a finite
// initial segment here.
assert(!canFind(NM.take(100), tuple(100, 0)));
assert(!canFind(NM.take(100), tuple(1, 1)));
assert(!canFind(NM.take(100), tuple(100, 200)));
auto MN = cartesianProduct(M,N);
foreach (pair; [[100, 0], [200, 0], [300, 0], [100, 1], [200, 1], [300, 1],
[100, 2], [200, 2], [300, 2], [100, 3], [200, 3],
[300, 3]])
{
assert(canFind(MN, tuple(pair[0], pair[1])));
}
// We can't solve the halting problem, so we can only check a finite
// initial segment here.
assert(!canFind(MN.take(100), tuple(0, 100)));
assert(!canFind(MN.take(100), tuple(0, 1)));
assert(!canFind(MN.take(100), tuple(100, 200)));
}
@safe unittest
{
import std.algorithm.searching : canFind;
import std.typecons : tuple;
// Test cartesian product of two finite ranges.
auto X = [1, 2, 3];
auto Y = [4, 5, 6];
auto XY = cartesianProduct(X, Y);
auto Expected = [[1, 4], [1, 5], [1, 6], [2, 4], [2, 5], [2, 6], [3, 4],
[3, 5], [3, 6]];
// Verify Expected ⊆ XY
foreach (pair; Expected)
{
assert(canFind(XY, tuple(pair[0], pair[1])));
}
// Verify XY ⊆ Expected
foreach (pair; XY)
{
assert(canFind(Expected, [pair[0], pair[1]]));
}
// And therefore, by set comprehension, XY == Expected
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : map;
import std.algorithm.searching : canFind;
import std.typecons : tuple;
import std.range;
auto N = sequence!"n"(0);
// To force the template to fall to the second case, we wrap N in a struct
// that doesn't allow bidirectional access.
struct FwdRangeWrapper(R)
{
R impl;
// Input range API
@property auto front() { return impl.front; }
void popFront() { impl.popFront(); }
static if (isInfinite!R)
enum empty = false;
else
@property bool empty() { return impl.empty; }
// Forward range API
@property auto save() { return typeof(this)(impl.save); }
}
auto fwdWrap(R)(R range) { return FwdRangeWrapper!R(range); }
// General test: two infinite bidirectional ranges
auto N2 = cartesianProduct(N, N);
assert(canFind(N2, tuple(0, 0)));
assert(canFind(N2, tuple(123, 321)));
assert(canFind(N2, tuple(11, 35)));
assert(canFind(N2, tuple(279, 172)));
// Test first case: forward range with bidirectional range
auto fwdN = fwdWrap(N);
auto N2_a = cartesianProduct(fwdN, N);
assert(canFind(N2_a, tuple(0, 0)));
assert(canFind(N2_a, tuple(123, 321)));
assert(canFind(N2_a, tuple(11, 35)));
assert(canFind(N2_a, tuple(279, 172)));
// Test second case: bidirectional range with forward range
auto N2_b = cartesianProduct(N, fwdN);
assert(canFind(N2_b, tuple(0, 0)));
assert(canFind(N2_b, tuple(123, 321)));
assert(canFind(N2_b, tuple(11, 35)));
assert(canFind(N2_b, tuple(279, 172)));
// Test third case: finite forward range with (infinite) input range
static struct InpRangeWrapper(R)
{
R impl;
// Input range API
@property auto front() { return impl.front; }
void popFront() { impl.popFront(); }
static if (isInfinite!R)
enum empty = false;
else
@property bool empty() { return impl.empty; }
}
auto inpWrap(R)(R r) { return InpRangeWrapper!R(r); }
auto inpN = inpWrap(N);
auto B = [ 1, 2, 3 ];
auto fwdB = fwdWrap(B);
auto BN = cartesianProduct(fwdB, inpN);
assert(equal(map!"[a[0],a[1]]"(BN.take(10)), [[1, 0], [2, 0], [3, 0],
[1, 1], [2, 1], [3, 1], [1, 2], [2, 2], [3, 2], [1, 3]]));
// Test fourth case: (infinite) input range with finite forward range
auto NB = cartesianProduct(inpN, fwdB);
assert(equal(map!"[a[0],a[1]]"(NB.take(10)), [[0, 1], [0, 2], [0, 3],
[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1]]));
// General finite range case
auto C = [ 4, 5, 6 ];
auto BC = cartesianProduct(B, C);
foreach (n; [[1, 4], [2, 4], [3, 4], [1, 5], [2, 5], [3, 5], [1, 6],
[2, 6], [3, 6]])
{
assert(canFind(BC, tuple(n[0], n[1])));
}
}
// Issue 13091
pure nothrow @safe @nogc unittest
{
int[1] a = [1];
foreach (t; cartesianProduct(a[], a[])) {}
}
/// ditto
auto cartesianProduct(RR...)(RR ranges)
if (ranges.length >= 2 &&
allSatisfy!(isForwardRange, RR) &&
!anySatisfy!(isInfinite, RR))
{
// This overload uses a much less template-heavy implementation when
// all ranges are finite forward ranges, which is the most common use
// case, so that we don't run out of resources too quickly.
//
// For infinite ranges or non-forward ranges, we fall back to the old
// implementation which expands an exponential number of templates.
import std.typecons : tuple;
static struct Result
{
RR ranges;
RR current;
bool empty = true;
this(RR _ranges)
{
ranges = _ranges;
empty = false;
foreach (i, r; ranges)
{
current[i] = r.save;
if (current[i].empty)
empty = true;
}
}
@property auto front()
{
import std.algorithm.internal : algoFormat;
import std.range : iota;
return mixin(algoFormat("tuple(%(current[%d].front%|,%))",
iota(0, current.length)));
}
void popFront()
{
foreach_reverse (i, ref r; current)
{
r.popFront();
if (!r.empty) break;
static if (i == 0)
empty = true;
else
r = ranges[i].save; // rollover
}
}
@property Result save()
{
Result copy = this;
foreach (i, r; ranges)
{
copy.ranges[i] = r.save;
copy.current[i] = current[i].save;
}
return copy;
}
}
static assert(isForwardRange!Result);
return Result(ranges);
}
@safe unittest
{
// Issue 10693: cartesian product of empty ranges should be empty.
int[] a, b, c, d, e;
auto cprod = cartesianProduct(a,b,c,d,e);
assert(cprod.empty);
foreach (_; cprod) {} // should not crash
// Test case where only one of the ranges is empty: the result should still
// be empty.
int[] p=[1], q=[];
auto cprod2 = cartesianProduct(p,p,p,q,p);
assert(cprod2.empty);
foreach (_; cprod2) {} // should not crash
}
@safe unittest
{
// .init value of cartesianProduct should be empty
auto cprod = cartesianProduct([0,0], [1,1], [2,2]);
assert(!cprod.empty);
assert(cprod.init.empty);
}
@safe unittest
{
// Issue 13393
assert(!cartesianProduct([0],[0],[0]).save.empty);
}
/// ditto
auto cartesianProduct(R1, R2, RR...)(R1 range1, R2 range2, RR otherRanges)
if (!allSatisfy!(isForwardRange, R1, R2, RR) ||
anySatisfy!(isInfinite, R1, R2, RR))
{
/* We implement the n-ary cartesian product by recursively invoking the
* binary cartesian product. To make the resulting range nicer, we denest
* one level of tuples so that a ternary cartesian product, for example,
* returns 3-element tuples instead of nested 2-element tuples.
*/
import std.algorithm.internal : algoFormat;
import std.algorithm.iteration : map;
import std.range : iota;
enum string denest = algoFormat("tuple(a[0], %(a[1][%d]%|,%))",
iota(0, otherRanges.length+1));
return map!denest(
cartesianProduct(range1, cartesianProduct(range2, otherRanges))
);
}
@safe unittest
{
import std.algorithm.searching : canFind;
import std.range;
import std.typecons : tuple, Tuple;
auto N = sequence!"n"(0);
auto N3 = cartesianProduct(N, N, N);
// Check that tuples are properly denested
assert(is(ElementType!(typeof(N3)) == Tuple!(size_t,size_t,size_t)));
assert(canFind(N3, tuple(0, 27, 7)));
assert(canFind(N3, tuple(50, 23, 71)));
assert(canFind(N3, tuple(9, 3, 0)));
}
@safe unittest
{
import std.algorithm.searching : canFind;
import std.range;
import std.typecons : tuple, Tuple;
auto N = sequence!"n"(0);
auto N4 = cartesianProduct(N, N, N, N);
// Check that tuples are properly denested
assert(is(ElementType!(typeof(N4)) == Tuple!(size_t,size_t,size_t,size_t)));
assert(canFind(N4, tuple(1, 2, 3, 4)));
assert(canFind(N4, tuple(4, 3, 2, 1)));
assert(canFind(N4, tuple(10, 3, 7, 2)));
}
// Issue 9878
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.typecons : tuple;
auto A = [ 1, 2, 3 ];
auto B = [ 'a', 'b', 'c' ];
auto C = [ "x", "y", "z" ];
auto ABC = cartesianProduct(A, B, C);
assert(ABC.equal([
tuple(1, 'a', "x"), tuple(1, 'a', "y"), tuple(1, 'a', "z"),
tuple(1, 'b', "x"), tuple(1, 'b', "y"), tuple(1, 'b', "z"),
tuple(1, 'c', "x"), tuple(1, 'c', "y"), tuple(1, 'c', "z"),
tuple(2, 'a', "x"), tuple(2, 'a', "y"), tuple(2, 'a', "z"),
tuple(2, 'b', "x"), tuple(2, 'b', "y"), tuple(2, 'b', "z"),
tuple(2, 'c', "x"), tuple(2, 'c', "y"), tuple(2, 'c', "z"),
tuple(3, 'a', "x"), tuple(3, 'a', "y"), tuple(3, 'a', "z"),
tuple(3, 'b', "x"), tuple(3, 'b', "y"), tuple(3, 'b', "z"),
tuple(3, 'c', "x"), tuple(3, 'c', "y"), tuple(3, 'c', "z")
]));
}
pure @safe nothrow @nogc unittest
{
import std.range.primitives : isForwardRange;
int[2] A = [1,2];
auto C = cartesianProduct(A[], A[], A[]);
assert(isForwardRange!(typeof(C)));
C.popFront();
auto front1 = C.front;
auto D = C.save;
C.popFront();
assert(D.front == front1);
}
// Issue 13935
@safe unittest
{
import std.algorithm.iteration : map;
auto seq = [1, 2].map!(x => x);
foreach (pair; cartesianProduct(seq, seq)) {}
}
// largestPartialIntersection
/**
Given a range of sorted $(REF_ALTTEXT forward ranges, isForwardRange, std,range,primitives)
`ror`, copies to `tgt` the elements that are common to most ranges, along with their number
of occurrences. All ranges in `ror` are assumed to be sorted by $(D
less). Only the most frequent `tgt.length` elements are returned.
Params:
less = The predicate the ranges are sorted by.
ror = A range of forward ranges sorted by `less`.
tgt = The target range to copy common elements to.
sorted = Whether the elements copied should be in sorted order.
The function `largestPartialIntersection` is useful for
e.g. searching an $(LINK2 https://en.wikipedia.org/wiki/Inverted_index,
inverted index) for the documents most
likely to contain some terms of interest. The complexity of the search
is $(BIGOH n * log(tgt.length)), where `n` is the sum of lengths of
all input ranges. This approach is faster than keeping an associative
array of the occurrences and then selecting its top items, and also
requires less memory (`largestPartialIntersection` builds its
result directly in `tgt` and requires no extra memory).
If at least one of the ranges is a multiset, then all occurences
of a duplicate element are taken into account. The result is
equivalent to merging all ranges and picking the most frequent
`tgt.length` elements.
Warning: Because `largestPartialIntersection` does not allocate
extra memory, it will leave `ror` modified. Namely, $(D
largestPartialIntersection) assumes ownership of `ror` and
discretionarily swaps and advances elements of it. If you want $(D
ror) to preserve its contents after the call, you may want to pass a
duplicate to `largestPartialIntersection` (and perhaps cache the
duplicate in between calls).
*/
void largestPartialIntersection
(alias less = "a < b", RangeOfRanges, Range)
(RangeOfRanges ror, Range tgt, SortOutput sorted = No.sortOutput)
{
struct UnitWeights
{
static int opIndex(ElementType!(ElementType!RangeOfRanges)) { return 1; }
}
return largestPartialIntersectionWeighted!less(ror, tgt, UnitWeights(),
sorted);
}
///
@system unittest
{
import std.typecons : tuple, Tuple;
// Figure which number can be found in most arrays of the set of
// arrays below.
double[][] a =
[
[ 1, 4, 7, 8 ],
[ 1, 7 ],
[ 1, 7, 8],
[ 4 ],
[ 7 ],
];
auto b = new Tuple!(double, uint)[1];
// it will modify the input range, hence we need to create a duplicate
largestPartialIntersection(a.dup, b);
// First member is the item, second is the occurrence count
assert(b[0] == tuple(7.0, 4u));
// 7.0 occurs in 4 out of 5 inputs, more than any other number
// If more of the top-frequent numbers are needed, just create a larger
// tgt range
auto c = new Tuple!(double, uint)[2];
largestPartialIntersection(a, c);
assert(c[0] == tuple(1.0, 3u));
// 1.0 occurs in 3 inputs
// multiset
double[][] x =
[
[1, 1, 1, 1, 4, 7, 8],
[1, 7],
[1, 7, 8],
[4, 7],
[7]
];
auto y = new Tuple!(double, uint)[2];
largestPartialIntersection(x.dup, y);
// 7.0 occurs 5 times
assert(y[0] == tuple(7.0, 5u));
// 1.0 occurs 6 times
assert(y[1] == tuple(1.0, 6u));
}
import std.algorithm.sorting : SortOutput; // FIXME
// largestPartialIntersectionWeighted
/**
Similar to `largestPartialIntersection`, but associates a weight
with each distinct element in the intersection.
If at least one of the ranges is a multiset, then all occurences
of a duplicate element are taken into account. The result
is equivalent to merging all input ranges and picking the highest
`tgt.length`, weight-based ranking elements.
Params:
less = The predicate the ranges are sorted by.
ror = A range of $(REF_ALTTEXT forward ranges, isForwardRange, std,range,primitives)
sorted by `less`.
tgt = The target range to copy common elements to.
weights = An associative array mapping elements to weights.
sorted = Whether the elements copied should be in sorted order.
*/
void largestPartialIntersectionWeighted
(alias less = "a < b", RangeOfRanges, Range, WeightsAA)
(RangeOfRanges ror, Range tgt, WeightsAA weights, SortOutput sorted = No.sortOutput)
{
import std.algorithm.iteration : group;
import std.algorithm.sorting : topNCopy;
if (tgt.empty) return;
alias InfoType = ElementType!Range;
bool heapComp(InfoType a, InfoType b)
{
return weights[a[0]] * a[1] > weights[b[0]] * b[1];
}
topNCopy!heapComp(group(multiwayMerge!less(ror)), tgt, sorted);
}
///
@system unittest
{
import std.typecons : tuple, Tuple;
// Figure which number can be found in most arrays of the set of
// arrays below, with specific per-element weights
double[][] a =
[
[ 1, 4, 7, 8 ],
[ 1, 7 ],
[ 1, 7, 8],
[ 4 ],
[ 7 ],
];
auto b = new Tuple!(double, uint)[1];
double[double] weights = [ 1:1.2, 4:2.3, 7:1.1, 8:1.1 ];
largestPartialIntersectionWeighted(a, b, weights);
// First member is the item, second is the occurrence count
assert(b[0] == tuple(4.0, 2u));
// 4.0 occurs 2 times -> 4.6 (2 * 2.3)
// 7.0 occurs 3 times -> 4.4 (3 * 1.1)
// multiset
double[][] x =
[
[ 1, 1, 1, 4, 7, 8 ],
[ 1, 7 ],
[ 1, 7, 8],
[ 4 ],
[ 7 ],
];
auto y = new Tuple!(double, uint)[1];
largestPartialIntersectionWeighted(x, y, weights);
assert(y[0] == tuple(1.0, 5u));
// 1.0 occurs 5 times -> 1.2 * 5 = 6
}
@system unittest
{
import std.conv : text;
import std.typecons : tuple, Tuple, Yes;
double[][] a =
[
[ 1, 4, 7, 8 ],
[ 1, 7 ],
[ 1, 7, 8],
[ 4 ],
[ 7 ],
];
auto b = new Tuple!(double, uint)[2];
largestPartialIntersection(a, b, Yes.sortOutput);
assert(b == [ tuple(7.0, 4u), tuple(1.0, 3u) ][], text(b));
assert(a[0].empty);
}
@system unittest
{
import std.conv : text;
import std.typecons : tuple, Tuple, Yes;
string[][] a =
[
[ "1", "4", "7", "8" ],
[ "1", "7" ],
[ "1", "7", "8"],
[ "4" ],
[ "7" ],
];
auto b = new Tuple!(string, uint)[2];
largestPartialIntersection(a, b, Yes.sortOutput);
assert(b == [ tuple("7", 4u), tuple("1", 3u) ][], text(b));
}
@system unittest
{
import std.typecons : tuple, Tuple;
// Figure which number can be found in most arrays of the set of
// arrays below, with specific per-element weights
double[][] a =
[
[ 1, 4, 7, 8 ],
[ 1, 7 ],
[ 1, 7, 8],
[ 4 ],
[ 7 ],
];
auto b = new Tuple!(double, uint)[1];
double[double] weights = [ 1:1.2, 4:2.3, 7:1.1, 8:1.1 ];
largestPartialIntersectionWeighted(a, b, weights);
// First member is the item, second is the occurrence count
assert(b[0] == tuple(4.0, 2u));
}
@system unittest
{
import std.container : Array;
import std.typecons : Tuple;
alias T = Tuple!(uint, uint);
const Array!T arrayOne = Array!T( [ T(1,2), T(3,4) ] );
const Array!T arrayTwo = Array!T([ T(1,2), T(3,4) ] );
assert(arrayOne == arrayTwo);
}
// MultiwayMerge
/**
Merges multiple sets. The input sets are passed as a
range of ranges and each is assumed to be sorted by $(D
less). Computation is done lazily, one union element at a time. The
complexity of one `popFront` operation is $(BIGOH
log(ror.length)). However, the length of `ror` decreases as ranges
in it are exhausted, so the complexity of a full pass through $(D
MultiwayMerge) is dependent on the distribution of the lengths of ranges
contained within `ror`. If all ranges have the same length `n`
(worst case scenario), the complexity of a full pass through $(D
MultiwayMerge) is $(BIGOH n * ror.length * log(ror.length)), i.e., $(D
log(ror.length)) times worse than just spanning all ranges in
turn. The output comes sorted (unstably) by `less`.
The length of the resulting range is the sum of all lengths of
the ranges passed as input. This means that all elements (duplicates
included) are transferred to the resulting range.
For backward compatibility, `multiwayMerge` is available under
the name `nWayUnion` and `MultiwayMerge` under the name of `NWayUnion` .
Future code should use `multiwayMerge` and `MultiwayMerge` as `nWayUnion`
and `NWayUnion` will be deprecated.
Params:
less = Predicate the given ranges are sorted by.
ror = A range of ranges sorted by `less` to compute the union for.
Returns:
A range of the union of the ranges in `ror`.
Warning: Because `MultiwayMerge` does not allocate extra memory, it
will leave `ror` modified. Namely, `MultiwayMerge` assumes ownership
of `ror` and discretionarily swaps and advances elements of it. If
you want `ror` to preserve its contents after the call, you may
want to pass a duplicate to `MultiwayMerge` (and perhaps cache the
duplicate in between calls).
*/
struct MultiwayMerge(alias less, RangeOfRanges)
{
import std.container : BinaryHeap;
private alias ElementType = .ElementType!(.ElementType!RangeOfRanges);
private alias comp = binaryFun!less;
private RangeOfRanges _ror;
///
static bool compFront(.ElementType!RangeOfRanges a,
.ElementType!RangeOfRanges b)
{
// revert comparison order so we get the smallest elements first
return comp(b.front, a.front);
}
private BinaryHeap!(RangeOfRanges, compFront) _heap;
///
this(RangeOfRanges ror)
{
import std.algorithm.mutation : remove, SwapStrategy;
// Preemptively get rid of all empty ranges in the input
// No need for stability either
_ror = remove!("a.empty", SwapStrategy.unstable)(ror);
//Build the heap across the range
_heap.acquire(_ror);
}
///
@property bool empty() { return _ror.empty; }
///
@property auto ref front()
{
return _heap.front.front;
}
///
void popFront()
{
_heap.removeFront();
// let's look at the guy just popped
_ror.back.popFront();
if (_ror.back.empty)
{
_ror.popBack();
// nothing else to do: the empty range is not in the
// heap and not in _ror
return;
}
// Put the popped range back in the heap
_heap.conditionalInsert(_ror.back) || assert(false);
}
}
/// Ditto
MultiwayMerge!(less, RangeOfRanges) multiwayMerge
(alias less = "a < b", RangeOfRanges)
(RangeOfRanges ror)
{
return typeof(return)(ror);
}
///
@system unittest
{
import std.algorithm.comparison : equal;
double[][] a =
[
[ 1, 4, 7, 8 ],
[ 1, 7 ],
[ 1, 7, 8],
[ 4 ],
[ 7 ],
];
auto witness = [
1, 1, 1, 4, 4, 7, 7, 7, 7, 8, 8
];
assert(equal(multiwayMerge(a), witness));
double[][] b =
[
// range with duplicates
[ 1, 1, 4, 7, 8 ],
[ 7 ],
[ 1, 7, 8],
[ 4 ],
[ 7 ],
];
// duplicates are propagated to the resulting range
assert(equal(multiwayMerge(b), witness));
}
alias nWayUnion = multiwayMerge;
alias NWayUnion = MultiwayMerge;
/**
Computes the union of multiple ranges. The input ranges are passed
as a range of ranges and each is assumed to be sorted by $(D
less). Computation is done lazily, one union element at a time.
`multiwayUnion(ror)` is functionally equivalent to `multiwayMerge(ror).uniq`.
"The output of multiwayUnion has no duplicates even when its inputs contain duplicates."
Params:
less = Predicate the given ranges are sorted by.
ror = A range of ranges sorted by `less` to compute the intersection for.
Returns:
A range of the union of the ranges in `ror`.
See also: $(LREF multiwayMerge)
*/
auto multiwayUnion(alias less = "a < b", RangeOfRanges)(RangeOfRanges ror)
{
import std.algorithm.iteration : uniq;
import std.functional : not;
return ror.multiwayMerge!(less).uniq!(not!less);
}
///
@system unittest
{
import std.algorithm.comparison : equal;
// sets
double[][] a =
[
[ 1, 4, 7, 8 ],
[ 1, 7 ],
[ 1, 7, 8],
[ 4 ],
[ 7 ],
];
auto witness = [1, 4, 7, 8];
assert(equal(multiwayUnion(a), witness));
// multisets
double[][] b =
[
[ 1, 1, 1, 4, 7, 8 ],
[ 1, 7 ],
[ 1, 7, 7, 8],
[ 4 ],
[ 7 ],
];
assert(equal(multiwayUnion(b), witness));
double[][] c =
[
[9, 8, 8, 8, 7, 6],
[9, 8, 6],
[9, 8, 5]
];
auto witness2 = [9, 8, 7, 6, 5];
assert(equal(multiwayUnion!"a > b"(c), witness2));
}
/**
Lazily computes the difference of `r1` and `r2`. The two ranges
are assumed to be sorted by `less`. The element types of the two
ranges must have a common type.
In the case of multisets, considering that element `a` appears `x`
times in `r1` and `y` times and `r2`, the number of occurences
of `a` in the resulting range is going to be `x-y` if x > y or 0 othwerise.
Params:
less = Predicate the given ranges are sorted by.
r1 = The first range.
r2 = The range to subtract from `r1`.
Returns:
A range of the difference of `r1` and `r2`.
See_also: $(LREF setSymmetricDifference)
*/
struct SetDifference(alias less = "a < b", R1, R2)
if (isInputRange!(R1) && isInputRange!(R2))
{
private:
R1 r1;
R2 r2;
alias comp = binaryFun!(less);
void adjustPosition()
{
while (!r1.empty)
{
if (r2.empty || comp(r1.front, r2.front)) break;
if (comp(r2.front, r1.front))
{
r2.popFront();
}
else
{
// both are equal
r1.popFront();
r2.popFront();
}
}
}
public:
///
this(R1 r1, R2 r2)
{
this.r1 = r1;
this.r2 = r2;
// position to the first element
adjustPosition();
}
///
void popFront()
{
r1.popFront();
adjustPosition();
}
///
@property auto ref front()
{
assert(!empty);
return r1.front;
}
static if (isForwardRange!R1 && isForwardRange!R2)
{
///
@property typeof(this) save()
{
auto ret = this;
ret.r1 = r1.save;
ret.r2 = r2.save;
return ret;
}
}
///
@property bool empty() { return r1.empty; }
}
/// Ditto
SetDifference!(less, R1, R2) setDifference(alias less = "a < b", R1, R2)
(R1 r1, R2 r2)
{
return typeof(return)(r1, r2);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range.primitives : isForwardRange;
//sets
int[] a = [ 1, 2, 4, 5, 7, 9 ];
int[] b = [ 0, 1, 2, 4, 7, 8 ];
assert(equal(setDifference(a, b), [5, 9]));
static assert(isForwardRange!(typeof(setDifference(a, b))));
// multisets
int[] x = [1, 1, 1, 2, 3];
int[] y = [1, 1, 2, 4, 5];
auto r = setDifference(x, y);
assert(equal(r, [1, 3]));
assert(setDifference(r, x).empty);
}
@safe unittest // Issue 10460
{
import std.algorithm.comparison : equal;
int[] a = [1, 2, 3, 4, 5];
int[] b = [2, 4];
foreach (ref e; setDifference(a, b))
e = 0;
assert(equal(a, [0, 2, 0, 4, 0]));
}
/**
Lazily computes the intersection of two or more input ranges $(D
ranges). The ranges are assumed to be sorted by `less`. The element
types of the ranges must have a common type.
In the case of multisets, the range with the minimum number of
occurences of a given element, propagates the number of
occurences of this element to the resulting range.
Params:
less = Predicate the given ranges are sorted by.
ranges = The ranges to compute the intersection for.
Returns:
A range containing the intersection of the given ranges.
*/
struct SetIntersection(alias less = "a < b", Rs...)
if (Rs.length >= 2 && allSatisfy!(isInputRange, Rs) &&
!is(CommonType!(staticMap!(ElementType, Rs)) == void))
{
private:
Rs _input;
alias comp = binaryFun!less;
alias ElementType = CommonType!(staticMap!(.ElementType, Rs));
// Positions to the first elements that are all equal
void adjustPosition()
{
if (empty) return;
size_t done = Rs.length;
static if (Rs.length > 1) while (true)
{
foreach (i, ref r; _input)
{
alias next = _input[(i + 1) % Rs.length];
if (comp(next.front, r.front))
{
do
{
next.popFront();
if (next.empty) return;
} while (comp(next.front, r.front));
done = Rs.length;
}
if (--done == 0) return;
}
}
}
public:
///
this(Rs input)
{
this._input = input;
// position to the first element
adjustPosition();
}
///
@property bool empty()
{
foreach (ref r; _input)
{
if (r.empty) return true;
}
return false;
}
///
void popFront()
{
assert(!empty);
static if (Rs.length > 1) foreach (i, ref r; _input)
{
alias next = _input[(i + 1) % Rs.length];
assert(!comp(r.front, next.front));
}
foreach (ref r; _input)
{
r.popFront();
}
adjustPosition();
}
///
@property ElementType front()
{
assert(!empty);
return _input[0].front;
}
static if (allSatisfy!(isForwardRange, Rs))
{
///
@property SetIntersection save()
{
auto ret = this;
foreach (i, ref r; _input)
{
ret._input[i] = r.save;
}
return ret;
}
}
}
/// Ditto
SetIntersection!(less, Rs) setIntersection(alias less = "a < b", Rs...)(Rs ranges)
if (Rs.length >= 2 && allSatisfy!(isInputRange, Rs) &&
!is(CommonType!(staticMap!(ElementType, Rs)) == void))
{
return typeof(return)(ranges);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
// sets
int[] a = [ 1, 2, 4, 5, 7, 9 ];
int[] b = [ 0, 1, 2, 4, 7, 8 ];
int[] c = [ 0, 1, 4, 5, 7, 8 ];
assert(equal(setIntersection(a, a), a));
assert(equal(setIntersection(a, b), [1, 2, 4, 7]));
assert(equal(setIntersection(a, b, c), [1, 4, 7]));
// multisets
int[] d = [ 1, 1, 2, 2, 7, 7 ];
int[] e = [ 1, 1, 1, 7];
assert(equal(setIntersection(a, d), [1, 2, 7]));
assert(equal(setIntersection(d, e), [1, 1, 7]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter;
int[] a = [ 1, 2, 4, 5, 7, 9 ];
int[] b = [ 0, 1, 2, 4, 7, 8 ];
int[] c = [ 0, 1, 4, 5, 7, 8 ];
int[] d = [ 1, 3, 4 ];
int[] e = [ 4, 5 ];
assert(equal(setIntersection(a, a), a));
assert(equal(setIntersection(a, a, a), a));
assert(equal(setIntersection(a, b), [1, 2, 4, 7]));
assert(equal(setIntersection(a, b, c), [1, 4, 7]));
assert(equal(setIntersection(a, b, c, d), [1, 4]));
assert(equal(setIntersection(a, b, c, d, e), [4]));
auto inpA = a.filter!(_ => true), inpB = b.filter!(_ => true);
auto inpC = c.filter!(_ => true), inpD = d.filter!(_ => true);
assert(equal(setIntersection(inpA, inpB, inpC, inpD), [1, 4]));
assert(equal(setIntersection(a, b, b, a), [1, 2, 4, 7]));
assert(equal(setIntersection(a, c, b), [1, 4, 7]));
assert(equal(setIntersection(b, a, c), [1, 4, 7]));
assert(equal(setIntersection(b, c, a), [1, 4, 7]));
assert(equal(setIntersection(c, a, b), [1, 4, 7]));
assert(equal(setIntersection(c, b, a), [1, 4, 7]));
}
/**
Lazily computes the symmetric difference of `r1` and `r2`,
i.e. the elements that are present in exactly one of `r1` and $(D
r2). The two ranges are assumed to be sorted by `less`, and the
output is also sorted by `less`. The element types of the two
ranges must have a common type.
If both ranges are sets (without duplicated elements), the resulting
range is going to be a set. If at least one of the ranges is a multiset,
the number of occurences of an element `x` in the resulting range is `abs(a-b)`
where `a` is the number of occurences of `x` in `r1`, `b` is the number of
occurences of `x` in `r2`, and `abs` is the absolute value.
If both arguments are ranges of L-values of the same type then
`SetSymmetricDifference` will also be a range of L-values of
that type.
Params:
less = Predicate the given ranges are sorted by.
r1 = The first range.
r2 = The second range.
Returns:
A range of the symmetric difference between `r1` and `r2`.
See_also: $(LREF setDifference)
*/
struct SetSymmetricDifference(alias less = "a < b", R1, R2)
if (isInputRange!(R1) && isInputRange!(R2))
{
private:
R1 r1;
R2 r2;
//bool usingR2;
alias comp = binaryFun!(less);
void adjustPosition()
{
while (!r1.empty && !r2.empty)
{
if (comp(r1.front, r2.front) || comp(r2.front, r1.front))
{
break;
}
// equal, pop both
r1.popFront();
r2.popFront();
}
}
public:
///
this(R1 r1, R2 r2)
{
this.r1 = r1;
this.r2 = r2;
// position to the first element
adjustPosition();
}
///
void popFront()
{
assert(!empty);
if (r1.empty) r2.popFront();
else if (r2.empty) r1.popFront();
else
{
// neither is empty
if (comp(r1.front, r2.front))
{
r1.popFront();
}
else
{
assert(comp(r2.front, r1.front));
r2.popFront();
}
}
adjustPosition();
}
///
@property auto ref front()
{
assert(!empty);
immutable chooseR1 = r2.empty || !r1.empty && comp(r1.front, r2.front);
assert(chooseR1 || r1.empty || comp(r2.front, r1.front));
return chooseR1 ? r1.front : r2.front;
}
static if (isForwardRange!R1 && isForwardRange!R2)
{
///
@property typeof(this) save()
{
auto ret = this;
ret.r1 = r1.save;
ret.r2 = r2.save;
return ret;
}
}
///
ref auto opSlice() { return this; }
///
@property bool empty() { return r1.empty && r2.empty; }
}
/// Ditto
SetSymmetricDifference!(less, R1, R2)
setSymmetricDifference(alias less = "a < b", R1, R2)
(R1 r1, R2 r2)
{
return typeof(return)(r1, r2);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range.primitives : isForwardRange;
// sets
int[] a = [ 1, 2, 4, 5, 7, 9 ];
int[] b = [ 0, 1, 2, 4, 7, 8 ];
assert(equal(setSymmetricDifference(a, b), [0, 5, 8, 9][]));
static assert(isForwardRange!(typeof(setSymmetricDifference(a, b))));
//mutisets
int[] c = [1, 1, 1, 1, 2, 2, 2, 4, 5, 6];
int[] d = [1, 1, 2, 2, 2, 2, 4, 7, 9];
assert(equal(setSymmetricDifference(c, d), setSymmetricDifference(d, c)));
assert(equal(setSymmetricDifference(c, d), [1, 1, 2, 5, 6, 7, 9]));
}
@safe unittest // Issue 10460
{
import std.algorithm.comparison : equal;
int[] a = [1, 2];
double[] b = [2.0, 3.0];
int[] c = [2, 3];
alias R1 = typeof(setSymmetricDifference(a, b));
static assert(is(ElementType!R1 == double));
static assert(!hasLvalueElements!R1);
alias R2 = typeof(setSymmetricDifference(a, c));
static assert(is(ElementType!R2 == int));
static assert(hasLvalueElements!R2);
assert(equal(setSymmetricDifference(a, b), [1.0, 3.0]));
assert(equal(setSymmetricDifference(a, c), [1, 3]));
}
/++
TODO: once SetUnion got deprecated we can provide the usual definition
(= merge + filter after uniqs)
See: https://github.com/dlang/phobos/pull/4249
/**
Lazily computes the union of two or more ranges `rs`. The ranges
are assumed to be sorted by `less`. Elements in the output are
unique. The element types of all ranges must have a common type.
Params:
less = Predicate the given ranges are sorted by.
rs = The ranges to compute the union for.
Returns:
A range containing the unique union of the given ranges.
See_Also:
$(REF merge, std,algorithm,sorting)
*/
auto setUnion(alias less = "a < b", Rs...)
(Rs rs)
{
import std.algorithm.iteration : uniq;
import std.algorithm.sorting : merge;
return merge!(less, Rs)(rs).uniq;
}
///
@safe pure nothrow unittest
///
{
import std.algorithm.comparison : equal;
int[] a = [1, 3, 5];
int[] b = [2, 3, 4];
assert(a.setUnion(b).equal([1, 2, 3, 4, 5]));
}
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
int[] a = [ 1, 2, 4, 5, 7, 9 ];
int[] b = [ 0, 1, 2, 4, 7, 8 ];
double[] c = [ 10.5 ];
assert(equal(setUnion(a, b), [0, 1, 2, 4, 5, 7, 8, 9][]));
assert(equal(setUnion(a, c, b),
[0, 1, 2, 4, 5, 7, 8, 9, 10.5][]));
}
@safe unittest
{
// save
import std.range : dropOne;
int[] a = [0, 1, 2];
int[] b = [0, 3];
auto arr = a.setUnion(b);
assert(arr.front == 0);
assert(arr.save.dropOne.front == 1);
assert(arr.front == 0);
}
@nogc @safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
static immutable a = [1, 3, 5];
static immutable b = [2, 4];
static immutable r = [1, 2, 3, 4, 5];
assert(a.setUnion(b).equal(r));
}
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange;
import std.range : iota;
auto dummyResult1 = [1, 1.5, 2, 3, 4, 5, 5.5, 6, 7, 8, 9, 10];
auto dummyResult2 = iota(1, 11);
foreach (DummyType; AllDummyRanges)
{
DummyType d;
assert(d.setUnion([1, 1.5, 5.5]).equal(dummyResult1));
assert(d.setUnion(d).equal(dummyResult2));
}
}
++/
| D |
/**
<script type="text/javascript">inhibitQuickIndex = 1</script>
$(BOOKTABLE ,
$(TR $(TH Category) $(TH Functions)
)
$(TR $(TDNW Template API) $(TD $(MYREF isDigest) $(MYREF DigestType) $(MYREF hasPeek)
$(MYREF ExampleDigest) $(MYREF _digest) $(MYREF hexDigest) $(MYREF makeDigest)
)
)
$(TR $(TDNW OOP API) $(TD $(MYREF Digest)
)
)
$(TR $(TDNW Helper functions) $(TD $(MYREF toHexString))
)
$(TR $(TDNW Implementation helpers) $(TD $(MYREF digestLength) $(MYREF WrapperDigest))
)
)
* This module describes the digest APIs used in Phobos. All digests follow these APIs.
* Additionally, this module contains useful helper methods which can be used with every _digest type.
*
* APIs:
* There are two APIs for digests: The template API and the OOP API. The template API uses structs
* and template helpers like $(LREF isDigest). The OOP API implements digests as classes inheriting
* the $(LREF Digest) interface. All digests are named so that the template API struct is called "$(B x)"
* and the OOP API class is called "$(B x)Digest". For example we have $(D MD5) <--> $(D MD5Digest),
* $(D CRC32) <--> $(D CRC32Digest), etc.
*
* The template API is slightly more efficient. It does not have to allocate memory dynamically,
* all memory is allocated on the stack. The OOP API has to allocate in the finish method if no
* buffer was provided. If you provide a buffer to the OOP APIs finish function, it doesn't allocate,
* but the $(LREF Digest) classes still have to be created using $(D new) which allocates them using the GC.
*
* The OOP API is useful to change the _digest function and/or _digest backend at 'runtime'. The benefit here
* is that switching e.g. Phobos MD5Digest and an OpenSSLMD5Digest implementation is ABI compatible.
*
* If just one specific _digest type and backend is needed, the template API is usually a good fit.
* In this simplest case, the template API can even be used without templates: Just use the "$(B x)" structs
* directly.
*
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>
* Authors:
* Johannes Pfau
*
* Source: $(PHOBOSSRC std/_digest/_digest.d)
*
* Macros:
* MYREF = <font face='Consolas, "Bitstream Vera Sans Mono", "Andale Mono", Monaco, "DejaVu Sans Mono", "Lucida Console", monospace'><a href="#$1">$1</a> </font>
* MYREF2 = <font face='Consolas, "Bitstream Vera Sans Mono", "Andale Mono", Monaco, "DejaVu Sans Mono", "Lucida Console", monospace'><a href="#$2">$1</a> </font>
* MYREF3 = <a href="#$2">$(D $1)</a>
*
* CTFE:
* Digests do not work in CTFE
*
* TODO:
* Digesting single bits (as opposed to bytes) is not implemented. This will be done as another
* template constraint helper (hasBitDigesting!T) and an additional interface (BitDigest)
*/
/* Copyright Johannes Pfau 2012.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module std.digest.digest;
import std.exception, std.range, std.traits;
import std.algorithm : copy;
import std.typetuple : allSatisfy;
import std.ascii : LetterCase;
///
unittest
{
import std.digest.crc;
//Simple example
char[8] hexHash = hexDigest!CRC32("The quick brown fox jumps over the lazy dog");
assert(hexHash == "39A34F41");
//Simple example, using the API manually
CRC32 context = makeDigest!CRC32();
context.put(cast(ubyte[])"The quick brown fox jumps over the lazy dog");
ubyte[4] hash = context.finish();
assert(toHexString(hash) == "39A34F41");
}
///
unittest
{
//Generating the hashes of a file, idiomatic D way
import std.digest.crc, std.digest.sha, std.digest.md;
import std.stdio;
// Digests a file and prints the result.
void digestFile(Hash)(string filename) if(isDigest!Hash)
{
auto file = File(filename);
auto result = digest!Hash(file.byChunk(4096 * 1024));
writefln("%s (%s) = %s", Hash.stringof, filename, toHexString(result));
}
void main(string[] args)
{
foreach (name; args[1 .. $])
{
digestFile!MD5(name);
digestFile!SHA1(name);
digestFile!CRC32(name);
}
}
}
///
unittest
{
//Generating the hashes of a file using the template API
import std.digest.crc, std.digest.sha, std.digest.md;
import std.stdio;
// Digests a file and prints the result.
void digestFile(Hash)(ref Hash hash, string filename) if(isDigest!Hash)
{
File file = File(filename);
//As digests imlement OutputRange, we could use std.algorithm.copy
//Let's do it manually for now
foreach (buffer; file.byChunk(4096 * 1024))
hash.put(buffer);
auto result = hash.finish();
writefln("%s (%s) = %s", Hash.stringof, filename, toHexString(result));
}
void uMain(string[] args)
{
MD5 md5;
SHA1 sha1;
CRC32 crc32;
md5.start();
sha1.start();
crc32.start();
foreach (arg; args[1 .. $])
{
digestFile(md5, arg);
digestFile(sha1, arg);
digestFile(crc32, arg);
}
}
}
///
unittest
{
import std.digest.crc, std.digest.sha, std.digest.md;
import std.stdio;
// Digests a file and prints the result.
void digestFile(Digest hash, string filename)
{
File file = File(filename);
//As digests implement OutputRange, we could use std.algorithm.copy
//Let's do it manually for now
foreach (buffer; file.byChunk(4096 * 1024))
hash.put(buffer);
ubyte[] result = hash.finish();
writefln("%s (%s) = %s", typeid(hash).toString(), filename, toHexString(result));
}
void umain(string[] args)
{
auto md5 = new MD5Digest();
auto sha1 = new SHA1Digest();
auto crc32 = new CRC32Digest();
foreach (arg; args[1 .. $])
{
digestFile(md5, arg);
digestFile(sha1, arg);
digestFile(crc32, arg);
}
}
}
version(StdDdoc)
version = ExampleDigest;
version(ExampleDigest)
{
/**
* This documents the general structure of a Digest in the template API.
* All digest implementations should implement the following members and therefore pass
* the $(LREF isDigest) test.
*
* Note:
* $(UL
* $(LI A digest must be a struct (value type) to pass the $(LREF isDigest) test.)
* $(LI A digest passing the $(LREF isDigest) test is always an $(D OutputRange))
* )
*/
struct ExampleDigest
{
public:
/**
* Use this to feed the digest with data.
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
* $(D const(ubyte)[]).
* The following usages of $(D put) must work for any type which passes $(LREF isDigest):
* Examples:
* ----
* ExampleDigest dig;
* dig.put(cast(ubyte)0); //single ubyte
* dig.put(cast(ubyte)0, cast(ubyte)0); //variadic
* ubyte[10] buf;
* dig.put(buf); //buffer
* ----
*/
@trusted void put(scope const(ubyte)[] data...)
{
}
/**
* This function is used to (re)initialize the digest.
* It must be called before using the digest and it also works as a 'reset' function
* if the digest has already processed data.
*/
@trusted void start()
{
}
/**
* The finish function returns the final hash sum and resets the Digest.
*
* Note:
* The actual type returned by finish depends on the digest implementation.
* $(D ubyte[16]) is just used as an example. It is guaranteed that the type is a
* static array of ubytes.
*
* $(UL
* $(LI Use $(LREF DigestType) to obtain the actual return type.)
* $(LI Use $(LREF digestLength) to obtain the length of the ubyte array.)
* )
*/
@trusted ubyte[16] finish()
{
return (ubyte[16]).init;
}
}
}
///
unittest
{
//Using the OutputRange feature
import std.algorithm : copy;
import std.range : repeat;
import std.digest.md;
auto oneMillionRange = repeat!ubyte(cast(ubyte)'a', 1000000);
auto ctx = makeDigest!MD5();
copy(oneMillionRange, &ctx); //Note: You must pass a pointer to copy!
assert(ctx.finish().toHexString() == "7707D6AE4E027C70EEA2A935C2296F21");
}
/**
* Use this to check if a type is a digest. See $(LREF ExampleDigest) to see what
* a type must provide to pass this check.
*
* Note:
* This is very useful as a template constraint (see examples)
*
* BUGS:
* $(UL
* $(LI Does not yet verify that put takes scope parameters.)
* $(LI Should check that finish() returns a ubyte[num] array)
* )
*/
template isDigest(T)
{
enum bool isDigest = isOutputRange!(T, const(ubyte)[]) && isOutputRange!(T, ubyte) &&
is(T == struct) &&
is(typeof(
{
T dig = void; //Can define
dig.put(cast(ubyte)0, cast(ubyte)0); //varags
dig.start(); //has start
auto value = dig.finish(); //has finish
}));
}
///
unittest
{
import std.digest.crc;
static assert(isDigest!CRC32);
}
///
unittest
{
import std.digest.crc;
void myFunction(T)() if(isDigest!T)
{
T dig;
dig.start();
auto result = dig.finish();
}
myFunction!CRC32();
}
/**
* Use this template to get the type which is returned by a digest's $(LREF finish) method.
*/
template DigestType(T)
{
static if(isDigest!T)
{
alias ReturnType!(typeof(
{
T dig = void;
return dig.finish();
})) DigestType;
}
else
static assert(false, T.stringof ~ " is not a digest! (fails isDigest!T)");
}
///
unittest
{
import std.digest.crc;
assert(is(DigestType!(CRC32) == ubyte[4]));
}
///
unittest
{
import std.digest.crc;
CRC32 dig;
dig.start();
DigestType!CRC32 result = dig.finish();
}
/**
* Used to check if a digest supports the $(D peek) method.
* Peek has exactly the same function signatures as finish, but it doesn't reset
* the digest's internal state.
*
* Note:
* $(UL
* $(LI This is very useful as a template constraint (see examples))
* $(LI This also checks if T passes $(LREF isDigest))
* )
*/
template hasPeek(T)
{
enum bool hasPeek = isDigest!T &&
is(typeof(
{
T dig = void; //Can define
DigestType!T val = dig.peek();
}));
}
///
unittest
{
import std.digest.crc, std.digest.md;
assert(!hasPeek!(MD5));
assert(hasPeek!CRC32);
}
///
unittest
{
import std.digest.crc;
void myFunction(T)() if(hasPeek!T)
{
T dig;
dig.start();
auto result = dig.peek();
}
myFunction!CRC32();
}
private template isDigestibleRange(Range)
{
import std.digest.md;
enum bool isDigestibleRange = isInputRange!Range && is(typeof(
{
MD5 ha; //Could use any conformant hash
ElementType!Range val;
ha.put(val);
}));
}
/**
* This is a convenience function to calculate a hash using the template API.
* Every digest passing the $(LREF isDigest) test can be used with this function.
*
* Params:
* range= an $(D InputRange) with $(D ElementType) $(D ubyte), $(D ubyte[]) or $(D ubyte[num])
*/
DigestType!Hash digest(Hash, Range)(auto ref Range range) if(!isArray!Range
&& isDigestibleRange!Range)
{
Hash hash;
hash.start();
copy(range, &hash);
return hash.finish();
}
///
unittest
{
import std.digest.md;
auto testRange = repeat!ubyte(cast(ubyte)'a', 100);
auto md5 = digest!MD5(testRange);
}
/**
* This overload of the digest function handles arrays.
*
* Params:
* data= one or more arrays of any type
*/
DigestType!Hash digest(Hash, T...)(scope const T data) if(allSatisfy!(isArray, typeof(data)))
{
Hash hash;
hash.start();
foreach(datum; data)
hash.put(cast(const(ubyte[]))datum);
return hash.finish();
}
///
unittest
{
import std.digest.md, std.digest.sha, std.digest.crc;
auto md5 = digest!MD5( "The quick brown fox jumps over the lazy dog");
auto sha1 = digest!SHA1( "The quick brown fox jumps over the lazy dog");
auto crc32 = digest!CRC32("The quick brown fox jumps over the lazy dog");
assert(toHexString(crc32) == "39A34F41");
}
///
unittest
{
import std.digest.crc;
auto crc32 = digest!CRC32("The quick ", "brown ", "fox jumps over the lazy dog");
assert(toHexString(crc32) == "39A34F41");
}
/**
* This is a convenience function similar to $(LREF digest), but it returns the string
* representation of the hash. Every digest passing the $(LREF isDigest) test can be used with this
* function.
*
* Params:
* order= the order in which the bytes are processed (see $(LREF toHexString))
* range= an $(D InputRange) with $(D ElementType) $(D ubyte), $(D ubyte[]) or $(D ubyte[num])
*/
char[digestLength!(Hash)*2] hexDigest(Hash, Order order = Order.increasing, Range)(ref Range range)
if(!isArray!Range && isDigestibleRange!Range)
{
return toHexString!order(digest!Hash(range));
}
///
unittest
{
import std.digest.md;
auto testRange = repeat!ubyte(cast(ubyte)'a', 100);
assert(hexDigest!MD5(testRange) == "36A92CC94A9E0FA21F625F8BFB007ADF");
}
/**
* This overload of the hexDigest function handles arrays.
*
* Params:
* order= the order in which the bytes are processed (see $(LREF toHexString))
* data= one or more arrays of any type
*/
char[digestLength!(Hash)*2] hexDigest(Hash, Order order = Order.increasing, T...)(scope const T data)
if(allSatisfy!(isArray, typeof(data)))
{
return toHexString!order(digest!Hash(data));
}
///
unittest
{
import std.digest.crc;
assert(hexDigest!(CRC32, Order.decreasing)("The quick brown fox jumps over the lazy dog") == "414FA339");
}
///
unittest
{
import std.digest.crc;
assert(hexDigest!(CRC32, Order.decreasing)("The quick ", "brown ", "fox jumps over the lazy dog") == "414FA339");
}
/**
* This is a convenience function which returns an initialized digest, so it's not necessary to call
* start manually.
*/
Hash makeDigest(Hash)()
{
Hash hash;
hash.start();
return hash;
}
///
unittest
{
import std.digest.md;
auto md5 = makeDigest!MD5();
md5.put(0);
assert(toHexString(md5.finish()) == "93B885ADFE0DA089CDF634904FD59F71");
}
/*+*************************** End of template part, welcome to OOP land **************************/
/**
* This describes the OOP API. To understand when to use the template API and when to use the OOP API,
* see the module documentation at the top of this page.
*
* The Digest interface is the base interface which is implemented by all digests.
*
* Note:
* A Digest implementation is always an $(D OutputRange)
*/
interface Digest
{
public:
/**
* Use this to feed the digest with data.
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
* $(D const(ubyte)[]).
*
* Examples:
* ----
* void test(Digest dig)
* {
* dig.put(cast(ubyte)0); //single ubyte
* dig.put(cast(ubyte)0, cast(ubyte)0); //variadic
* ubyte[10] buf;
* dig.put(buf); //buffer
* }
* ----
*/
@trusted nothrow void put(scope const(ubyte)[] data...);
/**
* Resets the internal state of the digest.
* Note:
* $(LREF finish) calls this internally, so it's not necessary to call
* $(D reset) manually after a call to $(LREF finish).
*/
@trusted nothrow void reset();
/**
* This is the length in bytes of the hash value which is returned by $(LREF finish).
* It's also the required size of a buffer passed to $(LREF finish).
*/
@trusted nothrow @property size_t length() const;
/**
* The finish function returns the hash value. It takes an optional buffer to copy the data
* into. If a buffer is passed, it must be at least $(LREF length) bytes big.
*/
@trusted nothrow ubyte[] finish();
///ditto
nothrow ubyte[] finish(scope ubyte[] buf);
//@@@BUG@@@ http://d.puremagic.com/issues/show_bug.cgi?id=6549
/*in
{
assert(buf.length >= this.length);
}*/
/**
* This is a convenience function to calculate the hash of a value using the OOP API.
*/
final @trusted nothrow ubyte[] digest(scope const(void[])[] data...)
{
this.reset();
foreach(datum; data)
this.put(cast(ubyte[])datum);
return this.finish();
}
}
///
unittest
{
//Using the OutputRange feature
import std.algorithm : copy;
import std.range : repeat;
import std.digest.md;
auto oneMillionRange = repeat!ubyte(cast(ubyte)'a', 1000000);
auto ctx = new MD5Digest();
copy(oneMillionRange, ctx);
assert(ctx.finish().toHexString() == "7707D6AE4E027C70EEA2A935C2296F21");
}
///
unittest
{
import std.digest.md, std.digest.sha, std.digest.crc;
ubyte[] md5 = (new MD5Digest()).digest("The quick brown fox jumps over the lazy dog");
ubyte[] sha1 = (new SHA1Digest()).digest("The quick brown fox jumps over the lazy dog");
ubyte[] crc32 = (new CRC32Digest()).digest("The quick brown fox jumps over the lazy dog");
assert(crcHexString(crc32) == "414FA339");
}
///
unittest
{
import std.digest.crc;
ubyte[] crc32 = (new CRC32Digest()).digest("The quick ", "brown ", "fox jumps over the lazy dog");
assert(crcHexString(crc32) == "414FA339");
}
unittest
{
assert(!isDigest!(Digest));
assert(isOutputRange!(Digest, ubyte));
}
///
unittest
{
void test(Digest dig)
{
dig.put(cast(ubyte)0); //single ubyte
dig.put(cast(ubyte)0, cast(ubyte)0); //variadic
ubyte[10] buf;
dig.put(buf); //buffer
}
}
/*+*************************** End of OOP part, helper functions follow ***************************/
/**
* See $(LREF toHexString)
*/
enum Order : bool
{
increasing, ///
decreasing ///
}
/**
* Used to convert a hash value (a static or dynamic array of ubytes) to a string.
* Can be used with the OOP and with the template API.
*
* The additional order parameter can be used to specify the order of the input data.
* By default the data is processed in increasing order, starting at index 0. To process it in the
* opposite order, pass Order.decreasing as a parameter.
*
* The additional letterCase parameter can be used to specify the case of the output data.
* By default the output is in upper case. To change it to the lower case
* pass LetterCase.lower as a parameter.
*/
char[num*2] toHexString(Order order = Order.increasing, size_t num, LetterCase letterCase = LetterCase.upper)
(in ubyte[num] digest)
{
static if (letterCase == LetterCase.upper)
{
import std.ascii : hexDigits = hexDigits;
}
else
{
import std.ascii : hexDigits = lowerHexDigits;
}
char[num*2] result;
size_t i;
static if(order == Order.increasing)
{
foreach(u; digest)
{
result[i++] = hexDigits[u >> 4];
result[i++] = hexDigits[u & 15];
}
}
else
{
size_t j = num - 1;
while(i < num*2)
{
result[i++] = hexDigits[digest[j] >> 4];
result[i++] = hexDigits[digest[j] & 15];
j--;
}
}
return result;
}
///ditto
auto toHexString(LetterCase letterCase, Order order = Order.increasing, size_t num)(in ubyte[num] digest)
{
return toHexString!(order, num, letterCase)(digest);
}
///ditto
string toHexString(Order order = Order.increasing, LetterCase letterCase = LetterCase.upper)
(in ubyte[] digest)
{
static if (letterCase == LetterCase.upper)
{
import std.ascii : hexDigits = hexDigits;
}
else
{
import std.ascii : hexDigits = lowerHexDigits;
}
auto result = new char[digest.length*2];
size_t i;
static if(order == Order.increasing)
{
foreach(u; digest)
{
result[i++] = hexDigits[u >> 4];
result[i++] = hexDigits[u & 15];
}
}
else
{
foreach(u; retro(digest))
{
result[i++] = hexDigits[u >> 4];
result[i++] = hexDigits[u & 15];
}
}
return assumeUnique(result);
}
///ditto
auto toHexString(LetterCase letterCase, Order order = Order.increasing)(in ubyte[] digest)
{
return toHexString!(order, letterCase)(digest);
}
//For more example unittests, see Digest.digest, digest
///
unittest
{
import std.digest.crc;
//Test with template API:
auto crc32 = digest!CRC32("The quick ", "brown ", "fox jumps over the lazy dog");
//Lower case variant:
assert(toHexString!(LetterCase.lower)(crc32) == "39a34f41");
//Usually CRCs are printed in this order, though:
assert(toHexString!(Order.decreasing)(crc32) == "414FA339");
assert(toHexString!(LetterCase.lower, Order.decreasing)(crc32) == "414fa339");
}
///
unittest
{
import std.digest.crc;
// With OOP API
auto crc32 = (new CRC32Digest()).digest("The quick ", "brown ", "fox jumps over the lazy dog");
//Usually CRCs are printed in this order, though:
assert(toHexString!(Order.decreasing)(crc32) == "414FA339");
}
unittest
{
ubyte[16] data;
assert(toHexString(data) == "00000000000000000000000000000000");
assert(toHexString(cast(ubyte[4])[42, 43, 44, 45]) == "2A2B2C2D");
assert(toHexString(cast(ubyte[])[42, 43, 44, 45]) == "2A2B2C2D");
assert(toHexString!(Order.decreasing)(cast(ubyte[4])[42, 43, 44, 45]) == "2D2C2B2A");
assert(toHexString!(Order.decreasing, LetterCase.lower)(cast(ubyte[4])[42, 43, 44, 45]) == "2d2c2b2a");
assert(toHexString!(Order.decreasing)(cast(ubyte[])[42, 43, 44, 45]) == "2D2C2B2A");
}
/*+*********************** End of public helper part, private helpers follow ***********************/
/*
* Used to convert from a ubyte[] slice to a ref ubyte[N].
* This helper is used internally in the WrapperDigest template to wrap the template API's
* finish function.
*/
ref T[N] asArray(size_t N, T)(ref T[] source, string errorMsg = "")
{
assert(source.length >= N, errorMsg);
return *cast(T[N]*)source.ptr;
}
/**
* This helper is used internally in the WrapperDigest template, but it might be
* useful for other purposes as well. It returns the length (in bytes) of the hash value
* produced by T.
*/
template digestLength(T) if(isDigest!T)
{
enum size_t digestLength = (ReturnType!(T.finish)).length;
}
/**
* Wraps a template API hash struct into a Digest interface.
* Modules providing digest implementations will usually provide
* an alias for this template (e.g. MD5Digest, SHA1Digest, ...).
*/
class WrapperDigest(T) if(isDigest!T) : Digest
{
protected:
T _digest;
public final:
/**
* Initializes the digest.
*/
this()
{
_digest.start();
}
/**
* Use this to feed the digest with data.
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
* $(D const(ubyte)[]).
*/
@trusted nothrow void put(scope const(ubyte)[] data...)
{
_digest.put(data);
}
/**
* Resets the internal state of the digest.
* Note:
* $(LREF finish) calls this internally, so it's not necessary to call
* $(D reset) manually after a call to $(LREF finish).
*/
@trusted nothrow void reset()
{
_digest.start();
}
/**
* This is the length in bytes of the hash value which is returned by $(LREF finish).
* It's also the required size of a buffer passed to $(LREF finish).
*/
@trusted nothrow @property size_t length() const pure
{
return digestLength!T;
}
/**
* The finish function returns the hash value. It takes an optional buffer to copy the data
* into. If a buffer is passed, it must have a length at least $(LREF length) bytes.
*
* Examples:
* --------
*
* import std.digest.md;
* ubyte[16] buf;
* auto hash = new WrapperDigest!MD5();
* hash.put(cast(ubyte)0);
* auto result = hash.finish(buf[]);
* //The result is now in result (and in buf). If you pass a buffer which is bigger than
* //necessary, result will have the correct length, but buf will still have it's original
* //length
* --------
*/
nothrow ubyte[] finish(scope ubyte[] buf)
in
{
assert(buf.length >= this.length);
}
body
{
enum string msg = "Buffer needs to be at least " ~ digestLength!(T).stringof ~ " bytes " ~
"big, check " ~ typeof(this).stringof ~ ".length!";
asArray!(digestLength!T)(buf, msg) = _digest.finish();
return buf[0 .. digestLength!T];
}
///ditto
@trusted nothrow ubyte[] finish()
{
enum len = digestLength!T;
auto buf = new ubyte[len];
asArray!(digestLength!T)(buf) = _digest.finish();
return buf;
}
version(StdDdoc)
{
/**
* Works like $(D finish) but does not reset the internal state, so it's possible
* to continue putting data into this WrapperDigest after a call to peek.
*
* These functions are only available if $(D hasPeek!T) is true.
*/
@trusted ubyte[] peek(scope ubyte[] buf) const;
///ditto
@trusted ubyte[] peek() const;
}
else static if(hasPeek!T)
{
@trusted ubyte[] peek(scope ubyte[] buf) const
in
{
assert(buf.length >= this.length);
}
body
{
enum string msg = "Buffer needs to be at least " ~ digestLength!(T).stringof ~ " bytes " ~
"big, check " ~ typeof(this).stringof ~ ".length!";
asArray!(digestLength!T)(buf, msg) = _digest.peek();
return buf[0 .. digestLength!T];
}
@trusted ubyte[] peek() const
{
enum len = digestLength!T;
auto buf = new ubyte[len];
asArray!(digestLength!T)(buf) = _digest.peek();
return buf;
}
}
}
///
unittest
{
import std.digest.md;
//Simple example
auto hash = new WrapperDigest!MD5();
hash.put(cast(ubyte)0);
auto result = hash.finish();
}
///
unittest
{
//using a supplied buffer
import std.digest.md;
ubyte[16] buf;
auto hash = new WrapperDigest!MD5();
hash.put(cast(ubyte)0);
auto result = hash.finish(buf[]);
//The result is now in result (and in buf). If you pass a buffer which is bigger than
//necessary, result will have the correct length, but buf will still have it's original
//length
}
| D |
/**
Command line tool that reads TSV files and summarizes field values associated with
equivalent keys.
Copyright (c) 2016-2019, eBay Software Foundation
Initially written by Jon Degenhardt
License: Boost License 1.0 (http://boost.org/LICENSE_1_0.txt)
*/
module tsv_utils.tsv_summarize;
import std.algorithm : all, any, canFind, each, find, findSplit, map, joiner, splitter;
import std.array : join;
import std.conv : to;
import std.format : format;
import std.range;
import std.stdio;
import std.typecons : tuple;
import std.container : DList;
static if (__VERSION__ >= 2085) extern(C) __gshared string[] rt_options = [ "gcopt=cleanup:none" ];
version(unittest)
{
// When running unit tests, use main from -main compiler switch.
}
else
{
int main(string[] cmdArgs)
{
/* When running in DMD code coverage mode, turn on report merging. */
version(D_Coverage) version(DigitalMars)
{
import core.runtime : dmd_coverSetMerge;
dmd_coverSetMerge(true);
}
TsvSummarizeOptions cmdopt;
auto r = cmdopt.processArgs(cmdArgs);
if (!r[0]) return r[1];
version(LDC_Profile)
{
import ldc.profile : resetAll;
resetAll();
}
try tsvSummarize(cmdopt, cmdArgs[1..$]);
catch (Exception exc)
{
stderr.writefln("Error [%s]: %s", cmdopt.programName, exc.msg);
return 1;
}
return 0;
}
}
auto helpTextVerbose = q"EOS
Synopsis: tsv-summarize [options] file [file...]
tsv-summarize reads tabular data files (tab-separated by default), tracks
field values for each unique key, and runs summarization algorithms. Consider
the file data.tsv:
make color time
ford blue 131
chevy green 124
ford red 128
bmw black 118
bmw black 126
ford blue 122
The min and average times for each make is generated by the command:
$ tsv-summarize --header --group-by 1 --min 3 --mean 3 data.tsv
This produces:
make time_min time_mean
ford 122 127
chevy 124 124
bmw 118 122
Using '--group 1,2' will group by both 'make' and 'color'. Omitting the
'--group-by' entirely summarizes fields for full file.
The program tries to generate useful headers, but custom headers can be
specified. Example (using -g and -H shortcuts for --header and --group-by):
$ tsv-summarize -H -g 1 --min 3:fastest --mean 3:average data.tsv
Most operators take custom headers in a similarly way, generally following:
--<operator-name> FIELD[:header]
Operators can be specified multiple times. They can also take multiple
fields (though not when a custom header is specified). Examples:
--median 2,3,4
--median 2-5,7-11
The quantile operator requires one or more probabilities after the fields:
--quantile 2:0.25 // Quantile 1 of field 2
--quantile 2-4:0.25,0.5,0.75 // Q1, Median, Q3 of fields 2, 3, 4
Summarization operators available are:
count range mad values
retain sum var unique-values
first mean stddev unique-count
last median mode missing-count
min quantile mode-count not-missing-count
max
Calculated numeric values are printed to 12 significant digits by default.
This can be changed using the '--p|float-precision' option. If six or less
it sets the number of significant digits after the decimal point. If
greater than six it sets the total number of significant digits.
Calculations hold onto the minimum data needed while reading data. A few
operations like median keep all data values in memory. These operations will
start to encounter performance issues as available memory becomes scarce. The
size that can be handled effectively is machine dependent, but often quite
large files can be handled.
Operations requiring numeric entries will signal an error and terminate
processing if a non-numeric entry is found.
Missing values are not treated specially by default, this can be changed
using the '--x|exclude-missing' or '--r|replace-missing' option. The former
turns off processing for missing values, the latter uses a replacement value.
Options:
EOS";
auto helpText = q"EOS
Synopsis: tsv-summarize [options] file [file...]
tsv-summarize runs aggregation operations on fields in tab-separated value
files. Operations can be run against the full input data or grouped by key
fields. Use --help-verbose for more extensive help.
Options:
EOS";
/** Command line options - Container and processing. The processArgs method is used to
* process the command line.
*/
struct TsvSummarizeOptions {
string programName;
/* Options set directly by on the command line.. */
size_t[] keyFields; // -g, --group-by
bool hasHeader = false; // --header
bool writeHeader = false; // -w, --write-header
char inputFieldDelimiter = '\t'; // --d|delimiter
char valuesDelimiter = '|'; // --v|values-delimiter
size_t floatPrecision = 12; // --p|float-precision
bool excludeMissing = false; // --x|exclude-missing
string missingValueReplacement; // --r|replace-missing
bool helpVerbose = false; // --help-verbose
bool versionWanted = false; // --V|version
DList!Operator operators; // Operators, in the order specified.
size_t endFieldIndex = 0; // Derived value. Max field index used plus one.
MissingFieldPolicy globalMissingPolicy = new MissingFieldPolicy; // Derived value.
/* Returns a tuple. First value is true if command line arguments were successfully
* processed and execution should continue, or false if an error occurred or the user
* asked for help. If false, the second value is the appropriate exit code (0 or 1).
*
* Returning true (execution continues) means args have been validated and derived
* values calculated. In addition, field indices have been converted to zero-based.
*/
auto processArgs (ref string[] cmdArgs) {
import std.algorithm : any, each;
import std.getopt;
import std.path : baseName, stripExtension;
import std.typecons : Yes, No;
import tsv_utils.common.getopt_inorder;
import tsv_utils.common.utils : makeFieldListOptionHandler;
programName = (cmdArgs.length > 0) ? cmdArgs[0].stripExtension.baseName : "Unknown_program_name";
try
{
arraySep = ","; // Use comma to separate values in command line options
auto r = getoptInorder(
cmdArgs,
"help-verbose", " Print full help.", &helpVerbose,
std.getopt.config.caseSensitive,
"V|version", " Print version information and exit.", &versionWanted,
std.getopt.config.caseInsensitive,
"g|group-by", "<field-list> Fields to use as key.",
keyFields.makeFieldListOptionHandler!(size_t, Yes.convertToZeroBasedIndex),
std.getopt.config.caseSensitive,
"H|header", " Treat the first line of each file as a header.", &hasHeader,
std.getopt.config.caseInsensitive,
"w|write-header", " Write an output header even if there is no input header.", &writeHeader,
"d|delimiter", "CHR Field delimiter. Default: TAB. (Single byte UTF-8 characters only.)", &inputFieldDelimiter,
"v|values-delimiter", "CHR Values delimiter. Default: vertical bar (|). (Single byte UTF-8 characters only.)", &valuesDelimiter,
"p|float-precision", "NUM 'Precision' to use printing floating point numbers. Affects the number of digits printed and exponent use. Default: 12", &floatPrecision,
"x|exclude-missing", " Exclude missing (empty) fields from calculations.", &excludeMissing,
"r|replace-missing", "STR Replace missing (empty) fields with STR in calculations.", &missingValueReplacement,
"count", " Count occurrences of each unique key ('--g|group-by'), or the total number of records if no key field is specified.", &countOptionHandler,
"count-header", "STR Count occurrences of each unique key, like '--count', but use STR as the header.", &countHeaderOptionHandler,
"retain", "<field-list> Retain one copy of the field.", &operatorOptionHandler!RetainOperator,
"first", "<field-list>[:STR] First value seen.", &operatorOptionHandler!FirstOperator,
"last", "<field-list>[:STR] Last value seen.", &operatorOptionHandler!LastOperator,
"min", "<field-list>[:STR] Min value. (Numeric fields only.)", &operatorOptionHandler!MinOperator,
"max", "<field-list>[:STR] Max value. (Numeric fields only.)", &operatorOptionHandler!MaxOperator,
"range", "<field-list>[:STR] Difference between min and max values. (Numeric fields only.)", &operatorOptionHandler!RangeOperator,
"sum", "<field-list>[:STR] Sum of the values. (Numeric fields only.)", &operatorOptionHandler!SumOperator,
"mean", "<field-list>[:STR] Mean (average). (Numeric fields only.)", &operatorOptionHandler!MeanOperator,
"median", "<field-list>[:STR] Median value. (Numeric fields only. Reads all values into memory.)", &operatorOptionHandler!MedianOperator,
"quantile", "<field-list>:p[,p...][:STR] Quantiles. One or more fields, then one or more 0.0-1.0 probabilities. (Numeric fields only. Reads all values into memory.)", &quantileOperatorOptionHandler,
"mad", "<field-list>[:STR] Median absolute deviation from the median. Raw value, not scaled. (Numeric fields only. Reads all values into memory.)", &operatorOptionHandler!MadOperator,
"var", "<field-list>[:STR] Variance. (Sample variance, numeric fields only).", &operatorOptionHandler!VarianceOperator,
"stdev", "<field-list>[:STR] Standard deviation. (Sample st.dev, numeric fields only).", &operatorOptionHandler!StDevOperator,
"mode", "<field-list>[:STR] Mode. The most frequent value. (Reads all unique values into memory.)", &operatorOptionHandler!ModeOperator,
"mode-count", "<field-list>[:STR] Count of the most frequent value. (Reads all unique values into memory.)", &operatorOptionHandler!ModeCountOperator,
"unique-count", "<field-list>[:STR] Number of unique values. (Reads all unique values into memory.)", &operatorOptionHandler!UniqueCountOperator,
"missing-count", "<field-list>[:STR] Number of missing (empty) fields. Not affected by '--x|exclude-missing' or '--r|replace-missing'.", &operatorOptionHandler!MissingCountOperator,
"not-missing-count", "<field-list>[:STR] Number of filled (non-empty) fields. Not affected by '--r|replace-missing'.", &operatorOptionHandler!NotMissingCountOperator,
"values", "<field-list>[:STR] All the values, separated by --v|values-delimiter. (Reads all values into memory.)", &operatorOptionHandler!ValuesOperator,
"unique-values", "<field-list>[:STR] All the unique values, separated by --v|values-delimiter. (Reads all unique values into memory.)", &operatorOptionHandler!UniqueValuesOperator,
);
if (r.helpWanted)
{
defaultGetoptPrinter(helpText, r.options);
return tuple(false, 0);
}
else if (helpVerbose)
{
defaultGetoptPrinter(helpTextVerbose, r.options);
return tuple(false, 0);
}
else if (versionWanted)
{
import tsv_utils.common.tsvutils_version;
writeln(tsvutilsVersionNotice("tsv-summarize"));
return tuple(false, 0);
}
consistencyValidations();
derivations();
}
catch (Exception exc)
{
stderr.writefln("[%s] Error processing command line arguments: %s", programName, exc.msg);
return tuple(false, 1);
}
return tuple(true, 0);
}
/* operationOptionHandler functions are callbacks that process command line options
* specifying summarization operations. eg. '--max 5', '--last 3:LastEntry'. Handlers
* check syntactic correctness and instantiate Operator objects that do the work. This
* is also where 1-upped field numbers are converted to 0-based indices.
*/
private void operatorOptionHandler(OperatorClass : SingleFieldOperator)(string option, string optionVal)
{
import std.range : enumerate;
import std.typecons : Yes, No;
import tsv_utils.common.utils : parseFieldList;
auto valSplit = findSplit(optionVal, ":");
if (valSplit[0].empty || (!valSplit[1].empty && valSplit[2].empty))
{
throw new Exception(
format("Invalid option value: '--%s %s'. Expected: '--%s <field-list>' or '--%s <field>:<header>'.",
option, optionVal, option, option));
}
try foreach (fieldNum, fieldIndex;
valSplit[0].to!string
.parseFieldList!(size_t, Yes.convertToZeroBasedIndex).enumerate(1))
{
auto op = new OperatorClass(fieldIndex, globalMissingPolicy);
if (!valSplit[2].empty) // Header specified
{
if (fieldNum > 1)
{
throw new Exception(
format("Invalid option: '--%s %s'. Cannot specify a custom header when using multiple fields.",
option, optionVal));
}
else if (!op.allowCustomHeader)
{
throw new Exception(
format("Invalid option: '--%s %s'. Operator does not support custom headers.",
option, optionVal));
}
op.setCustomHeader(valSplit[2].to!string);
}
operators.insertBack(op);
if (fieldIndex >= endFieldIndex) endFieldIndex = fieldIndex + 1;
}
catch (Exception exc)
{
import std.format : format;
exc.msg = format("[--%s] %s", option, exc.msg);
throw exc;
}
}
/* QuantileOperator has a different syntax and needs a custom command option handler. */
private void quantileOperatorOptionHandler(string option, string optionVal)
{
import std.typecons : Yes, No;
import tsv_utils.common.utils : parseFieldList;
auto formatErrorMsg(string option, string optionVal)
{
return format(
"Invalid option value: '--%s %s'. Expected: '--%s <field-list>:<prob>[,<prob>]' or '--%s <field>:<prob>:<header>' where <prob> is a number between 0.0 and 1.0.",
option, optionVal, option, option);
}
auto split1 = findSplit(optionVal, ":");
if (split1[0].empty || (!split1[1].empty && split1[2].empty))
throw new Exception(formatErrorMsg(option, optionVal));
auto split2 = findSplit(split1[2], ":");
if (split2[0].empty || (!split2[1].empty && split2[2].empty))
throw new Exception(formatErrorMsg(option, optionVal));
auto fieldStr = split1[0];
auto probStr = split2[0];
auto header = split2[2];
size_t[] fieldIndices;
double[] probs;
try foreach (fieldIndex;
fieldStr.to!string.parseFieldList!(size_t, Yes.convertToZeroBasedIndex))
{
fieldIndices ~= fieldIndex;
}
catch (Exception exc)
{
import std.format : format;
exc.msg = format("[--%s] %s", option, exc.msg);
throw exc;
}
foreach (str; probStr.splitter(','))
{
double p;
try p = str.to!double;
catch (Exception exc)
throw new Exception(formatErrorMsg(option, optionVal));
if (!(p >= 0.0 && p <= 1.0))
throw new Exception(
format("Invalid option: '--%s %s'. Probability '%g' is not in the interval [0.0,1.0].",
option, optionVal, p));
probs ~= p;
}
if (!header.empty && (fieldIndices.length > 1 || probs.length > 1))
{
throw new Exception(
format("Invalid option: '--%s %s'. Cannot specify a custom header when using multiple fields or multiple probabilities.",
option, optionVal));
}
assert (fieldIndices.length > 0);
assert (probs.length > 0);
assert (header.empty || (fieldIndices.length == 1 && probs.length == 1));
foreach (fieldIndex; fieldIndices)
{
foreach (p; probs)
{
auto op = new QuantileOperator(fieldIndex, globalMissingPolicy, p);
if (!header.empty) op.setCustomHeader(header);
operators.insertBack(op);
}
if (fieldIndex >= endFieldIndex) endFieldIndex = fieldIndex + 1;
}
}
private void countOptionHandler()
{
operators.insertBack(new CountOperator());
}
private void countHeaderOptionHandler(string option, string optionVal)
{
auto op = new CountOperator();
op.setCustomHeader(optionVal);
operators.insertBack(op);
}
/* This routine does validations not handled by processArgs. */
private void consistencyValidations()
{
if (operators.empty)
{
throw new Exception("At least one summary operator is required.");
}
if (inputFieldDelimiter == valuesDelimiter)
{
throw new Exception("Cannot use the same character for both --d|field-delimiter and --v|values-delimiter.");
}
if (excludeMissing && missingValueReplacement.length != 0)
{
throw new Exception("Cannot use both '--x|exclude-missing' and '--r|replace-missing'.");
}
}
/* Post-processing derivations. */
void derivations()
{
/* keyFields need to part of the endFieldIndex, which is one past the last field index. */
keyFields.each!(delegate (size_t x) { if (x >= endFieldIndex) endFieldIndex = x + 1; } );
/* Missing field policy. */
globalMissingPolicy.updatePolicy(excludeMissing, missingValueReplacement);
}
}
/** tsvSummarize does the primary work of the tsv-summarize program.
*/
void tsvSummarize(TsvSummarizeOptions cmdopt, in string[] inputFiles)
{
import tsv_utils.common.utils : bufferedByLine, throwIfWindowsNewlineOnUnix;
/* Pick the Summarizer based on the number of key-fields entered. */
auto summarizer =
(cmdopt.keyFields.length == 0)
? new NoKeySummarizer!(typeof(stdout.lockingTextWriter()))(
cmdopt.inputFieldDelimiter, cmdopt.globalMissingPolicy)
: (cmdopt.keyFields.length == 1)
? new OneKeySummarizer!(typeof(stdout.lockingTextWriter()))(
cmdopt.keyFields[0], cmdopt.inputFieldDelimiter, cmdopt.globalMissingPolicy)
: new MultiKeySummarizer!(typeof(stdout.lockingTextWriter()))(
cmdopt.keyFields, cmdopt.inputFieldDelimiter, cmdopt.globalMissingPolicy);
/* Add the operators to the Summarizer. */
summarizer.setOperators(inputRangeObject(cmdopt.operators[]));
/* Process each input file, one line at a time. */
auto lineFields = new char[][](cmdopt.endFieldIndex);
bool headerFound = false;
foreach (filename; (inputFiles.length > 0) ? inputFiles : ["-"])
{
auto inputStream = (filename == "-") ? stdin : filename.File();
foreach (lineNum, line; inputStream.bufferedByLine.enumerate(1))
{
if (lineNum == 1) throwIfWindowsNewlineOnUnix(line, filename, lineNum);
/* Copy the needed number of fields to the fields array.
* Note: The number is zero if no operator needs fields. Notably, the count
* operator. Used by itself, it counts the number input lines (ala 'wc -l').
*/
if (cmdopt.endFieldIndex > 0)
{
size_t fieldIndex = 0;
foreach (fieldValue; line.splitter(cmdopt.inputFieldDelimiter))
{
if (fieldIndex == cmdopt.endFieldIndex) break;
lineFields[fieldIndex] = fieldValue;
fieldIndex++;
}
if (fieldIndex == 0)
{
assert(cmdopt.endFieldIndex > 0);
assert(line.length == 0);
/* Bug work-around. Empty lines are not handled properly by splitter.
* - Bug: https://issues.dlang.org/show_bug.cgi?id=15735
* - Pull Request: https://github.com/D-Programming-Language/phobos/pull/4030
* This can arise for: '$ tsv-summarize -g 1 --count'. This counts the
* unique values in field 1. If there's only one column, then an empty
* line becomes an empty string for field 1. Work-around: Point to the
* line. It's an empty string.
*/
lineFields[fieldIndex] = line;
fieldIndex++;
}
if (fieldIndex < cmdopt.endFieldIndex)
{
throw new Exception(
format("Not enough fields in line. File: %s, Line: %s",
(filename == "-") ? "Standard Input" : filename, lineNum));
}
}
if (cmdopt.hasHeader && lineNum == 1)
{
if (!headerFound)
{
summarizer.processHeaderLine(lineFields);
headerFound = true;
}
}
else
{
/* Process the line. Processing will fail (throw) if a field cannot be
* converted to the expected type.
*/
try summarizer.processNextLine(lineFields);
catch (Exception exc)
{
throw new Exception(
format("Could not process line or field: %s\n File: %s Line: %s%s",
exc.msg, (filename == "-") ? "Standard Input" : filename, lineNum,
(lineNum == 1) ? "\n Is this a header line? Use --header to skip." : ""));
}
}
}
}
debug writeln("[tsvSummarize] After reading all data.");
/* Whew! We're done processing input data. Run the calculations and print. */
auto printOptions = SummarizerPrintOptions(
cmdopt.inputFieldDelimiter, cmdopt.valuesDelimiter, cmdopt.floatPrecision);
auto stdoutWriter = stdout.lockingTextWriter;
if (cmdopt.hasHeader || cmdopt.writeHeader)
{
summarizer.writeSummaryHeader(stdoutWriter, printOptions);
}
summarizer.writeSummaryBody(stdoutWriter, printOptions);
}
/** The default field header. This is used when the input doesn't have field headers,
* but field headers are used in the output. The default is "fieldN", where N is the
* 1-upped field number.
*/
string fieldHeaderFromIndex(size_t fieldIndex)
{
enum prefix = "field";
return prefix ~ (fieldIndex + 1).to!string;
}
unittest
{
assert(fieldHeaderFromIndex(0) == "field1");
assert(fieldHeaderFromIndex(10) == "field11");
}
/** Produce a summary header from a field header.
*
* The result has the form `<fieldHeader>_<operation>`. e.g. If the field header is
* "length" and the operation is "max", the summary header is "length_max". The field
* header typically comes a header line in the input data or was constructed by
* fieldHeaderFromIndex().
*
* If operationName is the empty string, then fieldHeader is used unchanged. This supports
* the Retain operator.
*/
string summaryHeaderFromFieldHeader(string fieldHeader, string operationName)
{
return (operationName.length > 0) ? fieldHeader ~ "_" ~ operationName : fieldHeader;
}
unittest
{
assert(summaryHeaderFromFieldHeader("originalfield", "mycalc") == "originalfield_mycalc");
assert(summaryHeaderFromFieldHeader("originalfield", "") == "originalfield");
}
/** SummarizerPrintOptions holds printing options for Summarizers and Calculators. Typically
* specified with command line options, it is separated out for modularity.
*/
struct SummarizerPrintOptions
{
char fieldDelimiter;
char valuesDelimiter;
size_t floatPrecision = 12;
import std.traits : isFloatingPoint, isIntegral;
auto formatNumber(T)(T n) const
if (isFloatingPoint!T || isIntegral!T)
{
import tsv_utils.common.numerics : formatNumber;
return formatNumber!T(n, floatPrecision);
}
}
/** A Summarizer object maintains the state of the summarization and performs basic
* processing. Handling of files and input lines is left to the caller.
*
* Classes supporting the Summarizer must implement the methods:
* - setOperators - Called after initializing the object for each operator to be processed.
* - processHeaderLine - Called to process the header line of each file. Returns true if
* it was the first header line processed (used when reading multiple files).
* - processNextLine - Called to process non-header lines.
* - writeSummaryHeader - Called to write the header line.
* - writeSummaryBody - Called to write the result lines.
*
*/
interface Summarizer(OutputRange)
{
/** Called after initializing the object for each operator to be processed. */
void setOperators(InputRange!Operator op);
/** Called to process the header line of each file. Returns true if it was the
* first header line processed (used when reading multiple files).
*/
bool processHeaderLine(const char[][] lineFields);
/** Called to process non-header lines. */
void processNextLine(const char[][] lineFields);
/** Called to write the header line. */
void writeSummaryHeader(ref OutputRange outputStream, const ref SummarizerPrintOptions);
/** Called to write the result lines. */
void writeSummaryBody(ref OutputRange outputStream, const ref SummarizerPrintOptions);
}
/** SummarizerBase performs work shared by all sumarizers, most everything except for
* handling of unique keys.
*
* The base class handles creation, allocates storage for Operators and SharedFieldValues,
* and similar. Derived classes deal primarily with unique keys and the associated Calculators
* and UniqueKeyValuesLists.
*/
class SummarizerBase(OutputRange) : Summarizer!OutputRange
{
private char _inputFieldDelimiter;
private bool _hasProcessedFirstHeaderLine = false;
private SharedFieldValues _sharedFieldValues = null; // Null if no shared field value lists.
protected MissingFieldPolicy _missingPolicy;
protected DList!Operator _operators;
protected size_t _numOperators = 0;
this(const char inputFieldDelimiter, MissingFieldPolicy missingPolicy)
{
_inputFieldDelimiter = inputFieldDelimiter;
_missingPolicy = missingPolicy;
}
char inputFieldDelimiter() const @property
{
return _inputFieldDelimiter;
}
/** Sets the Operators used by the Summarizer. Called after construction. */
void setOperators(InputRange!Operator operators)
{
foreach (op; operators)
{
_operators.insertBack(op);
_numOperators++;
auto numericFieldsToSave = op.numericFieldsToSave();
auto textFieldsToSave = op.textFieldsToSave();
if (numericFieldsToSave.length > 0 || textFieldsToSave.length > 0)
{
if (_sharedFieldValues is null)
{
_sharedFieldValues = new SharedFieldValues();
}
numericFieldsToSave.each!(x => _sharedFieldValues.addNumericIndex(x));
textFieldsToSave.each!(x => _sharedFieldValues.addTextIndex(x));
}
}
}
/** Called to process the header line of each file. Returns true if it was the
* first header line processed (used when reading multiple files).
*/
bool processHeaderLine(const char[][] lineFields)
{
if (!_hasProcessedFirstHeaderLine)
{
_operators.each!(x => x.processHeaderLine(lineFields));
_hasProcessedFirstHeaderLine = true;
return true;
}
else
{
return false;
}
}
protected final UniqueKeyValuesLists makeUniqueKeyValuesLists()
{
return (_sharedFieldValues is null)
? null
: _sharedFieldValues.makeUniqueKeyValuesLists;
}
abstract void processNextLine(const char[][] lineFields);
abstract void writeSummaryHeader(ref OutputRange outputStream, const ref SummarizerPrintOptions);
abstract void writeSummaryBody(ref OutputRange outputStream, const ref SummarizerPrintOptions);
}
/** The NoKeySummarizer is used when summarizing values across the entire input.
*
* Note: NoKeySummarizer is used in Operator unit tests and gets extensive testing
* through that mechanism.
*/
final class NoKeySummarizer(OutputRange) : SummarizerBase!OutputRange
{
private Calculator[] _calculators;
private UniqueKeyValuesLists _valueLists;
this(const char inputFieldDelimiter, MissingFieldPolicy missingPolicy)
{
super(inputFieldDelimiter, missingPolicy);
}
/** Called after initializing the object for each operator to be processed. */
override void setOperators(InputRange!Operator operators)
{
super.setOperators(operators);
/* Only one Calculator per Operation, so create them as Operators are added. */
foreach (op; operators) _calculators ~= op.makeCalculator;
_valueLists = super.makeUniqueKeyValuesLists();
}
/** Called to process non-header lines. */
override void processNextLine(const char[][] lineFields)
{
_calculators.each!(x => x.processNextLine(lineFields));
if (_valueLists !is null) _valueLists.processNextLine(lineFields, _missingPolicy);
}
/** Called to write the header line. */
override void writeSummaryHeader(ref OutputRange outputStream, const ref SummarizerPrintOptions printOptions)
{
put(outputStream, _operators[].map!(op => op.header).join(printOptions.fieldDelimiter));
put(outputStream, '\n');
}
/** Called to write the result lines. */
override void writeSummaryBody(ref OutputRange outputStream, const ref SummarizerPrintOptions printOptions)
{
put(outputStream,
_calculators[]
.map!(x => x.calculate(_valueLists, printOptions))
.join(printOptions.fieldDelimiter));
put(outputStream, '\n');
}
}
/** KeySummarizerBase does work shared by the single key and multi-key summarizers.
*
* The primary difference between those two is the formation of the key. The primary
* reason for separating those into two separate classes is to simplify (speed-up)
* handling of single field keys, which are the most common use case.
*/
class KeySummarizerBase(OutputRange) : SummarizerBase!OutputRange
{
protected struct UniqueKeyData
{
Calculator[] calculators;
UniqueKeyValuesLists valuesLists;
}
private DList!string _uniqueKeys;
private UniqueKeyData[string] _uniqueKeyData;
this(const char inputFieldDelimiter, MissingFieldPolicy missingPolicy)
{
super(inputFieldDelimiter, missingPolicy);
}
protected void processNextLineWithKey(T : const char[])(T key, const char[][] lineFields)
{
debug writefln("[%s]: %s", __FUNCTION__, lineFields.to!string);
auto dataPtr = (key in _uniqueKeyData);
auto data = (dataPtr is null) ? addUniqueKey(key.to!string) : *dataPtr;
data.calculators.each!(x => x.processNextLine(lineFields));
if (data.valuesLists !is null) data.valuesLists.processNextLine(lineFields, _missingPolicy);
}
protected UniqueKeyData addUniqueKey(string key)
{
assert(key !in _uniqueKeyData);
_uniqueKeys.insertBack(key);
auto calculators = new Calculator[_numOperators];
size_t i = 0;
foreach (op; _operators)
{
calculators[i] = op.makeCalculator;
i++;
}
return _uniqueKeyData[key] = UniqueKeyData(calculators, super.makeUniqueKeyValuesLists());
}
override void writeSummaryHeader(ref OutputRange outputStream, const ref SummarizerPrintOptions printOptions)
{
put(outputStream, keyFieldHeader());
put(outputStream, printOptions.fieldDelimiter);
put(outputStream, _operators[].map!(op => op.header).join(printOptions.fieldDelimiter));
put(outputStream, '\n');
}
override void writeSummaryBody(ref OutputRange outputStream, const ref SummarizerPrintOptions printOptions)
{
foreach(key; _uniqueKeys)
{
auto data = _uniqueKeyData[key];
put(outputStream, key);
put(outputStream, printOptions.fieldDelimiter);
put(outputStream,
data.calculators[]
.map!(x => x.calculate(data.valuesLists, printOptions))
.join(printOptions.fieldDelimiter));
put(outputStream, '\n');
}
}
abstract string keyFieldHeader() const @property;
}
/** This Summarizer is for the case where the unique key is based on exactly one field.
*/
final class OneKeySummarizer(OutputRange) : KeySummarizerBase!OutputRange
{
private size_t _keyFieldIndex = 0;
private string _keyFieldHeader;
private DList!string _uniqueKeys;
this(size_t keyFieldIndex, char inputFieldDelimiter, MissingFieldPolicy missingPolicy)
{
super(inputFieldDelimiter, missingPolicy);
_keyFieldIndex = keyFieldIndex;
_keyFieldHeader = fieldHeaderFromIndex(keyFieldIndex);
}
override string keyFieldHeader() const @property
{
return _keyFieldHeader;
}
override bool processHeaderLine(const char[][] lineFields)
{
assert(_keyFieldIndex <= lineFields.length);
bool isFirstHeaderLine = super.processHeaderLine(lineFields);
if (isFirstHeaderLine)
{
_keyFieldHeader = lineFields[_keyFieldIndex].to!string;
}
return isFirstHeaderLine;
}
override void processNextLine(const char[][] lineFields)
{
assert(_keyFieldIndex < lineFields.length);
processNextLineWithKey(lineFields[_keyFieldIndex], lineFields);
}
}
/** This Summarizer is for the case where the unique key is based on multiple fields.
*/
final class MultiKeySummarizer(OutputRange) : KeySummarizerBase!OutputRange
{
private size_t[] _keyFieldIndices;
private string _keyFieldHeader;
private DList!string _uniqueKeys;
this(const size_t[] keyFieldIndices, char inputFieldDelimiter, MissingFieldPolicy missingPolicy)
{
super(inputFieldDelimiter, missingPolicy);
_keyFieldIndices = keyFieldIndices.dup;
_keyFieldHeader =
_keyFieldIndices.map!(i => fieldHeaderFromIndex(i))
.join(inputFieldDelimiter);
}
override string keyFieldHeader() const @property
{
return _keyFieldHeader;
}
override bool processHeaderLine(const char[][] lineFields)
{
assert(_keyFieldIndices.all!(x => x < lineFields.length));
assert(_keyFieldIndices.length >= 2);
bool isFirstHeaderLine = super.processHeaderLine(lineFields);
if (isFirstHeaderLine)
{
_keyFieldHeader = _keyFieldIndices.map!(i => lineFields[i]).join(inputFieldDelimiter).to!string;
}
return isFirstHeaderLine;
}
override void processNextLine(const char[][] lineFields)
{
assert(_keyFieldIndices.all!(x => x < lineFields.length));
assert(_keyFieldIndices.length >= 2);
string key = _keyFieldIndices.map!(i => lineFields[i]).join(inputFieldDelimiter).to!string;
processNextLineWithKey(key, lineFields);
}
}
version(unittest)
{
/* testSummarizer is a helper that can run many types of unit tests against
* Summarizers. It can also test operators, but there are separate helper functions
* better suited for that purpose.
*
* Arguments are a command line args, an input file, and expected output. The
* input file and expected output are already split into lines and fields, the helper
* manages re-assembly. The program name from the command line args is printed if an
* an error occurs, it is useful to identify the test that failed.
*
* Note: Much of this is a duplication tsvSummarize logic. Better abstraction of
* file input/output would enable running unit tests directly on top of tsvSummarize.
*/
void testSummarizer(string[] cmdArgs, string[][] file, string[][] expected)
{
import std.array : appender;
assert(cmdArgs.length > 0, "[testSummarizer] cmdArgs must not be empty.");
auto formatAssertMessage(T...)(string msg, T formatArgs)
{
auto formatString = "[testSummarizer] %s: " ~ msg;
return format(formatString, cmdArgs[0], formatArgs);
}
TsvSummarizeOptions cmdopt;
auto savedCmdArgs = cmdArgs.to!string;
auto r = cmdopt.processArgs(cmdArgs);
assert(r[0], formatAssertMessage("Invalid command lines arg: '%s'.", savedCmdArgs));
assert(file.all!(line => line.length >= cmdopt.endFieldIndex),
formatAssertMessage("group-by or operator field number greater than number of fields a line of the input file."));
/* Pick the Summarizer based on the number of key-fields entered. */
auto summarizer =
(cmdopt.keyFields.length == 0)
? new NoKeySummarizer!(typeof(appender!(char[])()))(
cmdopt.inputFieldDelimiter, cmdopt.globalMissingPolicy)
: (cmdopt.keyFields.length == 1)
? new OneKeySummarizer!(typeof(appender!(char[])()))(
cmdopt.keyFields[0], cmdopt.inputFieldDelimiter, cmdopt.globalMissingPolicy)
: new MultiKeySummarizer!(typeof(appender!(char[])()))(
cmdopt.keyFields, cmdopt.inputFieldDelimiter, cmdopt.globalMissingPolicy);
/* Add the operators to the Summarizer. */
summarizer.setOperators(inputRangeObject(cmdopt.operators[]));
/* Process the file one line at a time. */
auto lineFields = new char[][](cmdopt.endFieldIndex);
bool headerFound = false;
foreach (lineNum, line; file.enumerate(1))
{
/* Copy the needed fields to the fields array. */
foreach (i, val; line[0..cmdopt.endFieldIndex]) lineFields[i] = val.dup;
if (cmdopt.hasHeader && lineNum == 1)
{
if (!headerFound)
{
summarizer.processHeaderLine(lineFields);
headerFound = true;
}
}
else
{
try summarizer.processNextLine(lineFields);
catch (Exception exc)
{
assert(false, formatAssertMessage(exc.msg));
}
}
}
auto printOptions = SummarizerPrintOptions(
cmdopt.inputFieldDelimiter, cmdopt.valuesDelimiter, cmdopt.floatPrecision);
auto summarizerOutput = appender!(char[])();
if (cmdopt.hasHeader || cmdopt.writeHeader)
{
summarizer.writeSummaryHeader(summarizerOutput, printOptions);
}
summarizer.writeSummaryBody(summarizerOutput, printOptions);
auto expectedOutput = expected.map!(x => x.joiner(cmdopt.inputFieldDelimiter.to!string)).joiner("\n").to!string;
if (expectedOutput.length > 0 && expectedOutput[$-1] != '\n') expectedOutput ~= "\n";
assert(summarizerOutput.data == expectedOutput,
formatAssertMessage(
"Result != expected:\n=====Expected=====\n%s=====Actual=======\n%s==================",
expectedOutput.to!string, summarizerOutput.data.to!string));
}
}
unittest
{
/* Summarizer unit tests. Primarily single-key and multi-key summarizers. To a limited
* extent, command line option handling (TsvSummarizeOptions). Individual operators
* have separate tests, those tests test the no-key summarizer. The Values operator is
* used in these tests. It engages a number of behaviors, and the results have limited
* ambiguity. Using only one operator limits dependence on individual operators.
*/
auto file1 = [["fld1", "fld2", "fld3"],
["a", "a", "3"],
["c", "a", "2b"],
["c", "bc", ""],
["a", "c", "2b"],
["", "bc", ""],
["c", "bc", "3"]];
/* Single-key summarizer tests.
*/
testSummarizer(["unittest-sk-1", "--header", "--group-by", "1", "--values", "1"],
file1,
[["fld1", "fld1_values"],
["a", "a|a"],
["c", "c|c|c"],
["", ""]]
);
testSummarizer(["unittest-sk-2", "-H", "--group-by", "1", "--values", "2"],
file1,
[["fld1", "fld2_values"],
["a", "a|c"],
["c", "a|bc|bc"],
["", "bc"]]
);
testSummarizer(["unittest-sk-3", "-H", "-g", "1", "--values", "3"],
file1,
[["fld1", "fld3_values"],
["a", "3|2b"],
["c", "2b||3"],
["", ""]]
);
testSummarizer(["unittest-sk-4", "-H", "--group-by", "1", "--values", "1,2,3"],
file1,
[["fld1", "fld1_values", "fld2_values", "fld3_values"],
["a", "a|a", "a|c", "3|2b"],
["c", "c|c|c", "a|bc|bc", "2b||3"],
["", "", "bc", ""]]
);
testSummarizer(["unittest-sk-5", "-H", "--group-by", "1", "--values", "1-3"],
file1,
[["fld1", "fld1_values", "fld2_values", "fld3_values"],
["a", "a|a", "a|c", "3|2b"],
["c", "c|c|c", "a|bc|bc", "2b||3"],
["", "", "bc", ""]]
);
testSummarizer(["unittest-sk-6", "-H", "--group-by", "1", "--values", "3,2,1"],
file1,
[["fld1", "fld3_values", "fld2_values", "fld1_values"],
["a", "3|2b", "a|c", "a|a"],
["c", "2b||3", "a|bc|bc", "c|c|c"],
["", "", "bc", ""]]
);
testSummarizer(["unittest-sk-7", "-H", "--group-by", "1", "--values", "3-1"],
file1,
[["fld1", "fld3_values", "fld2_values", "fld1_values"],
["a", "3|2b", "a|c", "a|a"],
["c", "2b||3", "a|bc|bc", "c|c|c"],
["", "", "bc", ""]]
);
testSummarizer(["unittest-sk-8", "-H", "--group-by", "2", "--values", "1"],
file1,
[["fld2", "fld1_values"],
["a", "a|c"],
["bc", "c||c"],
["c", "a"]]
);
testSummarizer(["unittest-sk-9", "-H", "--group-by", "2", "--values", "2"],
file1,
[["fld2", "fld2_values"],
["a", "a|a"],
["bc", "bc|bc|bc"],
["c", "c"]]
);
testSummarizer(["unittest-sk-10", "-H", "--group-by", "2", "--values", "3"],
file1,
[["fld2", "fld3_values"],
["a", "3|2b"],
["bc", "||3"],
["c", "2b"]]
);
testSummarizer(["unittest-sk-11", "-H", "--group-by", "2", "--values", "1,3"],
file1,
[["fld2", "fld1_values", "fld3_values"],
["a", "a|c", "3|2b"],
["bc", "c||c", "||3"],
["c", "a", "2b"]]
);
testSummarizer(["unittest-sk-12", "-H", "--group-by", "2", "--values", "3,1"],
file1,
[["fld2", "fld3_values", "fld1_values"],
["a", "3|2b", "a|c"],
["bc", "||3", "c||c"],
["c", "2b", "a"]]
);
testSummarizer(["unittest-sk-13", "-H", "--group-by", "3", "--values", "1"],
file1,
[["fld3", "fld1_values"],
["3", "a|c"],
["2b", "c|a"],
["", "c|"]]
);
testSummarizer(["unittest-sk-14", "-H", "--group-by", "3", "--values", "2"],
file1,
[["fld3", "fld2_values"],
["3", "a|bc"],
["2b", "a|c"],
["", "bc|bc"]]
);
testSummarizer(["unittest-sk-15", "-H", "--group-by", "3", "--values", "1,2"],
file1,
[["fld3", "fld1_values", "fld2_values"],
["3", "a|c", "a|bc"],
["2b", "c|a", "a|c"],
["", "c|", "bc|bc"]]
);
/* Multi-key summarizer tests.
*/
testSummarizer(["unittest-mk-1", "--header", "--group-by", "1,2", "--values", "1"],
file1,
[["fld1", "fld2", "fld1_values"],
["a", "a", "a"],
["c", "a", "c"],
["c", "bc", "c|c"],
["a", "c", "a"],
["", "bc", ""]]
);
testSummarizer(["unittest-mk-2", "-H", "--group-by", "1,2", "--values", "2"],
file1,
[["fld1", "fld2", "fld2_values"],
["a", "a", "a"],
["c", "a", "a"],
["c", "bc", "bc|bc"],
["a", "c", "c"],
["", "bc", "bc"]]
);
testSummarizer(["unittest-mk-3", "-H", "--group-by", "1,2", "--values", "3"],
file1,
[["fld1", "fld2", "fld3_values"],
["a", "a", "3"],
["c", "a", "2b"],
["c", "bc", "|3"],
["a", "c", "2b"],
["", "bc", ""]]
);
testSummarizer(["unittest-mk-4", "-H", "--group-by", "1,2", "--values", "3,1"],
file1,
[["fld1", "fld2", "fld3_values", "fld1_values"],
["a", "a", "3", "a"],
["c", "a", "2b", "c"],
["c", "bc", "|3", "c|c"],
["a", "c", "2b", "a"],
["", "bc", "", ""]]
);
testSummarizer(["unittest-mk-5", "-H", "--group-by", "3,2", "--values", "1"],
file1,
[["fld3", "fld2", "fld1_values"],
["3", "a", "a"],
["2b", "a", "c"],
["", "bc", "c|"],
["2b", "c", "a"],
["3", "bc", "c"]]
);
testSummarizer(["unittest-mk-6", "-H", "--group-by", "3-2", "--values", "1"],
file1,
[["fld3", "fld2", "fld1_values"],
["3", "a", "a"],
["2b", "a", "c"],
["", "bc", "c|"],
["2b", "c", "a"],
["3", "bc", "c"]]
);
testSummarizer(["unittest-mk-7", "-H", "--group-by", "2,1,3", "--values", "2"],
file1,
[["fld2", "fld1", "fld3", "fld2_values"],
["a", "a", "3", "a"],
["a", "c", "2b", "a"],
["bc", "c", "", "bc"],
["c", "a", "2b", "c"],
["bc", "", "", "bc"],
["bc", "c", "3", "bc"]]
);
/* Missing policies. */
testSummarizer(["unittest-mis-1", "--header", "--group-by", "1", "--values", "1", "--exclude-missing"],
file1,
[["fld1", "fld1_values"],
["a", "a|a"],
["c", "c|c|c"],
["", ""]]
);
testSummarizer(["unittest-mis-2", "-H", "--group-by", "1", "--values", "2", "-x"],
file1,
[["fld1", "fld2_values"],
["a", "a|c"],
["c", "a|bc|bc"],
["", "bc"]]
);
testSummarizer(["unittest-mis-3", "-H", "-g", "1", "--values", "3", "-x"],
file1,
[["fld1", "fld3_values"],
["a", "3|2b"],
["c", "2b|3"],
["", ""]]
);
testSummarizer(["unittest-mis-4", "-H", "--group-by", "1", "--values", "1,2,3", "-x"],
file1,
[["fld1", "fld1_values", "fld2_values", "fld3_values"],
["a", "a|a", "a|c", "3|2b"],
["c", "c|c|c", "a|bc|bc", "2b|3"],
["", "", "bc", ""]]
);
testSummarizer(["unittest-mis-5", "--header", "--group-by", "1", "--values", "1", "--replace-missing", "NA"],
file1,
[["fld1", "fld1_values"],
["a", "a|a"],
["c", "c|c|c"],
["", "NA"]]
);
testSummarizer(["unittest-mis-6", "-H", "--group-by", "1", "--values", "2", "-r", "NA"],
file1,
[["fld1", "fld2_values"],
["a", "a|c"],
["c", "a|bc|bc"],
["", "bc"]]
);
testSummarizer(["unittest-mis-7", "-H", "-g", "1", "--values", "3", "-r", "NA"],
file1,
[["fld1", "fld3_values"],
["a", "3|2b"],
["c", "2b|NA|3"],
["", "NA"]]
);
testSummarizer(["unittest-mis-8", "-H", "--group-by", "1", "--values", "1,2,3", "-r", "NA"],
file1,
[["fld1", "fld1_values", "fld2_values", "fld3_values"],
["a", "a|a", "a|c", "3|2b"],
["c", "c|c|c", "a|bc|bc", "2b|NA|3"],
["", "NA", "bc", "NA"]]
);
testSummarizer(["unittest-mis-9", "-H", "--group-by", "1,2", "--values", "3,1", "-x"],
file1,
[["fld1", "fld2", "fld3_values", "fld1_values"],
["a", "a", "3", "a"],
["c", "a", "2b", "c"],
["c", "bc", "3", "c|c"],
["a", "c", "2b", "a"],
["", "bc", "", ""]]
);
testSummarizer(["unittest-mis-10", "-H", "--group-by", "3,2", "--values", "1", "-x"],
file1,
[["fld3", "fld2", "fld1_values"],
["3", "a", "a"],
["2b", "a", "c"],
["", "bc", "c"],
["2b", "c", "a"],
["3", "bc", "c"]]
);
testSummarizer(["unittest-mis-11", "-H", "--group-by", "2,1,3", "--values", "2", "-x"],
file1,
[["fld2", "fld1", "fld3", "fld2_values"],
["a", "a", "3", "a"],
["a", "c", "2b", "a"],
["bc", "c", "", "bc"],
["c", "a", "2b", "c"],
["bc", "", "", "bc"],
["bc", "c", "3", "bc"]]
);
testSummarizer(["unittest-mis-12", "-H", "--group-by", "1,2", "--values", "3,1", "-r", "NA"],
file1,
[["fld1", "fld2", "fld3_values", "fld1_values"],
["a", "a", "3", "a"],
["c", "a", "2b", "c"],
["c", "bc", "NA|3", "c|c"],
["a", "c", "2b", "a"],
["", "bc", "NA", "NA"]]
);
testSummarizer(["unittest-mis-13", "-H", "--group-by", "3,2", "--values", "1", "-r", "NA"],
file1,
[["fld3", "fld2", "fld1_values"],
["3", "a", "a"],
["2b", "a", "c"],
["", "bc", "c|NA"],
["2b", "c", "a"],
["3", "bc", "c"]]
);
testSummarizer(["unittest-mis-14", "-H", "--group-by", "2,1,3", "--values", "2", "-r", "NA"],
file1,
[["fld2", "fld1", "fld3", "fld2_values"],
["a", "a", "3", "a"],
["a", "c", "2b", "a"],
["bc", "c", "", "bc"],
["c", "a", "2b", "c"],
["bc", "", "", "bc"],
["bc", "c", "3", "bc"]]
);
/* Validate that the no-key summarizer works with testSummarizer helper function.
*/
testSummarizer(["unittest-nk-1", "-H", "--values", "1,2"],
file1,
[["fld1_values", "fld2_values"],
["a|c|c|a||c", "a|a|bc|c|bc|bc"]]
);
/* Header variations: no header line; auto-generated header line; custom headers.
*/
testSummarizer(["unittest-hdr-1", "--group-by", "1", "--values", "1"],
file1[1..$],
[["a", "a|a"],
["c", "c|c|c"],
["", ""]]
);
testSummarizer(["unittest-hdr-2", "--group-by", "1,2", "--values", "2"],
file1[1..$],
[["a", "a", "a"],
["c", "a", "a"],
["c", "bc", "bc|bc"],
["a", "c", "c"],
["", "bc", "bc"]]
);
testSummarizer(["unittest-hdr-3", "--write-header", "--group-by", "2", "--values", "1"],
file1[1..$],
[["field2", "field1_values"],
["a", "a|c"],
["bc", "c||c"],
["c", "a"]]
);
testSummarizer(["unittest-hdr-4", "-w", "--group-by", "3,2", "--values", "1"],
file1[1..$],
[["field3", "field2", "field1_values"],
["3", "a", "a"],
["2b", "a", "c"],
["", "bc", "c|"],
["2b", "c", "a"],
["3", "bc", "c"]]
);
testSummarizer(["unittest-hdr-5", "-H", "--group-by", "2", "--values", "3:Field3Values"],
file1,
[["fld2", "Field3Values"],
["a", "3|2b"],
["bc", "||3"],
["c", "2b"]]
);
testSummarizer(["unittest-hdr-6", "-H", "--group-by", "1,2", "--values", "3:FieldThreeValues", "--values", "1:FieldOneValues"],
file1,
[["fld1", "fld2", "FieldThreeValues", "FieldOneValues"],
["a", "a", "3", "a"],
["c", "a", "2b", "c"],
["c", "bc", "|3", "c|c"],
["a", "c", "2b", "a"],
["", "bc", "", ""]]
);
testSummarizer(["unittest-hdr-7", "--write-header", "--group-by", "1", "--values", "3:f3_vals","--values", "2:f2_vals", "--values", "1:f1_vals"],
file1[1..$],
[["field1", "f3_vals", "f2_vals", "f1_vals"],
["a", "3|2b", "a|c", "a|a"],
["c", "2b||3", "a|bc|bc", "c|c|c"],
["", "", "bc", ""]]
);
testSummarizer(["unittest-hdr-8", "--write-header", "--group-by", "1,3,2", "--values", "3", "--values", "1:ValsField1", "--values", "2:ValsField2"],
file1[1..$],
[["field1", "field3", "field2", "field3_values", "ValsField1", "ValsField2"],
["a", "3", "a", "3", "a", "a"],
["c", "2b", "a", "2b", "c", "a"],
["c", "", "bc", "", "c", "bc"],
["a", "2b", "c", "2b", "a", "c"],
["", "", "bc", "", "", "bc"],
["c", "3", "bc", "3", "c", "bc"]]
);
testSummarizer(["unittest-hdr-9", "--write-header", "--group-by", "1,3-2", "--values", "3", "--values", "1:ValsField1", "--values", "2:ValsField2"],
file1[1..$],
[["field1", "field3", "field2", "field3_values", "ValsField1", "ValsField2"],
["a", "3", "a", "3", "a", "a"],
["c", "2b", "a", "2b", "c", "a"],
["c", "", "bc", "", "c", "bc"],
["a", "2b", "c", "2b", "a", "c"],
["", "", "bc", "", "", "bc"],
["c", "3", "bc", "3", "c", "bc"]]
);
/* Alternate file widths and lengths.
*/
auto file3x2 = [["fld1", "fld2", "fld3"],
["a", "b", "c"],
["c", "b", "a"]];
testSummarizer(["unittest-3x2-1", "-H", "--group-by", "1", "--values", "3"],
file3x2,
[["fld1", "fld3_values"],
["a", "c"],
["c", "a"]]
);
testSummarizer(["unittest-3x2-2", "-H", "--group-by", "2", "--values", "3"],
file3x2,
[["fld2", "fld3_values"],
["b", "c|a"]]
);
testSummarizer(["unittest-3x2-3", "-H", "--group-by", "2,1", "--values", "3"],
file3x2,
[["fld2", "fld1", "fld3_values"],
["b", "a", "c"],
["b", "c", "a"]]
);
auto file3x1 = [["fld1", "fld2", "fld3"],
["a", "b", "c"]];
testSummarizer(["unittest-3x1-1", "-H", "--group-by", "1", "--values", "3"],
file3x1,
[["fld1", "fld3_values"],
["a", "c"]]
);
testSummarizer(["unittest-3x1-2", "--group-by", "1", "--values", "3"],
file3x1[1..$],
[["a", "c"]]
);
testSummarizer(["unittest-3x1-3", "-H", "--group-by", "2,1", "--values", "3"],
file3x1,
[["fld2", "fld1", "fld3_values"],
["b", "a", "c"]]
);
testSummarizer(["unittest-3x1-4", "--group-by", "2,1", "--values", "3"],
file3x1[1..$],
[["b", "a", "c"]]
);
auto file3x0 = [["fld1", "fld2", "fld3"]];
testSummarizer(["unittest-3x0-1", "-H", "--group-by", "1", "--values", "3"],
file3x0,
[["fld1", "fld3_values"]]
);
testSummarizer(["unittest-3x0-2", "--group-by", "1", "--values", "3"],
file3x0[1..$],
[]
);
testSummarizer(["unittest-3x0-3", "--write-header", "--group-by", "1", "--values", "3"],
file3x0[1..$],
[["field1", "field3_values"]]
);
testSummarizer(["unittest-3x0-4", "-H", "--group-by", "2,1", "--values", "3"],
file3x0,
[["fld2", "fld1", "fld3_values"]]
);
testSummarizer(["unittest-3x0-5", "--group-by", "2,1", "--values", "3"],
file3x0[1..$],
[]
);
testSummarizer(["unittest-3x0-6", "--write-header", "--group-by", "2,1", "--values", "3"],
file3x0[1..$],
[["field2", "field1", "field3_values"]]
);
auto file2x1 = [["fld1", "fld2"],
["a", "b"]];
testSummarizer(["unittest-2x1-1", "-H", "--group-by", "1", "--values", "2"],
file2x1,
[["fld1", "fld2_values"],
["a", "b"]]
);
testSummarizer(["unittest-2x1-2", "-H", "--group-by", "2,1", "--values", "1"],
file2x1,
[["fld2", "fld1", "fld1_values"],
["b", "a", "a"]]
);
auto file2x0 = [["fld1", "fld2"]];
testSummarizer(["unittest-2x0-1", "-H", "--group-by", "1", "--values", "2"],
file2x0,
[["fld1", "fld2_values"]]
);
testSummarizer(["unittest-2x0-2", "-H", "--group-by", "2,1", "--values", "1"],
file2x0,
[["fld2", "fld1", "fld1_values"]]
);
auto file1x2 = [["fld1"],
["a"],
[""]];
testSummarizer(["unittest-1x2-1", "-H", "--group-by", "1", "--values", "1"],
file1x2,
[["fld1", "fld1_values"],
["a", "a"],
["", ""]]
);
auto file1x2b = [["fld1"],
[""],
[""]];
testSummarizer(["unittest-1x2b-2", "-H", "--group-by", "1", "--values", "1"],
file1x2b,
[["fld1", "fld1_values"],
["", "|"]]
);
auto file1x1 = [["fld1"],
["x"]];
testSummarizer(["unittest-1x1-1", "-H", "--group-by", "1", "--values", "1"],
file1x1,
[["fld1", "fld1_values"],
["x", "x"]]
);
testSummarizer(["unittest-1x1-2", "--group-by", "1", "--values", "1"],
file1x1[1..$],
[["x", "x"]]
);
testSummarizer(["unittest-1x1-3", "--write-header", "--group-by", "1", "--values", "1"],
file1x1[1..$],
[["field1", "field1_values"],
["x", "x"]]
);
auto file1x1b = [["fld1"],
[""]];
testSummarizer(["unittest-1x1b-1", "-H", "--group-by", "1", "--values", "1"],
file1x1b,
[["fld1", "fld1_values"],
["", ""]]
);
auto file1x0 = [["fld1"]];
testSummarizer(["unittest-1x0-1", "-H", "--group-by", "1", "--values", "1"],
file1x0,
[["fld1", "fld1_values"]]
);
testSummarizer(["unittest-1x0-2", "--group-by", "1", "--values", "1"],
file1x0[1..$],
[]
);
testSummarizer(["unittest-1x0-3", "--write-header", "--group-by", "1", "--values", "1"],
file1x0[1..$],
[["field1", "field1_values"]]
);
/* Alternate delimiters. */
testSummarizer(["unittest-delim-1", "-H", "--values", "1,2", "--delimiter", "%"],
file1,
[["fld1_values", "fld2_values"],
["a|c|c|a||c", "a|a|bc|c|bc|bc"]]
);
testSummarizer(["unittest-delim-2", "-H", "--values", "1-2", "--values-delimiter", "$"],
file1,
[["fld1_values", "fld2_values"],
["a$c$c$a$$c", "a$a$bc$c$bc$bc"]]
);
testSummarizer(["unittest-delim-3", "-H", "--values", "1,2", "--delimiter", "#", "--values-delimiter", ","],
file1,
[["fld1_values", "fld2_values"],
["a,c,c,a,,c", "a,a,bc,c,bc,bc"]]
);
testSummarizer(["unittest-delim-4", "--write-header", "--group-by", "2", "--values", "1",
"--delimiter", "^", "--values-delimiter", ":"],
file1[1..$],
[["field2", "field1_values"],
["a", "a:c"],
["bc", "c::c"],
["c", "a"]]
);
testSummarizer(["unittest-delim-5", "--group-by", "1,2", "--values", "2", "--delimiter", "/",
"--values-delimiter", "\\"],
file1[1..$],
[["a", "a", "a"],
["c", "a", "a"],
["c", "bc", "bc\\bc"],
["a", "c", "c"],
["", "bc", "bc"]]
);
}
/* Summary Operators and Calculators
*
* Two types of objects are used in implementation: Operators and Calculators. An Operator
* represents a summary calculation specified on the command line, e.g. '--mean 5'. A
* Calculator is used to manage the summary calculation for each unique key in the input.
*
* As an example, consider the command:
*
* $tsv-summarize --group-by 1 --mean 3 --mean 5
*
* This command will create two instances of a MeanOperator, one each for fields 3 and 5.
* They produce the output field headers (e.g. "field3_mean", "field5_mean"). They also
* create MeanCalculator objects for each unique value in field 1. For 'mean', a
* calculator needs to track occurrence count and sum. Calculators produce the final
* value when all processing is finished.
*
* Summary field headers
*
* There are several options for specifying summary field headers. The defaults combine the
* operator name and the header of the field summarized. The defaults can be overridden on
* on the command line. These scenarios are supported via the operator constructor and the
* processHeaderLine() method.
*
* Missing field policy
*
* At present, tsv-summarize has a single policy for handling missing values that applies
* to all operators. However, it is logically operator specific and is implemented that
* way. The MissingFieldPolicy struct describes the policy, each operator contains one.
* Calculators access thier operator's policy struct.
*/
/** An Operator represents a summary calculation specified on the command line.
* e.g. '--mean 5'.
*/
interface Operator
{
@property string header();
@property string name();
void processHeaderLine(const char[][] fields);
size_t[] numericFieldsToSave(); // Numeric fields this Operator needs saved
size_t[] textFieldsToSave(); // Text fields this Operator needs saved
Calculator makeCalculator();
}
/** Calculators are responsible for the calculation of a single computation. They
* process each line and produce the final value when all processing is finished.
*/
interface Calculator
{
void processNextLine(const char[][] fields);
string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions);
}
/** This class describes processing behavior when a missing value is encountered.
*/
final class MissingFieldPolicy
{
private bool _useMissing = true; // True if missing values are processed unchanged.
private bool _replaceMissing = false; // True if missing values are replaced.
private string _missingReplacement; // Replacement string if replaceMissing is true.
this (in bool excludeMissing = false, in string missingReplacement = "")
{
updatePolicy(excludeMissing, missingReplacement);
}
void updatePolicy(in bool excludeMissing, in string missingReplacement)
{
_missingReplacement = missingReplacement;
_replaceMissing = missingReplacement.length != 0;
_useMissing = !excludeMissing && !replaceMissing;
}
final bool isMissingField(const char[] field) const
{
return field.length == 0;
}
final bool useMissing() const @property
{
return _useMissing;
}
final bool excludeMissing() const @property
{
return !_useMissing && !_replaceMissing;
}
final bool replaceMissing() const @property
{
return _replaceMissing;
}
final string missingReplacement() const @property
{
return _missingReplacement;
}
}
/* The SharedFieldValues and UniqueKeyValuesLists classes manage lists of values collected
* while reading data. Operations like median collect all values and operate on them when
* running the final calculation. Value lists are needed for each unique key. A command
* using multiple Operators may save multiple fields. And, different Operators may be run
* against the same field.
*
* The last part motivates these classes. Handling large data sets necessitates minimizing
* in-memory storage, making it desirable to share identical lists between Calculators.
* Otherwise, each Calculator could implement its own storage, which would be simpler.
*
* The setup works as follows:
* - Operators advertise fields they need saved ([text|numeric]FieldsToSave methods).
* - The SummarizerBase object keeps a SharedFieldValues object, which in turn keeps list
* of the fields advertised by Operators as needing sharing. This list gets created
* during command initialization (SummarizerBase.setOperators).
* - The SharedFieldValues object is used to create a UniqueKeyValuesLists object every
* time a new unique key is found, in parellel to the Calculator objects created for the
* key. The UniqueKeyValuesLists objects are managed by derived Summarizer classes.
* - A unique key's UniqueKeyValuesLists object is passed each input line, same as
* Calculators, saving the values.
* - Calculators retrieve the saved values during the calculation phase. The calculator's
* ProcessNextField method is typically a no-op.
* - Calculators cannot make assumptions about the order of the saved values. This is
* pragmatic concession to median and quantile calculations, which need to sort the data,
* at least partially. Rather than generate sorted copies, the current algorithms
* sort the data in place.
*
* One concession to duplicate storage is that text and numeric versions of the same
* field might be stored. The reason is because it's important to convert text to numbers
* as they are read so that useful error messages can be generated. And, storing both
* forms of the same field should be less common.
*
* The current implementation uses the same missing values policy for all fields. If
* multiple policies become supported this will need to change.
*
* Built-in calculations - UniqueKeyValueLists have a built-in median operation. This is
* to avoid repeated calculations of the median by different calculations.
*/
final class SharedFieldValues
{
// Arrays with field indices that need to be saved.
private size_t[] _numericFieldIndices;
private size_t[] _textFieldIndices;
/* Called during summarizer setup to add a shared field value for a specific field index.
* eg. '--median 7' will add end up calling addNumericIdex(6), 6 being the zero-based index.
* A specific index is only added once.
*/
final void addNumericIndex (size_t index)
{
if (!canFind(_numericFieldIndices, index)) _numericFieldIndices ~= index;
}
/* Similar to addNumericIndex, except adds a text index. */
final void addTextIndex (size_t index)
{
if (!canFind(_textFieldIndices, index)) _textFieldIndices ~= index;
}
/* Called every time a new key is found, or once at the beginning of the program if no keys
* are being used (entire column summarized).
*/
final UniqueKeyValuesLists makeUniqueKeyValuesLists()
{
return new UniqueKeyValuesLists(_numericFieldIndices, _textFieldIndices);
}
}
final class UniqueKeyValuesLists
{
/* A FieldValues object holds is a list of values collect for a specific field. A
* unique key may hold several. For example, the command:
* $ tsv-summarize --k 1 --median 4 -- median 5
* requires keeping lists for both fields 4 and 5. This in turn will result in a
* _numericFieldValues being a 2 element array, one with a list of field 4 values,
* the second of field 5 values. Linear search is used to find a specific field.
*/
private FieldValues!double[] _numericFieldValues;
private FieldValues!string[] _textFieldValues;
private double[] _numericFieldMedians;
/* The UniqueKeyValuesLists constructor takes arrays of field indices to be saved. */
this(const size_t[] numericFieldIndices, const size_t[] textFieldIndices)
{
if (numericFieldIndices.length > 0)
{
_numericFieldValues = new FieldValues!double[](numericFieldIndices.length);
foreach (i, fieldIndex; numericFieldIndices)
_numericFieldValues[i] = new FieldValues!double(fieldIndex);
}
if (textFieldIndices.length > 0)
{
_textFieldValues = new FieldValues!string[](textFieldIndices.length);
foreach (i, fieldIndex; textFieldIndices)
_textFieldValues[i] = new FieldValues!string(fieldIndex);
}
}
void processNextLine(const char[][] fields, MissingFieldPolicy missingPolicy)
{
_numericFieldValues.each!((ref x) => x.processNextLine(fields, missingPolicy));
_textFieldValues.each!((ref x) => x.processNextLine(fields, missingPolicy));
}
private FieldValues!double findNumericFieldValues(size_t index)
{
alias pred = (FieldValues!double a, size_t b) => (a.fieldIndex == b);
auto r = find!pred(_numericFieldValues, index);
assert(!r.empty);
return r.front;
}
private FieldValues!string findTextFieldValues(size_t index)
{
alias pred = (FieldValues!string a, size_t b) => (a.fieldIndex == b);
auto r = find!pred(_textFieldValues, index);
assert(!r.empty);
return r.front;
}
final double[] numericValues(size_t index)
{
return findNumericFieldValues(index).getArray;
}
final double[] numericValuesSorted(size_t index)
{
return findNumericFieldValues(index).getSortedArray;
}
final string[] textValues(size_t index)
{
return findTextFieldValues(index).getArray;
}
final string[] textValuesSorted(size_t index)
{
return findTextFieldValues(index).getSortedArray;
}
final double numericValuesMedian(size_t index)
{
return findNumericFieldValues(index).median;
}
private final class FieldValues(ValueType)
{
import std.array : appender;
private size_t _fieldIndex;
private Appender!(ValueType[]) _values;
private bool _haveMedian = false;
private bool _isSorted = false;
private ValueType _medianValue;
this(size_t fieldIndex)
{
_fieldIndex = fieldIndex;
}
final size_t length() const @property
{
return _values.data.length;
}
final size_t fieldIndex() const @property
{
return _fieldIndex;
}
final void processNextLine(const char[][] fields, MissingFieldPolicy missingPolicy)
{
debug writefln("[%s]: %s", __FUNCTION__, fields.to!string);
const char[] field = fields[_fieldIndex];
if (missingPolicy.useMissing || !missingPolicy.isMissingField(field))
{
_values.put(field.to!ValueType);
_haveMedian = false;
_isSorted = false;
}
else if (missingPolicy.replaceMissing)
{
_values.put(missingPolicy.missingReplacement.to!ValueType);
_haveMedian = false;
_isSorted = false;
}
}
/* Return an input range of the values. */
final auto values()
{
return _values.data;
}
final ValueType[] getArray()
{
return _values.data;
}
final ValueType[] getSortedArray()
{
if (!_isSorted)
{
import std.algorithm : sort;
sort(_values.data);
_isSorted = true;
}
return _values.data;
}
final ValueType median()
{
if (!_haveMedian)
{
import tsv_utils.common.numerics : rangeMedian;
_medianValue = _values.data.rangeMedian();
_haveMedian = true;
}
return _medianValue;
}
}
}
/** SingleFieldOperator is a base class for single field operators, the most common
* Operator. Derived classes implement makeCalculator and the Calculator class it returns.
*/
class SingleFieldOperator : Operator
{
import std.typecons : Flag;
private string _name;
private string _header;
private size_t _fieldIndex;
private bool _useHeaderSuffix;
private bool _allowCustomHeader;
private bool _hasCustomHeader = false;
private size_t[] _numericFieldsToSave;
private size_t[] _textFieldsToSave;
private MissingFieldPolicy _missingPolicy;
this(string operatorName, size_t fieldIndex, MissingFieldPolicy missingPolicy,
Flag!"useHeaderSuffix" useHeaderSuffix = Yes.useHeaderSuffix,
Flag!"allowCustomHeader" allowCustomHeader = Yes.allowCustomHeader)
{
_name = operatorName;
_fieldIndex = fieldIndex;
_missingPolicy = missingPolicy;
_useHeaderSuffix = useHeaderSuffix;
_allowCustomHeader = allowCustomHeader;
// Default header. May be overrridden by custom header or header line.
_header =
fieldHeaderFromIndex(fieldIndex)
.summaryHeaderFromFieldHeader(_useHeaderSuffix ? operatorName : "");
}
void setCustomHeader (string customHeader)
{
assert(_allowCustomHeader);
_header = customHeader;
_hasCustomHeader = true;
}
final string name() const @property
{
return _name;
}
final bool allowCustomHeader() const @property
{
return _allowCustomHeader;
}
/* saveFieldValues[Numeric|Text] are called by derived classes to indicate that field
* that the field values should be saved. These should called during construction.
*/
final void setSaveFieldValuesNumeric()
{
_numericFieldsToSave ~= _fieldIndex;
}
final void setSaveFieldValuesText()
{
_textFieldsToSave ~= _fieldIndex;
}
final MissingFieldPolicy missingPolicy() @property
{
return _missingPolicy;
}
final size_t fieldIndex() const @property
{
return _fieldIndex;
}
final string header() const @property
{
return _header;
}
final bool useHeaderSuffix() const @property
{
return _useHeaderSuffix;
}
void processHeaderLine(const char[][] fields)
{
if (!_hasCustomHeader) {
debug writefln("[%s %d] fields: %s", __FUNCTION__, _fieldIndex, fields.to!string);
_header = summaryHeaderFromFieldHeader(fields[_fieldIndex].to!string,
_useHeaderSuffix ? _name : "");
}
}
final size_t[] numericFieldsToSave()
{
return _numericFieldsToSave;
}
final size_t[] textFieldsToSave()
{
return _textFieldsToSave;
}
abstract SingleFieldCalculator makeCalculator();
}
/** SingleFieldCalculator is a base class for the common case of calculators using a single
* field. Derived classes implement processNextField() rather than processNextLine().
*/
class SingleFieldCalculator : Calculator
{
private size_t _fieldIndex;
this(size_t fieldIndex)
{
_fieldIndex = fieldIndex;
}
final size_t fieldIndex() const @property
{
return _fieldIndex;
}
final void processNextLine(const char[][] fields)
{
debug writefln("[%s %d] fields: %s", __FUNCTION__, _fieldIndex, fields.to!string);
auto missingPolicy = getOperator.missingPolicy;
const char[] field = fields[_fieldIndex];
if (missingPolicy.useMissing || !missingPolicy.isMissingField(field))
{
processNextField(field);
}
else if (missingPolicy.replaceMissing)
{
processNextField(missingPolicy.missingReplacement);
}
}
abstract SingleFieldOperator getOperator();
abstract void processNextField(const char[] field);
}
/* Unittest helper functions. Only compiled when -unittest is in effect. */
version(unittest)
{
/** A helper for SingleFieldOperator unit tests.
*
* testSingleFieldOperator takes a set of split file values, a field index, a header
* suffix, and a set of expected values. The expected values array contains the
* initial value (zero entries) and the expected values after each line. (One more
* expected value than input lines.) The zero entry case is what is generated for an
* empty file. An example testing the 'min' operator against a file with 2 columns,
* 3 rows, using field index 1:
*
* testSingleFieldOperator!MinOperator(
* [["10", "100"], // The split file. 3 lines by 2 rows.
* ["5", "50"],
* ["20", "200"]],
* 1, // Field index (zero-based, so "100", "50", "200")
* "min", // The header suffix, normally the operator name.
* ["nan", "100", "50", "50"]); // Min value after processing each line.
*
* A typical operator unit test uses three "files", one each of 1x3, 2x3, and 3x3.
* Then run the operator is tested against each column, a total of six calls. Headers
* are automatically checked. Additional entries can be used to extend coverage.
*
* A non-default MissingFieldPolicy can be provide as an optional last argument.
* Operator tests should include exclusion and replacement variations. See operator
* unit tests for details.
*
* The testSingleFieldOperatorBase adds an additional capability - Custom operator
* init arguments. Currently this is used only by the quantile operator.
*
* These tests do not check unique key behavior (group-by). Operators don't have info
* about unique keys, and interact with them only indirectly, via Calculators.
*/
void testSingleFieldOperator(OperatorClass : SingleFieldOperator)
(const char[][][] splitFile, size_t fieldIndex, string headerSuffix,
const char[][] expectedValues,
MissingFieldPolicy missingPolicy = new MissingFieldPolicy)
{
testSingleFieldOperatorBase!OperatorClass(splitFile, fieldIndex, headerSuffix, expectedValues, missingPolicy);
}
void testSingleFieldOperatorBase(OperatorClass : SingleFieldOperator, T...)
(const char[][][] splitFile, size_t fieldIndex, string headerSuffix,
const char[][] expectedValues,
MissingFieldPolicy missingPolicy,
T extraOpInitArgs)
{
import std.format : format;
import std.array : appender;
import std.string : chomp;
import std.traits : EnumMembers;
auto numFields = (splitFile[0]).length;
assert(fieldIndex < numFields,
format("[testSingleFieldOperator] Invalid field index. headerSuffix: %s",
headerSuffix));
assert(splitFile.length + 1 == expectedValues.length,
format("[testSingleFieldOperator] Need one more expected value than number of rows. headerSuffix: %s",
headerSuffix));
/* printOptions - Only the 'values-delimiter' (2nd arg) is used these tests. */
auto printOptions = SummarizerPrintOptions('#', '|');
/* An input header line. */
string[] inputHeaderLine = new string[numFields];
foreach (i; 0 .. numFields) inputHeaderLine[i] = "header" ~ i.to!string;
/* The different expected output field headers. */
auto outputFieldHeaderWithNoHeaderLine =
fieldHeaderFromIndex(fieldIndex)
.summaryHeaderFromFieldHeader(headerSuffix);
auto outputFieldHeaderFromHeaderLine =
inputHeaderLine[fieldIndex]
.summaryHeaderFromFieldHeader(headerSuffix);
auto customOutputFieldHeader = "custom";
enum HeaderUsecase {
HeaderLine_DefaultHeader,
HeaderLine_CustomHeader,
NoHeaderLine_DefaultHeader,
NoHeaderLine_CustomHeader,
NoHeaderLine_NoOutputHeader,
}
string headerAssertMessage(Operator op, HeaderUsecase hc, const char[] actual, const char[] expected)
{
return format("[testSingleFieldOperator] Unexpected header. Operator: %s; Usecase: %s; Actual: '%s'; Expected: '%s'",
op.name, hc, actual, expected);
}
string valueAssertMessage(Operator op, HeaderUsecase hc, size_t rowIndex, size_t fieldIndex,
const char[] actual, const char[] expected)
{
return format("[testSingleFieldOperator] Unexpected value. Operator: %s; Usecase: %s; RowIndex: %d, FieldIndex: %d\n Actual: '%s'; Expected: '%s'",
op.name, hc, rowIndex, fieldIndex, actual, expected);
}
/* Run the logic for each header use case. */
foreach (hc; EnumMembers!HeaderUsecase)
{
bool hasInputHeader = (
hc == HeaderUsecase.HeaderLine_DefaultHeader ||
hc == HeaderUsecase.HeaderLine_CustomHeader
);
bool hasOutputHeader = (
hc == HeaderUsecase.HeaderLine_DefaultHeader ||
hc == HeaderUsecase.HeaderLine_CustomHeader ||
hc == HeaderUsecase.NoHeaderLine_DefaultHeader ||
hc == HeaderUsecase.NoHeaderLine_CustomHeader
);
bool hasCustomHeader = (
hc == HeaderUsecase.HeaderLine_CustomHeader ||
hc == HeaderUsecase.NoHeaderLine_CustomHeader
);
if (hasCustomHeader) assert(hasOutputHeader);
auto op = new OperatorClass(fieldIndex, missingPolicy, extraOpInitArgs);
if (hasCustomHeader)
{
if (!op.allowCustomHeader) continue; // Custom header not support by this operator
op.setCustomHeader(customOutputFieldHeader);
}
Operator[] operatorArray;
operatorArray ~= op;
auto summarizer = new NoKeySummarizer!(typeof(appender!(char[])()))('#', missingPolicy);
summarizer.setOperators(inputRangeObject(operatorArray));
if (hasInputHeader) summarizer.processHeaderLine(inputHeaderLine);
if (hasOutputHeader)
{
/* Write the header line. Note that this is a one-field header, */
auto headerLineOutput = appender!(char[])();
summarizer.writeSummaryHeader(headerLineOutput, printOptions);
/* Test that the header was generated correctly.
*
* Note: Because the output is generated by a Summarizer, it will have a
* trailing newline. Use chomp to trim it.
*/
final switch (hc)
{
case HeaderUsecase.HeaderLine_DefaultHeader:
assert(headerLineOutput.data.chomp == outputFieldHeaderFromHeaderLine,
headerAssertMessage(operatorArray[0], hc, headerLineOutput.data.chomp,
outputFieldHeaderFromHeaderLine));
break;
case HeaderUsecase.NoHeaderLine_DefaultHeader:
assert(headerLineOutput.data.chomp == outputFieldHeaderWithNoHeaderLine,
headerAssertMessage(operatorArray[0], hc, headerLineOutput.data.chomp,
outputFieldHeaderWithNoHeaderLine));
break;
case HeaderUsecase.HeaderLine_CustomHeader:
case HeaderUsecase.NoHeaderLine_CustomHeader:
assert(headerLineOutput.data.chomp == customOutputFieldHeader,
headerAssertMessage(operatorArray[0], hc, headerLineOutput.data.chomp,
customOutputFieldHeader));
break;
case HeaderUsecase.NoHeaderLine_NoOutputHeader:
break;
}
}
/* For each line, process the line, generate the output, and test that the
* value is correct. Start with the empty file case.
*/
foreach (i, const char[] expected; expectedValues)
{
if (i > 0) summarizer.processNextLine(splitFile[i - 1]);
auto summaryLineOutput = appender!(char[])();
summarizer.writeSummaryBody(summaryLineOutput, printOptions);
assert(summaryLineOutput.data.chomp == expected,
valueAssertMessage(operatorArray[0], hc, i, fieldIndex,
summaryLineOutput.data.chomp, expectedValues[i]));
}
}
}
}
/** ZeroFieldOperator is a base class for operators that take no input. The main use
* case is the CountOperator, which counts the occurrences of each unique key. Other
* uses are possible, for example, weighted random number assignment.
*
* The primary rationale for ZeroFieldOperator and ZeroFieldCalculator is to clarify
* the information available to such a routine. In particular, the split fields passed
* to processHeaderLine and processNextLine don't include all fields in the input,
* something that might not be obvious when implementing an operator. (Only fields
* required by operators acting on specific fields are included.)
*/
class ZeroFieldOperator : Operator
{
import std.typecons : Flag;
private string _name;
private string _header;
this(string operatorName)
{
_name = operatorName;
_header = operatorName;
}
void setCustomHeader (string customHeader)
{
_header = customHeader;
}
bool allowCustomHeader() const @property
{
return true;
}
final string name() const @property
{
return _name;
}
final string header() const @property
{
return _header;
}
/* A no-op. ZeroFieldOperators have no access to the header line. */
final void processHeaderLine(const char[][] fields) { }
/* A no-op. ZeroFieldOperators have no access to fields. */
final size_t[] numericFieldsToSave()
{
size_t[] emptyArray;
return emptyArray;
}
/* A no-op. ZeroFieldOperators have no access to fields. */
final size_t[] textFieldsToSave()
{
size_t[] emptyArray;
return emptyArray;
}
abstract ZeroFieldCalculator makeCalculator();
}
/** ZeroFieldCalculator is a base class for operators that don't use fields as input.
* In particular, the Count operator. It is a companion to the ZeroFieldOperator class.
*
* Derived classes implement processNextEntry() rather than processNextLine(), and the
* single argument form of calculate() given as an abstract function.
*/
class ZeroFieldCalculator : Calculator
{
this() { }
final void processNextLine(const char[][] fields)
{
debug writefln("[%s]", __FUNCTION__,);
processNextEntry();
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return calculate(printOptions);
}
abstract void processNextEntry();
abstract string calculate(const ref SummarizerPrintOptions printOptions);
}
version(unittest)
{
/* A helper for ZeroFieldOperator unit tests.
*
* testZeroFieldOperator takes a set of split file values, a default header, and a
* set of expected values. The expected values array contains the expected values
* after each line.
*
* testZeroFieldOperator is very similar to testSingleFieldOperator, except that
* there is no use of field indices and fewer types of headers. See the latter's
* documentation and the CountOperator unit tests for examples.
*/
void testZeroFieldOperator(OperatorClass : ZeroFieldOperator)
(const char[][][] splitFile, string defaultHeader, const char[][] expectedValues)
{
import std.format : format;
import std.array : appender;
import std.string : chomp;
import std.traits : EnumMembers;
auto numFields = (splitFile[0]).length;
assert(splitFile.length + 1 == expectedValues.length,
format("[testZeroFieldOperator] Need one more expected value than number of rows. headerSuffix: %s",
defaultHeader));
/* printOptions - Not used these tests, but needed for API calls. */
auto printOptions = SummarizerPrintOptions('#', '|');
/* Missing policy doesn't apply to zero field operators, but need the object for the summarizer. */
auto missingPolicy = new MissingFieldPolicy;
/* An input header line. */
string[] inputHeaderLine = new string[numFields];
foreach (i; 0 .. numFields) inputHeaderLine[i] = "header" ~ i.to!string;
auto customOutputFieldHeader = "custom";
enum HeaderUsecase {
HeaderLine_DefaultHeader,
HeaderLine_CustomHeader,
NoHeaderLine_DefaultHeader,
NoHeaderLine_CustomHeader,
NoHeaderLine_NoOutputHeader,
}
string headerAssertMessage(Operator op, HeaderUsecase hc, const char[] actual, const char[] expected)
{
return format("[testZeroFieldOperator] Unexpected header. Operator: %s; Usecase: %s; Actual: '%s'; Expected: '%s'",
op.name, hc, actual, expected);
}
string valueAssertMessage(Operator op, HeaderUsecase hc, size_t rowIndex,
const char[] actual, const char[] expected)
{
return format("[testZeroFieldOperator] Unexpected value. Operator: %s; Usecase: %s; RowIndex: %d\n Actual: '%s'; Expected: '%s'",
op.name, hc, rowIndex, actual, expected);
}
/* Run the logic for each header use case. */
foreach (hc; EnumMembers!HeaderUsecase)
{
bool hasInputHeader = (
hc == HeaderUsecase.HeaderLine_DefaultHeader ||
hc == HeaderUsecase.HeaderLine_CustomHeader
);
bool hasOutputHeader = (
hc == HeaderUsecase.HeaderLine_DefaultHeader ||
hc == HeaderUsecase.HeaderLine_CustomHeader ||
hc == HeaderUsecase.NoHeaderLine_DefaultHeader ||
hc == HeaderUsecase.NoHeaderLine_CustomHeader
);
bool hasCustomHeader = (
hc == HeaderUsecase.HeaderLine_CustomHeader ||
hc == HeaderUsecase.NoHeaderLine_CustomHeader
);
if (hasCustomHeader) assert(hasOutputHeader);
auto op = new OperatorClass();
if (hasCustomHeader)
{
if (!op.allowCustomHeader) continue; // Custom header not support by this operator
op.setCustomHeader(customOutputFieldHeader);
}
Operator[] operatorArray;
operatorArray ~= op;
auto summarizer = new NoKeySummarizer!(typeof(appender!(char[])()))('#', missingPolicy);
summarizer.setOperators(inputRangeObject(operatorArray));
if (hasInputHeader) summarizer.processHeaderLine(inputHeaderLine);
if (hasOutputHeader)
{
/* Write the header line. Note that this is a one-field header, */
auto headerLineOutput = appender!(char[])();
summarizer.writeSummaryHeader(headerLineOutput, printOptions);
/* Test that the header was generated correctly.
*
* Note: Because the output is generated by a Summarizer, it will have a
* trailing newline. Use chomp to trim it.
*/
final switch (hc)
{
case HeaderUsecase.HeaderLine_DefaultHeader:
case HeaderUsecase.NoHeaderLine_DefaultHeader:
assert(headerLineOutput.data.chomp == defaultHeader,
headerAssertMessage(operatorArray[0], hc, headerLineOutput.data.chomp,
defaultHeader));
break;
case HeaderUsecase.HeaderLine_CustomHeader:
case HeaderUsecase.NoHeaderLine_CustomHeader:
assert(headerLineOutput.data.chomp == customOutputFieldHeader,
headerAssertMessage(operatorArray[0], hc, headerLineOutput.data.chomp,
customOutputFieldHeader));
break;
case HeaderUsecase.NoHeaderLine_NoOutputHeader:
break;
}
}
/* For each line, process the line, generate the output, and test that the
* value is correct. Start with the empty file case.
*/
foreach (i, const char[] expected; expectedValues)
{
if (i > 0) summarizer.processNextLine(splitFile[i - 1]);
auto summaryLineOutput = appender!(char[])();
summarizer.writeSummaryBody(summaryLineOutput, printOptions);
assert(summaryLineOutput.data.chomp == expected,
valueAssertMessage(operatorArray[0], hc, i,
summaryLineOutput.data.chomp, expectedValues[i]));
}
}
}
}
/* Specific operators.
*
* Notes:
* - The 'Calculator' inner classes are 'static'. This means inner class instances do not
* keep a reference to the context of the outer class. In exchange, Calculator instances
* need to hold all needed state, typically the field index they are summarizing.
*/
/** CountOperator counts the number of occurrences of each unique key, or the number of
* input lines if there is no unique key.
*
* CountOperator differs from most other operators in that it doesn't summarize a specific
* field on the line. Instead it is summarizing a property of the unique key itself. For
* this reason it doesn't derive from SingleFieldOperator.
*/
final class CountOperator : ZeroFieldOperator
{
this()
{
super("count");
}
final override ZeroFieldCalculator makeCalculator()
{
return new CountCalculator();
}
static final class CountCalculator : ZeroFieldCalculator
{
private size_t _count = 0;
final override void processNextEntry()
{
_count++;
}
final override string calculate(const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(_count);
}
}
}
unittest // CountOperator
{
auto col1File = [["10"], ["9.5"], ["11"]];
auto col2File = [["20", "-30"], ["21", "-29"], ["22", "-31"]];
auto col3File = [["9009", "9", "-4.5"], ["199", "0", "-0.5"], ["3003", "0.2", "12"]];
testZeroFieldOperator!CountOperator(col1File, "count", ["0", "1", "2", "3"]);
testZeroFieldOperator!CountOperator(col2File, "count", ["0", "1", "2", "3"]);
testZeroFieldOperator!CountOperator(col3File, "count", ["0", "1", "2", "3"]);
}
/** RetainOperator retains the first occurrence of a field, without changing the header.
*
* RetainOperator is intended for fields where the value is expected to be the same for
* all occurrences of the unique key, and the goal is to pass the value through unchanged.
* It is like FirstOperator, except that the original header is preserved. The original
* header preservation is setup in the call to the SingleFieldOperation constructor.
*
* Notes:
* - An option to signal an error if multiple values are encountered might be useful.
*/
final class RetainOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("retain", fieldIndex, missingPolicy, No.useHeaderSuffix, No.allowCustomHeader);
}
final override SingleFieldCalculator makeCalculator()
{
return new RetainCalculator(fieldIndex);
}
final class RetainCalculator : SingleFieldCalculator
{
private bool _done = false;
private string _value = "";
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override RetainOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
if (!_done)
{
_value = nextField.to!string;
_done = true;
}
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return _value;
}
}
}
unittest // RetainOperator
{
auto col1File = [["r1c1"], ["r2c1"], ["r3c1"]];
auto col2File = [["r1c1", "r1c2"], ["r2c1", "r2c2"], ["r3c1", "r3c2"]];
auto col3File = [["r1c1", "r1c2", "r1c3"], ["r2c1", "r2c2", "r2c3"], ["r3c1", "r3c2", "r3c3"]];
testSingleFieldOperator!RetainOperator(col1File, 0, "", ["", "r1c1", "r1c1", "r1c1"]);
testSingleFieldOperator!RetainOperator(col2File, 0, "", ["", "r1c1", "r1c1", "r1c1"]);
testSingleFieldOperator!RetainOperator(col2File, 1, "", ["", "r1c2", "r1c2", "r1c2"]);
testSingleFieldOperator!RetainOperator(col3File, 0, "", ["", "r1c1", "r1c1", "r1c1"]);
testSingleFieldOperator!RetainOperator(col3File, 1, "", ["", "r1c2", "r1c2", "r1c2"]);
testSingleFieldOperator!RetainOperator(col3File, 2, "", ["", "r1c3", "r1c3", "r1c3"]);
auto col1misFile = [[""], ["r2c1"], ["r3c1"]];
testSingleFieldOperator!RetainOperator(col1misFile, 0, "", ["", "", "r2c1", "r2c1"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!RetainOperator(col1misFile, 0, "", ["", "NA", "NA", "NA"],
new MissingFieldPolicy(false, "NA")); // Replace missing
}
/** FirstOperator outputs the first value found for the field.
*/
final class FirstOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("first", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new FirstCalculator(fieldIndex);
}
final class FirstCalculator : SingleFieldCalculator
{
private bool _done = false;
private string _value = "";
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override FirstOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
if (!_done)
{
_value = nextField.to!string;
_done = true;
}
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return _value;
}
}
}
unittest // FirstOperator
{
auto col1File = [["r1c1"], ["r2c1"], ["r3c1"]];
auto col2File = [["r1c1", "r1c2"], ["r2c1", "r2c2"], ["r3c1", "r3c2"]];
auto col3File = [["r1c1", "r1c2", "r1c3"], ["r2c1", "r2c2", "r2c3"], ["r3c1", "r3c2", "r3c3"]];
testSingleFieldOperator!FirstOperator(col1File, 0, "first", ["", "r1c1", "r1c1", "r1c1"]);
testSingleFieldOperator!FirstOperator(col2File, 0, "first", ["", "r1c1", "r1c1", "r1c1"]);
testSingleFieldOperator!FirstOperator(col2File, 1, "first", ["", "r1c2", "r1c2", "r1c2"]);
testSingleFieldOperator!FirstOperator(col3File, 0, "first", ["", "r1c1", "r1c1", "r1c1"]);
testSingleFieldOperator!FirstOperator(col3File, 1, "first", ["", "r1c2", "r1c2", "r1c2"]);
testSingleFieldOperator!FirstOperator(col3File, 2, "first", ["", "r1c3", "r1c3", "r1c3"]);
auto col1misFile = [[""], ["r2c1"], ["r3c1"]];
testSingleFieldOperator!FirstOperator(col1misFile, 0, "first", ["", "", "r2c1", "r2c1"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!FirstOperator(col1misFile, 0, "first", ["", "NA", "NA", "NA"],
new MissingFieldPolicy(false, "NA")); // Replace missing
}
/** LastOperator outputs the last value found for the field.
*/
final class LastOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("last", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new LastCalculator(fieldIndex);
}
final class LastCalculator : SingleFieldCalculator
{
private string _value = "";
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override LastOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
_value = nextField.to!string;
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return _value;
}
}
}
unittest // LastOperator
{
auto col1File = [["r1c1"], ["r2c1"], ["r3c1"]];
auto col2File = [["r1c1", "r1c2"], ["r2c1", "r2c2"], ["r3c1", "r3c2"]];
auto col3File = [["r1c1", "r1c2", "r1c3"], ["r2c1", "r2c2", "r2c3"], ["r3c1", "r3c2", "r3c3"]];
testSingleFieldOperator!LastOperator(col1File, 0, "last", ["", "r1c1", "r2c1", "r3c1"]);
testSingleFieldOperator!LastOperator(col2File, 0, "last", ["", "r1c1", "r2c1", "r3c1"]);
testSingleFieldOperator!LastOperator(col2File, 1, "last", ["", "r1c2", "r2c2", "r3c2"]);
testSingleFieldOperator!LastOperator(col3File, 0, "last", ["", "r1c1", "r2c1", "r3c1"]);
testSingleFieldOperator!LastOperator(col3File, 1, "last", ["", "r1c2", "r2c2", "r3c2"]);
testSingleFieldOperator!LastOperator(col3File, 2, "last", ["", "r1c3", "r2c3", "r3c3"]);
auto col1misFile = [[""], ["r2c1"], ["r3c1"]];
testSingleFieldOperator!LastOperator(col1misFile, 0, "last", ["", "", "r2c1", "r3c1"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!LastOperator(col1misFile, 0, "last", ["", "NA", "r2c1", "r3c1"],
new MissingFieldPolicy(false, "NA")); // Replace missing
}
/** MinOperator output the minimum value for the field. This is a numeric operator.
*
* This operator returns the original string without additional numeric formatting.
* This can be useful when joining back to the original data. This is different than
* numeric operators that perform calculations.
*/
final class MinOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("min", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new MinCalculator(fieldIndex);
}
final class MinCalculator : SingleFieldCalculator
{
private bool _isFirst = true;
private double _value = double.nan;
private string _originalString = "nan"; // Note: Cannot format floats at compile time (version 2.087)
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override MinOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
double fieldValue = nextField.to!double;
if (_isFirst)
{
_value = fieldValue;
_originalString = nextField.to!string;
_isFirst = false;
}
else if (fieldValue < _value)
{
_value = fieldValue;
_originalString = nextField.to!string;
}
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return _originalString;
}
}
}
unittest // MinOperator
{
auto col1File = [["10"], ["9.5"], ["11"]];
auto col2File = [["20", "-30"], ["21", "-29"], ["22", "-31"]];
auto col3File = [["9009", "9", "-4.5"], ["199", "0", "-0.5"], ["3003", "0.2", "12"]];
testSingleFieldOperator!MinOperator(col1File, 0, "min", ["nan", "10", "9.5", "9.5"]);
testSingleFieldOperator!MinOperator(col2File, 0, "min", ["nan", "20", "20", "20"]);
testSingleFieldOperator!MinOperator(col2File, 1, "min", ["nan", "-30", "-30", "-31"]);
testSingleFieldOperator!MinOperator(col3File, 0, "min", ["nan", "9009", "199", "199"]);
testSingleFieldOperator!MinOperator(col3File, 1, "min", ["nan", "9", "0", "0"]);
testSingleFieldOperator!MinOperator(col3File, 2, "min", ["nan", "-4.5", "-4.5", "-4.5"]);
auto col1misFile = [[""], ["10"], ["-10"]];
testSingleFieldOperator!MinOperator(col1misFile, 0, "min", ["nan", "nan", "10", "-10"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!MinOperator(col1misFile, 0, "min", ["nan", "5", "5", "-10"],
new MissingFieldPolicy(false, "5")); // Replace missing
}
/** MaxOperator output the maximum value for the field. This is a numeric operator.
*
* This operator returns the original string without additional numeric formatting.
* This can be useful when joining back to the original data. This is different than
* numeric operators that perform calculations.
*/
final class MaxOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("max", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new MaxCalculator(fieldIndex);
}
final class MaxCalculator : SingleFieldCalculator
{
private bool _isFirst = true;
private double _value = double.nan;
private string _originalString = "nan"; // Note: Cannot format floats at compile time (version 2.087)
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override MaxOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
double fieldValue = nextField.to!double;
if (_isFirst)
{
_value = fieldValue;
_originalString = nextField.to!string;
_isFirst = false;
}
else if (fieldValue > _value)
{
_value = fieldValue;
_originalString = nextField.to!string;
}
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return _originalString;
}
}
}
unittest // MaxOperator
{
auto col1File = [["10"], ["9.5"], ["11"]];
auto col2File = [["20", "-30"], ["21", "-29"], ["22", "-31"]];
auto col3File = [["9009", "9", "-4.5"], ["199", "0", "-0.5"], ["3003", "0.2", "12"]];
testSingleFieldOperator!MaxOperator(col1File, 0, "max", ["nan", "10", "10", "11"]);
testSingleFieldOperator!MaxOperator(col2File, 0, "max", ["nan", "20", "21", "22"]);
testSingleFieldOperator!MaxOperator(col2File, 1, "max", ["nan", "-30", "-29", "-29"]);
testSingleFieldOperator!MaxOperator(col3File, 0, "max", ["nan", "9009", "9009", "9009"]);
testSingleFieldOperator!MaxOperator(col3File, 1, "max", ["nan", "9", "9", "9"]);
testSingleFieldOperator!MaxOperator(col3File, 2, "max", ["nan", "-4.5", "-0.5", "12"]);
auto col1misFile = [[""], ["-10"], ["10"]];
testSingleFieldOperator!MaxOperator(col1misFile, 0, "max", ["nan", "nan", "-10", "10"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!MaxOperator(col1misFile, 0, "max", ["nan", "5", "5", "10"],
new MissingFieldPolicy(false, "5")); // Replace missing
}
/** RangeOperator outputs the difference between the minimum and maximum values.
*
* If there is a single value, or all values are the same, the range is zero. This is
* a numeric operator.
*/
final class RangeOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("range", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new RangeCalculator(fieldIndex);
}
final class RangeCalculator : SingleFieldCalculator
{
private bool _isFirst = true;
private double _minValue = 0.0;
private double _maxValue = 0.0;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override RangeOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
double fieldValue = nextField.to!double;
if (_isFirst)
{
_minValue = _maxValue = fieldValue;
_isFirst = false;
}
else if (fieldValue > _maxValue)
{
_maxValue = fieldValue;
}
else if (fieldValue < _minValue)
{
_minValue = fieldValue;
}
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(_maxValue - _minValue);
}
}
}
unittest // RangeOperator
{
auto col1File = [["10"], ["9.5"], ["11"]];
auto col2File = [["20", "-30"], ["21", "-29"], ["22", "-31"]];
auto col3File = [["9009", "9", "-4.5"], ["199", "0", "-0.5"], ["3003", "0.2", "12"]];
testSingleFieldOperator!RangeOperator(col1File, 0, "range", ["0", "0", "0.5", "1.5"]);
testSingleFieldOperator!RangeOperator(col2File, 0, "range", ["0", "0", "1", "2"]);
testSingleFieldOperator!RangeOperator(col2File, 1, "range", ["0", "0", "1", "2"]);
testSingleFieldOperator!RangeOperator(col3File, 0, "range", ["0", "0", "8810", "8810"]);
testSingleFieldOperator!RangeOperator(col3File, 1, "range", ["0", "0", "9", "9"]);
testSingleFieldOperator!RangeOperator(col3File, 2, "range", ["0", "0", "4", "16.5"]);
auto col1misFile = [[""], ["10"], [""], ["9.5"], ["11"]];
testSingleFieldOperator!RangeOperator(col1misFile, 0, "range", ["0", "0", "0", "0", "0.5", "1.5"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!RangeOperator(col1misFile, 0, "range", ["0", "0", "4.5", "4.5", "4.5", "5.5"],
new MissingFieldPolicy(false, "5.5")); // Replace missing
}
/** SumOperator produces the sum of all the values. This is a numeric operator.
*/
final class SumOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("sum", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new SumCalculator(fieldIndex);
}
final class SumCalculator : SingleFieldCalculator
{
private double _total = 0.0;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override SumOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
_total += nextField.to!double;
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(_total);
}
}
}
unittest // SumOperator
{
auto col1File = [["10"], ["9.5"], ["11"]];
auto col2File = [["20", "-30"], ["21", "-29"], ["22", "-31"]];
auto col3File = [["9009", "9", "-4.5"], ["199", "0", "-0.5"], ["3003", "0.2", "12"]];
testSingleFieldOperator!SumOperator(col1File, 0, "sum", ["0", "10", "19.5", "30.5"]);
testSingleFieldOperator!SumOperator(col2File, 0, "sum", ["0", "20", "41", "63"]);
testSingleFieldOperator!SumOperator(col2File, 1, "sum", ["0", "-30", "-59", "-90"]);
testSingleFieldOperator!SumOperator(col3File, 0, "sum", ["0", "9009", "9208", "12211"]);
testSingleFieldOperator!SumOperator(col3File, 1, "sum", ["0", "9", "9", "9.2"]);
testSingleFieldOperator!SumOperator(col3File, 2, "sum", ["0", "-4.5", "-5", "7"]);
auto col1misFile = [[""], ["10"], [""], ["9.5"], ["11"]];
testSingleFieldOperator!SumOperator(col1misFile, 0, "sum", ["0", "0", "10", "10", "19.5", "30.5"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!SumOperator(col1misFile, 0, "sum", ["0", "1.5", "11.5", "13", "22.5", "33.5"],
new MissingFieldPolicy(false, "1.5")); // Replace missing
}
/** MeanOperator produces the mean (average) of all the values. This is a numeric operator.
*/
final class MeanOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("mean", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new MeanCalculator(fieldIndex);
}
final class MeanCalculator : SingleFieldCalculator
{
private double _total = 0.0;
private size_t _count = 0;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override MeanOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
_total += nextField.to!double;
_count++;
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(
(_count > 0) ? (_total / _count.to!double) : double.nan);
}
}
}
unittest // MeanOperator
{
auto col1File = [["10"], ["9.5"], ["7.5"]];
auto col2File = [["20", "-30"], ["21", "-29"], ["22", "-31"]];
auto col3File = [["9009", "9", "-4.5"], ["9", "0", "-1.5"], ["4509", "-3", "12"]];
testSingleFieldOperator!MeanOperator(col1File, 0, "mean", ["nan", "10", "9.75", "9"]);
testSingleFieldOperator!MeanOperator(col2File, 0, "mean", ["nan", "20", "20.5", "21"]);
testSingleFieldOperator!MeanOperator(col2File, 1, "mean", ["nan", "-30", "-29.5", "-30"]);
testSingleFieldOperator!MeanOperator(col3File, 0, "mean", ["nan", "9009", "4509", "4509"]);
testSingleFieldOperator!MeanOperator(col3File, 1, "mean", ["nan", "9", "4.5", "2"]);
testSingleFieldOperator!MeanOperator(col3File, 2, "mean", ["nan", "-4.5", "-3", "2"]);
auto col1misFile = [[""], ["6"], [""], ["14"], ["40"]];
testSingleFieldOperator!MeanOperator(col1misFile, 0, "mean", ["nan", "nan", "6", "6", "10", "20"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!MeanOperator(col1misFile, 0, "mean", ["nan", "0", "3", "2", "5", "12"],
new MissingFieldPolicy(false, "0")); // Replace missing
}
/** MedianOperator produces the median of all the values. This is a numeric operator.
*
* All the field values are stored in memory as part of this calculation. This is
* handled by unique key value lists.
*/
final class MedianOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("median", fieldIndex, missingPolicy);
setSaveFieldValuesNumeric();
}
final override SingleFieldCalculator makeCalculator()
{
return new MedianCalculator(fieldIndex);
}
final class MedianCalculator : SingleFieldCalculator
{
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override MedianOperator getOperator()
{
return this.outer;
}
/* Work is done by saving the field values. */
final override void processNextField(const char[] nextField)
{ }
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(valuesLists.numericValuesMedian(fieldIndex));
}
}
}
unittest // MedianOperator
{
auto col1File = [["10"], ["9.5"], ["7.5"]];
auto col2File = [["20", "-30"], ["21", "-29"], ["22", "-31"]];
auto col3File = [["9009", "9", "-4.5"], ["9", "0", "-1.5"], ["4509", "-3", "12"]];
testSingleFieldOperator!MedianOperator(col1File, 0, "median", ["nan", "10", "9.75", "9.5"]);
testSingleFieldOperator!MedianOperator(col2File, 0, "median", ["nan", "20", "20.5", "21"]);
testSingleFieldOperator!MedianOperator(col2File, 1, "median", ["nan", "-30", "-29.5", "-30"]);
testSingleFieldOperator!MedianOperator(col3File, 0, "median", ["nan", "9009", "4509", "4509"]);
testSingleFieldOperator!MedianOperator(col3File, 1, "median", ["nan", "9", "4.5", "0"]);
testSingleFieldOperator!MedianOperator(col3File, 2, "median", ["nan", "-4.5", "-3", "-1.5"]);
auto col1misFile = [[""], ["10"], [""], ["9.5"], ["7.5"]];
testSingleFieldOperator!MedianOperator(col1misFile, 0, "median", ["nan", "nan", "10", "10", "9.75", "9.5"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!MedianOperator(col1misFile, 0, "median", ["nan", "0", "5", "0", "4.75", "7.5"],
new MissingFieldPolicy(false, "0")); // Replace missing
}
/** QuantileOperator produces the value representing the data at a cummulative probability.
* This is a numeric operation.
*
* As an example, quantiles might be produced for the 0.25, 0.5, and 0.75 probabilities
* (alternately, the 25th, 50th, and 75th percentile ranks, the 50th percentile being the
* median). Data is sorted is ascending order. This operator takes one percentile, but it
* is common to generate multiple quantile ranks for the same field when summarizing.
*
* All the field's values are stored in memory as part of this calculation. This is
* handled by unique key value lists.
*/
final class QuantileOperator : SingleFieldOperator
{
private double _prob;
this(size_t fieldIndex, MissingFieldPolicy missingPolicy, double probability)
{
assert(0.0 <= probability && probability <= 1.0);
import std.format : format;
string header = (probability == 0.0) ? "pct0" : format("pct%02g", probability * 100.0);
super(header, fieldIndex, missingPolicy);
_prob = probability;
setSaveFieldValuesNumeric();
}
final override SingleFieldCalculator makeCalculator()
{
return new QuantileCalculator(fieldIndex);
}
final class QuantileCalculator : SingleFieldCalculator
{
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override QuantileOperator getOperator()
{
return this.outer;
}
/* Work is done by saving the field values. */
final override void processNextField(const char[] nextField)
{ }
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
import tsv_utils.common.numerics : quantile;
return printOptions.formatNumber(
quantile(this.outer._prob, valuesLists.numericValuesSorted(fieldIndex)));
}
}
}
unittest // QuantileOperator
{
auto col1File = [["10"], ["9.5"], ["7.5"]];
auto col2File = [["20", "-30"], ["21", "-29"], ["22", "-31"]];
auto col3File = [["9009", "9", "-4.5"], ["9", "0", "-1.5"], ["4509", "-3", "12"]];
auto defaultMissing = new MissingFieldPolicy;
/* Same as the median tests. */
testSingleFieldOperatorBase!QuantileOperator(col1File, 0, "pct50", ["nan", "10", "9.75", "9.5"], defaultMissing, 0.50);
testSingleFieldOperatorBase!QuantileOperator(col2File, 0, "pct50", ["nan", "20", "20.5", "21"], defaultMissing, 0.50);
testSingleFieldOperatorBase!QuantileOperator(col2File, 1, "pct50", ["nan", "-30", "-29.5", "-30"], defaultMissing, 0.50);
testSingleFieldOperatorBase!QuantileOperator(col3File, 0, "pct50", ["nan", "9009", "4509", "4509"], defaultMissing, 0.50);
testSingleFieldOperatorBase!QuantileOperator(col3File, 1, "pct50", ["nan", "9", "4.5", "0"], defaultMissing, 0.50);
testSingleFieldOperatorBase!QuantileOperator(col3File, 2, "pct50", ["nan", "-4.5", "-3", "-1.5"], defaultMissing, 0.50);
/* The extremes (0, 1), are min and max. */
testSingleFieldOperatorBase!QuantileOperator(col1File, 0, "pct0", ["nan", "10", "9.5", "7.5"], defaultMissing, 0.0);
testSingleFieldOperatorBase!QuantileOperator(col2File, 0, "pct0", ["nan", "20", "20", "20"], defaultMissing, 0.0);
testSingleFieldOperatorBase!QuantileOperator(col2File, 1, "pct0", ["nan", "-30", "-30", "-31"], defaultMissing, 0.0);
testSingleFieldOperatorBase!QuantileOperator(col3File, 0, "pct0", ["nan", "9009", "9", "9"], defaultMissing, 0.0);
testSingleFieldOperatorBase!QuantileOperator(col3File, 1, "pct0", ["nan", "9", "0", "-3"], defaultMissing, 0.0);
testSingleFieldOperatorBase!QuantileOperator(col3File, 2, "pct0", ["nan", "-4.5", "-4.5", "-4.5"], defaultMissing, 0.0);
testSingleFieldOperatorBase!QuantileOperator(col1File, 0, "pct100", ["nan", "10", "10", "10"], defaultMissing, 1.0);
testSingleFieldOperatorBase!QuantileOperator(col2File, 0, "pct100", ["nan", "20", "21", "22"], defaultMissing, 1.0);
testSingleFieldOperatorBase!QuantileOperator(col2File, 1, "pct100", ["nan", "-30", "-29", "-29"], defaultMissing, 1.0);
testSingleFieldOperatorBase!QuantileOperator(col3File, 0, "pct100", ["nan", "9009", "9009", "9009"], defaultMissing, 1.0);
testSingleFieldOperatorBase!QuantileOperator(col3File, 1, "pct100", ["nan", "9", "9", "9"], defaultMissing, 1.0);
testSingleFieldOperatorBase!QuantileOperator(col3File, 2, "pct100", ["nan", "-4.5", "-1.5", "12"], defaultMissing, 1.0);
/* For missing policies, re-use the median tests. */
auto col1misFile = [[""], ["10"], [""], ["9.5"], ["7.5"]];
testSingleFieldOperatorBase!QuantileOperator(col1misFile, 0, "pct50", ["nan", "nan", "10", "10", "9.75", "9.5"],
new MissingFieldPolicy(true, ""), 0.5); // Exclude missing
testSingleFieldOperatorBase!QuantileOperator(col1misFile, 0, "pct50", ["nan", "0", "5", "0", "4.75", "7.5"],
new MissingFieldPolicy(false, "0"), 0.5); // Replace missing
}
/** MadOperator produces the median absolute deviation from the median. This is a numeric
* operation.
*
* The result is the raw MAD value, without a normalization applied.
*
* All the field values are stored in memory as part of this calculation. This is
* handled by unique key value lists.
*/
final class MadOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("mad", fieldIndex, missingPolicy);
setSaveFieldValuesNumeric();
}
final override SingleFieldCalculator makeCalculator()
{
return new MadCalculator(fieldIndex);
}
final class MadCalculator : SingleFieldCalculator
{
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override MadOperator getOperator()
{
return this.outer;
}
/* Work is done by saving the field values. */
final override void processNextField(const char[] nextField)
{ }
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
import std.math : abs;
import tsv_utils.common.numerics : rangeMedian;
auto median = valuesLists.numericValuesMedian(fieldIndex);
auto values = valuesLists.numericValues(fieldIndex);
auto medianDevs = new double[values.length];
foreach (size_t i, double v; values)
medianDevs[i] = abs(v - median);
return printOptions.formatNumber(medianDevs.rangeMedian);
}
}
}
unittest // MadOperator
{
auto col1File = [["10"], ["15"], ["20"], ["25"], ["30"]];
auto col2File = [["2", "50"], ["2", "51"], ["2", "52"]];
auto col3File = [["16", "8", "-4"], ["8", "8", "-2"], ["8", "16", "0"]];
testSingleFieldOperator!MadOperator(col1File, 0, "mad", ["nan", "0", "2.5", "5", "5", "5"]);
testSingleFieldOperator!MadOperator(col2File, 0, "mad", ["nan", "0", "0", "0"]);
testSingleFieldOperator!MadOperator(col2File, 1, "mad", ["nan", "0", "0.5", "1"]);
testSingleFieldOperator!MadOperator(col3File, 0, "mad", ["nan", "0", "4", "0"]);
testSingleFieldOperator!MadOperator(col3File, 1, "mad", ["nan", "0", "0", "0"]);
testSingleFieldOperator!MadOperator(col3File, 2, "mad", ["nan", "0", "1", "2"]);
auto col1misFile = [[""], ["16"], [""], ["32"], ["-4"]];
testSingleFieldOperator!MadOperator(col1misFile, 0, "mad", ["nan", "nan", "0", "0", "8", "16"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!MadOperator(col1misFile, 0, "mad", ["nan", "0", "8", "0", "8", "4"],
new MissingFieldPolicy(false, "0")); // Replace missing
}
/** Generates the variance of the fields values. This is a numeric operator.
*/
final class VarianceOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("var", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new VarianceCalculator(fieldIndex);
}
final class VarianceCalculator : SingleFieldCalculator
{
private double _count = 0.0;
private double _mean = 0.0;
private double _m2 = 0.0; // Sum of squares of differences from current mean
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override VarianceOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
_count += 1.0;
double fieldValue = nextField.to!double;
double delta = fieldValue - _mean;
_mean += delta / _count;
_m2 += delta * (fieldValue - _mean);
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(
(_count >= 2.0) ? (_m2 / (_count - 1.0)) : double.nan);
}
}
}
unittest // VarianceOperator
{
auto col1File = [["5"], ["10"], ["15"]];
auto col2File = [["-5", "-5"], ["-10", "0"], ["-15", "5"]];
auto col3File = [["1", "2", "100"], ["2", "3", "100"], ["3", "4", "103"]];
testSingleFieldOperator!VarianceOperator(col1File, 0, "var", ["nan", "nan", "12.5", "25"]);
testSingleFieldOperator!VarianceOperator(col2File, 0, "var", ["nan", "nan", "12.5", "25"]);
testSingleFieldOperator!VarianceOperator(col2File, 1, "var", ["nan", "nan", "12.5", "25"]);
testSingleFieldOperator!VarianceOperator(col3File, 0, "var", ["nan", "nan", "0.5", "1"]);
testSingleFieldOperator!VarianceOperator(col3File, 1, "var", ["nan", "nan", "0.5", "1"]);
testSingleFieldOperator!VarianceOperator(col3File, 2, "var", ["nan", "nan", "0", "3"]);
auto col1misFile = [["5"], ["10"], [""]];
testSingleFieldOperator!VarianceOperator(col1misFile, 0, "var", ["nan", "nan", "12.5", "12.5"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!VarianceOperator(col1misFile, 0, "var", ["nan", "nan", "12.5", "25"],
new MissingFieldPolicy(false, "15")); // Replace missing
}
/** Generates the standard deviation of the fields values. This is a numeric operator.
*/
final class StDevOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("stdev", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new StDevCalculator(fieldIndex);
}
final class StDevCalculator : SingleFieldCalculator
{
private double _count = 0.0;
private double _mean = 0.0;
private double _m2 = 0.0; // Sum of squares of differences from current mean
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override StDevOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
_count += 1.0;
double fieldValue = nextField.to!double;
double delta = fieldValue - _mean;
_mean += delta / _count;
_m2 += delta * (fieldValue - _mean);
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
import std.math : sqrt;
return printOptions.formatNumber(
(_count >= 2.0) ? (_m2 / (_count - 1.0)).sqrt : double.nan);
}
}
}
/* StDevOperator unit tests - These would be improved with a tolerance option.
*/
unittest
{
auto col1File = [["1"], ["4"], ["7"]];
auto col2File = [["3", "3"], ["3", "9"], ["7", "15"]];
auto col3File = [["11", "10", "10"], ["24", "22", "25"], ["37", "34", "40"]];
testSingleFieldOperator!StDevOperator(col1File, 0, "stdev", ["nan", "nan", "2.12132034356", "3"]);
testSingleFieldOperator!StDevOperator(col2File, 0, "stdev", ["nan", "nan", "0", "2.30940107676"]);
testSingleFieldOperator!StDevOperator(col2File, 1, "stdev", ["nan", "nan", "4.24264068712", "6"]);
testSingleFieldOperator!StDevOperator(col3File, 0, "stdev", ["nan", "nan", "9.19238815543", "13"]);
testSingleFieldOperator!StDevOperator(col3File, 1, "stdev", ["nan", "nan", "8.48528137424", "12"]);
testSingleFieldOperator!StDevOperator(col3File, 2, "stdev", ["nan", "nan", "10.6066017178", "15"]);
auto col1misFile = [["1"], ["4"], [""]];
testSingleFieldOperator!StDevOperator(col1misFile, 0, "stdev", ["nan", "nan", "2.12132034356", "2.12132034356"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!StDevOperator(col1misFile, 0, "stdev", ["nan", "nan", "2.12132034356", "3"],
new MissingFieldPolicy(false, "7")); // Replace missing
}
/** UniqueCountOperator generates the number of unique values. Unique values are
* based on exact text match calculation, not a numeric comparison.
*
* All the unique field values are stored in memory as part of this calculation.
*/
final class UniqueCountOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("unique_count", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new UniqueCountCalculator(fieldIndex);
}
final class UniqueCountCalculator : SingleFieldCalculator
{
private bool[string] _values;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override UniqueCountOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
if (nextField !in _values) _values[nextField.to!string] = true;
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(_values.length);
}
}
}
unittest // UniqueCount
{
auto col1File = [["a"], ["b"], ["c"], ["c"], ["b"], ["b"], ["a"], ["ab"]];
auto col2File = [["abc", "pqr"], ["def", "pqr"], ["def", "xyz"]];
auto col3File = [["1.0", "1", "a"], ["2.0", "a", "1"], ["2", "a", "1.0"]];
testSingleFieldOperator!UniqueCountOperator(col1File, 0, "unique_count", ["0", "1", "2", "3", "3", "3", "3", "3", "4"]);
testSingleFieldOperator!UniqueCountOperator(col2File, 0, "unique_count", ["0", "1", "2", "2"]);
testSingleFieldOperator!UniqueCountOperator(col2File, 1, "unique_count", ["0", "1", "1", "2"]);
testSingleFieldOperator!UniqueCountOperator(col3File, 0, "unique_count", ["0", "1", "2", "3"]);
testSingleFieldOperator!UniqueCountOperator(col3File, 1, "unique_count", ["0", "1", "2", "2"]);
testSingleFieldOperator!UniqueCountOperator(col3File, 2, "unique_count", ["0", "1", "2", "3"]);
auto col1misFile = [[""], ["a"], [""], ["b"], ["c"], ["c"], ["b"], ["b"], ["a"], ["ab"]];
testSingleFieldOperator!UniqueCountOperator(col1misFile, 0, "unique_count", ["0", "0", "1", "1", "2", "3", "3", "3", "3", "3", "4"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!UniqueCountOperator(col1misFile, 0, "unique_count", ["0", "1", "2", "2", "3", "4", "4", "4", "4", "4", "5"],
new MissingFieldPolicy(false, "XYZ")); // Replace missing
}
/** MissingCountOperator generates the number of missing values. This overrides
* the global missingFieldsPolicy.
*/
final class MissingCountOperator : SingleFieldOperator
{
private MissingFieldPolicy _globalMissingPolicy;
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
_globalMissingPolicy = missingPolicy;
super("missing_count", fieldIndex, new MissingFieldPolicy(false, ""));
}
final override SingleFieldCalculator makeCalculator()
{
return new MissingCountCalculator(fieldIndex);
}
final class MissingCountCalculator : SingleFieldCalculator
{
private size_t _missingCount = 0;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override MissingCountOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
if (this.outer._globalMissingPolicy.isMissingField(nextField)) _missingCount++;
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(_missingCount);
}
}
}
unittest // MissingCount
{
auto col1File = [["a"], ["b"], [""], [" "], [""]];
auto col2File = [["abc", ""], ["", ""], ["def", ""]];
auto col3File = [["", "1", "a"], ["2.0", "", "1"], ["2", "", ""]];
testSingleFieldOperator!MissingCountOperator(col1File, 0, "missing_count", ["0", "0", "0", "1", "1", "2"]);
testSingleFieldOperator!MissingCountOperator(col2File, 0, "missing_count", ["0", "0", "1", "1"]);
testSingleFieldOperator!MissingCountOperator(col2File, 1, "missing_count", ["0", "1", "2", "3"]);
testSingleFieldOperator!MissingCountOperator(col3File, 0, "missing_count", ["0", "1", "1", "1"]);
testSingleFieldOperator!MissingCountOperator(col3File, 1, "missing_count", ["0", "0", "1", "2"]);
testSingleFieldOperator!MissingCountOperator(col3File, 2, "missing_count", ["0", "0", "0", "1"]);
auto excludeMissing = new MissingFieldPolicy(true, "");
auto replaceMissing = new MissingFieldPolicy(false, "X");
testSingleFieldOperator!MissingCountOperator(col1File, 0, "missing_count", ["0", "0", "0", "1", "1", "2"], excludeMissing);
testSingleFieldOperator!MissingCountOperator(col2File, 0, "missing_count", ["0", "0", "1", "1"], excludeMissing);
testSingleFieldOperator!MissingCountOperator(col2File, 1, "missing_count", ["0", "1", "2", "3"], excludeMissing);
testSingleFieldOperator!MissingCountOperator(col3File, 0, "missing_count", ["0", "1", "1", "1"], excludeMissing);
testSingleFieldOperator!MissingCountOperator(col3File, 1, "missing_count", ["0", "0", "1", "2"], excludeMissing);
testSingleFieldOperator!MissingCountOperator(col3File, 2, "missing_count", ["0", "0", "0", "1"], excludeMissing);
testSingleFieldOperator!MissingCountOperator(col1File, 0, "missing_count", ["0", "0", "0", "1", "1", "2"], replaceMissing);
testSingleFieldOperator!MissingCountOperator(col2File, 0, "missing_count", ["0", "0", "1", "1"], replaceMissing);
testSingleFieldOperator!MissingCountOperator(col2File, 1, "missing_count", ["0", "1", "2", "3"], replaceMissing);
testSingleFieldOperator!MissingCountOperator(col3File, 0, "missing_count", ["0", "1", "1", "1"], replaceMissing);
testSingleFieldOperator!MissingCountOperator(col3File, 1, "missing_count", ["0", "0", "1", "2"], replaceMissing);
testSingleFieldOperator!MissingCountOperator(col3File, 2, "missing_count", ["0", "0", "0", "1"], replaceMissing);
}
/** NotMissingCountOperator generates the number of not-missing values. This overrides
* the global missingFieldsPolicy.
*/
final class NotMissingCountOperator : SingleFieldOperator
{
private MissingFieldPolicy _globalMissingPolicy;
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
_globalMissingPolicy = missingPolicy;
super("not_missing_count", fieldIndex, new MissingFieldPolicy(false, ""));
}
final override SingleFieldCalculator makeCalculator()
{
return new NotMissingCountCalculator(fieldIndex);
}
final class NotMissingCountCalculator : SingleFieldCalculator
{
private size_t _notMissingCount = 0;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override NotMissingCountOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
if (!this.outer._globalMissingPolicy.isMissingField(nextField)) _notMissingCount++;
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return printOptions.formatNumber(_notMissingCount);
}
}
}
unittest // NotMissingCount
{
auto col1File = [["a"], ["b"], [""], [" "], [""]];
auto col2File = [["abc", ""], ["", ""], ["def", ""]];
auto col3File = [["", "1", "a"], ["2.0", "", "1"], ["2", "", ""]];
testSingleFieldOperator!NotMissingCountOperator(col1File, 0, "not_missing_count", ["0", "1", "2", "2", "3", "3"]);
testSingleFieldOperator!NotMissingCountOperator(col2File, 0, "not_missing_count", ["0", "1", "1", "2"]);
testSingleFieldOperator!NotMissingCountOperator(col2File, 1, "not_missing_count", ["0", "0", "0", "0"]);
testSingleFieldOperator!NotMissingCountOperator(col3File, 0, "not_missing_count", ["0", "0", "1", "2"]);
testSingleFieldOperator!NotMissingCountOperator(col3File, 1, "not_missing_count", ["0", "1", "1", "1"]);
testSingleFieldOperator!NotMissingCountOperator(col3File, 2, "not_missing_count", ["0", "1", "2", "2"]);
auto excludeMissing = new MissingFieldPolicy(true, "");
auto replaceMissing = new MissingFieldPolicy(false, "X");
testSingleFieldOperator!NotMissingCountOperator(col1File, 0, "not_missing_count", ["0", "1", "2", "2", "3", "3"], excludeMissing);
testSingleFieldOperator!NotMissingCountOperator(col2File, 0, "not_missing_count", ["0", "1", "1", "2"], excludeMissing);
testSingleFieldOperator!NotMissingCountOperator(col2File, 1, "not_missing_count", ["0", "0", "0", "0"], excludeMissing);
testSingleFieldOperator!NotMissingCountOperator(col3File, 0, "not_missing_count", ["0", "0", "1", "2"], excludeMissing);
testSingleFieldOperator!NotMissingCountOperator(col3File, 1, "not_missing_count", ["0", "1", "1", "1"], excludeMissing);
testSingleFieldOperator!NotMissingCountOperator(col3File, 2, "not_missing_count", ["0", "1", "2", "2"], excludeMissing);
testSingleFieldOperator!NotMissingCountOperator(col1File, 0, "not_missing_count", ["0", "1", "2", "2", "3", "3"], replaceMissing);
testSingleFieldOperator!NotMissingCountOperator(col2File, 0, "not_missing_count", ["0", "1", "1", "2"], replaceMissing);
testSingleFieldOperator!NotMissingCountOperator(col2File, 1, "not_missing_count", ["0", "0", "0", "0"], replaceMissing);
testSingleFieldOperator!NotMissingCountOperator(col3File, 0, "not_missing_count", ["0", "0", "1", "2"], replaceMissing);
testSingleFieldOperator!NotMissingCountOperator(col3File, 1, "not_missing_count", ["0", "1", "1", "1"], replaceMissing);
testSingleFieldOperator!NotMissingCountOperator(col3File, 2, "not_missing_count", ["0", "1", "2", "2"], replaceMissing);
}
/** ModeOperator outputs the most frequent value seen. In the event of a tie, the
* first value seen is produced.
*
* All the field values are stored in memory as part of this calculation.
*
*/
final class ModeOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("mode", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new ModeCalculator(fieldIndex);
}
final class ModeCalculator : SingleFieldCalculator
{
private size_t[string] _valueCounts;
private Appender!(string[]) _uniqueValues;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override ModeOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
auto countPtr = (nextField in _valueCounts);
if (countPtr is null)
{
string value = nextField.to!string;
_uniqueValues.put(value);
_valueCounts[value] = 1;
}
else
{
(*countPtr)++;
}
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
string modeValue = "";
size_t modeCount = 0;
foreach (value; _uniqueValues.data)
{
assert(value in _valueCounts);
auto count = _valueCounts[value];
if (count > modeCount)
{
modeValue = value;
modeCount = count;
}
}
return modeValue;
}
}
}
unittest // ModeOperator
{
auto col1File = [["a"], ["b"], ["c"], ["c"], ["b"], ["b"], ["a"]];
auto col2File = [["abc", "pqr"], ["def", "pqr"], ["def", "xyz"]];
auto col3File = [["1.0", "1", "a"], ["2.0", "a", "1"], ["2", "a", "1.0"]];
testSingleFieldOperator!ModeOperator(col1File, 0, "mode", ["", "a", "a", "a", "c", "b", "b", "b"]);
testSingleFieldOperator!ModeOperator(col2File, 0, "mode", ["", "abc", "abc", "def"]);
testSingleFieldOperator!ModeOperator(col2File, 1, "mode", ["", "pqr", "pqr", "pqr"]);
testSingleFieldOperator!ModeOperator(col3File, 0, "mode", ["", "1.0", "1.0", "1.0"]);
testSingleFieldOperator!ModeOperator(col3File, 1, "mode", ["", "1", "1", "a"]);
testSingleFieldOperator!ModeOperator(col3File, 2, "mode", ["", "a", "a", "a"]);
auto col1misFile = [[""], ["a"], [""], ["b"], ["c"], ["c"], ["b"], ["b"]];
testSingleFieldOperator!ModeOperator(col1misFile, 0, "mode", ["", "", "a", "a", "a", "a", "c", "b", "b"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!ModeOperator(col1misFile, 0, "mode", ["", "X", "X", "X", "X", "X", "X", "X", "b"],
new MissingFieldPolicy(false, "X")); // Replace missing
}
/** ModeCountOperator outputs the count of the most frequent value seen.
*
* All the field values are stored in memory as part of this calculation.
*
*/
final class ModeCountOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("mode_count", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new ModeCountCalculator(fieldIndex);
}
final class ModeCountCalculator : SingleFieldCalculator
{
private size_t[string] _valueCounts;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override ModeCountOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
auto countPtr = (nextField in _valueCounts);
if (countPtr is null)
{
string value = nextField.to!string;
_valueCounts[value] = 1;
}
else
{
(*countPtr)++;
}
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
size_t modeCount = 0;
foreach (count; _valueCounts.byValue) if (count > modeCount) modeCount = count;
return printOptions.formatNumber(modeCount);
}
}
}
unittest // ModeCountOperator
{
auto col1File = [["a"], ["b"], ["c"], ["c"], ["b"], ["b"], ["a"]];
auto col2File = [["abc", ""], ["def", ""], ["def", "xyz"]];
auto col3File = [["1.0", "1", "a"], ["2.0", "a", "1"], ["2", "a", "1.0"]];
testSingleFieldOperator!ModeCountOperator(col1File, 0, "mode_count", ["0", "1", "1", "1", "2", "2", "3", "3"]);
testSingleFieldOperator!ModeCountOperator(col2File, 0, "mode_count", ["0", "1", "1", "2"]);
testSingleFieldOperator!ModeCountOperator(col2File, 1, "mode_count", ["0", "1", "2", "2"]);
testSingleFieldOperator!ModeCountOperator(col3File, 0, "mode_count", ["0", "1", "1", "1"]);
testSingleFieldOperator!ModeCountOperator(col3File, 1, "mode_count", ["0", "1", "1", "2"]);
testSingleFieldOperator!ModeCountOperator(col3File, 2, "mode_count", ["0", "1", "1", "1"]);
auto col1misFile = [[""], ["a"], [""], ["b"], ["c"], ["c"], ["b"], ["b"]];
testSingleFieldOperator!ModeCountOperator(col1misFile, 0, "mode_count", ["0", "0", "1", "1", "1", "1", "2", "2", "3"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!ModeCountOperator(col1misFile, 0, "mode_count", ["0", "1", "1", "2", "2", "2", "2", "2", "3"],
new MissingFieldPolicy(false, "X")); // Replace missing
}
/** ValuesOperator outputs each value delimited by an alternate delimiter character.
*
* All the field values are stored in memory as part of this calculation. This is
* handled by unique key value lists.
*/
final class ValuesOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("values", fieldIndex, missingPolicy);
setSaveFieldValuesText();
}
final override SingleFieldCalculator makeCalculator()
{
return new ValuesCalculator(fieldIndex);
}
final class ValuesCalculator : SingleFieldCalculator
{
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override ValuesOperator getOperator()
{
return this.outer;
}
/* Work is done by saving the field values. */
final override void processNextField(const char[] nextField)
{ }
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return valuesLists.textValues(fieldIndex).join(printOptions.valuesDelimiter);
}
}
}
unittest // ValuesOperator
{
auto col1File = [["a"], [""], ["b"], ["cd"], ["e"], [""], ["a"]];
auto col2File = [["", "50"], ["", "51"], ["xyz", "52"]];
auto col3File = [["z", "a", "-"], ["y", "ab", "--"], ["w", "ba", "---"]];
testSingleFieldOperator!ValuesOperator(col1File, 0, "values", ["", "a", "a|", "a||b", "a||b|cd", "a||b|cd|e", "a||b|cd|e|", "a||b|cd|e||a"]);
testSingleFieldOperator!ValuesOperator(col2File, 0, "values", ["", "", "|", "||xyz"]);
testSingleFieldOperator!ValuesOperator(col2File, 1, "values", ["", "50", "50|51", "50|51|52"]);
testSingleFieldOperator!ValuesOperator(col3File, 0, "values", ["", "z", "z|y", "z|y|w"]);
testSingleFieldOperator!ValuesOperator(col3File, 1, "values", ["", "a", "a|ab", "a|ab|ba"]);
testSingleFieldOperator!ValuesOperator(col3File, 2, "values", ["", "-", "-|--", "-|--|---"]);
testSingleFieldOperator!ValuesOperator(col1File, 0, "values", ["", "a", "a", "a|b", "a|b|cd", "a|b|cd|e", "a|b|cd|e", "a|b|cd|e|a"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!ValuesOperator(col1File, 0, "values", ["", "a", "a|X", "a|X|b", "a|X|b|cd", "a|X|b|cd|e", "a|X|b|cd|e|X", "a|X|b|cd|e|X|a"],
new MissingFieldPolicy(false, "X")); // Replace missing
}
/** UniqueValuesOperator outputs each unique value delimited by an alternate delimiter
* character. Values are output in the order seen.
*
* All unique field values are stored in memory as part of this calculation.
*
*/
final class UniqueValuesOperator : SingleFieldOperator
{
this(size_t fieldIndex, MissingFieldPolicy missingPolicy)
{
super("unique_values", fieldIndex, missingPolicy);
}
final override SingleFieldCalculator makeCalculator()
{
return new UniqueValuesCalculator(fieldIndex);
}
final class UniqueValuesCalculator : SingleFieldCalculator
{
private size_t[string] _valuesHash;
private Appender!(string[]) _uniqueValues;
this(size_t fieldIndex)
{
super(fieldIndex);
}
final override UniqueValuesOperator getOperator()
{
return this.outer;
}
final override void processNextField(const char[] nextField)
{
auto ptr = (nextField in _valuesHash);
if (ptr is null)
{
string value = nextField.to!string;
_uniqueValues.put(value);
_valuesHash[value] = 1;
}
}
final string calculate(UniqueKeyValuesLists valuesLists, const ref SummarizerPrintOptions printOptions)
{
return _uniqueValues.data.join(printOptions.valuesDelimiter);
}
}
}
unittest // UniqueValuesOperator
{
auto col1File = [["a"], [""], ["b"], ["cd"], ["e"], [""], ["a"]];
auto col2File = [["", "50"], ["", "50"], ["xyz", "52"]];
auto col3File = [["z", "a", "-"], ["y", "ab", "--"], ["w", "ba", "-"]];
testSingleFieldOperator!UniqueValuesOperator(col1File, 0, "unique_values", ["", "a", "a|", "a||b", "a||b|cd", "a||b|cd|e", "a||b|cd|e", "a||b|cd|e"]);
testSingleFieldOperator!UniqueValuesOperator(col2File, 0, "unique_values", ["", "", "", "|xyz"]);
testSingleFieldOperator!UniqueValuesOperator(col2File, 1, "unique_values", ["", "50", "50", "50|52"]);
testSingleFieldOperator!UniqueValuesOperator(col3File, 0, "unique_values", ["", "z", "z|y", "z|y|w"]);
testSingleFieldOperator!UniqueValuesOperator(col3File, 1, "unique_values", ["", "a", "a|ab", "a|ab|ba"]);
testSingleFieldOperator!UniqueValuesOperator(col3File, 2, "unique_values", ["", "-", "-|--", "-|--"]);
testSingleFieldOperator!UniqueValuesOperator(col1File, 0, "unique_values", ["", "a", "a", "a|b", "a|b|cd", "a|b|cd|e", "a|b|cd|e", "a|b|cd|e"],
new MissingFieldPolicy(true, "")); // Exclude missing
testSingleFieldOperator!UniqueValuesOperator(col1File, 0, "unique_values", ["", "a", "a|X", "a|X|b", "a|X|b|cd", "a|X|b|cd|e", "a|X|b|cd|e", "a|X|b|cd|e"],
new MissingFieldPolicy(false, "X")); // Replace missing
}
| D |
INSTANCE Info_Mod_Gizar_Hi (C_INFO)
{
npc = Mod_1772_KDF_Gizar_PAT;
nr = 1;
condition = Info_Mod_Gizar_Hi_Condition;
information = Info_Mod_Gizar_Hi_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Gizar_Hi_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Gizar_Hi_Info()
{
AI_Output(self, hero, "Info_Mod_Gizar_Hi_10_00"); //Du sollst zu Nagon, Bruder. Er erwartet dich in der Kapelle.
AI_Output(hero, self, "Info_Mod_Gizar_Hi_15_01"); //Wer ist der Magier, der hier eben hochgerannt ist?
AI_Output(self, hero, "Info_Mod_Gizar_Hi_10_02"); //Das war Aaron. Er ist erst seit kurzem hier stationiert.
Npc_ClearAIQueue (Mod_1771_KDF_Aaron_PAT);
AI_StandUp (Mod_1771_KDF_Aaron_PAT);
B_StartOtherRoutine (Mod_1771_KDF_Aaron_PAT, "TOT");
AI_Teleport (Mod_1771_KDF_Aaron_PAT, "TOT");
B_LogEntry (TOPIC_MOD_FM_VERRAT, "Ein Magier names Aaron, welcher erst seit kurzer Zeit hier im Kloster ist, ist nach dem Angriff des Trolls auf den Turm gerannt. Ich sollte der Sache mal auf den Grund gehen.");
};
INSTANCE Info_Mod_Gizar_EXIT (C_INFO)
{
npc = Mod_1772_KDF_Gizar_PAT;
nr = 1;
condition = Info_Mod_Gizar_EXIT_Condition;
information = Info_Mod_Gizar_EXIT_Info;
permanent = 1;
important = 0;
description = DIALOG_ENDE;
};
FUNC INT Info_Mod_Gizar_EXIT_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Gizar_EXIT_Info()
{
AI_StopProcessInfos (self);
}; | D |
module org.serviio.library.playlist.AsxIniParserStrategy;
import java.lang.String;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import org.apache.commons.io.FilenameUtils;
import org.serviio.util.ObjectValidator;
import org.serviio.library.playlist.AbstractPlaylistParserStrategy;
import org.serviio.library.playlist.ParsedPlaylist;
public class AsxIniParserStrategy : AbstractPlaylistParserStrategy
{
public ParsedPlaylist parsePlaylist(byte[] playlist, String playlistLocation)
{
String content = readPlaylistContent(playlist);
BufferedReader reader = new BufferedReader(new StringReader(content));
String inputLine = null;
ParsedPlaylist pl = new ParsedPlaylist(FilenameUtils.getBaseName(playlistLocation));
try
{
while ((inputLine = reader.readLine()) !is null) {
if ((ObjectValidator.isNotEmpty(inputLine)) && (inputLine.startsWith("Ref")))
{
String filePath = inputLine.trim();
filePath = filePath.substring(filePath.indexOf("=") + 1);
pl.addItem(getAbsoluteFilePath(filePath, playlistLocation));
}
}
return pl;
}
catch (IOException e)
{
throw new CannotParsePlaylistException(PlaylistType.ASX, playlistLocation, e.getMessage());
}
}
public bool matches(byte[] playlist, String playlistLocation)
{
String content = readPlaylistContent(playlist);
if (content !is null)
{
BufferedReader reader = new BufferedReader(new StringReader(content));
try
{
String firstLine = reader.readLine();
return firstLine.startsWith("[Reference]");
}
catch (IOException e)
{
return false;
}
}
return false;
}
}
/* Location: C:\Users\Main\Downloads\serviio.jar
* Qualified Name: org.serviio.library.playlist.AsxIniParserStrategy
* JD-Core Version: 0.7.0.1
*/ | D |
/*
* This file has been automatically generated by Soupply and released under the MIT license.
*/
module soupply.java.packet;
public import soupply.java393.packet;
alias JavaPacket = Java393Packet;
| D |
INSTANCE MIL_122_Arenamaster (C_NPC)
// PlayerInstanz
{
//-------- primary data --------
name = "Arenameister";
Npctype = NPCTYPE_MAIN;
guild = GIL_MILITIA;
level = 35;
voice = 12;
id = 122;
flags = 0;
//-------- attributes --------
attribute[ATR_STRENGTH] = 150;
attribute[ATR_DEXTERITY] = 100;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX]= 500;
attribute[ATR_HITPOINTS] = 500;
//-------- protection -----
protection[PROT_EDGE] = 0;
protection[PROT_EDGE] = 0;
protection[PROT_BLUNT] = 0;
protection[PROT_POINT] = 0;
protection[PROT_FIRE] = 0;
protection[PROT_MAGIC] = 0;
//-------- visuals --------
Mdl_SetVisual (self, "humans.mds"); // basic animation file
Mdl_ApplyOverlayMds (self, "humans_arrogance.mds"); // overlay animation file
Mdl_SetVisualBody (self, "hum_body_Naked0", 0,1,"Hum_Head_FatBald",11,3,EBR_ARMOR_M);
B_Scale (self); // body width according to strength of character
Mdl_SetModelFatness (self, 2); // limb fatness
//-------- talents --------
Npc_SetTalentSkill (self, NPC_TALENT_1H,2);
//-------- inventory --------
EquipItem (self, ItMw_Arenamaster_Sword);
//------------- ai -------------
senses_range = 2000;
senses = SENSE_SEE|SENSE_HEAR|SENSE_SMELL;
fight_tactic = FAI_HUMAN_MASTER;
daily_routine = Rtn_start_122;
};
FUNC VOID Rtn_start_122 ()
{
// steht hinter dem Arena-Wett-Tisch
TA_ArenaMasterBooth (ARENASTAND_H,ARENASTAND_M, ARENAPRE_H,ARENAPRE_M, "OCR_STAND_WETT");
// steht hinter dem Arena-Wett-Tisch
TA_ArenaMasterNpcSend (ARENAPRE_H,ARENAPRE_M, ARENABEGIN_H,ARENABEGIN_M, "OCR_STAND_WETT");
// überwacht den aktuellen Arena-Kampf
TA_ArenaMasterNpc (ARENABEGIN_H,ARENABEGIN_M, ARENAEND_H,ARENAEND_M, "OCR_ARENA_BARONS_HUT");
// schläft in seiner Hütte
TA_ArenaMasterSleep (ARENAEND_H,ARENAEND_M, ARENASTAND_H,ARENASTAND_M, "OCR_ARENA_BARONS_HUT");
};
func void Rtn_Attendance_122 ()
{
// Beendung der Arenateilnahme, wenn der SC tagsüber wiederkommt
TA_ArenaMasterBooth (ARENASTAND_H,ARENASTAND_M, ARENAPRE_H,ARENAPRE_M, ARENA_WP_THRONE);
// Beendung der Arenateilnahme, wenn der SC während der Vorprogrammphase wiederkommt
TA_ArenaMasterNpcSend (ARENAPRE_H,ARENAPRE_M, ARENABEGIN_H,ARENABEGIN_M, ARENA_WP_THRONE);
// überwacht den aktuellen Arena-Kampf
TA_ArenaMasterNpc (ARENABEGIN_H,ARENABEGIN_M, ARENAEND_H,ARENAEND_M, ARENA_WP_THRONE);
// Beendung der Arenateilnahme, wenn der SC zur Schlafenszeit wiederkommt
TA_ArenaMasterSleep (ARENAEND_H,ARENAEND_M, ARENASTAND_H,ARENASTAND_M, ARENA_WP_THRONE);
};
| D |
// Generated from Hello.g4 by ANTLR 4.9.2
import antlr.v4.runtime.Lexer;
import antlr.v4.runtime.CharStream;
import antlr.v4.runtime.InterfaceRuleContext;
import antlr.v4.runtime.RuleContext;
import antlr.v4.runtime.RuntimeMetaData;
import antlr.v4.runtime.Token;
import antlr.v4.runtime.TokenStream;
import antlr.v4.runtime.Vocabulary;
import antlr.v4.runtime.VocabularyImpl;
import antlr.v4.runtime.atn.ATN : ATN;
alias ATNType = ATN;
import antlr.v4.runtime.atn.PredictionContextCache;
import antlr.v4.runtime.atn.ATNDeserializer;
import antlr.v4.runtime.atn.LexerATNSimulator;
import antlr.v4.runtime.dfa.DFA;
import antlr.v4.runtime.LexerNoViableAltException;
public class HelloLexer : Lexer {
alias recover = Lexer.recover;
static this() { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); }
protected static DFA[] _decisionToDFA;
protected PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public enum int
T__0=1,ID=2,WS=3;
public static string[] channelNames = [
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
];
public static string[] modeNames = [
"DEFAULT_MODE"
];
public static string[] ruleNames = [
"T__0","ID","WS"
];
private static const string[] _LITERAL_NAMES = [
null,"'hello'"
];
private static const string[] _SYMBOLIC_NAMES = [
null,null,"ID","WS"
];
public static Vocabulary VOCABULARY;
/**
* @deprecated Use {@link #VOCABULARY} instead.
*/
public static string[_SYMBOLIC_NAMES.length] tokenNames;
static this() {
VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
int index = 0;
foreach (ref tokenName; tokenNames)
{
tokenName = VOCABULARY.getLiteralName(index);
if (!tokenName) {
tokenName = VOCABULARY.getSymbolicName(index);
}
if (!tokenName)
{
tokenName = "<INVALID>";
}
}
++index;
}
override public string[] getTokenNames() {
return tokenNames;
}
override public Vocabulary getVocabulary() {
return VOCABULARY;
}
public this(CharStream input) {
super(input);
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
override
public string getGrammarFileName() { return "Hello.g4"; }
override
public string[] getRuleNames() { return ruleNames; }
override
public wstring getSerializedATN() { return _serializedATN; }
override
public string[] getChannelNames() { return channelNames; }
override
public string[] getModeNames() { return modeNames; }
override
public ATNType getATN() { return _ATN; }
public static immutable wstring _serializedATN =
"\x03\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\x02\x05\x1b"~
"\b\x01\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x03\x02\x03\x02\x03"~
"\x02\x03\x02\x03\x02\x03\x02\x03\x03\x06\x03\x11\n\x03\r\x03\x0e\x03"~
"\x12\x03\x04\x06\x04\x16\n\x04\r\x04\x0e\x04\x17\x03\x04\x03\x04\x02"~
"\x02\x05\x03\x03\x05\x04\x07\x05\x03\x02\x04\x03\x02c|\x05\x02\x0b"~
"\f\x0f\x0f\"\"\x02\x1c\x02\x03\x03\x02\x02\x02\x02\x05\x03\x02\x02"~
"\x02\x02\x07\x03\x02\x02\x02\x03\t\x03\x02\x02\x02\x05\x10\x03\x02"~
"\x02\x02\x07\x15\x03\x02\x02\x02\t\n\x07j\x02\x02\n\x0b\x07g\x02\x02"~
"\x0b\f\x07n\x02\x02\f\r\x07n\x02\x02\r\x0e\x07q\x02\x02\x0e\x04\x03"~
"\x02\x02\x02\x0f\x11\t\x02\x02\x02\x10\x0f\x03\x02\x02\x02\x11\x12"~
"\x03\x02\x02\x02\x12\x10\x03\x02\x02\x02\x12\x13\x03\x02\x02\x02\x13"~
"\x06\x03\x02\x02\x02\x14\x16\t\x03\x02\x02\x15\x14\x03\x02\x02\x02"~
"\x16\x17\x03\x02\x02\x02\x17\x15\x03\x02\x02\x02\x17\x18\x03\x02\x02"~
"\x02\x18\x19\x03\x02\x02\x02\x19\x1a\b\x04\x02\x02\x1a\b\x03\x02\x02"~
"\x02\x05\x02\x12\x17\x03\b\x02\x02";
public static ATNType _ATN;
static this() {
auto atnDeserializer = new ATNDeserializer;
_ATN = atnDeserializer.deserialize(_serializedATN);
_decisionToDFA.length = 0;
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
_decisionToDFA ~= new DFA(_ATN.getDecisionState(i), i);
}
}
} | D |
position six in a countable series of things
one part in six equal parts
the musical interval between one note and another six notes away from it
coming next after the fifth and just before the seventh in position
| D |
import std.stdio;
import std.range;
import std.ascii;
import std.algorithm;
import std.conv;
import texp;
/// prints productions from a Texp
void printGrammar(Texp grammar) {
auto maxValueLength = grammar.children.map!(k => k.value.length).maxElement;
foreach (Texp c; grammar.children()) {
const k = c.svalue;
const v = c.children[0];
const rulerep = v.paren[0] == '(' ? v.paren[1 .. $ - 1] : v.paren;
writefln("%"~(maxValueLength + 1).to!string~"s ::= %s", k, rulerep);
}
}
/// makes a dictionary from a grammar texp
Texp[string] makeDict(Texp grammar) {
Texp[string] gmap;
foreach (Texp c; grammar.children()) {
gmap[c.svalue] = c.children[0];
}
return gmap;
}
/// keeps track of the history of traversed productions
bool[string] history;
/// traverses grammar from current and adds everything that current depends on
string[] foldTraversal(Texp[string] grammar, string current) {
if (current in history) {
return [];
}
history[current] = true;
string[] acc;
Texp rule = grammar[current];
if (rule.value == "|") {
foreach (c; rule.children) {
acc ~= c.svalue;
}
} else {
foreach (num, c; rule.children.enumerate) {
if (c.value[0].isUpper) {
acc ~= c.svalue;
}
if (c.svalue == "*") {
auto child = c.children[0];
if (child.value[0].isUpper) {
acc ~= child.svalue;
}
}
}
}
acc.each!(k => acc ~= grammar.foldTraversal(k));
return acc;
}
| D |
/// Copyright: Copyright (c) 2020 Andrey Penechko.
/// License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
/// Authors: Andrey Penechko.
/// Resources:
/// - https://www.muppetlabs.com/~breadbox/software/ELF.txt
/// - ELF-64 Object File Format: Version 1.5 Draft 2, May 27, 1998
/// - http://www.skyfree.org/linux/references/ELF_Format.pdf
/// - https://github.com/aspieln3r/spergland/wiki/ELF-File-:-short-summary
/// - https://refspecs.linuxbase.org/elf/gabi4+/ch4.eheader.html
/// An ELF object file consists of the following parts:
/// * File header, which must appear at the beginning of the file.
/// * Section table, required for relocatable files, and optional for loadable files.
/// * Program header table, required for loadable files, and optional for
/// relocatable files. This table describes the loadable segments and other
/// data structures required for loading a program or dynamically-linked
/// library in preparation for execution.
/// * Contents of the sections or segments, including loadable data, relocations,
/// and string and symbol tables.
module vox.be.elf64;
/// The file header is located at the beginning of the file, and is used to locate the other parts of the file.
struct Elf64Header {
char[4] magic = "\x7FELF";
ElfObjectFileClass file_class = ElfObjectFileClass.ELFCLASS64;
ElfDataEncoding data_encoding = ElfDataEncoding.ELFDATA2LSB;
ubyte file_version = 1; // Object file format version, always 1
ElfOsAbi os_abi; // Identifies the operating system and ABI for which the object is prepared
// Specifies version of the ABI in os_abi field
// For applications conforming to the System V ABI, third edition, this field should contain 0.
ubyte abi_version = 0;
ubyte[7] pad;
ElfObjectFileType file_type; // Object file type
ElfMachineType machine; // Machine type. These values are defined in the processor-specific supplements.
uint _version = 1; // Object file format version
// Contains the virtual address of the program entry point. If there is no entry point, this field contains zero.
ulong entry; // Entry point address
ulong phoff = 64; // Program header file offset in bytes
ulong shoff; // Section header file offset in bytes
uint flags; // Processor-specific flags
ushort ehsize = 64; // ELF header size in bytes
ushort phentsize = 56; // Program header table single entry size in bytes.
ushort phnum; // Program header table number of entries.
ushort shentsize = 64; // Section header table single entry size in bytes.
ushort shnum; // Section header table number of entries.
// Contains the section header table index of the section containing
// the section name string table. If there is no section name string
// table, this field has the value SHN_UNDEF (0)
ushort shstrndx; // String table index
}
static assert(Elf64Header.sizeof == 64);
// Object File Classes, identifies the class of the object file, or its capacity.
enum ElfObjectFileClass : ubyte {
ELFCLASSNONE = 0, /// Invalid class
ELFCLASS32 = 1, /// 32-bit objects
ELFCLASS64 = 2, /// 64-bit objects
}
// Data Encodings
enum ElfDataEncoding : ubyte {
ELFDATA2LSB = 1, /// Object file data structures are little-endian
ELFDATA2MSB = 2, /// Object file data structures are big-endian
}
// Operating System and ABI Identifiers,
enum ElfOsAbi : ubyte {
ELFOSABI_SYSV = 0, /// System V ABI
ELFOSABI_HPUX = 1, /// HP-UX operating system
ELFOSABI_STANDALONE = 255, /// Standalone (embedded) application
}
// Object File Types
enum ElfObjectFileType : ushort {
ET_NONE = 0, /// No file type
ET_REL = 1, /// Relocatable object file
ET_EXEC = 2, /// Executable file
ET_DYN = 3, /// Shared object file
ET_CORE = 4, /// Core file
ET_LOOS = 0xFE00, /// Environment-specific use
ET_HIOS = 0xFEFF, ///
ET_LOPROC = 0xFF00, /// Processor-specific use
ET_HIPROC = 0xFFFF, ///
}
enum ElfMachineType : ushort {
x86 = 0x03, /// x86
x86_64 = 0x3E, /// amd64
arm = 0x28,
arm64 = 0xB7, /// aarch64
riscv = 0xF3, /// RISC-V
}
// Section index 0, and indices in the range 0xFF00–0xFFFF are reserved for special purposes.
// The first entry in the section header table (with an index of 0) is reserved, and must contain all zeroes.
enum ElfSectionIndicies : ushort {
SHN_UNDEF = 0, /// Used to mark an undefined or meaningless section reference
SHN_LOPROC = 0xFF00, /// Processor-specific use
SHN_HIPROC = 0xFF1F,
SHN_LOOS = 0xFF20, /// Environment-specific use
SHN_HIOS = 0xFF3F,
SHN_ABS = 0xFFF1, /// Indicates that the corresponding reference is an absolute value
SHN_COMMON = 0xFFF2, /// Indicates a symbol that has been declared as a common block (Fortran COMMON or C tentative declaration)
}
struct Elf64SectionHeader {
uint sh_name; /// Section name
uint sh_type; /// Section type
ulong sh_flags; /// Section attributes
ulong sh_addr; /// Virtual address in memory
ulong sh_offset; /// Offset in file
ulong sh_size; /// Size of section
uint sh_link; /// Link to other section
uint sh_info; /// Miscellaneous information
ulong sh_addralign; /// Address alignment boundary
ulong sh_entsize; /// Size of entries, if section has table
}
struct Elf64ProgramHeader {
Elf64SegmentType type; /// Type of segment
uint flags; /// Segment attributes (set of Elf64SegmentAttributes)
ulong offset; /// Offset in file
ulong vaddr; /// Virtual address in memory
ulong paddr; /// Reserved
ulong filesz; /// Size of segment in file
ulong memsz; /// Size of segment in memory
ulong alignment; /// Alignment of segment
}
enum Elf64SegmentType : uint {
PT_NULL = 0, /// Unused entry
PT_LOAD = 1, /// Loadable segment
PT_DYNAMIC = 2, /// Dynamic linking tables
/// If PT_INTERP segment is added, then PT_DYNAMIC must be present too
/// Otherwise it is invalid executable
PT_INTERP = 3, /// Program interpreter path name
PT_NOTE = 4, /// Note sections
PT_SHLIB = 5, /// Reserved
PT_PHDR = 6, /// Program header table
PT_TLS = 7, /// Thread Local Storage http://www.sco.com/developers/gabi/latest/ch5.pheader.html#tls
PT_LOOS = 0x6000_0000, /// Environment-specific use
PT_HIOS = 0x6FFF_FFFF,
PT_LOPROC = 0x7000_0000, /// Processor-specific use
PT_HIPROC = 0X7FFF_FFFF,
/// The array element specifies the location and size of the
/// exception handling information as defined by the .eh_frame_hdr section.
PT_GNU_EH_FRAME = 0X6474E550,
/// The p_flags member specifies the permissions on the segment containing the stack and
/// is used to indicate wether the stack should be executable. The absense of this header
/// indicates that the stack will be executable.
PT_GNU_STACK = 0X6474E551,
/// The array element specifies the location and size of a segment which may be made
/// read-only after relocation shave been processed.
PT_GNU_RELRO = 0X6474E552,
}
enum Elf64SegmentAttributes : uint {
EXECUTE = 0x1, /// Execute permission
WRITE = 0x2, /// Write permission
READ = 0x4, /// Read permission
PF_MASKOS = 0x00FF_0000, /// These flag bits are reserved for environment-specific use
PF_MASKPROC = 0xFF00_0000, /// These flag bits are reserved for processor-specific use
}
| 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: $(LINK2 https://github.com/dlang/dmd/blob/master/src/ddmd/dsymbolsem.d, _dsymbolsem.d)
*/
module ddmd.dsymbolsem;
// Online documentation: https://dlang.org/phobos/ddmd_dsymbolsem.html
import core.stdc.stdio;
import core.stdc.string;
import ddmd.aggregate;
import ddmd.aliasthis;
import ddmd.arraytypes;
import ddmd.astcodegen;
import ddmd.attrib;
import ddmd.blockexit;
import ddmd.clone;
import ddmd.dcast;
import ddmd.dclass;
import ddmd.declaration;
import ddmd.denum;
import ddmd.dimport;
import ddmd.dinterpret;
import ddmd.dmodule;
import ddmd.dscope;
import ddmd.dstruct;
import ddmd.dsymbol;
import ddmd.dtemplate;
import ddmd.dversion;
import ddmd.errors;
import ddmd.escape;
import ddmd.expression;
import ddmd.expressionsem;
import ddmd.func;
import ddmd.globals;
import ddmd.gluelayer;
import ddmd.id;
import ddmd.identifier;
import ddmd.init;
import ddmd.initsem;
import ddmd.hdrgen;
import ddmd.mars;
import ddmd.mtype;
import ddmd.nogc;
import ddmd.nspace;
import ddmd.objc;
import ddmd.opover;
import ddmd.parse;
import ddmd.root.filename;
import ddmd.root.outbuffer;
import ddmd.root.rmem;
import ddmd.root.rootobject;
import ddmd.sideeffect;
import ddmd.statementsem;
import ddmd.staticassert;
import ddmd.tokens;
import ddmd.utf;
import ddmd.utils;
import ddmd.semantic;
import ddmd.statement;
import ddmd.target;
import ddmd.templateparamsem;
import ddmd.typesem;
import ddmd.visitor;
enum LOG = false;
private uint setMangleOverride(Dsymbol s, char* sym)
{
AttribDeclaration ad = s.isAttribDeclaration();
if (ad)
{
Dsymbols* decls = ad.include(null, null);
uint nestedCount = 0;
if (decls && decls.dim)
for (size_t i = 0; i < decls.dim; ++i)
nestedCount += setMangleOverride((*decls)[i], sym);
return nestedCount;
}
else if (s.isFuncDeclaration() || s.isVarDeclaration())
{
s.isDeclaration().mangleOverride = sym;
return 1;
}
else
return 0;
}
/*************************************
* Does semantic analysis on the public face of declarations.
*/
extern(C++) void dsymbolSemantic(Dsymbol dsym, Scope* sc)
{
scope v = new DsymbolSemanticVisitor(sc);
dsym.accept(v);
}
extern(C++) final class Semantic2Visitor : Visitor
{
alias visit = super.visit;
Scope* sc;
this(Scope* sc)
{
this.sc = sc;
}
override void visit(Dsymbol) {}
override void visit(StaticAssert sa)
{
//printf("StaticAssert::semantic2() %s\n", toChars());
auto sds = new ScopeDsymbol();
sc = sc.push(sds);
sc.tinst = null;
sc.minst = null;
import ddmd.staticcond;
bool errors;
bool result = evalStaticCondition(sc, sa.exp, sa.exp, errors);
sc = sc.pop();
if (errors)
{
errorSupplemental(sa.loc, "while evaluating: `static assert(%s)`", sa.exp.toChars());
}
else if (!result)
{
if (sa.msg)
{
sc = sc.startCTFE();
sa.msg = sa.msg.expressionSemantic(sc);
sa.msg = resolveProperties(sc, sa.msg);
sc = sc.endCTFE();
sa.msg = sa.msg.ctfeInterpret();
if (StringExp se = sa.msg.toStringExp())
{
// same with pragma(msg)
se = se.toUTF8(sc);
sa.error("\"%.*s\"", cast(int)se.len, se.string);
}
else
sa.error("%s", sa.msg.toChars());
}
else
sa.error("`%s` is false", sa.exp.toChars());
if (sc.tinst)
sc.tinst.printInstantiationTrace();
if (!global.gag)
fatal();
}
}
override void visit(TemplateInstance tempinst)
{
if (tempinst.semanticRun >= PASSsemantic2)
return;
tempinst.semanticRun = PASSsemantic2;
static if (LOG)
{
printf("+TemplateInstance.semantic2('%s')\n", tempinst.toChars());
}
if (!tempinst.errors && tempinst.members)
{
TemplateDeclaration tempdecl = tempinst.tempdecl.isTemplateDeclaration();
assert(tempdecl);
sc = tempdecl._scope;
assert(sc);
sc = sc.push(tempinst.argsym);
sc = sc.push(tempinst);
sc.tinst = tempinst;
sc.minst = tempinst.minst;
int needGagging = (tempinst.gagged && !global.gag);
uint olderrors = global.errors;
int oldGaggedErrors = -1; // dead-store to prevent spurious warning
if (needGagging)
oldGaggedErrors = global.startGagging();
for (size_t i = 0; i < tempinst.members.dim; i++)
{
Dsymbol s = (*tempinst.members)[i];
static if (LOG)
{
printf("\tmember '%s', kind = '%s'\n", s.toChars(), s.kind());
}
s.semantic2(sc);
if (tempinst.gagged && global.errors != olderrors)
break;
}
if (global.errors != olderrors)
{
if (!tempinst.errors)
{
if (!tempdecl.literal)
tempinst.error(tempinst.loc, "error instantiating");
if (tempinst.tinst)
tempinst.tinst.printInstantiationTrace();
}
tempinst.errors = true;
}
if (needGagging)
global.endGagging(oldGaggedErrors);
sc = sc.pop();
sc.pop();
}
static if (LOG)
{
printf("-TemplateInstance.semantic2('%s')\n", tempinst.toChars());
}
}
override void visit(TemplateMixin tmix)
{
if (tmix.semanticRun >= PASSsemantic2)
return;
tmix.semanticRun = PASSsemantic2;
static if (LOG)
{
printf("+TemplateMixin.semantic2('%s')\n", tmix.toChars());
}
if (tmix.members)
{
assert(sc);
sc = sc.push(tmix.argsym);
sc = sc.push(tmix);
for (size_t i = 0; i < tmix.members.dim; i++)
{
Dsymbol s = (*tmix.members)[i];
static if (LOG)
{
printf("\tmember '%s', kind = '%s'\n", s.toChars(), s.kind());
}
s.semantic2(sc);
}
sc = sc.pop();
sc.pop();
}
static if (LOG)
{
printf("-TemplateMixin.semantic2('%s')\n", tmix.toChars());
}
}
override void visit(VarDeclaration vd)
{
if (vd.semanticRun < PASSsemanticdone && vd.inuse)
return;
//printf("VarDeclaration::semantic2('%s')\n", toChars());
if (vd._init && !vd.toParent().isFuncDeclaration())
{
vd.inuse++;
version (none)
{
ExpInitializer ei = vd._init.isExpInitializer();
if (ei)
{
ei.exp.print();
printf("type = %p\n", ei.exp.type);
}
}
// https://issues.dlang.org/show_bug.cgi?id=14166
// Don't run CTFE for the temporary variables inside typeof
vd._init = vd._init.initializerSemantic(sc, vd.type, sc.intypeof == 1 ? INITnointerpret : INITinterpret);
vd.inuse--;
}
if (vd._init && vd.storage_class & STCmanifest)
{
/* Cannot initializer enums with CTFE classreferences and addresses of struct literals.
* Scan initializer looking for them. Issue error if found.
*/
if (ExpInitializer ei = vd._init.isExpInitializer())
{
static bool hasInvalidEnumInitializer(Expression e)
{
static bool arrayHasInvalidEnumInitializer(Expressions* elems)
{
foreach (e; *elems)
{
if (e && hasInvalidEnumInitializer(e))
return true;
}
return false;
}
if (e.op == TOKclassreference)
return true;
if (e.op == TOKaddress && (cast(AddrExp)e).e1.op == TOKstructliteral)
return true;
if (e.op == TOKarrayliteral)
return arrayHasInvalidEnumInitializer((cast(ArrayLiteralExp)e).elements);
if (e.op == TOKstructliteral)
return arrayHasInvalidEnumInitializer((cast(StructLiteralExp)e).elements);
if (e.op == TOKassocarrayliteral)
{
AssocArrayLiteralExp ae = cast(AssocArrayLiteralExp)e;
return arrayHasInvalidEnumInitializer(ae.values) ||
arrayHasInvalidEnumInitializer(ae.keys);
}
return false;
}
if (hasInvalidEnumInitializer(ei.exp))
vd.error(": Unable to initialize enum with class or pointer to struct. Use static const variable instead.");
}
}
else if (vd._init && vd.isThreadlocal())
{
if ((vd.type.ty == Tclass) && vd.type.isMutable() && !vd.type.isShared())
{
ExpInitializer ei = vd._init.isExpInitializer();
if (ei && ei.exp.op == TOKclassreference)
vd.error("is mutable. Only const or immutable class thread local variable are allowed, not %s", vd.type.toChars());
}
else if (vd.type.ty == Tpointer && vd.type.nextOf().ty == Tstruct && vd.type.nextOf().isMutable() && !vd.type.nextOf().isShared())
{
ExpInitializer ei = vd._init.isExpInitializer();
if (ei && ei.exp.op == TOKaddress && (cast(AddrExp)ei.exp).e1.op == TOKstructliteral)
{
vd.error("is a pointer to mutable struct. Only pointers to const, immutable or shared struct thread local variable are allowed, not %s", vd.type.toChars());
}
}
}
vd.semanticRun = PASSsemantic2done;
}
override void visit(Module mod)
{
//printf("Module::semantic2('%s'): parent = %p\n", toChars(), parent);
if (mod.semanticRun != PASSsemanticdone) // semantic() not completed yet - could be recursive call
return;
mod.semanticRun = PASSsemantic2;
// Note that modules get their own scope, from scratch.
// This is so regardless of where in the syntax a module
// gets imported, it is unaffected by context.
Scope* sc = Scope.createGlobal(mod); // create root scope
//printf("Module = %p\n", sc.scopesym);
// Pass 2 semantic routines: do initializers and function bodies
for (size_t i = 0; i < mod.members.dim; i++)
{
Dsymbol s = (*mod.members)[i];
s.semantic2(sc);
}
if (mod.userAttribDecl)
{
mod.userAttribDecl.semantic2(sc);
}
sc = sc.pop();
sc.pop();
mod.semanticRun = PASSsemantic2done;
//printf("-Module::semantic2('%s'): parent = %p\n", toChars(), parent);
}
override void visit(FuncDeclaration fd)
{
if (fd.semanticRun >= PASSsemantic2done)
return;
assert(fd.semanticRun <= PASSsemantic2);
fd.semanticRun = PASSsemantic2;
objc.setSelector(fd, sc);
objc.validateSelector(fd);
if (ClassDeclaration cd = fd.parent.isClassDeclaration())
{
objc.checkLinkage(fd);
}
}
override void visit(Import i)
{
//printf("Import::semantic2('%s')\n", toChars());
if (i.mod)
{
i.mod.semantic2(null);
if (i.mod.needmoduleinfo)
{
//printf("module5 %s because of %s\n", sc.module.toChars(), mod.toChars());
if (sc)
sc._module.needmoduleinfo = 1;
}
}
}
override void visit(Nspace ns)
{
if (ns.semanticRun >= PASSsemantic2)
return;
ns.semanticRun = PASSsemantic2;
static if (LOG)
{
printf("+Nspace::semantic2('%s')\n", ns.toChars());
}
if (ns.members)
{
assert(sc);
sc = sc.push(ns);
sc.linkage = LINKcpp;
foreach (s; *ns.members)
{
static if (LOG)
{
printf("\tmember '%s', kind = '%s'\n", s.toChars(), s.kind());
}
s.semantic2(sc);
}
sc.pop();
}
static if (LOG)
{
printf("-Nspace::semantic2('%s')\n", ns.toChars());
}
}
override void visit(AttribDeclaration ad)
{
Dsymbols* d = ad.include(sc, null);
if (d)
{
Scope* sc2 = ad.newScope(sc);
for (size_t i = 0; i < d.dim; i++)
{
Dsymbol s = (*d)[i];
s.semantic2(sc2);
}
if (sc2 != sc)
sc2.pop();
}
}
/**
* Run the DeprecatedDeclaration's semantic2 phase then its members.
*
* The message set via a `DeprecatedDeclaration` can be either of:
* - a string literal
* - an enum
* - a static immutable
* So we need to call ctfe to resolve it.
* Afterward forwards to the members' semantic2.
*/
override void visit(DeprecatedDeclaration dd)
{
getMessage(dd);
visit(cast(AttribDeclaration)dd);
}
override void visit(AlignDeclaration ad)
{
ad.getAlignment(sc);
visit(cast(AttribDeclaration)ad);
}
override void visit(UserAttributeDeclaration uad)
{
if (uad.decl && uad.atts && uad.atts.dim && uad._scope)
{
static void eval(Scope* sc, Expressions* exps)
{
foreach (ref Expression e; *exps)
{
if (e)
{
e = e.expressionSemantic(sc);
if (definitelyValueParameter(e))
e = e.ctfeInterpret();
if (e.op == TOKtuple)
{
TupleExp te = cast(TupleExp)e;
eval(sc, te.exps);
}
}
}
}
uad._scope = null;
eval(sc, uad.atts);
}
visit(cast(AttribDeclaration)uad);
}
override void visit(AggregateDeclaration ad)
{
//printf("AggregateDeclaration::semantic2(%s) type = %s, errors = %d\n", toChars(), type.toChars(), errors);
if (!ad.members)
return;
if (ad._scope)
{
ad.error("has forward references");
return;
}
auto sc2 = ad.newScope(sc);
ad.determineSize(ad.loc);
for (size_t i = 0; i < ad.members.dim; i++)
{
Dsymbol s = (*ad.members)[i];
//printf("\t[%d] %s\n", i, s.toChars());
s.semantic2(sc2);
}
sc2.pop();
}
}
structalign_t getAlignment(AlignDeclaration ad, Scope* sc)
{
if (ad.salign != ad.UNKNOWN)
return ad.salign;
if (!ad.ealign)
return ad.salign = STRUCTALIGN_DEFAULT;
sc = sc.startCTFE();
ad.ealign = ad.ealign.expressionSemantic(sc);
ad.ealign = resolveProperties(sc, ad.ealign);
sc = sc.endCTFE();
ad.ealign = ad.ealign.ctfeInterpret();
if (ad.ealign.op == TOKerror)
return ad.salign = STRUCTALIGN_DEFAULT;
Type tb = ad.ealign.type.toBasetype();
auto n = ad.ealign.toInteger();
if (n < 1 || n & (n - 1) || structalign_t.max < n || !tb.isintegral())
{
error(ad.loc, "alignment must be an integer positive power of 2, not %s", ad.ealign.toChars());
return ad.salign = STRUCTALIGN_DEFAULT;
}
return ad.salign = cast(structalign_t)n;
}
const(char)* getMessage(DeprecatedDeclaration dd)
{
if (auto sc = dd._scope)
{
dd._scope = null;
sc = sc.startCTFE();
dd.msg = dd.msg.expressionSemantic(sc);
dd.msg = resolveProperties(sc, dd.msg);
sc = sc.endCTFE();
dd.msg = dd.msg.ctfeInterpret();
if (auto se = dd.msg.toStringExp())
dd.msgstr = se.toStringz().ptr;
else
dd.msg.error("compile time constant expected, not `%s`", dd.msg.toChars());
}
return dd.msgstr;
}
extern(C++) final class Semantic3Visitor : Visitor
{
alias visit = super.visit;
Scope* sc;
this(Scope* sc)
{
this.sc = sc;
}
override void visit(Dsymbol) {}
override void visit(TemplateInstance tempinst)
{
static if (LOG)
{
printf("TemplateInstance.semantic3('%s'), semanticRun = %d\n", tempinst.toChars(), tempinst.semanticRun);
}
//if (toChars()[0] == 'D') *(char*)0=0;
if (tempinst.semanticRun >= PASSsemantic3)
return;
tempinst.semanticRun = PASSsemantic3;
if (!tempinst.errors && tempinst.members)
{
TemplateDeclaration tempdecl = tempinst.tempdecl.isTemplateDeclaration();
assert(tempdecl);
sc = tempdecl._scope;
sc = sc.push(tempinst.argsym);
sc = sc.push(tempinst);
sc.tinst = tempinst;
sc.minst = tempinst.minst;
int needGagging = (tempinst.gagged && !global.gag);
uint olderrors = global.errors;
int oldGaggedErrors = -1; // dead-store to prevent spurious warning
/* If this is a gagged instantiation, gag errors.
* Future optimisation: If the results are actually needed, errors
* would already be gagged, so we don't really need to run semantic
* on the members.
*/
if (needGagging)
oldGaggedErrors = global.startGagging();
for (size_t i = 0; i < tempinst.members.dim; i++)
{
Dsymbol s = (*tempinst.members)[i];
s.semantic3(sc);
if (tempinst.gagged && global.errors != olderrors)
break;
}
if (global.errors != olderrors)
{
if (!tempinst.errors)
{
if (!tempdecl.literal)
tempinst.error(tempinst.loc, "error instantiating");
if (tempinst.tinst)
tempinst.tinst.printInstantiationTrace();
}
tempinst.errors = true;
}
if (needGagging)
global.endGagging(oldGaggedErrors);
sc = sc.pop();
sc.pop();
}
}
override void visit(TemplateMixin tmix)
{
if (tmix.semanticRun >= PASSsemantic3)
return;
tmix.semanticRun = PASSsemantic3;
static if (LOG)
{
printf("TemplateMixin.semantic3('%s')\n", tmix.toChars());
}
if (tmix.members)
{
sc = sc.push(tmix.argsym);
sc = sc.push(tmix);
for (size_t i = 0; i < tmix.members.dim; i++)
{
Dsymbol s = (*tmix.members)[i];
s.semantic3(sc);
}
sc = sc.pop();
sc.pop();
}
}
override void visit(Module mod)
{
//printf("Module::semantic3('%s'): parent = %p\n", toChars(), parent);
if (mod.semanticRun != PASSsemantic2done)
return;
mod.semanticRun = PASSsemantic3;
// Note that modules get their own scope, from scratch.
// This is so regardless of where in the syntax a module
// gets imported, it is unaffected by context.
Scope* sc = Scope.createGlobal(mod); // create root scope
//printf("Module = %p\n", sc.scopesym);
// Pass 3 semantic routines: do initializers and function bodies
for (size_t i = 0; i < mod.members.dim; i++)
{
Dsymbol s = (*mod.members)[i];
//printf("Module %s: %s.semantic3()\n", toChars(), s.toChars());
s.semantic3(sc);
mod.runDeferredSemantic2();
}
if (mod.userAttribDecl)
{
mod.userAttribDecl.semantic3(sc);
}
sc = sc.pop();
sc.pop();
mod.semanticRun = PASSsemantic3done;
}
override void visit(FuncDeclaration funcdecl)
{
VarDeclaration _arguments = null;
if (!funcdecl.parent)
{
if (global.errors)
return;
//printf("FuncDeclaration::semantic3(%s '%s', sc = %p)\n", kind(), toChars(), sc);
assert(0);
}
if (funcdecl.errors || isError(funcdecl.parent))
{
funcdecl.errors = true;
return;
}
//printf("FuncDeclaration::semantic3('%s.%s', %p, sc = %p, loc = %s)\n", parent.toChars(), toChars(), this, sc, loc.toChars());
//fflush(stdout);
//printf("storage class = x%x %x\n", sc.stc, storage_class);
//{ static int x; if (++x == 2) *(char*)0=0; }
//printf("\tlinkage = %d\n", sc.linkage);
if (funcdecl.ident == Id.assign && !funcdecl.inuse)
{
if (funcdecl.storage_class & STCinference)
{
/* https://issues.dlang.org/show_bug.cgi?id=15044
* For generated opAssign function, any errors
* from its body need to be gagged.
*/
uint oldErrors = global.startGagging();
++funcdecl.inuse;
funcdecl.semantic3(sc);
--funcdecl.inuse;
if (global.endGagging(oldErrors)) // if errors happened
{
// Disable generated opAssign, because some members forbid identity assignment.
funcdecl.storage_class |= STCdisable;
funcdecl.fbody = null; // remove fbody which contains the error
funcdecl.semantic3Errors = false;
}
return;
}
}
//printf(" sc.incontract = %d\n", (sc.flags & SCOPEcontract));
if (funcdecl.semanticRun >= PASSsemantic3)
return;
funcdecl.semanticRun = PASSsemantic3;
funcdecl.semantic3Errors = false;
if (!funcdecl.type || funcdecl.type.ty != Tfunction)
return;
TypeFunction f = cast(TypeFunction)funcdecl.type;
if (!funcdecl.inferRetType && f.next.ty == Terror)
return;
if (!funcdecl.fbody && funcdecl.inferRetType && !f.next)
{
funcdecl.error("has no function body with return type inference");
return;
}
uint oldErrors = global.errors;
if (funcdecl.frequire)
{
for (size_t i = 0; i < funcdecl.foverrides.dim; i++)
{
FuncDeclaration fdv = funcdecl.foverrides[i];
if (fdv.fbody && !fdv.frequire)
{
funcdecl.error("cannot have an in contract when overridden function %s does not have an in contract", fdv.toPrettyChars());
break;
}
}
}
// Remember whether we need to generate an 'out' contract.
immutable bool needEnsure = FuncDeclaration.needsFensure(funcdecl);
if (funcdecl.fbody || funcdecl.frequire || needEnsure)
{
/* Symbol table into which we place parameters and nested functions,
* solely to diagnose name collisions.
*/
funcdecl.localsymtab = new DsymbolTable();
// Establish function scope
auto ss = new ScopeDsymbol();
// find enclosing scope symbol, might skip symbol-less CTFE and/or FuncExp scopes
for (auto scx = sc; ; scx = scx.enclosing)
{
if (scx.scopesym)
{
ss.parent = scx.scopesym;
break;
}
}
ss.loc = funcdecl.loc;
ss.endlinnum = funcdecl.endloc.linnum;
Scope* sc2 = sc.push(ss);
sc2.func = funcdecl;
sc2.parent = funcdecl;
sc2.callSuper = 0;
sc2.sbreak = null;
sc2.scontinue = null;
sc2.sw = null;
sc2.fes = funcdecl.fes;
sc2.linkage = LINKd;
sc2.stc &= ~(STCauto | STCscope | STCstatic | STCabstract | STCdeprecated | STCoverride | STC_TYPECTOR | STCfinal | STCtls | STCgshared | STCref | STCreturn | STCproperty | STCnothrow | STCpure | STCsafe | STCtrusted | STCsystem);
sc2.protection = Prot(PROTpublic);
sc2.explicitProtection = 0;
sc2.aligndecl = null;
if (funcdecl.ident != Id.require && funcdecl.ident != Id.ensure)
sc2.flags = sc.flags & ~SCOPEcontract;
sc2.flags &= ~SCOPEcompile;
sc2.tf = null;
sc2.os = null;
sc2.noctor = 0;
sc2.userAttribDecl = null;
if (sc2.intypeof == 1)
sc2.intypeof = 2;
sc2.fieldinit = null;
sc2.fieldinit_dim = 0;
/* Note: When a lambda is defined immediately under aggregate member
* scope, it should be contextless due to prevent interior pointers.
* e.g.
* // dg points 'this' - it's interior pointer
* class C { int x; void delegate() dg = (){ this.x = 1; }; }
*
* However, lambdas could be used inside typeof, in order to check
* some expressions validity at compile time. For such case the lambda
* body can access aggregate instance members.
* e.g.
* class C { int x; static assert(is(typeof({ this.x = 1; }))); }
*
* To properly accept it, mark these lambdas as member functions.
*/
if (auto fld = funcdecl.isFuncLiteralDeclaration())
{
if (auto ad = funcdecl.isMember2())
{
if (!sc.intypeof)
{
if (fld.tok == TOKdelegate)
funcdecl.error("cannot be %s members", ad.kind());
else
fld.tok = TOKfunction;
}
else
{
if (fld.tok != TOKfunction)
fld.tok = TOKdelegate;
}
}
}
// Declare 'this'
auto ad = funcdecl.isThis();
funcdecl.vthis = funcdecl.declareThis(sc2, ad);
//printf("[%s] ad = %p vthis = %p\n", loc.toChars(), ad, vthis);
//if (vthis) printf("\tvthis.type = %s\n", vthis.type.toChars());
// Declare hidden variable _arguments[] and _argptr
if (f.varargs == 1)
{
if (f.linkage == LINKd)
{
// Declare _arguments[]
funcdecl.v_arguments = new VarDeclaration(Loc(), Type.typeinfotypelist.type, Id._arguments_typeinfo, null);
funcdecl.v_arguments.storage_class |= STCtemp | STCparameter;
funcdecl.v_arguments.dsymbolSemantic(sc2);
sc2.insert(funcdecl.v_arguments);
funcdecl.v_arguments.parent = funcdecl;
//Type *t = Type::typeinfo.type.constOf().arrayOf();
Type t = Type.dtypeinfo.type.arrayOf();
_arguments = new VarDeclaration(Loc(), t, Id._arguments, null);
_arguments.storage_class |= STCtemp;
_arguments.dsymbolSemantic(sc2);
sc2.insert(_arguments);
_arguments.parent = funcdecl;
}
if (f.linkage == LINKd || (f.parameters && Parameter.dim(f.parameters)))
{
// Declare _argptr
Type t = Type.tvalist;
// Init is handled in FuncDeclaration_toObjFile
funcdecl.v_argptr = new VarDeclaration(Loc(), t, Id._argptr, new VoidInitializer(funcdecl.loc));
funcdecl.v_argptr.storage_class |= STCtemp;
funcdecl.v_argptr.dsymbolSemantic(sc2);
sc2.insert(funcdecl.v_argptr);
funcdecl.v_argptr.parent = funcdecl;
}
}
/* Declare all the function parameters as variables
* and install them in parameters[]
*/
size_t nparams = Parameter.dim(f.parameters);
if (nparams)
{
/* parameters[] has all the tuples removed, as the back end
* doesn't know about tuples
*/
funcdecl.parameters = new VarDeclarations();
funcdecl.parameters.reserve(nparams);
for (size_t i = 0; i < nparams; i++)
{
Parameter fparam = Parameter.getNth(f.parameters, i);
Identifier id = fparam.ident;
StorageClass stc = 0;
if (!id)
{
/* Generate identifier for un-named parameter,
* because we need it later on.
*/
fparam.ident = id = Identifier.generateId("_param_", i);
stc |= STCtemp;
}
Type vtype = fparam.type;
auto v = new VarDeclaration(funcdecl.loc, vtype, id, null);
//printf("declaring parameter %s of type %s\n", v.toChars(), v.type.toChars());
stc |= STCparameter;
if (f.varargs == 2 && i + 1 == nparams)
stc |= STCvariadic;
if (funcdecl.flags & FUNCFLAGinferScope && !(fparam.storageClass & STCscope))
stc |= STCmaybescope;
stc |= fparam.storageClass & (STCin | STCout | STCref | STCreturn | STCscope | STClazy | STCfinal | STC_TYPECTOR | STCnodtor);
v.storage_class = stc;
v.dsymbolSemantic(sc2);
if (!sc2.insert(v))
funcdecl.error("parameter %s.%s is already defined", funcdecl.toChars(), v.toChars());
else
funcdecl.parameters.push(v);
funcdecl.localsymtab.insert(v);
v.parent = funcdecl;
}
}
// Declare the tuple symbols and put them in the symbol table,
// but not in parameters[].
if (f.parameters)
{
for (size_t i = 0; i < f.parameters.dim; i++)
{
Parameter fparam = (*f.parameters)[i];
if (!fparam.ident)
continue; // never used, so ignore
if (fparam.type.ty == Ttuple)
{
TypeTuple t = cast(TypeTuple)fparam.type;
size_t dim = Parameter.dim(t.arguments);
auto exps = new Objects();
exps.setDim(dim);
for (size_t j = 0; j < dim; j++)
{
Parameter narg = Parameter.getNth(t.arguments, j);
assert(narg.ident);
VarDeclaration v = sc2.search(Loc(), narg.ident, null).isVarDeclaration();
assert(v);
Expression e = new VarExp(v.loc, v);
(*exps)[j] = e;
}
assert(fparam.ident);
auto v = new TupleDeclaration(funcdecl.loc, fparam.ident, exps);
//printf("declaring tuple %s\n", v.toChars());
v.isexp = true;
if (!sc2.insert(v))
funcdecl.error("parameter %s.%s is already defined", funcdecl.toChars(), v.toChars());
funcdecl.localsymtab.insert(v);
v.parent = funcdecl;
}
}
}
// Precondition invariant
Statement fpreinv = null;
if (funcdecl.addPreInvariant())
{
Expression e = addInvariant(funcdecl.loc, sc, ad, funcdecl.vthis);
if (e)
fpreinv = new ExpStatement(Loc(), e);
}
// Postcondition invariant
Statement fpostinv = null;
if (funcdecl.addPostInvariant())
{
Expression e = addInvariant(funcdecl.loc, sc, ad, funcdecl.vthis);
if (e)
fpostinv = new ExpStatement(Loc(), e);
}
// Pre/Postcondition contract
if (!funcdecl.fbody)
funcdecl.buildEnsureRequire();
Scope* scout = null;
if (needEnsure || funcdecl.addPostInvariant())
{
/* https://issues.dlang.org/show_bug.cgi?id=3657
* Set the correct end line number for fensure scope.
*/
uint fensure_endlin = funcdecl.endloc.linnum;
if (funcdecl.fensure)
if (auto s = funcdecl.fensure.isScopeStatement())
fensure_endlin = s.endloc.linnum;
if ((needEnsure && global.params.useOut) || fpostinv)
{
funcdecl.returnLabel = new LabelDsymbol(Id.returnLabel);
}
// scope of out contract (need for vresult.semantic)
auto sym = new ScopeDsymbol();
sym.parent = sc2.scopesym;
sym.loc = funcdecl.loc;
sym.endlinnum = fensure_endlin;
scout = sc2.push(sym);
}
if (funcdecl.fbody)
{
auto sym = new ScopeDsymbol();
sym.parent = sc2.scopesym;
sym.loc = funcdecl.loc;
sym.endlinnum = funcdecl.endloc.linnum;
sc2 = sc2.push(sym);
auto ad2 = funcdecl.isMember2();
/* If this is a class constructor
*/
if (ad2 && funcdecl.isCtorDeclaration())
{
sc2.allocFieldinit(ad2.fields.dim);
foreach (v; ad2.fields)
{
v.ctorinit = 0;
}
}
if (!funcdecl.inferRetType && retStyle(f) != RETstack)
funcdecl.nrvo_can = 0;
bool inferRef = (f.isref && (funcdecl.storage_class & STCauto));
funcdecl.fbody = funcdecl.fbody.statementSemantic(sc2);
if (!funcdecl.fbody)
funcdecl.fbody = new CompoundStatement(Loc(), new Statements());
if (funcdecl.naked)
{
fpreinv = null; // can't accommodate with no stack frame
fpostinv = null;
}
assert(funcdecl.type == f || (funcdecl.type.ty == Tfunction && f.purity == PUREimpure && (cast(TypeFunction)funcdecl.type).purity >= PUREfwdref));
f = cast(TypeFunction)funcdecl.type;
if (funcdecl.inferRetType)
{
// If no return type inferred yet, then infer a void
if (!f.next)
f.next = Type.tvoid;
if (f.checkRetType(funcdecl.loc))
funcdecl.fbody = new ErrorStatement();
}
if (global.params.vcomplex && f.next !is null)
f.next.checkComplexTransition(funcdecl.loc);
if (funcdecl.returns && !funcdecl.fbody.isErrorStatement())
{
for (size_t i = 0; i < funcdecl.returns.dim;)
{
Expression exp = (*funcdecl.returns)[i].exp;
if (exp.op == TOKvar && (cast(VarExp)exp).var == funcdecl.vresult)
{
if (f.next.ty == Tvoid && funcdecl.isMain())
exp.type = Type.tint32;
else
exp.type = f.next;
// Remove `return vresult;` from returns
funcdecl.returns.remove(i);
continue;
}
if (inferRef && f.isref && !exp.type.constConv(f.next)) // https://issues.dlang.org/show_bug.cgi?id=13336
f.isref = false;
i++;
}
}
if (f.isref) // Function returns a reference
{
if (funcdecl.storage_class & STCauto)
funcdecl.storage_class &= ~STCauto;
}
if (retStyle(f) != RETstack)
funcdecl.nrvo_can = 0;
if (funcdecl.fbody.isErrorStatement())
{
}
else if (funcdecl.isStaticCtorDeclaration())
{
/* It's a static constructor. Ensure that all
* ctor consts were initialized.
*/
ScopeDsymbol pd = funcdecl.toParent().isScopeDsymbol();
for (size_t i = 0; i < pd.members.dim; i++)
{
Dsymbol s = (*pd.members)[i];
s.checkCtorConstInit();
}
}
else if (ad2 && funcdecl.isCtorDeclaration())
{
ClassDeclaration cd = ad2.isClassDeclaration();
// Verify that all the ctorinit fields got initialized
if (!(sc2.callSuper & CSXthis_ctor))
{
foreach (i, v; ad2.fields)
{
if (v.isThisDeclaration())
continue;
if (v.ctorinit == 0)
{
/* Current bugs in the flow analysis:
* 1. union members should not produce error messages even if
* not assigned to
* 2. structs should recognize delegating opAssign calls as well
* as delegating calls to other constructors
*/
if (v.isCtorinit() && !v.type.isMutable() && cd)
funcdecl.error("missing initializer for %s field %s", MODtoChars(v.type.mod), v.toChars());
else if (v.storage_class & STCnodefaultctor)
error(funcdecl.loc, "field %s must be initialized in constructor", v.toChars());
else if (v.type.needsNested())
error(funcdecl.loc, "field %s must be initialized in constructor, because it is nested struct", v.toChars());
}
else
{
bool mustInit = (v.storage_class & STCnodefaultctor || v.type.needsNested());
if (mustInit && !(sc2.fieldinit[i] & CSXthis_ctor))
{
funcdecl.error("field %s must be initialized but skipped", v.toChars());
}
}
}
}
sc2.freeFieldinit();
if (cd && !(sc2.callSuper & CSXany_ctor) && cd.baseClass && cd.baseClass.ctor)
{
sc2.callSuper = 0;
// Insert implicit super() at start of fbody
FuncDeclaration fd = resolveFuncCall(Loc(), sc2, cd.baseClass.ctor, null, funcdecl.vthis.type, null, 1);
if (!fd)
{
funcdecl.error("no match for implicit super() call in constructor");
}
else if (fd.storage_class & STCdisable)
{
funcdecl.error("cannot call super() implicitly because it is annotated with @disable");
}
else
{
Expression e1 = new SuperExp(Loc());
Expression e = new CallExp(Loc(), e1);
e = e.expressionSemantic(sc2);
Statement s = new ExpStatement(Loc(), e);
funcdecl.fbody = new CompoundStatement(Loc(), s, funcdecl.fbody);
}
}
//printf("callSuper = x%x\n", sc2.callSuper);
}
/* https://issues.dlang.org/show_bug.cgi?id=17502
* Wait until after the return type has been inferred before
* generating the contracts for this function, and merging contracts
* from overrides.
*
* https://issues.dlang.org/show_bug.cgi?id=17893
* However should take care to generate this before inferered
* function attributes are applied, such as 'nothrow'.
*
* This was originally at the end of the first semantic pass, but
* required a fix-up to be done here for the '__result' variable
* type of __ensure() inside auto functions, but this didn't work
* if the out parameter was implicit.
*/
funcdecl.buildEnsureRequire();
int blockexit = BEnone;
if (!funcdecl.fbody.isErrorStatement())
{
// Check for errors related to 'nothrow'.
uint nothrowErrors = global.errors;
blockexit = funcdecl.fbody.blockExit(funcdecl, f.isnothrow);
if (f.isnothrow && (global.errors != nothrowErrors))
error(funcdecl.loc, "nothrow %s `%s` may throw", funcdecl.kind(), funcdecl.toPrettyChars());
if (funcdecl.flags & FUNCFLAGnothrowInprocess)
{
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.isnothrow = !(blockexit & BEthrow);
}
}
if (funcdecl.fbody.isErrorStatement())
{
}
else if (ad2 && funcdecl.isCtorDeclaration())
{
/* Append:
* return this;
* to function body
*/
if (blockexit & BEfallthru)
{
Statement s = new ReturnStatement(funcdecl.loc, null);
s = s.statementSemantic(sc2);
funcdecl.fbody = new CompoundStatement(funcdecl.loc, funcdecl.fbody, s);
funcdecl.hasReturnExp |= (funcdecl.hasReturnExp & 1 ? 16 : 1);
}
}
else if (funcdecl.fes)
{
// For foreach(){} body, append a return 0;
if (blockexit & BEfallthru)
{
Expression e = new IntegerExp(0);
Statement s = new ReturnStatement(Loc(), e);
funcdecl.fbody = new CompoundStatement(Loc(), funcdecl.fbody, s);
funcdecl.hasReturnExp |= (funcdecl.hasReturnExp & 1 ? 16 : 1);
}
assert(!funcdecl.returnLabel);
}
else
{
const(bool) inlineAsm = (funcdecl.hasReturnExp & 8) != 0;
if ((blockexit & BEfallthru) && f.next.ty != Tvoid && !inlineAsm)
{
Expression e;
if (!funcdecl.hasReturnExp)
funcdecl.error("has no return statement, but is expected to return a value of type %s", f.next.toChars());
else
funcdecl.error("no return exp; or assert(0); at end of function");
if (global.params.useAssert && !global.params.useInline)
{
/* Add an assert(0, msg); where the missing return
* should be.
*/
e = new AssertExp(funcdecl.endloc, new IntegerExp(0), new StringExp(funcdecl.loc, cast(char*)"missing return expression"));
}
else
e = new HaltExp(funcdecl.endloc);
e = new CommaExp(Loc(), e, f.next.defaultInit());
e = e.expressionSemantic(sc2);
Statement s = new ExpStatement(Loc(), e);
funcdecl.fbody = new CompoundStatement(Loc(), funcdecl.fbody, s);
}
}
if (funcdecl.returns)
{
bool implicit0 = (f.next.ty == Tvoid && funcdecl.isMain());
Type tret = implicit0 ? Type.tint32 : f.next;
assert(tret.ty != Tvoid);
if (funcdecl.vresult || funcdecl.returnLabel)
funcdecl.buildResultVar(scout ? scout : sc2, tret);
/* Cannot move this loop into NrvoWalker, because
* returns[i] may be in the nested delegate for foreach-body.
*/
for (size_t i = 0; i < funcdecl.returns.dim; i++)
{
ReturnStatement rs = (*funcdecl.returns)[i];
Expression exp = rs.exp;
if (exp.op == TOKerror)
continue;
if (tret.ty == Terror)
{
// https://issues.dlang.org/show_bug.cgi?id=13702
exp = checkGC(sc2, exp);
continue;
}
if (!exp.implicitConvTo(tret) && funcdecl.isTypeIsolated(exp.type))
{
if (exp.type.immutableOf().implicitConvTo(tret))
exp = exp.castTo(sc2, exp.type.immutableOf());
else if (exp.type.wildOf().implicitConvTo(tret))
exp = exp.castTo(sc2, exp.type.wildOf());
}
exp = exp.implicitCastTo(sc2, tret);
if (f.isref)
{
// Function returns a reference
exp = exp.toLvalue(sc2, exp);
checkReturnEscapeRef(sc2, exp, false);
}
else
{
exp = exp.optimize(WANTvalue);
/* https://issues.dlang.org/show_bug.cgi?id=10789
* If NRVO is not possible, all returned lvalues should call their postblits.
*/
if (!funcdecl.nrvo_can)
exp = doCopyOrMove(sc2, exp);
if (tret.hasPointers())
checkReturnEscape(sc2, exp, false);
}
exp = checkGC(sc2, exp);
if (funcdecl.vresult)
{
// Create: return vresult = exp;
exp = new BlitExp(rs.loc, funcdecl.vresult, exp);
exp.type = funcdecl.vresult.type;
if (rs.caseDim)
exp = Expression.combine(exp, new IntegerExp(rs.caseDim));
}
else if (funcdecl.tintro && !tret.equals(funcdecl.tintro.nextOf()))
{
exp = exp.implicitCastTo(sc2, funcdecl.tintro.nextOf());
}
rs.exp = exp;
}
}
if (funcdecl.nrvo_var || funcdecl.returnLabel)
{
scope NrvoWalker nw = new NrvoWalker();
nw.fd = funcdecl;
nw.sc = sc2;
nw.visitStmt(funcdecl.fbody);
}
sc2 = sc2.pop();
}
funcdecl.frequire = funcdecl.mergeFrequire(funcdecl.frequire);
funcdecl.fensure = funcdecl.mergeFensure(funcdecl.fensure, funcdecl.outId);
Statement freq = funcdecl.frequire;
Statement fens = funcdecl.fensure;
/* Do the semantic analysis on the [in] preconditions and
* [out] postconditions.
*/
if (freq)
{
/* frequire is composed of the [in] contracts
*/
auto sym = new ScopeDsymbol();
sym.parent = sc2.scopesym;
sym.loc = funcdecl.loc;
sym.endlinnum = funcdecl.endloc.linnum;
sc2 = sc2.push(sym);
sc2.flags = (sc2.flags & ~SCOPEcontract) | SCOPErequire;
// BUG: need to error if accessing out parameters
// BUG: need to treat parameters as const
// BUG: need to disallow returns and throws
// BUG: verify that all in and ref parameters are read
freq = freq.statementSemantic(sc2);
freq.blockExit(funcdecl, false);
sc2 = sc2.pop();
if (!global.params.useIn)
freq = null;
}
if (fens)
{
/* fensure is composed of the [out] contracts
*/
if (f.next.ty == Tvoid && funcdecl.outId)
funcdecl.error("void functions have no result");
sc2 = scout; //push
sc2.flags = (sc2.flags & ~SCOPEcontract) | SCOPEensure;
// BUG: need to treat parameters as const
// BUG: need to disallow returns and throws
if (funcdecl.fensure && f.next.ty != Tvoid)
funcdecl.buildResultVar(scout, f.next);
fens = fens.statementSemantic(sc2);
fens.blockExit(funcdecl, false);
sc2 = sc2.pop();
if (!global.params.useOut)
fens = null;
}
if (funcdecl.fbody && funcdecl.fbody.isErrorStatement())
{
}
else
{
auto a = new Statements();
// Merge in initialization of 'out' parameters
if (funcdecl.parameters)
{
for (size_t i = 0; i < funcdecl.parameters.dim; i++)
{
VarDeclaration v = (*funcdecl.parameters)[i];
if (v.storage_class & STCout)
{
assert(v._init);
ExpInitializer ie = v._init.isExpInitializer();
assert(ie);
if (ie.exp.op == TOKconstruct)
ie.exp.op = TOKassign; // construction occurred in parameter processing
a.push(new ExpStatement(Loc(), ie.exp));
}
}
}
if (_arguments)
{
/* Advance to elements[] member of TypeInfo_Tuple with:
* _arguments = v_arguments.elements;
*/
Expression e = new VarExp(Loc(), funcdecl.v_arguments);
e = new DotIdExp(Loc(), e, Id.elements);
e = new ConstructExp(Loc(), _arguments, e);
e = e.expressionSemantic(sc2);
_arguments._init = new ExpInitializer(Loc(), e);
auto de = new DeclarationExp(Loc(), _arguments);
a.push(new ExpStatement(Loc(), de));
}
// Merge contracts together with body into one compound statement
if (freq || fpreinv)
{
if (!freq)
freq = fpreinv;
else if (fpreinv)
freq = new CompoundStatement(Loc(), freq, fpreinv);
a.push(freq);
}
if (funcdecl.fbody)
a.push(funcdecl.fbody);
if (fens || fpostinv)
{
if (!fens)
fens = fpostinv;
else if (fpostinv)
fens = new CompoundStatement(Loc(), fpostinv, fens);
auto ls = new LabelStatement(Loc(), Id.returnLabel, fens);
funcdecl.returnLabel.statement = ls;
a.push(funcdecl.returnLabel.statement);
if (f.next.ty != Tvoid && funcdecl.vresult)
{
// Create: return vresult;
Expression e = new VarExp(Loc(), funcdecl.vresult);
if (funcdecl.tintro)
{
e = e.implicitCastTo(sc, funcdecl.tintro.nextOf());
e = e.expressionSemantic(sc);
}
auto s = new ReturnStatement(Loc(), e);
a.push(s);
}
}
if (funcdecl.isMain() && f.next.ty == Tvoid)
{
// Add a return 0; statement
Statement s = new ReturnStatement(Loc(), new IntegerExp(0));
a.push(s);
}
Statement sbody = new CompoundStatement(Loc(), a);
/* Append destructor calls for parameters as finally blocks.
*/
if (funcdecl.parameters)
{
foreach (v; *funcdecl.parameters)
{
if (v.storage_class & (STCref | STCout | STClazy))
continue;
if (v.needsScopeDtor())
{
// same with ExpStatement.scopeCode()
Statement s = new DtorExpStatement(Loc(), v.edtor, v);
v.storage_class |= STCnodtor;
s = s.statementSemantic(sc2);
bool isnothrow = f.isnothrow & !(funcdecl.flags & FUNCFLAGnothrowInprocess);
int blockexit = s.blockExit(funcdecl, isnothrow);
if (f.isnothrow && isnothrow && blockexit & BEthrow)
error(funcdecl.loc, "nothrow %s `%s` may throw", funcdecl.kind(), funcdecl.toPrettyChars());
if (funcdecl.flags & FUNCFLAGnothrowInprocess && blockexit & BEthrow)
f.isnothrow = false;
if (sbody.blockExit(funcdecl, f.isnothrow) == BEfallthru)
sbody = new CompoundStatement(Loc(), sbody, s);
else
sbody = new TryFinallyStatement(Loc(), sbody, s);
}
}
}
// from this point on all possible 'throwers' are checked
funcdecl.flags &= ~FUNCFLAGnothrowInprocess;
if (funcdecl.isSynchronized())
{
/* Wrap the entire function body in a synchronized statement
*/
ClassDeclaration cd = funcdecl.isThis() ? funcdecl.isThis().isClassDeclaration() : funcdecl.parent.isClassDeclaration();
if (cd)
{
if (!global.params.is64bit && global.params.isWindows && !funcdecl.isStatic() && !sbody.usesEH() && !global.params.trace)
{
/* The back end uses the "jmonitor" hack for syncing;
* no need to do the sync at this level.
*/
}
else
{
Expression vsync;
if (funcdecl.isStatic())
{
// The monitor is in the ClassInfo
vsync = new DotIdExp(funcdecl.loc, resolve(funcdecl.loc, sc2, cd, false), Id.classinfo);
}
else
{
// 'this' is the monitor
vsync = new VarExp(funcdecl.loc, funcdecl.vthis);
}
sbody = new PeelStatement(sbody); // don't redo semantic()
sbody = new SynchronizedStatement(funcdecl.loc, vsync, sbody);
sbody = sbody.statementSemantic(sc2);
}
}
else
{
funcdecl.error("synchronized function %s must be a member of a class", funcdecl.toChars());
}
}
// If declaration has no body, don't set sbody to prevent incorrect codegen.
InterfaceDeclaration id = funcdecl.parent.isInterfaceDeclaration();
if (funcdecl.fbody || id && (funcdecl.fdensure || funcdecl.fdrequire) && funcdecl.isVirtual())
funcdecl.fbody = sbody;
}
// Fix up forward-referenced gotos
if (funcdecl.gotos)
{
for (size_t i = 0; i < funcdecl.gotos.dim; ++i)
{
(*funcdecl.gotos)[i].checkLabel();
}
}
if (funcdecl.naked && (funcdecl.fensure || funcdecl.frequire))
funcdecl.error("naked assembly functions with contracts are not supported");
sc2.callSuper = 0;
sc2.pop();
}
if (funcdecl.checkClosure())
{
// We should be setting errors here instead of relying on the global error count.
//errors = true;
}
/* If function survived being marked as impure, then it is pure
*/
if (funcdecl.flags & FUNCFLAGpurityInprocess)
{
funcdecl.flags &= ~FUNCFLAGpurityInprocess;
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.purity = PUREfwdref;
}
if (funcdecl.flags & FUNCFLAGsafetyInprocess)
{
funcdecl.flags &= ~FUNCFLAGsafetyInprocess;
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.trust = TRUSTsafe;
}
if (funcdecl.flags & FUNCFLAGnogcInprocess)
{
funcdecl.flags &= ~FUNCFLAGnogcInprocess;
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.isnogc = true;
}
if (funcdecl.flags & FUNCFLAGreturnInprocess)
{
funcdecl.flags &= ~FUNCFLAGreturnInprocess;
if (funcdecl.storage_class & STCreturn)
{
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.isreturn = true;
}
}
funcdecl.flags &= ~FUNCFLAGinferScope;
// Infer STCscope
if (funcdecl.parameters)
{
size_t nfparams = Parameter.dim(f.parameters);
assert(nfparams == funcdecl.parameters.dim);
foreach (u, v; *funcdecl.parameters)
{
if (v.storage_class & STCmaybescope)
{
//printf("Inferring scope for %s\n", v.toChars());
Parameter p = Parameter.getNth(f.parameters, u);
v.storage_class &= ~STCmaybescope;
v.storage_class |= STCscope | STCscopeinferred;
p.storageClass |= STCscope | STCscopeinferred;
assert(!(p.storageClass & STCmaybescope));
}
}
}
if (funcdecl.vthis && funcdecl.vthis.storage_class & STCmaybescope)
{
funcdecl.vthis.storage_class &= ~STCmaybescope;
funcdecl.vthis.storage_class |= STCscope | STCscopeinferred;
f.isscope = true;
f.isscopeinferred = true;
}
// reset deco to apply inference result to mangled name
if (f != funcdecl.type)
f.deco = null;
// Do semantic type AFTER pure/nothrow inference.
if (!f.deco && funcdecl.ident != Id.xopEquals && funcdecl.ident != Id.xopCmp)
{
sc = sc.push();
if (funcdecl.isCtorDeclaration()) // https://issues.dlang.org/show_bug.cgi?id=#15665
sc.flags |= SCOPEctor;
sc.stc = 0;
sc.linkage = funcdecl.linkage; // https://issues.dlang.org/show_bug.cgi?id=8496
funcdecl.type = f.typeSemantic(funcdecl.loc, sc);
sc = sc.pop();
}
/* If this function had instantiated with gagging, error reproduction will be
* done by TemplateInstance::semantic.
* Otherwise, error gagging should be temporarily ungagged by functionSemantic3.
*/
funcdecl.semanticRun = PASSsemantic3done;
funcdecl.semantic3Errors = (global.errors != oldErrors) || (funcdecl.fbody && funcdecl.fbody.isErrorStatement());
if (funcdecl.type.ty == Terror)
funcdecl.errors = true;
//printf("-FuncDeclaration::semantic3('%s.%s', sc = %p, loc = %s)\n", parent.toChars(), toChars(), sc, loc.toChars());
//fflush(stdout);
}
override void visit(Nspace ns)
{
if (ns.semanticRun >= PASSsemantic3)
return;
ns.semanticRun = PASSsemantic3;
static if (LOG)
{
printf("Nspace::semantic3('%s')\n", ns.toChars());
}
if (ns.members)
{
sc = sc.push(ns);
sc.linkage = LINKcpp;
foreach (s; *ns.members)
{
s.semantic3(sc);
}
sc.pop();
}
}
override void visit(AttribDeclaration ad)
{
Dsymbols* d = ad.include(sc, null);
if (d)
{
Scope* sc2 = ad.newScope(sc);
for (size_t i = 0; i < d.dim; i++)
{
Dsymbol s = (*d)[i];
s.semantic3(sc2);
}
if (sc2 != sc)
sc2.pop();
}
}
override void visit(AggregateDeclaration ad)
{
//printf("AggregateDeclaration::semantic3(sc=%p, %s) type = %s, errors = %d\n", sc, toChars(), type.toChars(), errors);
if (!ad.members)
return;
StructDeclaration sd = ad.isStructDeclaration();
if (!sc) // from runDeferredSemantic3 for TypeInfo generation
{
assert(sd);
sd.semanticTypeInfoMembers();
return;
}
auto sc2 = ad.newScope(sc);
for (size_t i = 0; i < ad.members.dim; i++)
{
Dsymbol s = (*ad.members)[i];
s.semantic3(sc2);
}
sc2.pop();
// don't do it for unused deprecated types
// or error ypes
if (!ad.getRTInfo && Type.rtinfo && (!ad.isDeprecated() || global.params.useDeprecated) && (ad.type && ad.type.ty != Terror))
{
// Evaluate: RTinfo!type
auto tiargs = new Objects();
tiargs.push(ad.type);
auto ti = new TemplateInstance(ad.loc, Type.rtinfo, tiargs);
Scope* sc3 = ti.tempdecl._scope.startCTFE();
sc3.tinst = sc.tinst;
sc3.minst = sc.minst;
if (ad.isDeprecated())
sc3.stc |= STCdeprecated;
ti.dsymbolSemantic(sc3);
ti.semantic2(sc3);
ti.semantic3(sc3);
auto e = resolve(Loc(), sc3, ti.toAlias(), false);
sc3.endCTFE();
e = e.ctfeInterpret();
ad.getRTInfo = e;
}
if (sd)
sd.semanticTypeInfoMembers();
ad.semanticRun = PASSsemantic3done;
}
}
private extern(C++) final class DsymbolSemanticVisitor : Visitor
{
alias visit = super.visit;
Scope* sc;
this(Scope* sc)
{
this.sc = sc;
}
override void visit(Dsymbol dsym)
{
dsym.error("%p has no semantic routine", dsym);
}
override void visit(ScopeDsymbol) { }
override void visit(Declaration) { }
override void visit(AliasThis dsym)
{
if (dsym.semanticRun != PASSinit)
return;
if (dsym._scope)
{
sc = dsym._scope;
dsym._scope = null;
}
if (!sc)
return;
dsym.semanticRun = PASSsemantic;
Dsymbol p = sc.parent.pastMixin();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
error(dsym.loc, "alias this can only be a member of aggregate, not %s `%s`", p.kind(), p.toChars());
return;
}
assert(ad.members);
Dsymbol s = ad.search(dsym.loc, dsym.ident);
if (!s)
{
s = sc.search(dsym.loc, dsym.ident, null);
if (s)
error(dsym.loc, "`%s` is not a member of `%s`", s.toChars(), ad.toChars());
else
error(dsym.loc, "undefined identifier `%s`", dsym.ident.toChars());
return;
}
if (ad.aliasthis && s != ad.aliasthis)
{
error(dsym.loc, "there can be only one alias this");
return;
}
/* disable the alias this conversion so the implicit conversion check
* doesn't use it.
*/
ad.aliasthis = null;
Dsymbol sx = s;
if (sx.isAliasDeclaration())
sx = sx.toAlias();
Declaration d = sx.isDeclaration();
if (d && !d.isTupleDeclaration())
{
Type t = d.type;
assert(t);
if (ad.type.implicitConvTo(t) > MATCH.nomatch)
{
error(dsym.loc, "alias this is not reachable as `%s` already converts to `%s`", ad.toChars(), t.toChars());
}
}
ad.aliasthis = s;
dsym.semanticRun = PASSsemanticdone;
}
override void visit(AliasDeclaration dsym)
{
if (dsym.semanticRun >= PASSsemanticdone)
return;
assert(dsym.semanticRun <= PASSsemantic);
dsym.storage_class |= sc.stc & STCdeprecated;
dsym.protection = sc.protection;
dsym.userAttribDecl = sc.userAttribDecl;
if (!sc.func && dsym.inNonRoot())
return;
aliasSemantic(dsym, sc);
}
override void visit(VarDeclaration dsym)
{
version (none)
{
printf("VarDeclaration::semantic('%s', parent = '%s') sem = %d\n", toChars(), sc.parent ? sc.parent.toChars() : null, sem);
printf(" type = %s\n", type ? type.toChars() : "null");
printf(" stc = x%x\n", sc.stc);
printf(" storage_class = x%llx\n", storage_class);
printf("linkage = %d\n", sc.linkage);
//if (strcmp(toChars(), "mul") == 0) assert(0);
}
//if (semanticRun > PASSinit)
// return;
//semanticRun = PSSsemantic;
if (dsym.semanticRun >= PASSsemanticdone)
return;
Scope* scx = null;
if (dsym._scope)
{
sc = dsym._scope;
scx = sc;
dsym._scope = null;
}
if (!sc)
return;
dsym.semanticRun = PASSsemantic;
/* Pick up storage classes from context, but except synchronized,
* override, abstract, and final.
*/
dsym.storage_class |= (sc.stc & ~(STCsynchronized | STCoverride | STCabstract | STCfinal));
if (dsym.storage_class & STCextern && dsym._init)
dsym.error("extern symbols cannot have initializers");
dsym.userAttribDecl = sc.userAttribDecl;
AggregateDeclaration ad = dsym.isThis();
if (ad)
dsym.storage_class |= ad.storage_class & STC_TYPECTOR;
/* If auto type inference, do the inference
*/
int inferred = 0;
if (!dsym.type)
{
dsym.inuse++;
// Infering the type requires running semantic,
// so mark the scope as ctfe if required
bool needctfe = (dsym.storage_class & (STCmanifest | STCstatic)) != 0;
if (needctfe)
sc = sc.startCTFE();
//printf("inferring type for %s with init %s\n", toChars(), _init.toChars());
dsym._init = dsym._init.inferType(sc);
dsym.type = dsym._init.initializerToExpression().type;
if (needctfe)
sc = sc.endCTFE();
dsym.inuse--;
inferred = 1;
/* This is a kludge to support the existing syntax for RAII
* declarations.
*/
dsym.storage_class &= ~STCauto;
dsym.originalType = dsym.type.syntaxCopy();
}
else
{
if (!dsym.originalType)
dsym.originalType = dsym.type.syntaxCopy();
/* Prefix function attributes of variable declaration can affect
* its type:
* pure nothrow void function() fp;
* static assert(is(typeof(fp) == void function() pure nothrow));
*/
Scope* sc2 = sc.push();
sc2.stc |= (dsym.storage_class & STC_FUNCATTR);
dsym.inuse++;
dsym.type = dsym.type.typeSemantic(dsym.loc, sc2);
dsym.inuse--;
sc2.pop();
}
//printf(" semantic type = %s\n", type ? type.toChars() : "null");
if (dsym.type.ty == Terror)
dsym.errors = true;
dsym.type.checkDeprecated(dsym.loc, sc);
dsym.linkage = sc.linkage;
dsym.parent = sc.parent;
//printf("this = %p, parent = %p, '%s'\n", this, parent, parent.toChars());
dsym.protection = sc.protection;
/* If scope's alignment is the default, use the type's alignment,
* otherwise the scope overrrides.
*/
dsym.alignment = sc.alignment();
if (dsym.alignment == STRUCTALIGN_DEFAULT)
dsym.alignment = dsym.type.alignment(); // use type's alignment
//printf("sc.stc = %x\n", sc.stc);
//printf("storage_class = x%x\n", storage_class);
if (global.params.vcomplex)
dsym.type.checkComplexTransition(dsym.loc);
// Calculate type size + safety checks
if (sc.func && !sc.intypeof)
{
if (dsym.storage_class & STCgshared && !dsym.isMember())
{
if (sc.func.setUnsafe())
dsym.error("__gshared not allowed in safe functions; use shared");
}
}
Dsymbol parent = dsym.toParent();
Type tb = dsym.type.toBasetype();
Type tbn = tb.baseElemOf();
if (tb.ty == Tvoid && !(dsym.storage_class & STClazy))
{
if (inferred)
{
dsym.error("type %s is inferred from initializer %s, and variables cannot be of type void", dsym.type.toChars(), dsym._init.toChars());
}
else
dsym.error("variables cannot be of type void");
dsym.type = Type.terror;
tb = dsym.type;
}
if (tb.ty == Tfunction)
{
dsym.error("cannot be declared to be a function");
dsym.type = Type.terror;
tb = dsym.type;
}
if (tb.ty == Tstruct)
{
TypeStruct ts = cast(TypeStruct)tb;
if (!ts.sym.members)
{
dsym.error("no definition of struct %s", ts.toChars());
}
}
if ((dsym.storage_class & STCauto) && !inferred)
dsym.error("storage class 'auto' has no effect if type is not inferred, did you mean 'scope'?");
if (tb.ty == Ttuple)
{
/* Instead, declare variables for each of the tuple elements
* and add those.
*/
TypeTuple tt = cast(TypeTuple)tb;
size_t nelems = Parameter.dim(tt.arguments);
Expression ie = (dsym._init && !dsym._init.isVoidInitializer()) ? dsym._init.initializerToExpression() : null;
if (ie)
ie = ie.expressionSemantic(sc);
if (nelems > 0 && ie)
{
auto iexps = new Expressions();
iexps.push(ie);
auto exps = new Expressions();
for (size_t pos = 0; pos < iexps.dim; pos++)
{
Lexpand1:
Expression e = (*iexps)[pos];
Parameter arg = Parameter.getNth(tt.arguments, pos);
arg.type = arg.type.typeSemantic(dsym.loc, sc);
//printf("[%d] iexps.dim = %d, ", pos, iexps.dim);
//printf("e = (%s %s, %s), ", Token::tochars[e.op], e.toChars(), e.type.toChars());
//printf("arg = (%s, %s)\n", arg.toChars(), arg.type.toChars());
if (e != ie)
{
if (iexps.dim > nelems)
goto Lnomatch;
if (e.type.implicitConvTo(arg.type))
continue;
}
if (e.op == TOKtuple)
{
TupleExp te = cast(TupleExp)e;
if (iexps.dim - 1 + te.exps.dim > nelems)
goto Lnomatch;
iexps.remove(pos);
iexps.insert(pos, te.exps);
(*iexps)[pos] = Expression.combine(te.e0, (*iexps)[pos]);
goto Lexpand1;
}
else if (isAliasThisTuple(e))
{
auto v = copyToTemp(0, "__tup", e);
v.dsymbolSemantic(sc);
auto ve = new VarExp(dsym.loc, v);
ve.type = e.type;
exps.setDim(1);
(*exps)[0] = ve;
expandAliasThisTuples(exps, 0);
for (size_t u = 0; u < exps.dim; u++)
{
Lexpand2:
Expression ee = (*exps)[u];
arg = Parameter.getNth(tt.arguments, pos + u);
arg.type = arg.type.typeSemantic(dsym.loc, sc);
//printf("[%d+%d] exps.dim = %d, ", pos, u, exps.dim);
//printf("ee = (%s %s, %s), ", Token::tochars[ee.op], ee.toChars(), ee.type.toChars());
//printf("arg = (%s, %s)\n", arg.toChars(), arg.type.toChars());
size_t iexps_dim = iexps.dim - 1 + exps.dim;
if (iexps_dim > nelems)
goto Lnomatch;
if (ee.type.implicitConvTo(arg.type))
continue;
if (expandAliasThisTuples(exps, u) != -1)
goto Lexpand2;
}
if ((*exps)[0] != ve)
{
Expression e0 = (*exps)[0];
(*exps)[0] = new CommaExp(dsym.loc, new DeclarationExp(dsym.loc, v), e0);
(*exps)[0].type = e0.type;
iexps.remove(pos);
iexps.insert(pos, exps);
goto Lexpand1;
}
}
}
if (iexps.dim < nelems)
goto Lnomatch;
ie = new TupleExp(dsym._init.loc, iexps);
}
Lnomatch:
if (ie && ie.op == TOKtuple)
{
TupleExp te = cast(TupleExp)ie;
size_t tedim = te.exps.dim;
if (tedim != nelems)
{
error(dsym.loc, "tuple of %d elements cannot be assigned to tuple of %d elements", cast(int)tedim, cast(int)nelems);
for (size_t u = tedim; u < nelems; u++) // fill dummy expression
te.exps.push(new ErrorExp());
}
}
auto exps = new Objects();
exps.setDim(nelems);
for (size_t i = 0; i < nelems; i++)
{
Parameter arg = Parameter.getNth(tt.arguments, i);
OutBuffer buf;
buf.printf("__%s_field_%llu", dsym.ident.toChars(), cast(ulong)i);
auto id = Identifier.idPool(buf.peekSlice());
Initializer ti;
if (ie)
{
Expression einit = ie;
if (ie.op == TOKtuple)
{
TupleExp te = cast(TupleExp)ie;
einit = (*te.exps)[i];
if (i == 0)
einit = Expression.combine(te.e0, einit);
}
ti = new ExpInitializer(einit.loc, einit);
}
else
ti = dsym._init ? dsym._init.syntaxCopy() : null;
StorageClass storage_class = STCtemp | dsym.storage_class;
if (arg.storageClass & STCparameter)
storage_class |= arg.storageClass;
auto v = new VarDeclaration(dsym.loc, arg.type, id, ti, storage_class);
//printf("declaring field %s of type %s\n", v.toChars(), v.type.toChars());
v.dsymbolSemantic(sc);
if (sc.scopesym)
{
//printf("adding %s to %s\n", v.toChars(), sc.scopesym.toChars());
if (sc.scopesym.members)
// Note this prevents using foreach() over members, because the limits can change
sc.scopesym.members.push(v);
}
Expression e = new DsymbolExp(dsym.loc, v);
(*exps)[i] = e;
}
auto v2 = new TupleDeclaration(dsym.loc, dsym.ident, exps);
v2.parent = dsym.parent;
v2.isexp = true;
dsym.aliassym = v2;
dsym.semanticRun = PASSsemanticdone;
return;
}
/* Storage class can modify the type
*/
dsym.type = dsym.type.addStorageClass(dsym.storage_class);
/* Adjust storage class to reflect type
*/
if (dsym.type.isConst())
{
dsym.storage_class |= STCconst;
if (dsym.type.isShared())
dsym.storage_class |= STCshared;
}
else if (dsym.type.isImmutable())
dsym.storage_class |= STCimmutable;
else if (dsym.type.isShared())
dsym.storage_class |= STCshared;
else if (dsym.type.isWild())
dsym.storage_class |= STCwild;
if (StorageClass stc = dsym.storage_class & (STCsynchronized | STCoverride | STCabstract | STCfinal))
{
if (stc == STCfinal)
dsym.error("cannot be final, perhaps you meant const?");
else
{
OutBuffer buf;
stcToBuffer(&buf, stc);
dsym.error("cannot be %s", buf.peekString());
}
dsym.storage_class &= ~stc; // strip off
}
if (dsym.storage_class & STCscope)
{
StorageClass stc = dsym.storage_class & (STCstatic | STCextern | STCmanifest | STCtls | STCgshared);
if (stc)
{
OutBuffer buf;
stcToBuffer(&buf, stc);
dsym.error("cannot be 'scope' and '%s'", buf.peekString());
}
else if (dsym.isMember())
{
dsym.error("field cannot be 'scope'");
}
else if (!dsym.type.hasPointers())
{
dsym.storage_class &= ~STCscope; // silently ignore; may occur in generic code
}
}
if (dsym.storage_class & (STCstatic | STCextern | STCmanifest | STCtemplateparameter | STCtls | STCgshared | STCctfe))
{
}
else
{
AggregateDeclaration aad = parent.isAggregateDeclaration();
if (aad)
{
if (global.params.vfield && dsym.storage_class & (STCconst | STCimmutable) && dsym._init && !dsym._init.isVoidInitializer())
{
const(char)* p = dsym.loc.toChars();
const(char)* s = (dsym.storage_class & STCimmutable) ? "immutable" : "const";
fprintf(global.stdmsg, "%s: %s.%s is %s field\n", p ? p : "", ad.toPrettyChars(), dsym.toChars(), s);
}
dsym.storage_class |= STCfield;
if (tbn.ty == Tstruct && (cast(TypeStruct)tbn).sym.noDefaultCtor)
{
if (!dsym.isThisDeclaration() && !dsym._init)
aad.noDefaultCtor = true;
}
}
InterfaceDeclaration id = parent.isInterfaceDeclaration();
if (id)
{
dsym.error("field not allowed in interface");
}
else if (aad && aad.sizeok == SIZEOKdone)
{
dsym.error("cannot be further field because it will change the determined %s size", aad.toChars());
}
/* Templates cannot add fields to aggregates
*/
TemplateInstance ti = parent.isTemplateInstance();
if (ti)
{
// Take care of nested templates
while (1)
{
TemplateInstance ti2 = ti.tempdecl.parent.isTemplateInstance();
if (!ti2)
break;
ti = ti2;
}
// If it's a member template
AggregateDeclaration ad2 = ti.tempdecl.isMember();
if (ad2 && dsym.storage_class != STCundefined)
{
dsym.error("cannot use template to add field to aggregate '%s'", ad2.toChars());
}
}
}
if ((dsym.storage_class & (STCref | STCparameter | STCforeach | STCtemp | STCresult)) == STCref && dsym.ident != Id.This)
{
dsym.error("only parameters or foreach declarations can be ref");
}
if (dsym.type.hasWild())
{
if (dsym.storage_class & (STCstatic | STCextern | STCtls | STCgshared | STCmanifest | STCfield) || dsym.isDataseg())
{
dsym.error("only parameters or stack based variables can be inout");
}
FuncDeclaration func = sc.func;
if (func)
{
if (func.fes)
func = func.fes.func;
bool isWild = false;
for (FuncDeclaration fd = func; fd; fd = fd.toParent2().isFuncDeclaration())
{
if ((cast(TypeFunction)fd.type).iswild)
{
isWild = true;
break;
}
}
if (!isWild)
{
dsym.error("inout variables can only be declared inside inout functions");
}
}
}
if (!(dsym.storage_class & (STCctfe | STCref | STCresult)) && tbn.ty == Tstruct && (cast(TypeStruct)tbn).sym.noDefaultCtor)
{
if (!dsym._init)
{
if (dsym.isField())
{
/* For fields, we'll check the constructor later to make sure it is initialized
*/
dsym.storage_class |= STCnodefaultctor;
}
else if (dsym.storage_class & STCparameter)
{
}
else
dsym.error("default construction is disabled for type %s", dsym.type.toChars());
}
}
FuncDeclaration fd = parent.isFuncDeclaration();
if (dsym.type.isscope() && !(dsym.storage_class & STCnodtor))
{
if (dsym.storage_class & (STCfield | STCout | STCref | STCstatic | STCmanifest | STCtls | STCgshared) || !fd)
{
dsym.error("globals, statics, fields, manifest constants, ref and out parameters cannot be scope");
}
if (!(dsym.storage_class & STCscope))
{
if (!(dsym.storage_class & STCparameter) && dsym.ident != Id.withSym)
dsym.error("reference to scope class must be scope");
}
}
// Calculate type size + safety checks
if (sc.func && !sc.intypeof)
{
if (dsym._init && dsym._init.isVoidInitializer() && dsym.type.hasPointers()) // get type size
{
if (sc.func.setUnsafe())
dsym.error("void initializers for pointers not allowed in safe functions");
}
else if (!dsym._init &&
!(dsym.storage_class & (STCstatic | STCextern | STCtls | STCgshared | STCmanifest | STCfield | STCparameter)) &&
dsym.type.hasVoidInitPointers())
{
if (sc.func.setUnsafe())
dsym.error("void initializers for pointers not allowed in safe functions");
}
}
if (!dsym._init && !fd)
{
// If not mutable, initializable by constructor only
dsym.storage_class |= STCctorinit;
}
if (dsym._init)
dsym.storage_class |= STCinit; // remember we had an explicit initializer
else if (dsym.storage_class & STCmanifest)
dsym.error("manifest constants must have initializers");
bool isBlit = false;
d_uns64 sz;
if (!dsym._init &&
!sc.inunion &&
!(dsym.storage_class & (STCstatic | STCgshared | STCextern)) &&
fd &&
(!(dsym.storage_class & (STCfield | STCin | STCforeach | STCparameter | STCresult)) ||
(dsym.storage_class & STCout)) &&
(sz = dsym.type.size()) != 0)
{
// Provide a default initializer
//printf("Providing default initializer for '%s'\n", toChars());
if (sz == SIZE_INVALID && dsym.type.ty != Terror)
dsym.error("size of type %s is invalid", dsym.type.toChars());
Type tv = dsym.type;
while (tv.ty == Tsarray) // Don't skip Tenum
tv = tv.nextOf();
if (tv.needsNested())
{
/* Nested struct requires valid enclosing frame pointer.
* In StructLiteralExp::toElem(), it's calculated.
*/
assert(tbn.ty == Tstruct);
checkFrameAccess(dsym.loc, sc, (cast(TypeStruct)tbn).sym);
Expression e = tv.defaultInitLiteral(dsym.loc);
e = new BlitExp(dsym.loc, new VarExp(dsym.loc, dsym), e);
e = e.expressionSemantic(sc);
dsym._init = new ExpInitializer(dsym.loc, e);
goto Ldtor;
}
if (tv.ty == Tstruct && (cast(TypeStruct)tv).sym.zeroInit == 1)
{
/* If a struct is all zeros, as a special case
* set it's initializer to the integer 0.
* In AssignExp::toElem(), we check for this and issue
* a memset() to initialize the struct.
* Must do same check in interpreter.
*/
Expression e = new IntegerExp(dsym.loc, 0, Type.tint32);
e = new BlitExp(dsym.loc, new VarExp(dsym.loc, dsym), e);
e.type = dsym.type; // don't type check this, it would fail
dsym._init = new ExpInitializer(dsym.loc, e);
goto Ldtor;
}
if (dsym.type.baseElemOf().ty == Tvoid)
{
dsym.error("%s does not have a default initializer", dsym.type.toChars());
}
else if (auto e = dsym.type.defaultInit(dsym.loc))
{
dsym._init = new ExpInitializer(dsym.loc, e);
}
// Default initializer is always a blit
isBlit = true;
}
if (dsym._init)
{
sc = sc.push();
sc.stc &= ~(STC_TYPECTOR | STCpure | STCnothrow | STCnogc | STCref | STCdisable);
ExpInitializer ei = dsym._init.isExpInitializer();
if (ei) // https://issues.dlang.org/show_bug.cgi?id=13424
// Preset the required type to fail in FuncLiteralDeclaration::semantic3
ei.exp = inferType(ei.exp, dsym.type);
// If inside function, there is no semantic3() call
if (sc.func || sc.intypeof == 1)
{
// If local variable, use AssignExp to handle all the various
// possibilities.
if (fd && !(dsym.storage_class & (STCmanifest | STCstatic | STCtls | STCgshared | STCextern)) && !dsym._init.isVoidInitializer())
{
//printf("fd = '%s', var = '%s'\n", fd.toChars(), toChars());
if (!ei)
{
ArrayInitializer ai = dsym._init.isArrayInitializer();
Expression e;
if (ai && tb.ty == Taarray)
e = ai.toAssocArrayLiteral();
else
e = dsym._init.initializerToExpression();
if (!e)
{
// Run semantic, but don't need to interpret
dsym._init = dsym._init.initializerSemantic(sc, dsym.type, INITnointerpret);
e = dsym._init.initializerToExpression();
if (!e)
{
dsym.error("is not a static and cannot have static initializer");
e = new ErrorExp();
}
}
ei = new ExpInitializer(dsym._init.loc, e);
dsym._init = ei;
}
Expression exp = ei.exp;
Expression e1 = new VarExp(dsym.loc, dsym);
if (isBlit)
exp = new BlitExp(dsym.loc, e1, exp);
else
exp = new ConstructExp(dsym.loc, e1, exp);
dsym.canassign++;
exp = exp.expressionSemantic(sc);
dsym.canassign--;
exp = exp.optimize(WANTvalue);
if (exp.op == TOKerror)
{
dsym._init = new ErrorInitializer();
ei = null;
}
else
ei.exp = exp;
if (ei && dsym.isScope())
{
Expression ex = ei.exp;
while (ex.op == TOKcomma)
ex = (cast(CommaExp)ex).e2;
if (ex.op == TOKblit || ex.op == TOKconstruct)
ex = (cast(AssignExp)ex).e2;
if (ex.op == TOKnew)
{
// See if initializer is a NewExp that can be allocated on the stack
NewExp ne = cast(NewExp)ex;
if (dsym.type.toBasetype().ty == Tclass)
{
if (ne.newargs && ne.newargs.dim > 1)
{
dsym.mynew = true;
}
else
{
ne.onstack = 1;
dsym.onstack = true;
}
}
}
else if (ex.op == TOKfunction)
{
// or a delegate that doesn't escape a reference to the function
FuncDeclaration f = (cast(FuncExp)ex).fd;
f.tookAddressOf--;
}
}
}
else
{
// https://issues.dlang.org/show_bug.cgi?id=14166
// Don't run CTFE for the temporary variables inside typeof
dsym._init = dsym._init.initializerSemantic(sc, dsym.type, sc.intypeof == 1 ? INITnointerpret : INITinterpret);
}
}
else if (parent.isAggregateDeclaration())
{
dsym._scope = scx ? scx : sc.copy();
dsym._scope.setNoFree();
}
else if (dsym.storage_class & (STCconst | STCimmutable | STCmanifest) || dsym.type.isConst() || dsym.type.isImmutable())
{
/* Because we may need the results of a const declaration in a
* subsequent type, such as an array dimension, before semantic2()
* gets ordinarily run, try to run semantic2() now.
* Ignore failure.
*/
if (!inferred)
{
uint errors = global.errors;
dsym.inuse++;
if (ei)
{
Expression exp = ei.exp.syntaxCopy();
bool needctfe = dsym.isDataseg() || (dsym.storage_class & STCmanifest);
if (needctfe)
sc = sc.startCTFE();
exp = exp.expressionSemantic(sc);
exp = resolveProperties(sc, exp);
if (needctfe)
sc = sc.endCTFE();
Type tb2 = dsym.type.toBasetype();
Type ti = exp.type.toBasetype();
/* The problem is the following code:
* struct CopyTest {
* double x;
* this(double a) { x = a * 10.0;}
* this(this) { x += 2.0; }
* }
* const CopyTest z = CopyTest(5.3); // ok
* const CopyTest w = z; // not ok, postblit not run
* static assert(w.x == 55.0);
* because the postblit doesn't get run on the initialization of w.
*/
if (ti.ty == Tstruct)
{
StructDeclaration sd = (cast(TypeStruct)ti).sym;
/* Look to see if initializer involves a copy constructor
* (which implies a postblit)
*/
// there is a copy constructor
// and exp is the same struct
if (sd.postblit && tb2.toDsymbol(null) == sd)
{
// The only allowable initializer is a (non-copy) constructor
if (exp.isLvalue())
dsym.error("of type struct %s uses this(this), which is not allowed in static initialization", tb2.toChars());
}
}
ei.exp = exp;
}
dsym._init = dsym._init.initializerSemantic(sc, dsym.type, INITinterpret);
dsym.inuse--;
if (global.errors > errors)
{
dsym._init = new ErrorInitializer();
dsym.type = Type.terror;
}
}
else
{
dsym._scope = scx ? scx : sc.copy();
dsym._scope.setNoFree();
}
}
sc = sc.pop();
}
Ldtor:
/* Build code to execute destruction, if necessary
*/
dsym.edtor = dsym.callScopeDtor(sc);
if (dsym.edtor)
{
if (sc.func && dsym.storage_class & (STCstatic | STCgshared))
dsym.edtor = dsym.edtor.expressionSemantic(sc._module._scope);
else
dsym.edtor = dsym.edtor.expressionSemantic(sc);
version (none)
{
// currently disabled because of std.stdio.stdin, stdout and stderr
if (dsym.isDataseg() && !(dsym.storage_class & STCextern))
dsym.error("static storage variables cannot have destructors");
}
}
dsym.semanticRun = PASSsemanticdone;
if (dsym.type.toBasetype().ty == Terror)
dsym.errors = true;
if(sc.scopesym && !sc.scopesym.isAggregateDeclaration())
{
for (ScopeDsymbol sym = sc.scopesym; sym && dsym.endlinnum == 0;
sym = sym.parent ? sym.parent.isScopeDsymbol() : null)
dsym.endlinnum = sym.endlinnum;
}
}
override void visit(TypeInfoDeclaration dsym)
{
assert(dsym.linkage == LINKc);
}
override void visit(Import imp)
{
//printf("Import::semantic('%s') %s\n", toPrettyChars(), id.toChars());
if (imp.semanticRun > PASSinit)
return;
if (imp._scope)
{
sc = imp._scope;
imp._scope = null;
}
if (!sc)
return;
imp.semanticRun = PASSsemantic;
// Load if not already done so
if (!imp.mod)
{
imp.load(sc);
if (imp.mod)
imp.mod.importAll(null);
}
if (imp.mod)
{
// Modules need a list of each imported module
//printf("%s imports %s\n", sc.module.toChars(), mod.toChars());
sc._module.aimports.push(imp.mod);
if (sc.explicitProtection)
imp.protection = sc.protection;
if (!imp.aliasId && !imp.names.dim) // neither a selective nor a renamed import
{
ScopeDsymbol scopesym;
for (Scope* scd = sc; scd; scd = scd.enclosing)
{
if (!scd.scopesym)
continue;
scopesym = scd.scopesym;
break;
}
if (!imp.isstatic)
{
scopesym.importScope(imp.mod, imp.protection);
}
// Mark the imported packages as accessible from the current
// scope. This access check is necessary when using FQN b/c
// we're using a single global package tree.
// https://issues.dlang.org/show_bug.cgi?id=313
if (imp.packages)
{
// import a.b.c.d;
auto p = imp.pkg; // a
scopesym.addAccessiblePackage(p, imp.protection);
foreach (id; (*imp.packages)[1 .. imp.packages.dim]) // [b, c]
{
p = cast(Package) p.symtab.lookup(id);
scopesym.addAccessiblePackage(p, imp.protection);
}
}
scopesym.addAccessiblePackage(imp.mod, imp.protection); // d
}
imp.mod.dsymbolSemantic(null);
if (imp.mod.needmoduleinfo)
{
//printf("module4 %s because of %s\n", sc.module.toChars(), mod.toChars());
sc._module.needmoduleinfo = 1;
}
sc = sc.push(imp.mod);
sc.protection = imp.protection;
for (size_t i = 0; i < imp.aliasdecls.dim; i++)
{
AliasDeclaration ad = imp.aliasdecls[i];
//printf("\tImport %s alias %s = %s, scope = %p\n", toPrettyChars(), aliases[i].toChars(), names[i].toChars(), ad._scope);
if (imp.mod.search(imp.loc, imp.names[i]))
{
ad.dsymbolSemantic(sc);
// If the import declaration is in non-root module,
// analysis of the aliased symbol is deferred.
// Therefore, don't see the ad.aliassym or ad.type here.
}
else
{
Dsymbol s = imp.mod.search_correct(imp.names[i]);
if (s)
imp.mod.error(imp.loc, "import '%s' not found, did you mean %s '%s'?", imp.names[i].toChars(), s.kind(), s.toChars());
else
imp.mod.error(imp.loc, "import '%s' not found", imp.names[i].toChars());
ad.type = Type.terror;
}
}
sc = sc.pop();
}
imp.semanticRun = PASSsemanticdone;
// object self-imports itself, so skip that
// https://issues.dlang.org/show_bug.cgi?id=7547
// don't list pseudo modules __entrypoint.d, __main.d
// https://issues.dlang.org/show_bug.cgi?id=11117
// https://issues.dlang.org/show_bug.cgi?id=11164
if (global.params.moduleDeps !is null && !(imp.id == Id.object && sc._module.ident == Id.object) &&
sc._module.ident != Id.entrypoint &&
strcmp(sc._module.ident.toChars(), "__main") != 0)
{
/* The grammar of the file is:
* ImportDeclaration
* ::= BasicImportDeclaration [ " : " ImportBindList ] [ " -> "
* ModuleAliasIdentifier ] "\n"
*
* BasicImportDeclaration
* ::= ModuleFullyQualifiedName " (" FilePath ") : " Protection|"string"
* " [ " static" ] : " ModuleFullyQualifiedName " (" FilePath ")"
*
* FilePath
* - any string with '(', ')' and '\' escaped with the '\' character
*/
OutBuffer* ob = global.params.moduleDeps;
Module imod = sc.instantiatingModule();
if (!global.params.moduleDepsFile)
ob.writestring("depsImport ");
ob.writestring(imod.toPrettyChars());
ob.writestring(" (");
escapePath(ob, imod.srcfile.toChars());
ob.writestring(") : ");
// use protection instead of sc.protection because it couldn't be
// resolved yet, see the comment above
protectionToBuffer(ob, imp.protection);
ob.writeByte(' ');
if (imp.isstatic)
{
stcToBuffer(ob, STCstatic);
ob.writeByte(' ');
}
ob.writestring(": ");
if (imp.packages)
{
for (size_t i = 0; i < imp.packages.dim; i++)
{
Identifier pid = (*imp.packages)[i];
ob.printf("%s.", pid.toChars());
}
}
ob.writestring(imp.id.toChars());
ob.writestring(" (");
if (imp.mod)
escapePath(ob, imp.mod.srcfile.toChars());
else
ob.writestring("???");
ob.writeByte(')');
for (size_t i = 0; i < imp.names.dim; i++)
{
if (i == 0)
ob.writeByte(':');
else
ob.writeByte(',');
Identifier name = imp.names[i];
Identifier _alias = imp.aliases[i];
if (!_alias)
{
ob.printf("%s", name.toChars());
_alias = name;
}
else
ob.printf("%s=%s", _alias.toChars(), name.toChars());
}
if (imp.aliasId)
ob.printf(" -> %s", imp.aliasId.toChars());
ob.writenl();
}
//printf("-Import::semantic('%s'), pkg = %p\n", toChars(), pkg);
}
void attribSemantic(AttribDeclaration ad)
{
if (ad.semanticRun != PASSinit)
return;
ad.semanticRun = PASSsemantic;
Dsymbols* d = ad.include(sc, null);
//printf("\tAttribDeclaration::semantic '%s', d = %p\n",toChars(), d);
if (d)
{
Scope* sc2 = ad.newScope(sc);
bool errors;
for (size_t i = 0; i < d.dim; i++)
{
Dsymbol s = (*d)[i];
s.dsymbolSemantic(sc2);
errors |= s.errors;
}
ad.errors |= errors;
if (sc2 != sc)
sc2.pop();
}
ad.semanticRun = PASSsemanticdone;
}
override void visit(AttribDeclaration atd)
{
attribSemantic(atd);
}
override void visit(AnonDeclaration scd)
{
//printf("\tAnonDeclaration::semantic %s %p\n", isunion ? "union" : "struct", this);
assert(sc.parent);
auto p = sc.parent.pastMixin();
auto ad = p.isAggregateDeclaration();
if (!ad)
{
error(scd.loc, "%s can only be a part of an aggregate, not %s `%s`", scd.kind(), p.kind(), p.toChars());
scd.errors = true;
return;
}
if (scd.decl)
{
sc = sc.push();
sc.stc &= ~(STCauto | STCscope | STCstatic | STCtls | STCgshared);
sc.inunion = scd.isunion;
sc.flags = 0;
for (size_t i = 0; i < scd.decl.dim; i++)
{
Dsymbol s = (*scd.decl)[i];
s.dsymbolSemantic(sc);
}
sc = sc.pop();
}
}
override void visit(PragmaDeclaration pd)
{
// Should be merged with PragmaStatement
//printf("\tPragmaDeclaration::semantic '%s'\n",toChars());
if (pd.ident == Id.msg)
{
if (pd.args)
{
for (size_t i = 0; i < pd.args.dim; i++)
{
Expression e = (*pd.args)[i];
sc = sc.startCTFE();
e = e.expressionSemantic(sc);
e = resolveProperties(sc, e);
sc = sc.endCTFE();
// pragma(msg) is allowed to contain types as well as expressions
e = ctfeInterpretForPragmaMsg(e);
if (e.op == TOKerror)
{
errorSupplemental(pd.loc, "while evaluating pragma(msg, %s)", (*pd.args)[i].toChars());
return;
}
StringExp se = e.toStringExp();
if (se)
{
se = se.toUTF8(sc);
fprintf(stderr, "%.*s", cast(int)se.len, se.string);
}
else
fprintf(stderr, "%s", e.toChars());
}
fprintf(stderr, "\n");
}
goto Lnodecl;
}
else if (pd.ident == Id.lib)
{
if (!pd.args || pd.args.dim != 1)
pd.error("string expected for library name");
else
{
auto se = semanticString(sc, (*pd.args)[0], "library name");
if (!se)
goto Lnodecl;
(*pd.args)[0] = se;
auto name = cast(char*)mem.xmalloc(se.len + 1);
memcpy(name, se.string, se.len);
name[se.len] = 0;
if (global.params.verbose)
fprintf(global.stdmsg, "library %s\n", name);
if (global.params.moduleDeps && !global.params.moduleDepsFile)
{
OutBuffer* ob = global.params.moduleDeps;
Module imod = sc.instantiatingModule();
ob.writestring("depsLib ");
ob.writestring(imod.toPrettyChars());
ob.writestring(" (");
escapePath(ob, imod.srcfile.toChars());
ob.writestring(") : ");
ob.writestring(name);
ob.writenl();
}
mem.xfree(name);
}
goto Lnodecl;
}
else if (pd.ident == Id.startaddress)
{
if (!pd.args || pd.args.dim != 1)
pd.error("function name expected for start address");
else
{
/* https://issues.dlang.org/show_bug.cgi?id=11980
* resolveProperties and ctfeInterpret call are not necessary.
*/
Expression e = (*pd.args)[0];
sc = sc.startCTFE();
e = e.expressionSemantic(sc);
sc = sc.endCTFE();
(*pd.args)[0] = e;
Dsymbol sa = getDsymbol(e);
if (!sa || !sa.isFuncDeclaration())
pd.error("function name expected for start address, not `%s`", e.toChars());
}
goto Lnodecl;
}
else if (pd.ident == Id.Pinline)
{
goto Ldecl;
}
else if (pd.ident == Id.mangle)
{
if (!pd.args)
pd.args = new Expressions();
if (pd.args.dim != 1)
{
pd.error("string expected for mangled name");
pd.args.setDim(1);
(*pd.args)[0] = new ErrorExp(); // error recovery
goto Ldecl;
}
auto se = semanticString(sc, (*pd.args)[0], "mangled name");
if (!se)
goto Ldecl;
(*pd.args)[0] = se; // Will be used later
if (!se.len)
{
pd.error("zero-length string not allowed for mangled name");
goto Ldecl;
}
if (se.sz != 1)
{
pd.error("mangled name characters can only be of type char");
goto Ldecl;
}
version (all)
{
/* Note: D language specification should not have any assumption about backend
* implementation. Ideally pragma(mangle) can accept a string of any content.
*
* Therefore, this validation is compiler implementation specific.
*/
for (size_t i = 0; i < se.len;)
{
char* p = se.string;
dchar c = p[i];
if (c < 0x80)
{
if (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c != 0 && strchr("$%().:?@[]_", c))
{
++i;
continue;
}
else
{
pd.error("char 0x%02x not allowed in mangled name", c);
break;
}
}
if (const msg = utf_decodeChar(se.string, se.len, i, c))
{
pd.error("%s", msg);
break;
}
if (!isUniAlpha(c))
{
pd.error("char `0x%04x` not allowed in mangled name", c);
break;
}
}
}
}
else if (global.params.ignoreUnsupportedPragmas)
{
if (global.params.verbose)
{
/* Print unrecognized pragmas
*/
fprintf(global.stdmsg, "pragma %s", pd.ident.toChars());
if (pd.args)
{
for (size_t i = 0; i < pd.args.dim; i++)
{
Expression e = (*pd.args)[i];
sc = sc.startCTFE();
e = e.expressionSemantic(sc);
e = resolveProperties(sc, e);
sc = sc.endCTFE();
e = e.ctfeInterpret();
if (i == 0)
fprintf(global.stdmsg, " (");
else
fprintf(global.stdmsg, ",");
fprintf(global.stdmsg, "%s", e.toChars());
}
if (pd.args.dim)
fprintf(global.stdmsg, ")");
}
fprintf(global.stdmsg, "\n");
}
goto Lnodecl;
}
else
pd.error("unrecognized `pragma(%s)`", pd.ident.toChars());
Ldecl:
if (pd.decl)
{
Scope* sc2 = pd.newScope(sc);
for (size_t i = 0; i < pd.decl.dim; i++)
{
Dsymbol s = (*pd.decl)[i];
s.dsymbolSemantic(sc2);
if (pd.ident == Id.mangle)
{
assert(pd.args && pd.args.dim == 1);
if (auto se = (*pd.args)[0].toStringExp())
{
char* name = cast(char*)mem.xmalloc(se.len + 1);
memcpy(name, se.string, se.len);
name[se.len] = 0;
uint cnt = setMangleOverride(s, name);
if (cnt > 1)
pd.error("can only apply to a single declaration");
}
}
}
if (sc2 != sc)
sc2.pop();
}
return;
Lnodecl:
if (pd.decl)
{
pd.error("pragma is missing closing `;`");
goto Ldecl;
// do them anyway, to avoid segfaults.
}
}
override void visit(StaticIfDeclaration sid)
{
attribSemantic(sid);
}
override void visit(StaticForeachDeclaration sfd)
{
attribSemantic(sfd);
}
void compileIt(CompileDeclaration cd, Scope* sc)
{
//printf("CompileDeclaration::compileIt(loc = %d) %s\n", loc.linnum, exp.toChars());
auto se = semanticString(sc, cd.exp, "argument to mixin");
if (!se)
return;
se = se.toUTF8(sc);
uint errors = global.errors;
scope p = new Parser!ASTCodegen(cd.loc, sc._module, se.toStringz(), false);
p.nextToken();
cd.decl = p.parseDeclDefs(0);
if (p.token.value != TOKeof)
cd.exp.error("incomplete mixin declaration `%s`", se.toChars());
if (p.errors)
{
assert(global.errors != errors);
cd.decl = null;
}
}
override void visit(CompileDeclaration cd)
{
//printf("CompileDeclaration::semantic()\n");
if (!cd.compiled)
{
compileIt(cd, sc);
cd.AttribDeclaration.addMember(sc, cd.scopesym);
cd.compiled = true;
if (cd._scope && cd.decl)
{
for (size_t i = 0; i < cd.decl.dim; i++)
{
Dsymbol s = (*cd.decl)[i];
s.setScope(cd._scope);
}
}
}
attribSemantic(cd);
}
override void visit(UserAttributeDeclaration uad)
{
//printf("UserAttributeDeclaration::semantic() %p\n", this);
if (uad.decl && !uad._scope)
uad.Dsymbol.setScope(sc); // for function local symbols
return attribSemantic(uad);
}
override void visit(StaticAssert sa)
{
if (sa.semanticRun < PASSsemanticdone)
sa.semanticRun = PASSsemanticdone;
}
override void visit(DebugSymbol ds)
{
//printf("DebugSymbol::semantic() %s\n", toChars());
if (ds.semanticRun < PASSsemanticdone)
ds.semanticRun = PASSsemanticdone;
}
override void visit(VersionSymbol vs)
{
if (vs.semanticRun < PASSsemanticdone)
vs.semanticRun = PASSsemanticdone;
}
override void visit(Package pkg)
{
if (pkg.semanticRun < PASSsemanticdone)
pkg.semanticRun = PASSsemanticdone;
}
override void visit(Module m)
{
if (m.semanticRun != PASSinit)
return;
//printf("+Module::semantic(this = %p, '%s'): parent = %p\n", this, toChars(), parent);
m.semanticRun = PASSsemantic;
// Note that modules get their own scope, from scratch.
// This is so regardless of where in the syntax a module
// gets imported, it is unaffected by context.
Scope* sc = m._scope; // see if already got one from importAll()
if (!sc)
{
Scope.createGlobal(m); // create root scope
}
//printf("Module = %p, linkage = %d\n", sc.scopesym, sc.linkage);
// Pass 1 semantic routines: do public side of the definition
for (size_t i = 0; i < m.members.dim; i++)
{
Dsymbol s = (*m.members)[i];
//printf("\tModule('%s'): '%s'.dsymbolSemantic()\n", toChars(), s.toChars());
s.dsymbolSemantic(sc);
m.runDeferredSemantic();
}
if (m.userAttribDecl)
{
m.userAttribDecl.dsymbolSemantic(sc);
}
if (!m._scope)
{
sc = sc.pop();
sc.pop(); // 2 pops because Scope::createGlobal() created 2
}
m.semanticRun = PASSsemanticdone;
//printf("-Module::semantic(this = %p, '%s'): parent = %p\n", this, toChars(), parent);
}
override void visit(EnumDeclaration ed)
{
//printf("EnumDeclaration::semantic(sd = %p, '%s') %s\n", sc.scopesym, sc.scopesym.toChars(), toChars());
//printf("EnumDeclaration::semantic() %p %s\n", this, toChars());
if (ed.semanticRun >= PASSsemanticdone)
return; // semantic() already completed
if (ed.semanticRun == PASSsemantic)
{
assert(ed.memtype);
error(ed.loc, "circular reference to enum base type `%s`", ed.memtype.toChars());
ed.errors = true;
ed.semanticRun = PASSsemanticdone;
return;
}
uint dprogress_save = Module.dprogress;
Scope* scx = null;
if (ed._scope)
{
sc = ed._scope;
scx = ed._scope; // save so we don't make redundant copies
ed._scope = null;
}
if (!sc)
return;
ed.parent = sc.parent;
ed.type = ed.type.typeSemantic(ed.loc, sc);
ed.protection = sc.protection;
if (sc.stc & STCdeprecated)
ed.isdeprecated = true;
ed.userAttribDecl = sc.userAttribDecl;
ed.semanticRun = PASSsemantic;
if (!ed.members && !ed.memtype) // enum ident;
{
ed.semanticRun = PASSsemanticdone;
return;
}
if (!ed.symtab)
ed.symtab = new DsymbolTable();
/* The separate, and distinct, cases are:
* 1. enum { ... }
* 2. enum : memtype { ... }
* 3. enum ident { ... }
* 4. enum ident : memtype { ... }
* 5. enum ident : memtype;
* 6. enum ident;
*/
if (ed.memtype)
{
ed.memtype = ed.memtype.typeSemantic(ed.loc, sc);
/* Check to see if memtype is forward referenced
*/
if (ed.memtype.ty == Tenum)
{
EnumDeclaration sym = cast(EnumDeclaration)ed.memtype.toDsymbol(sc);
if (!sym.memtype || !sym.members || !sym.symtab || sym._scope)
{
// memtype is forward referenced, so try again later
ed._scope = scx ? scx : sc.copy();
ed._scope.setNoFree();
ed._scope._module.addDeferredSemantic(ed);
Module.dprogress = dprogress_save;
//printf("\tdeferring %s\n", toChars());
ed.semanticRun = PASSinit;
return;
}
}
if (ed.memtype.ty == Tvoid)
{
ed.error("base type must not be void");
ed.memtype = Type.terror;
}
if (ed.memtype.ty == Terror)
{
ed.errors = true;
if (ed.members)
{
for (size_t i = 0; i < ed.members.dim; i++)
{
Dsymbol s = (*ed.members)[i];
s.errors = true; // poison all the members
}
}
ed.semanticRun = PASSsemanticdone;
return;
}
}
ed.semanticRun = PASSsemanticdone;
if (!ed.members) // enum ident : memtype;
return;
if (ed.members.dim == 0)
{
ed.error("enum `%s` must have at least one member", ed.toChars());
ed.errors = true;
return;
}
Module.dprogress++;
Scope* sce;
if (ed.isAnonymous())
sce = sc;
else
{
sce = sc.push(ed);
sce.parent = ed;
}
sce = sce.startCTFE();
sce.setNoFree(); // needed for getMaxMinValue()
/* Each enum member gets the sce scope
*/
for (size_t i = 0; i < ed.members.dim; i++)
{
EnumMember em = (*ed.members)[i].isEnumMember();
if (em)
em._scope = sce;
}
if (!ed.added)
{
/* addMember() is not called when the EnumDeclaration appears as a function statement,
* so we have to do what addMember() does and install the enum members in the right symbol
* table
*/
ScopeDsymbol scopesym = null;
if (ed.isAnonymous())
{
/* Anonymous enum members get added to enclosing scope.
*/
for (Scope* sct = sce; 1; sct = sct.enclosing)
{
assert(sct);
if (sct.scopesym)
{
scopesym = sct.scopesym;
if (!sct.scopesym.symtab)
sct.scopesym.symtab = new DsymbolTable();
break;
}
}
}
else
{
// Otherwise enum members are in the EnumDeclaration's symbol table
scopesym = ed;
}
for (size_t i = 0; i < ed.members.dim; i++)
{
EnumMember em = (*ed.members)[i].isEnumMember();
if (em)
{
em.ed = ed;
em.addMember(sc, scopesym);
}
}
}
for (size_t i = 0; i < ed.members.dim; i++)
{
EnumMember em = (*ed.members)[i].isEnumMember();
if (em)
em.dsymbolSemantic(em._scope);
}
//printf("defaultval = %lld\n", defaultval);
//if (defaultval) printf("defaultval: %s %s\n", defaultval.toChars(), defaultval.type.toChars());
//printf("members = %s\n", members.toChars());
}
override void visit(EnumMember em)
{
//printf("EnumMember::semantic() %s\n", toChars());
void errorReturn()
{
em.errors = true;
em.semanticRun = PASSsemanticdone;
}
if (em.errors || em.semanticRun >= PASSsemanticdone)
return;
if (em.semanticRun == PASSsemantic)
{
em.error("circular reference to enum member");
return errorReturn();
}
assert(em.ed);
em.ed.dsymbolSemantic(sc);
if (em.ed.errors)
return errorReturn();
if (em.errors || em.semanticRun >= PASSsemanticdone)
return;
if (em._scope)
sc = em._scope;
if (!sc)
return;
em.semanticRun = PASSsemantic;
em.protection = em.ed.isAnonymous() ? em.ed.protection : Prot(PROTpublic);
em.linkage = LINKd;
em.storage_class = STCmanifest;
em.userAttribDecl = em.ed.isAnonymous() ? em.ed.userAttribDecl : null;
// The first enum member is special
bool first = (em == (*em.ed.members)[0]);
if (em.origType)
{
em.origType = em.origType.typeSemantic(em.loc, sc);
em.type = em.origType;
assert(em.value); // "type id;" is not a valid enum member declaration
}
if (em.value)
{
Expression e = em.value;
assert(e.dyncast() == DYNCAST.expression);
e = e.expressionSemantic(sc);
e = resolveProperties(sc, e);
e = e.ctfeInterpret();
if (e.op == TOKerror)
return errorReturn();
if (first && !em.ed.memtype && !em.ed.isAnonymous())
{
em.ed.memtype = e.type;
if (em.ed.memtype.ty == Terror)
{
em.ed.errors = true;
return errorReturn();
}
if (em.ed.memtype.ty != Terror)
{
/* https://issues.dlang.org/show_bug.cgi?id=11746
* All of named enum members should have same type
* with the first member. If the following members were referenced
* during the first member semantic, their types should be unified.
*/
for (size_t i = 0; i < em.ed.members.dim; i++)
{
EnumMember enm = (*em.ed.members)[i].isEnumMember();
if (!enm || enm == em || enm.semanticRun < PASSsemanticdone || enm.origType)
continue;
//printf("[%d] em = %s, em.semanticRun = %d\n", i, toChars(), em.semanticRun);
Expression ev = enm.value;
ev = ev.implicitCastTo(sc, em.ed.memtype);
ev = ev.ctfeInterpret();
ev = ev.castTo(sc, em.ed.type);
if (ev.op == TOKerror)
em.ed.errors = true;
enm.value = ev;
}
if (em.ed.errors)
{
em.ed.memtype = Type.terror;
return errorReturn();
}
}
}
if (em.ed.memtype && !em.origType)
{
e = e.implicitCastTo(sc, em.ed.memtype);
e = e.ctfeInterpret();
// save origValue for better json output
em.origValue = e;
if (!em.ed.isAnonymous())
{
e = e.castTo(sc, em.ed.type);
e = e.ctfeInterpret();
}
}
else if (em.origType)
{
e = e.implicitCastTo(sc, em.origType);
e = e.ctfeInterpret();
assert(em.ed.isAnonymous());
// save origValue for better json output
em.origValue = e;
}
em.value = e;
}
else if (first)
{
Type t;
if (em.ed.memtype)
t = em.ed.memtype;
else
{
t = Type.tint32;
if (!em.ed.isAnonymous())
em.ed.memtype = t;
}
Expression e = new IntegerExp(em.loc, 0, Type.tint32);
e = e.implicitCastTo(sc, t);
e = e.ctfeInterpret();
// save origValue for better json output
em.origValue = e;
if (!em.ed.isAnonymous())
{
e = e.castTo(sc, em.ed.type);
e = e.ctfeInterpret();
}
em.value = e;
}
else
{
/* Find the previous enum member,
* and set this to be the previous value + 1
*/
EnumMember emprev = null;
for (size_t i = 0; i < em.ed.members.dim; i++)
{
EnumMember enm = (*em.ed.members)[i].isEnumMember();
if (enm)
{
if (enm == em)
break;
emprev = enm;
}
}
assert(emprev);
if (emprev.semanticRun < PASSsemanticdone) // if forward reference
emprev.dsymbolSemantic(emprev._scope); // resolve it
if (emprev.errors)
return errorReturn();
Expression eprev = emprev.value;
Type tprev = eprev.type.equals(em.ed.type) ? em.ed.memtype : eprev.type;
Expression emax = tprev.getProperty(em.ed.loc, Id.max, 0);
emax = emax.expressionSemantic(sc);
emax = emax.ctfeInterpret();
// Set value to (eprev + 1).
// But first check that (eprev != emax)
assert(eprev);
Expression e = new EqualExp(TOKequal, em.loc, eprev, emax);
e = e.expressionSemantic(sc);
e = e.ctfeInterpret();
if (e.toInteger())
{
em.error("initialization with `%s.%s+1` causes overflow for type `%s`",
emprev.ed.toChars(), emprev.toChars(), em.ed.memtype.toChars());
return errorReturn();
}
// Now set e to (eprev + 1)
e = new AddExp(em.loc, eprev, new IntegerExp(em.loc, 1, Type.tint32));
e = e.expressionSemantic(sc);
e = e.castTo(sc, eprev.type);
e = e.ctfeInterpret();
// save origValue (without cast) for better json output
if (e.op != TOKerror) // avoid duplicate diagnostics
{
assert(emprev.origValue);
em.origValue = new AddExp(em.loc, emprev.origValue, new IntegerExp(em.loc, 1, Type.tint32));
em.origValue = em.origValue.expressionSemantic(sc);
em.origValue = em.origValue.ctfeInterpret();
}
if (e.op == TOKerror)
return errorReturn();
if (e.type.isfloating())
{
// Check that e != eprev (not always true for floats)
Expression etest = new EqualExp(TOKequal, em.loc, e, eprev);
etest = etest.expressionSemantic(sc);
etest = etest.ctfeInterpret();
if (etest.toInteger())
{
em.error("has inexact value due to loss of precision");
return errorReturn();
}
}
em.value = e;
}
if (!em.origType)
em.type = em.value.type;
assert(em.origValue);
em.semanticRun = PASSsemanticdone;
}
override void visit(TemplateDeclaration tempdecl)
{
static if (LOG)
{
printf("TemplateDeclaration.dsymbolSemantic(this = %p, id = '%s')\n", this, tempdecl.ident.toChars());
printf("sc.stc = %llx\n", sc.stc);
printf("sc.module = %s\n", sc._module.toChars());
}
if (tempdecl.semanticRun != PASSinit)
return; // semantic() already run
// Remember templates defined in module object that we need to know about
if (sc._module && sc._module.ident == Id.object)
{
if (tempdecl.ident == Id.RTInfo)
Type.rtinfo = tempdecl;
}
/* Remember Scope for later instantiations, but make
* a copy since attributes can change.
*/
if (!tempdecl._scope)
{
tempdecl._scope = sc.copy();
tempdecl._scope.setNoFree();
}
tempdecl.semanticRun = PASSsemantic;
tempdecl.parent = sc.parent;
tempdecl.protection = sc.protection;
tempdecl.isstatic = tempdecl.toParent().isModule() || (tempdecl._scope.stc & STCstatic);
if (!tempdecl.isstatic)
{
if (auto ad = tempdecl.parent.pastMixin().isAggregateDeclaration())
ad.makeNested();
}
// Set up scope for parameters
auto paramsym = new ScopeDsymbol();
paramsym.parent = tempdecl.parent;
Scope* paramscope = sc.push(paramsym);
paramscope.stc = 0;
if (global.params.doDocComments)
{
tempdecl.origParameters = new TemplateParameters();
tempdecl.origParameters.setDim(tempdecl.parameters.dim);
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
TemplateParameter tp = (*tempdecl.parameters)[i];
(*tempdecl.origParameters)[i] = tp.syntaxCopy();
}
}
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
TemplateParameter tp = (*tempdecl.parameters)[i];
if (!tp.declareParameter(paramscope))
{
error(tp.loc, "parameter '%s' multiply defined", tp.ident.toChars());
tempdecl.errors = true;
}
if (!tp.tpsemantic(paramscope, tempdecl.parameters))
{
tempdecl.errors = true;
}
if (i + 1 != tempdecl.parameters.dim && tp.isTemplateTupleParameter())
{
tempdecl.error("template tuple parameter must be last one");
tempdecl.errors = true;
}
}
/* Calculate TemplateParameter.dependent
*/
TemplateParameters tparams;
tparams.setDim(1);
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
TemplateParameter tp = (*tempdecl.parameters)[i];
tparams[0] = tp;
for (size_t j = 0; j < tempdecl.parameters.dim; j++)
{
// Skip cases like: X(T : T)
if (i == j)
continue;
if (TemplateTypeParameter ttp = (*tempdecl.parameters)[j].isTemplateTypeParameter())
{
if (reliesOnTident(ttp.specType, &tparams))
tp.dependent = true;
}
else if (TemplateAliasParameter tap = (*tempdecl.parameters)[j].isTemplateAliasParameter())
{
if (reliesOnTident(tap.specType, &tparams) ||
reliesOnTident(isType(tap.specAlias), &tparams))
{
tp.dependent = true;
}
}
}
}
paramscope.pop();
// Compute again
tempdecl.onemember = null;
if (tempdecl.members)
{
Dsymbol s;
if (Dsymbol.oneMembers(tempdecl.members, &s, tempdecl.ident) && s)
{
tempdecl.onemember = s;
s.parent = tempdecl;
}
}
/* BUG: should check:
* o no virtual functions or non-static data members of classes
*/
tempdecl.semanticRun = PASSsemanticdone;
}
override void visit(TemplateInstance ti)
{
templateInstanceSemantic(ti, sc, null);
}
override void visit(TemplateMixin tm)
{
static if (LOG)
{
printf("+TemplateMixin.dsymbolSemantic('%s', this=%p)\n",tm.toChars(), tm);
fflush(stdout);
}
if (tm.semanticRun != PASSinit)
{
// When a class/struct contains mixin members, and is done over
// because of forward references, never reach here so semanticRun
// has been reset to PASSinit.
static if (LOG)
{
printf("\tsemantic done\n");
}
return;
}
tm.semanticRun = PASSsemantic;
static if (LOG)
{
printf("\tdo semantic\n");
}
Scope* scx = null;
if (tm._scope)
{
sc = tm._scope;
scx = tm._scope; // save so we don't make redundant copies
tm._scope = null;
}
/* Run semantic on each argument, place results in tiargs[],
* then find best match template with tiargs
*/
if (!tm.findTempDecl(sc) || !tm.semanticTiargs(sc) || !tm.findBestMatch(sc, null))
{
if (tm.semanticRun == PASSinit) // forward reference had occurred
{
//printf("forward reference - deferring\n");
tm._scope = scx ? scx : sc.copy();
tm._scope.setNoFree();
tm._scope._module.addDeferredSemantic(tm);
return;
}
tm.inst = tm;
tm.errors = true;
return; // error recovery
}
auto tempdecl = tm.tempdecl.isTemplateDeclaration();
assert(tempdecl);
if (!tm.ident)
{
/* Assign scope local unique identifier, as same as lambdas.
*/
const(char)* s = "__mixin";
DsymbolTable symtab;
if (FuncDeclaration func = sc.parent.isFuncDeclaration())
{
tm.symtab = func.localsymtab;
if (tm.symtab)
{
// Inside template constraint, symtab is not set yet.
goto L1;
}
}
else
{
tm.symtab = sc.parent.isScopeDsymbol().symtab;
L1:
assert(tm.symtab);
tm.ident = Identifier.generateId(s, tm.symtab.len + 1);
tm.symtab.insert(tm);
}
}
tm.inst = tm;
tm.parent = sc.parent;
/* Detect recursive mixin instantiations.
*/
for (Dsymbol s = tm.parent; s; s = s.parent)
{
//printf("\ts = '%s'\n", s.toChars());
TemplateMixin tmix = s.isTemplateMixin();
if (!tmix || tempdecl != tmix.tempdecl)
continue;
/* Different argument list lengths happen with variadic args
*/
if (tm.tiargs.dim != tmix.tiargs.dim)
continue;
for (size_t i = 0; i < tm.tiargs.dim; i++)
{
RootObject o = (*tm.tiargs)[i];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
RootObject tmo = (*tmix.tiargs)[i];
if (ta)
{
Type tmta = isType(tmo);
if (!tmta)
goto Lcontinue;
if (!ta.equals(tmta))
goto Lcontinue;
}
else if (ea)
{
Expression tme = isExpression(tmo);
if (!tme || !ea.equals(tme))
goto Lcontinue;
}
else if (sa)
{
Dsymbol tmsa = isDsymbol(tmo);
if (sa != tmsa)
goto Lcontinue;
}
else
assert(0);
}
tm.error("recursive mixin instantiation");
return;
Lcontinue:
continue;
}
// Copy the syntax trees from the TemplateDeclaration
tm.members = Dsymbol.arraySyntaxCopy(tempdecl.members);
if (!tm.members)
return;
tm.symtab = new DsymbolTable();
for (Scope* sce = sc; 1; sce = sce.enclosing)
{
ScopeDsymbol sds = sce.scopesym;
if (sds)
{
sds.importScope(tm, Prot(PROTpublic));
break;
}
}
static if (LOG)
{
printf("\tcreate scope for template parameters '%s'\n", tm.toChars());
}
Scope* scy = sc.push(tm);
scy.parent = tm;
tm.argsym = new ScopeDsymbol();
tm.argsym.parent = scy.parent;
Scope* argscope = scy.push(tm.argsym);
uint errorsave = global.errors;
// Declare each template parameter as an alias for the argument type
tm.declareParameters(argscope);
// Add members to enclosing scope, as well as this scope
for (size_t i = 0; i < tm.members.dim; i++)
{
Dsymbol s = (*tm.members)[i];
s.addMember(argscope, tm);
//printf("sc.parent = %p, sc.scopesym = %p\n", sc.parent, sc.scopesym);
//printf("s.parent = %s\n", s.parent.toChars());
}
// Do semantic() analysis on template instance members
static if (LOG)
{
printf("\tdo semantic() on template instance members '%s'\n", tm.toChars());
}
Scope* sc2 = argscope.push(tm);
//size_t deferred_dim = Module.deferred.dim;
static __gshared int nest;
//printf("%d\n", nest);
if (++nest > 500)
{
global.gag = 0; // ensure error message gets printed
tm.error("recursive expansion");
fatal();
}
for (size_t i = 0; i < tm.members.dim; i++)
{
Dsymbol s = (*tm.members)[i];
s.setScope(sc2);
}
for (size_t i = 0; i < tm.members.dim; i++)
{
Dsymbol s = (*tm.members)[i];
s.importAll(sc2);
}
for (size_t i = 0; i < tm.members.dim; i++)
{
Dsymbol s = (*tm.members)[i];
s.dsymbolSemantic(sc2);
}
nest--;
/* In DeclDefs scope, TemplateMixin does not have to handle deferred symbols.
* Because the members would already call Module.addDeferredSemantic() for themselves.
* See Struct, Class, Interface, and EnumDeclaration.dsymbolSemantic().
*/
//if (!sc.func && Module.deferred.dim > deferred_dim) {}
AggregateDeclaration ad = tm.toParent().isAggregateDeclaration();
if (sc.func && !ad)
{
tm.semantic2(sc2);
tm.semantic3(sc2);
}
// Give additional context info if error occurred during instantiation
if (global.errors != errorsave)
{
tm.error("error instantiating");
tm.errors = true;
}
sc2.pop();
argscope.pop();
scy.pop();
static if (LOG)
{
printf("-TemplateMixin.dsymbolSemantic('%s', this=%p)\n", tm.toChars(), tm);
}
}
override void visit(Nspace ns)
{
if (ns.semanticRun != PASSinit)
return;
static if (LOG)
{
printf("+Nspace::semantic('%s')\n", ns.toChars());
}
if (ns._scope)
{
sc = ns._scope;
ns._scope = null;
}
if (!sc)
return;
ns.semanticRun = PASSsemantic;
ns.parent = sc.parent;
if (ns.members)
{
assert(sc);
sc = sc.push(ns);
sc.linkage = LINKcpp; // note that namespaces imply C++ linkage
sc.parent = ns;
foreach (s; *ns.members)
{
s.importAll(sc);
}
foreach (s; *ns.members)
{
static if (LOG)
{
printf("\tmember '%s', kind = '%s'\n", s.toChars(), s.kind());
}
s.dsymbolSemantic(sc);
}
sc.pop();
}
ns.semanticRun = PASSsemanticdone;
static if (LOG)
{
printf("-Nspace::semantic('%s')\n", ns.toChars());
}
}
void funcDeclarationSemantic(FuncDeclaration funcdecl)
{
TypeFunction f;
AggregateDeclaration ad;
InterfaceDeclaration id;
version (none)
{
printf("FuncDeclaration::semantic(sc = %p, this = %p, '%s', linkage = %d)\n", sc, funcdecl, funcdecl.toPrettyChars(), sc.linkage);
if (funcdecl.isFuncLiteralDeclaration())
printf("\tFuncLiteralDeclaration()\n");
printf("sc.parent = %s, parent = %s\n", sc.parent.toChars(), funcdecl.parent ? funcdecl.parent.toChars() : "");
printf("type: %p, %s\n", funcdecl.type, funcdecl.type.toChars());
}
if (funcdecl.semanticRun != PASSinit && funcdecl.isFuncLiteralDeclaration())
{
/* Member functions that have return types that are
* forward references can have semantic() run more than
* once on them.
* See test\interface2.d, test20
*/
return;
}
if (funcdecl.semanticRun >= PASSsemanticdone)
return;
assert(funcdecl.semanticRun <= PASSsemantic);
funcdecl.semanticRun = PASSsemantic;
if (funcdecl._scope)
{
sc = funcdecl._scope;
funcdecl._scope = null;
}
if (!sc || funcdecl.errors)
return;
funcdecl.parent = sc.parent;
Dsymbol parent = funcdecl.toParent();
funcdecl.foverrides.setDim(0); // reset in case semantic() is being retried for this function
funcdecl.storage_class |= sc.stc & ~STCref;
ad = funcdecl.isThis();
// Don't nest structs b/c of generated methods which should not access the outer scopes.
// https://issues.dlang.org/show_bug.cgi?id=16627
if (ad && !funcdecl.generated)
{
funcdecl.storage_class |= ad.storage_class & (STC_TYPECTOR | STCsynchronized);
ad.makeNested();
}
if (sc.func)
funcdecl.storage_class |= sc.func.storage_class & STCdisable;
// Remove prefix storage classes silently.
if ((funcdecl.storage_class & STC_TYPECTOR) && !(ad || funcdecl.isNested()))
funcdecl.storage_class &= ~STC_TYPECTOR;
//printf("function storage_class = x%llx, sc.stc = x%llx, %x\n", storage_class, sc.stc, Declaration::isFinal());
FuncLiteralDeclaration fld = funcdecl.isFuncLiteralDeclaration();
if (fld && fld.treq)
{
Type treq = fld.treq;
assert(treq.nextOf().ty == Tfunction);
if (treq.ty == Tdelegate)
fld.tok = TOKdelegate;
else if (treq.ty == Tpointer && treq.nextOf().ty == Tfunction)
fld.tok = TOKfunction;
else
assert(0);
funcdecl.linkage = treq.nextOf().toTypeFunction().linkage;
}
else
funcdecl.linkage = sc.linkage;
funcdecl.inlining = sc.inlining;
funcdecl.protection = sc.protection;
funcdecl.userAttribDecl = sc.userAttribDecl;
if (!funcdecl.originalType)
funcdecl.originalType = funcdecl.type.syntaxCopy();
if (funcdecl.type.ty != Tfunction)
{
if (funcdecl.type.ty != Terror)
{
funcdecl.error("%s must be a function instead of %s", funcdecl.toChars(), funcdecl.type.toChars());
funcdecl.type = Type.terror;
}
funcdecl.errors = true;
return;
}
if (!funcdecl.type.deco)
{
sc = sc.push();
sc.stc |= funcdecl.storage_class & (STCdisable | STCdeprecated); // forward to function type
TypeFunction tf = funcdecl.type.toTypeFunction();
if (sc.func)
{
/* If the nesting parent is pure without inference,
* then this function defaults to pure too.
*
* auto foo() pure {
* auto bar() {} // become a weak purity function
* class C { // nested class
* auto baz() {} // become a weak purity function
* }
*
* static auto boo() {} // typed as impure
* // Even though, boo cannot call any impure functions.
* // See also Expression::checkPurity().
* }
*/
if (tf.purity == PUREimpure && (funcdecl.isNested() || funcdecl.isThis()))
{
FuncDeclaration fd = null;
for (Dsymbol p = funcdecl.toParent2(); p; p = p.toParent2())
{
if (AggregateDeclaration adx = p.isAggregateDeclaration())
{
if (adx.isNested())
continue;
break;
}
if ((fd = p.isFuncDeclaration()) !is null)
break;
}
/* If the parent's purity is inferred, then this function's purity needs
* to be inferred first.
*/
if (fd && fd.isPureBypassingInference() >= PUREweak && !funcdecl.isInstantiated())
{
tf.purity = PUREfwdref; // default to pure
}
}
}
if (tf.isref)
sc.stc |= STCref;
if (tf.isscope)
sc.stc |= STCscope;
if (tf.isnothrow)
sc.stc |= STCnothrow;
if (tf.isnogc)
sc.stc |= STCnogc;
if (tf.isproperty)
sc.stc |= STCproperty;
if (tf.purity == PUREfwdref)
sc.stc |= STCpure;
if (tf.trust != TRUSTdefault)
sc.stc &= ~(STCsafe | STCsystem | STCtrusted);
if (tf.trust == TRUSTsafe)
sc.stc |= STCsafe;
if (tf.trust == TRUSTsystem)
sc.stc |= STCsystem;
if (tf.trust == TRUSTtrusted)
sc.stc |= STCtrusted;
if (funcdecl.isCtorDeclaration())
{
sc.flags |= SCOPEctor;
Type tret = ad.handleType();
assert(tret);
tret = tret.addStorageClass(funcdecl.storage_class | sc.stc);
tret = tret.addMod(funcdecl.type.mod);
tf.next = tret;
if (ad.isStructDeclaration())
sc.stc |= STCref;
}
// 'return' on a non-static class member function implies 'scope' as well
if (ad && ad.isClassDeclaration() && (tf.isreturn || sc.stc & STCreturn) && !(sc.stc & STCstatic))
sc.stc |= STCscope;
// If 'this' has no pointers, remove 'scope' as it has no meaning
if (sc.stc & STCscope && ad && ad.isStructDeclaration() && !ad.type.hasPointers())
{
sc.stc &= ~STCscope;
tf.isscope = false;
}
sc.linkage = funcdecl.linkage;
if (!tf.isNaked() && !(funcdecl.isThis() || funcdecl.isNested()))
{
OutBuffer buf;
MODtoBuffer(&buf, tf.mod);
funcdecl.error("without 'this' cannot be %s", buf.peekString());
tf.mod = 0; // remove qualifiers
}
/* Apply const, immutable, wild and shared storage class
* to the function type. Do this before type semantic.
*/
auto stc = funcdecl.storage_class;
if (funcdecl.type.isImmutable())
stc |= STCimmutable;
if (funcdecl.type.isConst())
stc |= STCconst;
if (funcdecl.type.isShared() || funcdecl.storage_class & STCsynchronized)
stc |= STCshared;
if (funcdecl.type.isWild())
stc |= STCwild;
funcdecl.type = funcdecl.type.addSTC(stc);
funcdecl.type = funcdecl.type.typeSemantic(funcdecl.loc, sc);
sc = sc.pop();
}
if (funcdecl.type.ty != Tfunction)
{
if (funcdecl.type.ty != Terror)
{
funcdecl.error("%s must be a function instead of %s", funcdecl.toChars(), funcdecl.type.toChars());
funcdecl.type = Type.terror;
}
funcdecl.errors = true;
return;
}
else
{
// Merge back function attributes into 'originalType'.
// It's used for mangling, ddoc, and json output.
TypeFunction tfo = funcdecl.originalType.toTypeFunction();
TypeFunction tfx = funcdecl.type.toTypeFunction();
tfo.mod = tfx.mod;
tfo.isscope = tfx.isscope;
tfo.isscopeinferred = tfx.isscopeinferred;
tfo.isref = tfx.isref;
tfo.isnothrow = tfx.isnothrow;
tfo.isnogc = tfx.isnogc;
tfo.isproperty = tfx.isproperty;
tfo.purity = tfx.purity;
tfo.trust = tfx.trust;
funcdecl.storage_class &= ~(STC_TYPECTOR | STC_FUNCATTR);
}
f = cast(TypeFunction)funcdecl.type;
size_t nparams = Parameter.dim(f.parameters);
if ((funcdecl.storage_class & STCauto) && !f.isref && !funcdecl.inferRetType)
funcdecl.error("storage class 'auto' has no effect if return type is not inferred");
/* Functions can only be 'scope' if they have a 'this'
*/
if (f.isscope && !funcdecl.isNested() && !ad)
{
funcdecl.error("functions cannot be scope");
}
if (f.isreturn && !funcdecl.needThis() && !funcdecl.isNested())
{
/* Non-static nested functions have a hidden 'this' pointer to which
* the 'return' applies
*/
funcdecl.error("static member has no 'this' to which 'return' can apply");
}
if (funcdecl.isAbstract() && !funcdecl.isVirtual())
{
const(char)* sfunc;
if (funcdecl.isStatic())
sfunc = "static";
else if (funcdecl.protection.kind == PROTprivate || funcdecl.protection.kind == PROTpackage)
sfunc = protectionToChars(funcdecl.protection.kind);
else
sfunc = "non-virtual";
funcdecl.error("%s functions cannot be abstract", sfunc);
}
if (funcdecl.isOverride() && !funcdecl.isVirtual())
{
PROTKIND kind = funcdecl.prot().kind;
if ((kind == PROTprivate || kind == PROTpackage) && funcdecl.isMember())
funcdecl.error("%s method is not virtual and cannot override", protectionToChars(kind));
else
funcdecl.error("cannot override a non-virtual function");
}
if (funcdecl.isAbstract() && funcdecl.isFinalFunc())
funcdecl.error("cannot be both final and abstract");
version (none)
{
if (funcdecl.isAbstract() && funcdecl.fbody)
funcdecl.error("abstract functions cannot have bodies");
}
version (none)
{
if (funcdecl.isStaticConstructor() || funcdecl.isStaticDestructor())
{
if (!funcdecl.isStatic() || funcdecl.type.nextOf().ty != Tvoid)
funcdecl.error("static constructors / destructors must be static void");
if (f.arguments && f.arguments.dim)
funcdecl.error("static constructors / destructors must have empty parameter list");
// BUG: check for invalid storage classes
}
}
id = parent.isInterfaceDeclaration();
if (id)
{
funcdecl.storage_class |= STCabstract;
if (funcdecl.isCtorDeclaration() || funcdecl.isPostBlitDeclaration() || funcdecl.isDtorDeclaration() || funcdecl.isInvariantDeclaration() || funcdecl.isNewDeclaration() || funcdecl.isDelete())
funcdecl.error("constructors, destructors, postblits, invariants, new and delete functions are not allowed in interface %s", id.toChars());
if (funcdecl.fbody && funcdecl.isVirtual())
funcdecl.error("function body only allowed in final functions in interface %s", id.toChars());
}
if (UnionDeclaration ud = parent.isUnionDeclaration())
{
if (funcdecl.isPostBlitDeclaration() || funcdecl.isDtorDeclaration() || funcdecl.isInvariantDeclaration())
funcdecl.error("destructors, postblits and invariants are not allowed in union %s", ud.toChars());
}
/* Contracts can only appear without a body when they are virtual interface functions
*/
if (!funcdecl.fbody && (funcdecl.fensure || funcdecl.frequire) && !(id && funcdecl.isVirtual()))
funcdecl.error("in and out contracts require function body");
if (StructDeclaration sd = parent.isStructDeclaration())
{
if (funcdecl.isCtorDeclaration())
{
goto Ldone;
}
}
if (ClassDeclaration cd = parent.isClassDeclaration())
{
if (funcdecl.isCtorDeclaration())
{
goto Ldone;
}
if (funcdecl.storage_class & STCabstract)
cd.isabstract = ABSyes;
// if static function, do not put in vtbl[]
if (!funcdecl.isVirtual())
{
//printf("\tnot virtual\n");
goto Ldone;
}
// Suppress further errors if the return type is an error
if (funcdecl.type.nextOf() == Type.terror)
goto Ldone;
bool may_override = false;
for (size_t i = 0; i < cd.baseclasses.dim; i++)
{
BaseClass* b = (*cd.baseclasses)[i];
ClassDeclaration cbd = b.type.toBasetype().isClassHandle();
if (!cbd)
continue;
for (size_t j = 0; j < cbd.vtbl.dim; j++)
{
FuncDeclaration f2 = cbd.vtbl[j].isFuncDeclaration();
if (!f2 || f2.ident != funcdecl.ident)
continue;
if (cbd.parent && cbd.parent.isTemplateInstance())
{
if (!f2.functionSemantic())
goto Ldone;
}
may_override = true;
}
}
if (may_override && funcdecl.type.nextOf() is null)
{
/* If same name function exists in base class but 'this' is auto return,
* cannot find index of base class's vtbl[] to override.
*/
funcdecl.error("return type inference is not supported if may override base class function");
}
/* Find index of existing function in base class's vtbl[] to override
* (the index will be the same as in cd's current vtbl[])
*/
int vi = cd.baseClass ? funcdecl.findVtblIndex(&cd.baseClass.vtbl, cast(int)cd.baseClass.vtbl.dim) : -1;
bool doesoverride = false;
switch (vi)
{
case -1:
Lintro:
/* Didn't find one, so
* This is an 'introducing' function which gets a new
* slot in the vtbl[].
*/
// Verify this doesn't override previous final function
if (cd.baseClass)
{
Dsymbol s = cd.baseClass.search(funcdecl.loc, funcdecl.ident);
if (s)
{
FuncDeclaration f2 = s.isFuncDeclaration();
if (f2)
{
f2 = f2.overloadExactMatch(funcdecl.type);
if (f2 && f2.isFinalFunc() && f2.prot().kind != PROTprivate)
funcdecl.error("cannot override final function %s", f2.toPrettyChars());
}
}
}
/* These quirky conditions mimic what VC++ appears to do
*/
if (global.params.mscoff && cd.cpp &&
cd.baseClass && cd.baseClass.vtbl.dim)
{
/* if overriding an interface function, then this is not
* introducing and don't put it in the class vtbl[]
*/
funcdecl.interfaceVirtual = funcdecl.overrideInterface();
if (funcdecl.interfaceVirtual)
{
//printf("\tinterface function %s\n", toChars());
cd.vtblFinal.push(funcdecl);
goto Linterfaces;
}
}
if (funcdecl.isFinalFunc())
{
// Don't check here, as it may override an interface function
//if (isOverride())
// error("is marked as override, but does not override any function");
cd.vtblFinal.push(funcdecl);
}
else
{
//printf("\tintroducing function %s\n", toChars());
funcdecl.introducing = 1;
if (cd.cpp && Target.reverseCppOverloads)
{
// with dmc, overloaded functions are grouped and in reverse order
funcdecl.vtblIndex = cast(int)cd.vtbl.dim;
for (size_t i = 0; i < cd.vtbl.dim; i++)
{
if (cd.vtbl[i].ident == funcdecl.ident && cd.vtbl[i].parent == parent)
{
funcdecl.vtblIndex = cast(int)i;
break;
}
}
// shift all existing functions back
for (size_t i = cd.vtbl.dim; i > funcdecl.vtblIndex; i--)
{
FuncDeclaration fd = cd.vtbl[i - 1].isFuncDeclaration();
assert(fd);
fd.vtblIndex++;
}
cd.vtbl.insert(funcdecl.vtblIndex, funcdecl);
}
else
{
// Append to end of vtbl[]
vi = cast(int)cd.vtbl.dim;
cd.vtbl.push(funcdecl);
funcdecl.vtblIndex = vi;
}
}
break;
case -2:
// can't determine because of forward references
funcdecl.errors = true;
return;
default:
{
FuncDeclaration fdv = cd.baseClass.vtbl[vi].isFuncDeclaration();
FuncDeclaration fdc = cd.vtbl[vi].isFuncDeclaration();
// This function is covariant with fdv
if (fdc == funcdecl)
{
doesoverride = true;
break;
}
if (fdc.toParent() == parent)
{
//printf("vi = %d,\tthis = %p %s %s @ [%s]\n\tfdc = %p %s %s @ [%s]\n\tfdv = %p %s %s @ [%s]\n",
// vi, this, this.toChars(), this.type.toChars(), this.loc.toChars(),
// fdc, fdc .toChars(), fdc .type.toChars(), fdc .loc.toChars(),
// fdv, fdv .toChars(), fdv .type.toChars(), fdv .loc.toChars());
// fdc overrides fdv exactly, then this introduces new function.
if (fdc.type.mod == fdv.type.mod && funcdecl.type.mod != fdv.type.mod)
goto Lintro;
}
// This function overrides fdv
if (fdv.isFinalFunc())
funcdecl.error("cannot override final function %s", fdv.toPrettyChars());
if (!funcdecl.isOverride())
{
if (fdv.isFuture())
{
deprecation(funcdecl.loc, "@future base class method %s is being overridden by %s; rename the latter", fdv.toPrettyChars(), funcdecl.toPrettyChars());
// Treat 'this' as an introducing function, giving it a separate hierarchy in the vtbl[]
goto Lintro;
}
else
{
int vi2 = funcdecl.findVtblIndex(&cd.baseClass.vtbl, cast(int)cd.baseClass.vtbl.dim, false);
if (vi2 < 0)
// https://issues.dlang.org/show_bug.cgi?id=17349
deprecation(funcdecl.loc, "cannot implicitly override base class method `%s` with `%s`; add `override` attribute", fdv.toPrettyChars(), funcdecl.toPrettyChars());
else
error(funcdecl.loc, "cannot implicitly override base class method %s with %s; add 'override' attribute", fdv.toPrettyChars(), funcdecl.toPrettyChars());
}
}
doesoverride = true;
if (fdc.toParent() == parent)
{
// If both are mixins, or both are not, then error.
// If either is not, the one that is not overrides the other.
bool thismixin = funcdecl.parent.isClassDeclaration() !is null;
bool fdcmixin = fdc.parent.isClassDeclaration() !is null;
if (thismixin == fdcmixin)
{
funcdecl.error("multiple overrides of same function");
}
else if (!thismixin) // fdc overrides fdv
{
// this doesn't override any function
break;
}
}
cd.vtbl[vi] = funcdecl;
funcdecl.vtblIndex = vi;
/* Remember which functions this overrides
*/
funcdecl.foverrides.push(fdv);
/* This works by whenever this function is called,
* it actually returns tintro, which gets dynamically
* cast to type. But we know that tintro is a base
* of type, so we could optimize it by not doing a
* dynamic cast, but just subtracting the isBaseOf()
* offset if the value is != null.
*/
if (fdv.tintro)
funcdecl.tintro = fdv.tintro;
else if (!funcdecl.type.equals(fdv.type))
{
/* Only need to have a tintro if the vptr
* offsets differ
*/
int offset;
if (fdv.type.nextOf().isBaseOf(funcdecl.type.nextOf(), &offset))
{
funcdecl.tintro = fdv.type;
}
}
break;
}
}
/* Go through all the interface bases.
* If this function is covariant with any members of those interface
* functions, set the tintro.
*/
Linterfaces:
foreach (b; cd.interfaces)
{
vi = funcdecl.findVtblIndex(&b.sym.vtbl, cast(int)b.sym.vtbl.dim);
switch (vi)
{
case -1:
break;
case -2:
// can't determine because of forward references
funcdecl.errors = true;
return;
default:
{
auto fdv = cast(FuncDeclaration)b.sym.vtbl[vi];
Type ti = null;
/* Remember which functions this overrides
*/
funcdecl.foverrides.push(fdv);
/* Should we really require 'override' when implementing
* an interface function?
*/
//if (!isOverride())
// warning(loc, "overrides base class function %s, but is not marked with 'override'", fdv.toPrettyChars());
if (fdv.tintro)
ti = fdv.tintro;
else if (!funcdecl.type.equals(fdv.type))
{
/* Only need to have a tintro if the vptr
* offsets differ
*/
int offset;
if (fdv.type.nextOf().isBaseOf(funcdecl.type.nextOf(), &offset))
{
ti = fdv.type;
}
}
if (ti)
{
if (funcdecl.tintro)
{
if (!funcdecl.tintro.nextOf().equals(ti.nextOf()) && !funcdecl.tintro.nextOf().isBaseOf(ti.nextOf(), null) && !ti.nextOf().isBaseOf(funcdecl.tintro.nextOf(), null))
{
funcdecl.error("incompatible covariant types %s and %s", funcdecl.tintro.toChars(), ti.toChars());
}
}
funcdecl.tintro = ti;
}
goto L2;
}
}
}
if (!doesoverride && funcdecl.isOverride() && (funcdecl.type.nextOf() || !may_override))
{
BaseClass* bc = null;
Dsymbol s = null;
for (size_t i = 0; i < cd.baseclasses.dim; i++)
{
bc = (*cd.baseclasses)[i];
s = bc.sym.search_correct(funcdecl.ident);
if (s)
break;
}
if (s)
funcdecl.error("does not override any function, did you mean to override '%s%s'?",
bc.sym.isCPPclass() ? "extern (C++) ".ptr : "".ptr, s.toPrettyChars());
else
funcdecl.error("does not override any function");
}
L2:
/* Go through all the interface bases.
* Disallow overriding any final functions in the interface(s).
*/
foreach (b; cd.interfaces)
{
if (b.sym)
{
Dsymbol s = search_function(b.sym, funcdecl.ident);
if (s)
{
FuncDeclaration f2 = s.isFuncDeclaration();
if (f2)
{
f2 = f2.overloadExactMatch(funcdecl.type);
if (f2 && f2.isFinalFunc() && f2.prot().kind != PROTprivate)
funcdecl.error("cannot override final function %s.%s", b.sym.toChars(), f2.toPrettyChars());
}
}
}
}
if (funcdecl.isOverride)
{
if (funcdecl.storage_class & STCdisable)
funcdecl.deprecation("overridden functions cannot be annotated @disable");
if (funcdecl.isDeprecated)
funcdecl.deprecation("deprecated functions cannot be annotated @disable");
}
}
else if (funcdecl.isOverride() && !parent.isTemplateInstance())
funcdecl.error("override only applies to class member functions");
// Reflect this.type to f because it could be changed by findVtblIndex
f = funcdecl.type.toTypeFunction();
/* Do not allow template instances to add virtual functions
* to a class.
*/
if (funcdecl.isVirtual())
{
TemplateInstance ti = parent.isTemplateInstance();
if (ti)
{
// Take care of nested templates
while (1)
{
TemplateInstance ti2 = ti.tempdecl.parent.isTemplateInstance();
if (!ti2)
break;
ti = ti2;
}
// If it's a member template
ClassDeclaration cd = ti.tempdecl.isClassMember();
if (cd)
{
funcdecl.error("cannot use template to add virtual function to class '%s'", cd.toChars());
}
}
}
if (funcdecl.isMain())
funcdecl.checkDmain(); // Check main() parameters and return type
Ldone:
/* Purity and safety can be inferred for some functions by examining
* the function body.
*/
if (funcdecl.canInferAttributes(sc))
funcdecl.initInferAttributes();
Module.dprogress++;
funcdecl.semanticRun = PASSsemanticdone;
/* Save scope for possible later use (if we need the
* function internals)
*/
funcdecl._scope = sc.copy();
funcdecl._scope.setNoFree();
static __gshared bool printedMain = false; // semantic might run more than once
if (global.params.verbose && !printedMain)
{
const(char)* type = funcdecl.isMain() ? "main" : funcdecl.isWinMain() ? "winmain" : funcdecl.isDllMain() ? "dllmain" : cast(const(char)*)null;
Module mod = sc._module;
if (type && mod)
{
printedMain = true;
const(char)* name = FileName.searchPath(global.path, mod.srcfile.toChars(), true);
fprintf(global.stdmsg, "entry %-10s\t%s\n", type, name);
}
}
if (funcdecl.fbody && funcdecl.isMain() && sc._module.isRoot())
genCmain(sc);
assert(funcdecl.type.ty != Terror || funcdecl.errors);
}
/// Do the semantic analysis on the external interface to the function.
override void visit(FuncDeclaration funcdecl)
{
funcDeclarationSemantic(funcdecl);
}
override void visit(CtorDeclaration ctd)
{
//printf("CtorDeclaration::semantic() %s\n", toChars());
if (ctd.semanticRun >= PASSsemanticdone)
return;
if (ctd._scope)
{
sc = ctd._scope;
ctd._scope = null;
}
ctd.parent = sc.parent;
Dsymbol p = ctd.toParent2();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
error(ctd.loc, "constructor can only be a member of aggregate, not %s %s", p.kind(), p.toChars());
ctd.type = Type.terror;
ctd.errors = true;
return;
}
sc = sc.push();
sc.stc &= ~STCstatic; // not a static constructor
sc.flags |= SCOPEctor;
funcDeclarationSemantic(ctd);
sc.pop();
if (ctd.errors)
return;
TypeFunction tf = ctd.type.toTypeFunction();
/* See if it's the default constructor
* But, template constructor should not become a default constructor.
*/
if (ad && (!ctd.parent.isTemplateInstance() || ctd.parent.isTemplateMixin()))
{
immutable dim = Parameter.dim(tf.parameters);
if (auto sd = ad.isStructDeclaration())
{
if (dim == 0 && tf.varargs == 0) // empty default ctor w/o any varargs
{
if (ctd.fbody || !(ctd.storage_class & STCdisable))
{
ctd.error("default constructor for structs only allowed " ~
"with @disable, no body, and no parameters");
ctd.storage_class |= STCdisable;
ctd.fbody = null;
}
sd.noDefaultCtor = true;
}
else if (dim == 0 && tf.varargs) // allow varargs only ctor
{
}
else if (dim && Parameter.getNth(tf.parameters, 0).defaultArg)
{
// if the first parameter has a default argument, then the rest does as well
if (ctd.storage_class & STCdisable)
{
ctd.deprecation("@disable'd constructor cannot have default "~
"arguments for all parameters.");
deprecationSupplemental(ctd.loc, "Use @disable this(); if you want to disable default initialization.");
}
else
ctd.deprecation("all parameters have default arguments, "~
"but structs cannot have default constructors.");
}
}
else if (dim == 0 && tf.varargs == 0)
{
ad.defaultCtor = ctd;
}
}
}
override void visit(PostBlitDeclaration pbd)
{
//printf("PostBlitDeclaration::semantic() %s\n", toChars());
//printf("ident: %s, %s, %p, %p\n", ident.toChars(), Id::dtor.toChars(), ident, Id::dtor);
//printf("stc = x%llx\n", sc.stc);
if (pbd.semanticRun >= PASSsemanticdone)
return;
if (pbd._scope)
{
sc = pbd._scope;
pbd._scope = null;
}
pbd.parent = sc.parent;
Dsymbol p = pbd.toParent2();
StructDeclaration ad = p.isStructDeclaration();
if (!ad)
{
error(pbd.loc, "postblit can only be a member of struct/union, not %s %s", p.kind(), p.toChars());
pbd.type = Type.terror;
pbd.errors = true;
return;
}
if (pbd.ident == Id.postblit && pbd.semanticRun < PASSsemantic)
ad.postblits.push(pbd);
if (!pbd.type)
pbd.type = new TypeFunction(null, Type.tvoid, false, LINKd, pbd.storage_class);
sc = sc.push();
sc.stc &= ~STCstatic; // not static
sc.linkage = LINKd;
funcDeclarationSemantic(pbd);
sc.pop();
}
override void visit(DtorDeclaration dd)
{
//printf("DtorDeclaration::semantic() %s\n", toChars());
//printf("ident: %s, %s, %p, %p\n", ident.toChars(), Id::dtor.toChars(), ident, Id::dtor);
if (dd.semanticRun >= PASSsemanticdone)
return;
if (dd._scope)
{
sc = dd._scope;
dd._scope = null;
}
dd.parent = sc.parent;
Dsymbol p = dd.toParent2();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
error(dd.loc, "destructor can only be a member of aggregate, not %s %s", p.kind(), p.toChars());
dd.type = Type.terror;
dd.errors = true;
return;
}
if (dd.ident == Id.dtor && dd.semanticRun < PASSsemantic)
ad.dtors.push(dd);
if (!dd.type)
dd.type = new TypeFunction(null, Type.tvoid, false, LINKd, dd.storage_class);
sc = sc.push();
sc.stc &= ~STCstatic; // not a static destructor
if (sc.linkage != LINKcpp)
sc.linkage = LINKd;
funcDeclarationSemantic(dd);
sc.pop();
}
override void visit(StaticCtorDeclaration scd)
{
//printf("StaticCtorDeclaration::semantic()\n");
if (scd.semanticRun >= PASSsemanticdone)
return;
if (scd._scope)
{
sc = scd._scope;
scd._scope = null;
}
scd.parent = sc.parent;
Dsymbol p = scd.parent.pastMixin();
if (!p.isScopeDsymbol())
{
const(char)* s = (scd.isSharedStaticCtorDeclaration() ? "shared " : "");
error(scd.loc, "%sstatic constructor can only be member of module/aggregate/template, not %s %s", s, p.kind(), p.toChars());
scd.type = Type.terror;
scd.errors = true;
return;
}
if (!scd.type)
scd.type = new TypeFunction(null, Type.tvoid, false, LINKd, scd.storage_class);
/* If the static ctor appears within a template instantiation,
* it could get called multiple times by the module constructors
* for different modules. Thus, protect it with a gate.
*/
if (scd.isInstantiated() && scd.semanticRun < PASSsemantic)
{
/* Add this prefix to the function:
* static int gate;
* if (++gate != 1) return;
* Note that this is not thread safe; should not have threads
* during static construction.
*/
auto v = new VarDeclaration(Loc(), Type.tint32, Id.gate, null);
v.storage_class = STCtemp | (scd.isSharedStaticCtorDeclaration() ? STCstatic : STCtls);
auto sa = new Statements();
Statement s = new ExpStatement(Loc(), v);
sa.push(s);
Expression e = new IdentifierExp(Loc(), v.ident);
e = new AddAssignExp(Loc(), e, new IntegerExp(1));
e = new EqualExp(TOKnotequal, Loc(), e, new IntegerExp(1));
s = new IfStatement(Loc(), null, e, new ReturnStatement(Loc(), null), null, Loc());
sa.push(s);
if (scd.fbody)
sa.push(scd.fbody);
scd.fbody = new CompoundStatement(Loc(), sa);
}
funcDeclarationSemantic(scd);
// We're going to need ModuleInfo
Module m = scd.getModule();
if (!m)
m = sc._module;
if (m)
{
m.needmoduleinfo = 1;
//printf("module1 %s needs moduleinfo\n", m.toChars());
}
}
override void visit(StaticDtorDeclaration sdd)
{
if (sdd.semanticRun >= PASSsemanticdone)
return;
if (sdd._scope)
{
sc = sdd._scope;
sdd._scope = null;
}
sdd.parent = sc.parent;
Dsymbol p = sdd.parent.pastMixin();
if (!p.isScopeDsymbol())
{
const(char)* s = (sdd.isSharedStaticDtorDeclaration() ? "shared " : "");
error(sdd.loc, "%sstatic destructor can only be member of module/aggregate/template, not %s %s", s, p.kind(), p.toChars());
sdd.type = Type.terror;
sdd.errors = true;
return;
}
if (!sdd.type)
sdd.type = new TypeFunction(null, Type.tvoid, false, LINKd, sdd.storage_class);
/* If the static ctor appears within a template instantiation,
* it could get called multiple times by the module constructors
* for different modules. Thus, protect it with a gate.
*/
if (sdd.isInstantiated() && sdd.semanticRun < PASSsemantic)
{
/* Add this prefix to the function:
* static int gate;
* if (--gate != 0) return;
* Increment gate during constructor execution.
* Note that this is not thread safe; should not have threads
* during static destruction.
*/
auto v = new VarDeclaration(Loc(), Type.tint32, Id.gate, null);
v.storage_class = STCtemp | (sdd.isSharedStaticDtorDeclaration() ? STCstatic : STCtls);
auto sa = new Statements();
Statement s = new ExpStatement(Loc(), v);
sa.push(s);
Expression e = new IdentifierExp(Loc(), v.ident);
e = new AddAssignExp(Loc(), e, new IntegerExp(-1));
e = new EqualExp(TOKnotequal, Loc(), e, new IntegerExp(0));
s = new IfStatement(Loc(), null, e, new ReturnStatement(Loc(), null), null, Loc());
sa.push(s);
if (sdd.fbody)
sa.push(sdd.fbody);
sdd.fbody = new CompoundStatement(Loc(), sa);
sdd.vgate = v;
}
funcDeclarationSemantic(sdd);
// We're going to need ModuleInfo
Module m = sdd.getModule();
if (!m)
m = sc._module;
if (m)
{
m.needmoduleinfo = 1;
//printf("module2 %s needs moduleinfo\n", m.toChars());
}
}
override void visit(InvariantDeclaration invd)
{
if (invd.semanticRun >= PASSsemanticdone)
return;
if (invd._scope)
{
sc = invd._scope;
invd._scope = null;
}
invd.parent = sc.parent;
Dsymbol p = invd.parent.pastMixin();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
error(invd.loc, "invariant can only be a member of aggregate, not %s %s", p.kind(), p.toChars());
invd.type = Type.terror;
invd.errors = true;
return;
}
if (invd.ident != Id.classInvariant &&
invd.semanticRun < PASSsemantic &&
!ad.isUnionDeclaration() // users are on their own with union fields
)
ad.invs.push(invd);
if (!invd.type)
invd.type = new TypeFunction(null, Type.tvoid, false, LINKd, invd.storage_class);
sc = sc.push();
sc.stc &= ~STCstatic; // not a static invariant
sc.stc |= STCconst; // invariant() is always const
sc.flags = (sc.flags & ~SCOPEcontract) | SCOPEinvariant;
sc.linkage = LINKd;
funcDeclarationSemantic(invd);
sc.pop();
}
override void visit(UnitTestDeclaration utd)
{
// The identifier has to be generated here in order for it to be possible
// to link regardless of whether the files were compiled separately
// or all at once. See:
// https://issues.dlang.org/show_bug.cgi?id=16995
utd.setIdentifier();
if (utd.semanticRun >= PASSsemanticdone)
return;
if (utd._scope)
{
sc = utd._scope;
utd._scope = null;
}
utd.protection = sc.protection;
utd.parent = sc.parent;
Dsymbol p = utd.parent.pastMixin();
if (!p.isScopeDsymbol())
{
error(utd.loc, "unittest can only be a member of module/aggregate/template, not %s %s", p.kind(), p.toChars());
utd.type = Type.terror;
utd.errors = true;
return;
}
if (global.params.useUnitTests)
{
if (!utd.type)
utd.type = new TypeFunction(null, Type.tvoid, false, LINKd, utd.storage_class);
Scope* sc2 = sc.push();
sc2.linkage = LINKd;
funcDeclarationSemantic(utd);
sc2.pop();
}
version (none)
{
// We're going to need ModuleInfo even if the unit tests are not
// compiled in, because other modules may import this module and refer
// to this ModuleInfo.
// (This doesn't make sense to me?)
Module m = utd.getModule();
if (!m)
m = sc._module;
if (m)
{
//printf("module3 %s needs moduleinfo\n", m.toChars());
m.needmoduleinfo = 1;
}
}
}
override void visit(NewDeclaration nd)
{
//printf("NewDeclaration::semantic()\n");
if (nd.semanticRun >= PASSsemanticdone)
return;
if (nd._scope)
{
sc = nd._scope;
nd._scope = null;
}
nd.parent = sc.parent;
Dsymbol p = nd.parent.pastMixin();
if (!p.isAggregateDeclaration())
{
error(nd.loc, "allocator can only be a member of aggregate, not %s %s", p.kind(), p.toChars());
nd.type = Type.terror;
nd.errors = true;
return;
}
Type tret = Type.tvoid.pointerTo();
if (!nd.type)
nd.type = new TypeFunction(nd.parameters, tret, nd.varargs, LINKd, nd.storage_class);
nd.type = nd.type.typeSemantic(nd.loc, sc);
// Check that there is at least one argument of type size_t
TypeFunction tf = nd.type.toTypeFunction();
if (Parameter.dim(tf.parameters) < 1)
{
nd.error("at least one argument of type size_t expected");
}
else
{
Parameter fparam = Parameter.getNth(tf.parameters, 0);
if (!fparam.type.equals(Type.tsize_t))
nd.error("first argument must be type size_t, not %s", fparam.type.toChars());
}
funcDeclarationSemantic(nd);
}
override void visit(DeleteDeclaration deld)
{
//printf("DeleteDeclaration::semantic()\n");
if (deld.semanticRun >= PASSsemanticdone)
return;
if (deld._scope)
{
sc = deld._scope;
deld._scope = null;
}
deld.parent = sc.parent;
Dsymbol p = deld.parent.pastMixin();
if (!p.isAggregateDeclaration())
{
error(deld.loc, "deallocator can only be a member of aggregate, not %s %s", p.kind(), p.toChars());
deld.type = Type.terror;
deld.errors = true;
return;
}
if (!deld.type)
deld.type = new TypeFunction(deld.parameters, Type.tvoid, 0, LINKd, deld.storage_class);
deld.type = deld.type.typeSemantic(deld.loc, sc);
// Check that there is only one argument of type void*
TypeFunction tf = deld.type.toTypeFunction();
if (Parameter.dim(tf.parameters) != 1)
{
deld.error("one argument of type void* expected");
}
else
{
Parameter fparam = Parameter.getNth(tf.parameters, 0);
if (!fparam.type.equals(Type.tvoid.pointerTo()))
deld.error("one argument of type void* expected, not %s", fparam.type.toChars());
}
funcDeclarationSemantic(deld);
}
override void visit(StructDeclaration sd)
{
//printf("StructDeclaration::semantic(this=%p, '%s', sizeok = %d)\n", this, toPrettyChars(), sizeok);
//static int count; if (++count == 20) assert(0);
if (sd.semanticRun >= PASSsemanticdone)
return;
int errors = global.errors;
//printf("+StructDeclaration::semantic(this=%p, '%s', sizeok = %d)\n", this, toPrettyChars(), sizeok);
Scope* scx = null;
if (sd._scope)
{
sc = sd._scope;
scx = sd._scope; // save so we don't make redundant copies
sd._scope = null;
}
if (!sd.parent)
{
assert(sc.parent && sc.func);
sd.parent = sc.parent;
}
assert(sd.parent && !sd.isAnonymous());
if (sd.errors)
sd.type = Type.terror;
if (sd.semanticRun == PASSinit)
sd.type = sd.type.addSTC(sc.stc | sd.storage_class);
sd.type = sd.type.typeSemantic(sd.loc, sc);
if (sd.type.ty == Tstruct && (cast(TypeStruct)sd.type).sym != sd)
{
auto ti = (cast(TypeStruct)sd.type).sym.isInstantiated();
if (ti && isError(ti))
(cast(TypeStruct)sd.type).sym = sd;
}
// Ungag errors when not speculative
Ungag ungag = sd.ungagSpeculative();
if (sd.semanticRun == PASSinit)
{
sd.protection = sc.protection;
sd.alignment = sc.alignment();
sd.storage_class |= sc.stc;
if (sd.storage_class & STCdeprecated)
sd.isdeprecated = true;
if (sd.storage_class & STCabstract)
sd.error("structs, unions cannot be abstract");
sd.userAttribDecl = sc.userAttribDecl;
}
else if (sd.symtab && !scx)
return;
sd.semanticRun = PASSsemantic;
if (!sd.members) // if opaque declaration
{
sd.semanticRun = PASSsemanticdone;
return;
}
if (!sd.symtab)
{
sd.symtab = new DsymbolTable();
for (size_t i = 0; i < sd.members.dim; i++)
{
auto s = (*sd.members)[i];
//printf("adding member '%s' to '%s'\n", s.toChars(), this.toChars());
s.addMember(sc, sd);
}
}
auto sc2 = sd.newScope(sc);
/* Set scope so if there are forward references, we still might be able to
* resolve individual members like enums.
*/
for (size_t i = 0; i < sd.members.dim; i++)
{
auto s = (*sd.members)[i];
//printf("struct: setScope %s %s\n", s.kind(), s.toChars());
s.setScope(sc2);
}
for (size_t i = 0; i < sd.members.dim; i++)
{
auto s = (*sd.members)[i];
s.importAll(sc2);
}
for (size_t i = 0; i < sd.members.dim; i++)
{
auto s = (*sd.members)[i];
s.dsymbolSemantic(sc2);
sd.errors |= s.errors;
}
if (sd.errors)
sd.type = Type.terror;
if (!sd.determineFields())
{
if (sd.type.ty != Terror)
{
sd.error(sd.loc, "circular or forward reference");
sd.errors = true;
sd.type = Type.terror;
}
sc2.pop();
sd.semanticRun = PASSsemanticdone;
return;
}
/* Following special member functions creation needs semantic analysis
* completion of sub-structs in each field types. For example, buildDtor
* needs to check existence of elaborate dtor in type of each fields.
* See the case in compilable/test14838.d
*/
foreach (v; sd.fields)
{
Type tb = v.type.baseElemOf();
if (tb.ty != Tstruct)
continue;
auto sdec = (cast(TypeStruct)tb).sym;
if (sdec.semanticRun >= PASSsemanticdone)
continue;
sc2.pop();
sd._scope = scx ? scx : sc.copy();
sd._scope.setNoFree();
sd._scope._module.addDeferredSemantic(sd);
//printf("\tdeferring %s\n", toChars());
return;
}
/* Look for special member functions.
*/
sd.aggNew = cast(NewDeclaration)sd.search(Loc(), Id.classNew);
sd.aggDelete = cast(DeleteDeclaration)sd.search(Loc(), Id.classDelete);
// Look for the constructor
sd.ctor = sd.searchCtor();
sd.dtor = buildDtor(sd, sc2);
sd.postblit = buildPostBlit(sd, sc2);
buildOpAssign(sd, sc2);
buildOpEquals(sd, sc2);
sd.xeq = buildXopEquals(sd, sc2);
sd.xcmp = buildXopCmp(sd, sc2);
sd.xhash = buildXtoHash(sd, sc2);
sd.inv = buildInv(sd, sc2);
Module.dprogress++;
sd.semanticRun = PASSsemanticdone;
//printf("-StructDeclaration::semantic(this=%p, '%s')\n", this, toChars());
sc2.pop();
if (sd.ctor)
{
Dsymbol scall = sd.search(Loc(), Id.call);
if (scall)
{
uint xerrors = global.startGagging();
sc = sc.push();
sc.tinst = null;
sc.minst = null;
auto fcall = resolveFuncCall(sd.loc, sc, scall, null, null, null, 1);
sc = sc.pop();
global.endGagging(xerrors);
if (fcall && fcall.isStatic())
{
sd.error(fcall.loc, "static opCall is hidden by constructors and can never be called");
errorSupplemental(fcall.loc, "Please use a factory method instead, or replace all constructors with static opCall.");
}
}
}
if (global.errors != errors)
{
// The type is no good.
sd.type = Type.terror;
sd.errors = true;
if (sd.deferred)
sd.deferred.errors = true;
}
if (sd.deferred && !global.gag)
{
sd.deferred.semantic2(sc);
sd.deferred.semantic3(sc);
}
version (none)
{
if (sd.type.ty == Tstruct && (cast(TypeStruct)sd.type).sym != sd)
{
printf("this = %p %s\n", sd, sd.toChars());
printf("type = %d sym = %p\n", sd.type.ty, (cast(TypeStruct)sd.type).sym);
}
}
assert(sd.type.ty != Tstruct || (cast(TypeStruct)sd.type).sym == sd);
}
final void interfaceSemantic(ClassDeclaration cd)
{
cd.vtblInterfaces = new BaseClasses();
cd.vtblInterfaces.reserve(cd.interfaces.length);
foreach (b; cd.interfaces)
{
cd.vtblInterfaces.push(b);
b.copyBaseInterfaces(cd.vtblInterfaces);
}
}
override void visit(ClassDeclaration cldec)
{
//printf("ClassDeclaration.dsymbolSemantic(%s), type = %p, sizeok = %d, this = %p\n", toChars(), type, sizeok, this);
//printf("\tparent = %p, '%s'\n", sc.parent, sc.parent ? sc.parent.toChars() : "");
//printf("sc.stc = %x\n", sc.stc);
//{ static int n; if (++n == 20) *(char*)0=0; }
if (cldec.semanticRun >= PASSsemanticdone)
return;
int errors = global.errors;
//printf("+ClassDeclaration.dsymbolSemantic(%s), type = %p, sizeok = %d, this = %p\n", toChars(), type, sizeok, this);
Scope* scx = null;
if (cldec._scope)
{
sc = cldec._scope;
scx = cldec._scope; // save so we don't make redundant copies
cldec._scope = null;
}
if (!cldec.parent)
{
assert(sc.parent);
cldec.parent = sc.parent;
}
if (cldec.errors)
cldec.type = Type.terror;
cldec.type = cldec.type.typeSemantic(cldec.loc, sc);
if (cldec.type.ty == Tclass && (cast(TypeClass)cldec.type).sym != cldec)
{
auto ti = (cast(TypeClass)cldec.type).sym.isInstantiated();
if (ti && isError(ti))
(cast(TypeClass)cldec.type).sym = cldec;
}
// Ungag errors when not speculative
Ungag ungag = cldec.ungagSpeculative();
if (cldec.semanticRun == PASSinit)
{
cldec.protection = sc.protection;
cldec.storage_class |= sc.stc;
if (cldec.storage_class & STCdeprecated)
cldec.isdeprecated = true;
if (cldec.storage_class & STCauto)
cldec.error("storage class 'auto' is invalid when declaring a class, did you mean to use 'scope'?");
if (cldec.storage_class & STCscope)
cldec.isscope = true;
if (cldec.storage_class & STCabstract)
cldec.isabstract = ABSyes;
cldec.userAttribDecl = sc.userAttribDecl;
if (sc.linkage == LINKcpp)
cldec.cpp = true;
if (sc.linkage == LINKobjc)
objc.setObjc(cldec);
}
else if (cldec.symtab && !scx)
{
cldec.semanticRun = PASSsemanticdone;
return;
}
cldec.semanticRun = PASSsemantic;
if (cldec.baseok < BASEOKdone)
{
/* https://issues.dlang.org/show_bug.cgi?id=12078
* https://issues.dlang.org/show_bug.cgi?id=12143
* https://issues.dlang.org/show_bug.cgi?id=15733
* While resolving base classes and interfaces, a base may refer
* the member of this derived class. In that time, if all bases of
* this class can be determined, we can go forward the semantc process
* beyond the Lancestorsdone. To do the recursive semantic analysis,
* temporarily set and unset `_scope` around exp().
*/
T resolveBase(T)(lazy T exp)
{
if (!scx)
{
scx = sc.copy();
scx.setNoFree();
}
static if (!is(T == void))
{
cldec._scope = scx;
auto r = exp();
cldec._scope = null;
return r;
}
else
{
cldec._scope = scx;
exp();
cldec._scope = null;
}
}
cldec.baseok = BASEOKin;
// Expand any tuples in baseclasses[]
for (size_t i = 0; i < cldec.baseclasses.dim;)
{
auto b = (*cldec.baseclasses)[i];
b.type = resolveBase(b.type.typeSemantic(cldec.loc, sc));
Type tb = b.type.toBasetype();
if (tb.ty == Ttuple)
{
TypeTuple tup = cast(TypeTuple)tb;
cldec.baseclasses.remove(i);
size_t dim = Parameter.dim(tup.arguments);
for (size_t j = 0; j < dim; j++)
{
Parameter arg = Parameter.getNth(tup.arguments, j);
b = new BaseClass(arg.type);
cldec.baseclasses.insert(i + j, b);
}
}
else
i++;
}
if (cldec.baseok >= BASEOKdone)
{
//printf("%s already semantic analyzed, semanticRun = %d\n", toChars(), semanticRun);
if (cldec.semanticRun >= PASSsemanticdone)
return;
goto Lancestorsdone;
}
// See if there's a base class as first in baseclasses[]
if (cldec.baseclasses.dim)
{
BaseClass* b = (*cldec.baseclasses)[0];
Type tb = b.type.toBasetype();
TypeClass tc = (tb.ty == Tclass) ? cast(TypeClass)tb : null;
if (!tc)
{
if (b.type != Type.terror)
cldec.error("base type must be class or interface, not %s", b.type.toChars());
cldec.baseclasses.remove(0);
goto L7;
}
if (tc.sym.isDeprecated())
{
if (!cldec.isDeprecated())
{
// Deriving from deprecated class makes this one deprecated too
cldec.isdeprecated = true;
tc.checkDeprecated(cldec.loc, sc);
}
}
if (tc.sym.isInterfaceDeclaration())
goto L7;
for (ClassDeclaration cdb = tc.sym; cdb; cdb = cdb.baseClass)
{
if (cdb == cldec)
{
cldec.error("circular inheritance");
cldec.baseclasses.remove(0);
goto L7;
}
}
/* https://issues.dlang.org/show_bug.cgi?id=11034
* Class inheritance hierarchy
* and instance size of each classes are orthogonal information.
* Therefore, even if tc.sym.sizeof == SIZEOKnone,
* we need to set baseClass field for class covariance check.
*/
cldec.baseClass = tc.sym;
b.sym = cldec.baseClass;
if (tc.sym.baseok < BASEOKdone)
resolveBase(tc.sym.dsymbolSemantic(null)); // Try to resolve forward reference
if (tc.sym.baseok < BASEOKdone)
{
//printf("\ttry later, forward reference of base class %s\n", tc.sym.toChars());
if (tc.sym._scope)
tc.sym._scope._module.addDeferredSemantic(tc.sym);
cldec.baseok = BASEOKnone;
}
L7:
}
// Treat the remaining entries in baseclasses as interfaces
// Check for errors, handle forward references
for (size_t i = (cldec.baseClass ? 1 : 0); i < cldec.baseclasses.dim;)
{
BaseClass* b = (*cldec.baseclasses)[i];
Type tb = b.type.toBasetype();
TypeClass tc = (tb.ty == Tclass) ? cast(TypeClass)tb : null;
if (!tc || !tc.sym.isInterfaceDeclaration())
{
if (b.type != Type.terror)
cldec.error("base type must be interface, not %s", b.type.toChars());
cldec.baseclasses.remove(i);
continue;
}
// Check for duplicate interfaces
for (size_t j = (cldec.baseClass ? 1 : 0); j < i; j++)
{
BaseClass* b2 = (*cldec.baseclasses)[j];
if (b2.sym == tc.sym)
{
cldec.error("inherits from duplicate interface %s", b2.sym.toChars());
cldec.baseclasses.remove(i);
continue;
}
}
if (tc.sym.isDeprecated())
{
if (!cldec.isDeprecated())
{
// Deriving from deprecated class makes this one deprecated too
cldec.isdeprecated = true;
tc.checkDeprecated(cldec.loc, sc);
}
}
b.sym = tc.sym;
if (tc.sym.baseok < BASEOKdone)
resolveBase(tc.sym.dsymbolSemantic(null)); // Try to resolve forward reference
if (tc.sym.baseok < BASEOKdone)
{
//printf("\ttry later, forward reference of base %s\n", tc.sym.toChars());
if (tc.sym._scope)
tc.sym._scope._module.addDeferredSemantic(tc.sym);
cldec.baseok = BASEOKnone;
}
i++;
}
if (cldec.baseok == BASEOKnone)
{
// Forward referencee of one or more bases, try again later
cldec._scope = scx ? scx : sc.copy();
cldec._scope.setNoFree();
cldec._scope._module.addDeferredSemantic(cldec);
//printf("\tL%d semantic('%s') failed due to forward references\n", __LINE__, toChars());
return;
}
cldec.baseok = BASEOKdone;
// If no base class, and this is not an Object, use Object as base class
if (!cldec.baseClass && cldec.ident != Id.Object && !cldec.cpp)
{
void badObjectDotD()
{
cldec.error("missing or corrupt object.d");
fatal();
}
if (!cldec.object || cldec.object.errors)
badObjectDotD();
Type t = cldec.object.type;
t = t.typeSemantic(cldec.loc, sc).toBasetype();
if (t.ty == Terror)
badObjectDotD();
assert(t.ty == Tclass);
TypeClass tc = cast(TypeClass)t;
auto b = new BaseClass(tc);
cldec.baseclasses.shift(b);
cldec.baseClass = tc.sym;
assert(!cldec.baseClass.isInterfaceDeclaration());
b.sym = cldec.baseClass;
}
if (cldec.baseClass)
{
if (cldec.baseClass.storage_class & STCfinal)
cldec.error("cannot inherit from final class %s", cldec.baseClass.toChars());
// Inherit properties from base class
if (cldec.baseClass.isCOMclass())
cldec.com = true;
if (cldec.baseClass.isCPPclass())
cldec.cpp = true;
if (cldec.baseClass.isscope)
cldec.isscope = true;
cldec.enclosing = cldec.baseClass.enclosing;
cldec.storage_class |= cldec.baseClass.storage_class & STC_TYPECTOR;
}
cldec.interfaces = cldec.baseclasses.tdata()[(cldec.baseClass ? 1 : 0) .. cldec.baseclasses.dim];
foreach (b; cldec.interfaces)
{
// If this is an interface, and it derives from a COM interface,
// then this is a COM interface too.
if (b.sym.isCOMinterface())
cldec.com = true;
if (cldec.cpp && !b.sym.isCPPinterface())
{
error(cldec.loc, "C++ class '%s' cannot implement D interface '%s'",
cldec.toPrettyChars(), b.sym.toPrettyChars());
}
}
interfaceSemantic(cldec);
}
Lancestorsdone:
//printf("\tClassDeclaration.dsymbolSemantic(%s) baseok = %d\n", toChars(), baseok);
if (!cldec.members) // if opaque declaration
{
cldec.semanticRun = PASSsemanticdone;
return;
}
if (!cldec.symtab)
{
cldec.symtab = new DsymbolTable();
/* https://issues.dlang.org/show_bug.cgi?id=12152
* The semantic analysis of base classes should be finished
* before the members semantic analysis of this class, in order to determine
* vtbl in this class. However if a base class refers the member of this class,
* it can be resolved as a normal forward reference.
* Call addMember() and setScope() to make this class members visible from the base classes.
*/
for (size_t i = 0; i < cldec.members.dim; i++)
{
auto s = (*cldec.members)[i];
s.addMember(sc, cldec);
}
auto sc2 = cldec.newScope(sc);
/* Set scope so if there are forward references, we still might be able to
* resolve individual members like enums.
*/
for (size_t i = 0; i < cldec.members.dim; i++)
{
auto s = (*cldec.members)[i];
//printf("[%d] setScope %s %s, sc2 = %p\n", i, s.kind(), s.toChars(), sc2);
s.setScope(sc2);
}
sc2.pop();
}
for (size_t i = 0; i < cldec.baseclasses.dim; i++)
{
BaseClass* b = (*cldec.baseclasses)[i];
Type tb = b.type.toBasetype();
assert(tb.ty == Tclass);
TypeClass tc = cast(TypeClass)tb;
if (tc.sym.semanticRun < PASSsemanticdone)
{
// Forward referencee of one or more bases, try again later
cldec._scope = scx ? scx : sc.copy();
cldec._scope.setNoFree();
if (tc.sym._scope)
tc.sym._scope._module.addDeferredSemantic(tc.sym);
cldec._scope._module.addDeferredSemantic(cldec);
//printf("\tL%d semantic('%s') failed due to forward references\n", __LINE__, toChars());
return;
}
}
if (cldec.baseok == BASEOKdone)
{
cldec.baseok = BASEOKsemanticdone;
// initialize vtbl
if (cldec.baseClass)
{
if (cldec.cpp && cldec.baseClass.vtbl.dim == 0)
{
cldec.error("C++ base class %s needs at least one virtual function", cldec.baseClass.toChars());
}
// Copy vtbl[] from base class
cldec.vtbl.setDim(cldec.baseClass.vtbl.dim);
memcpy(cldec.vtbl.tdata(), cldec.baseClass.vtbl.tdata(), (void*).sizeof * cldec.vtbl.dim);
cldec.vthis = cldec.baseClass.vthis;
}
else
{
// No base class, so this is the root of the class hierarchy
cldec.vtbl.setDim(0);
if (cldec.vtblOffset())
cldec.vtbl.push(cldec); // leave room for classinfo as first member
}
/* If this is a nested class, add the hidden 'this'
* member which is a pointer to the enclosing scope.
*/
if (cldec.vthis) // if inheriting from nested class
{
// Use the base class's 'this' member
if (cldec.storage_class & STCstatic)
cldec.error("static class cannot inherit from nested class %s", cldec.baseClass.toChars());
if (cldec.toParent2() != cldec.baseClass.toParent2() &&
(!cldec.toParent2() ||
!cldec.baseClass.toParent2().getType() ||
!cldec.baseClass.toParent2().getType().isBaseOf(cldec.toParent2().getType(), null)))
{
if (cldec.toParent2())
{
cldec.error("is nested within %s, but super class %s is nested within %s",
cldec.toParent2().toChars(),
cldec.baseClass.toChars(),
cldec.baseClass.toParent2().toChars());
}
else
{
cldec.error("is not nested, but super class %s is nested within %s",
cldec.baseClass.toChars(),
cldec.baseClass.toParent2().toChars());
}
cldec.enclosing = null;
}
}
else
cldec.makeNested();
}
auto sc2 = cldec.newScope(sc);
for (size_t i = 0; i < cldec.members.dim; ++i)
{
auto s = (*cldec.members)[i];
s.importAll(sc2);
}
// Note that members.dim can grow due to tuple expansion during semantic()
for (size_t i = 0; i < cldec.members.dim; ++i)
{
auto s = (*cldec.members)[i];
s.dsymbolSemantic(sc2);
}
if (!cldec.determineFields())
{
assert(cldec.type == Type.terror);
sc2.pop();
return;
}
/* Following special member functions creation needs semantic analysis
* completion of sub-structs in each field types.
*/
foreach (v; cldec.fields)
{
Type tb = v.type.baseElemOf();
if (tb.ty != Tstruct)
continue;
auto sd = (cast(TypeStruct)tb).sym;
if (sd.semanticRun >= PASSsemanticdone)
continue;
sc2.pop();
cldec._scope = scx ? scx : sc.copy();
cldec._scope.setNoFree();
cldec._scope._module.addDeferredSemantic(cldec);
//printf("\tdeferring %s\n", toChars());
return;
}
/* Look for special member functions.
* They must be in this class, not in a base class.
*/
// Can be in base class
cldec.aggNew = cast(NewDeclaration)cldec.search(Loc(), Id.classNew);
cldec.aggDelete = cast(DeleteDeclaration)cldec.search(Loc(), Id.classDelete);
// Look for the constructor
cldec.ctor = cldec.searchCtor();
if (!cldec.ctor && cldec.noDefaultCtor)
{
// A class object is always created by constructor, so this check is legitimate.
foreach (v; cldec.fields)
{
if (v.storage_class & STCnodefaultctor)
error(v.loc, "field %s must be initialized in constructor", v.toChars());
}
}
// If this class has no constructor, but base class has a default
// ctor, create a constructor:
// this() { }
if (!cldec.ctor && cldec.baseClass && cldec.baseClass.ctor)
{
auto fd = resolveFuncCall(cldec.loc, sc2, cldec.baseClass.ctor, null, cldec.type, null, 1);
if (!fd) // try shared base ctor instead
fd = resolveFuncCall(cldec.loc, sc2, cldec.baseClass.ctor, null, cldec.type.sharedOf, null, 1);
if (fd && !fd.errors)
{
//printf("Creating default this(){} for class %s\n", toChars());
auto btf = fd.type.toTypeFunction();
auto tf = new TypeFunction(null, null, 0, LINKd, fd.storage_class);
tf.mod = btf.mod;
tf.purity = btf.purity;
tf.isnothrow = btf.isnothrow;
tf.isnogc = btf.isnogc;
tf.trust = btf.trust;
auto ctor = new CtorDeclaration(cldec.loc, Loc(), 0, tf);
ctor.fbody = new CompoundStatement(Loc(), new Statements());
cldec.members.push(ctor);
ctor.addMember(sc, cldec);
ctor.dsymbolSemantic(sc2);
cldec.ctor = ctor;
cldec.defaultCtor = ctor;
}
else
{
cldec.error("cannot implicitly generate a default ctor when base class %s is missing a default ctor",
cldec.baseClass.toPrettyChars());
}
}
cldec.dtor = buildDtor(cldec, sc2);
if (auto f = hasIdentityOpAssign(cldec, sc2))
{
if (!(f.storage_class & STCdisable))
cldec.error(f.loc, "identity assignment operator overload is illegal");
}
cldec.inv = buildInv(cldec, sc2);
Module.dprogress++;
cldec.semanticRun = PASSsemanticdone;
//printf("-ClassDeclaration.dsymbolSemantic(%s), type = %p\n", toChars(), type);
//members.print();
sc2.pop();
/* isAbstract() is undecidable in some cases because of circular dependencies.
* Now that semantic is finished, get a definitive result, and error if it is not the same.
*/
if (cldec.isabstract != ABSfwdref) // if evaluated it before completion
{
const isabstractsave = cldec.isabstract;
cldec.isabstract = ABSfwdref;
cldec.isAbstract(); // recalculate
if (cldec.isabstract != isabstractsave)
{
cldec.error("cannot infer `abstract` attribute due to circular dependencies");
}
}
if (cldec.type.ty == Tclass && (cast(TypeClass)cldec.type).sym != cldec)
{
// https://issues.dlang.org/show_bug.cgi?id=17492
ClassDeclaration cd = (cast(TypeClass)cldec.type).sym;
version (none)
{
printf("this = %p %s\n", cldec, cldec.toPrettyChars());
printf("type = %d sym = %p, %s\n", cldec.type.ty, cd, cd.toPrettyChars());
}
cldec.error("already exists at %s. Perhaps in another function with the same name?", cd.loc.toChars());
}
if (global.errors != errors)
{
// The type is no good.
cldec.type = Type.terror;
cldec.errors = true;
if (cldec.deferred)
cldec.deferred.errors = true;
}
// Verify fields of a synchronized class are not public
if (cldec.storage_class & STCsynchronized)
{
foreach (vd; cldec.fields)
{
if (!vd.isThisDeclaration() &&
!vd.prot().isMoreRestrictiveThan(Prot(PROTpublic)))
{
vd.error("Field members of a synchronized class cannot be %s",
protectionToChars(vd.prot().kind));
}
}
}
if (cldec.deferred && !global.gag)
{
cldec.deferred.semantic2(sc);
cldec.deferred.semantic3(sc);
}
//printf("-ClassDeclaration.dsymbolSemantic(%s), type = %p, sizeok = %d, this = %p\n", toChars(), type, sizeok, this);
}
override void visit(InterfaceDeclaration idec)
{
//printf("InterfaceDeclaration.dsymbolSemantic(%s), type = %p\n", toChars(), type);
if (idec.semanticRun >= PASSsemanticdone)
return;
int errors = global.errors;
//printf("+InterfaceDeclaration.dsymbolSemantic(%s), type = %p\n", toChars(), type);
Scope* scx = null;
if (idec._scope)
{
sc = idec._scope;
scx = idec._scope; // save so we don't make redundant copies
idec._scope = null;
}
if (!idec.parent)
{
assert(sc.parent && sc.func);
idec.parent = sc.parent;
}
assert(idec.parent && !idec.isAnonymous());
if (idec.errors)
idec.type = Type.terror;
idec.type = idec.type.typeSemantic(idec.loc, sc);
if (idec.type.ty == Tclass && (cast(TypeClass)idec.type).sym != idec)
{
auto ti = (cast(TypeClass)idec.type).sym.isInstantiated();
if (ti && isError(ti))
(cast(TypeClass)idec.type).sym = idec;
}
// Ungag errors when not speculative
Ungag ungag = idec.ungagSpeculative();
if (idec.semanticRun == PASSinit)
{
idec.protection = sc.protection;
idec.storage_class |= sc.stc;
if (idec.storage_class & STCdeprecated)
idec.isdeprecated = true;
idec.userAttribDecl = sc.userAttribDecl;
}
else if (idec.symtab)
{
if (idec.sizeok == SIZEOKdone || !scx)
{
idec.semanticRun = PASSsemanticdone;
return;
}
}
idec.semanticRun = PASSsemantic;
if (idec.baseok < BASEOKdone)
{
T resolveBase(T)(lazy T exp)
{
if (!scx)
{
scx = sc.copy();
scx.setNoFree();
}
static if (!is(T == void))
{
idec._scope = scx;
auto r = exp();
idec._scope = null;
return r;
}
else
{
idec._scope = scx;
exp();
idec._scope = null;
}
}
idec.baseok = BASEOKin;
// Expand any tuples in baseclasses[]
for (size_t i = 0; i < idec.baseclasses.dim;)
{
auto b = (*idec.baseclasses)[i];
b.type = resolveBase(b.type.typeSemantic(idec.loc, sc));
Type tb = b.type.toBasetype();
if (tb.ty == Ttuple)
{
TypeTuple tup = cast(TypeTuple)tb;
idec.baseclasses.remove(i);
size_t dim = Parameter.dim(tup.arguments);
for (size_t j = 0; j < dim; j++)
{
Parameter arg = Parameter.getNth(tup.arguments, j);
b = new BaseClass(arg.type);
idec.baseclasses.insert(i + j, b);
}
}
else
i++;
}
if (idec.baseok >= BASEOKdone)
{
//printf("%s already semantic analyzed, semanticRun = %d\n", toChars(), semanticRun);
if (idec.semanticRun >= PASSsemanticdone)
return;
goto Lancestorsdone;
}
if (!idec.baseclasses.dim && sc.linkage == LINKcpp)
idec.cpp = true;
if (sc.linkage == LINKobjc)
objc.setObjc(idec);
// Check for errors, handle forward references
for (size_t i = 0; i < idec.baseclasses.dim;)
{
BaseClass* b = (*idec.baseclasses)[i];
Type tb = b.type.toBasetype();
TypeClass tc = (tb.ty == Tclass) ? cast(TypeClass)tb : null;
if (!tc || !tc.sym.isInterfaceDeclaration())
{
if (b.type != Type.terror)
idec.error("base type must be interface, not %s", b.type.toChars());
idec.baseclasses.remove(i);
continue;
}
// Check for duplicate interfaces
for (size_t j = 0; j < i; j++)
{
BaseClass* b2 = (*idec.baseclasses)[j];
if (b2.sym == tc.sym)
{
idec.error("inherits from duplicate interface %s", b2.sym.toChars());
idec.baseclasses.remove(i);
continue;
}
}
if (tc.sym == idec || idec.isBaseOf2(tc.sym))
{
idec.error("circular inheritance of interface");
idec.baseclasses.remove(i);
continue;
}
if (tc.sym.isDeprecated())
{
if (!idec.isDeprecated())
{
// Deriving from deprecated class makes this one deprecated too
idec.isdeprecated = true;
tc.checkDeprecated(idec.loc, sc);
}
}
b.sym = tc.sym;
if (tc.sym.baseok < BASEOKdone)
resolveBase(tc.sym.dsymbolSemantic(null)); // Try to resolve forward reference
if (tc.sym.baseok < BASEOKdone)
{
//printf("\ttry later, forward reference of base %s\n", tc.sym.toChars());
if (tc.sym._scope)
tc.sym._scope._module.addDeferredSemantic(tc.sym);
idec.baseok = BASEOKnone;
}
i++;
}
if (idec.baseok == BASEOKnone)
{
// Forward referencee of one or more bases, try again later
idec._scope = scx ? scx : sc.copy();
idec._scope.setNoFree();
idec._scope._module.addDeferredSemantic(idec);
return;
}
idec.baseok = BASEOKdone;
idec.interfaces = idec.baseclasses.tdata()[0 .. idec.baseclasses.dim];
foreach (b; idec.interfaces)
{
// If this is an interface, and it derives from a COM interface,
// then this is a COM interface too.
if (b.sym.isCOMinterface())
idec.com = true;
if (b.sym.isCPPinterface())
idec.cpp = true;
}
interfaceSemantic(idec);
}
Lancestorsdone:
if (!idec.members) // if opaque declaration
{
idec.semanticRun = PASSsemanticdone;
return;
}
if (!idec.symtab)
idec.symtab = new DsymbolTable();
for (size_t i = 0; i < idec.baseclasses.dim; i++)
{
BaseClass* b = (*idec.baseclasses)[i];
Type tb = b.type.toBasetype();
assert(tb.ty == Tclass);
TypeClass tc = cast(TypeClass)tb;
if (tc.sym.semanticRun < PASSsemanticdone)
{
// Forward referencee of one or more bases, try again later
idec._scope = scx ? scx : sc.copy();
idec._scope.setNoFree();
if (tc.sym._scope)
tc.sym._scope._module.addDeferredSemantic(tc.sym);
idec._scope._module.addDeferredSemantic(idec);
return;
}
}
if (idec.baseok == BASEOKdone)
{
idec.baseok = BASEOKsemanticdone;
// initialize vtbl
if (idec.vtblOffset())
idec.vtbl.push(idec); // leave room at vtbl[0] for classinfo
// Cat together the vtbl[]'s from base interfaces
foreach (i, b; idec.interfaces)
{
// Skip if b has already appeared
for (size_t k = 0; k < i; k++)
{
if (b == idec.interfaces[k])
goto Lcontinue;
}
// Copy vtbl[] from base class
if (b.sym.vtblOffset())
{
size_t d = b.sym.vtbl.dim;
if (d > 1)
{
idec.vtbl.reserve(d - 1);
for (size_t j = 1; j < d; j++)
idec.vtbl.push(b.sym.vtbl[j]);
}
}
else
{
idec.vtbl.append(&b.sym.vtbl);
}
Lcontinue:
}
}
for (size_t i = 0; i < idec.members.dim; i++)
{
Dsymbol s = (*idec.members)[i];
s.addMember(sc, idec);
}
auto sc2 = idec.newScope(sc);
/* Set scope so if there are forward references, we still might be able to
* resolve individual members like enums.
*/
for (size_t i = 0; i < idec.members.dim; i++)
{
Dsymbol s = (*idec.members)[i];
//printf("setScope %s %s\n", s.kind(), s.toChars());
s.setScope(sc2);
}
for (size_t i = 0; i < idec.members.dim; i++)
{
Dsymbol s = (*idec.members)[i];
s.importAll(sc2);
}
for (size_t i = 0; i < idec.members.dim; i++)
{
Dsymbol s = (*idec.members)[i];
s.dsymbolSemantic(sc2);
}
Module.dprogress++;
idec.semanticRun = PASSsemanticdone;
//printf("-InterfaceDeclaration.dsymbolSemantic(%s), type = %p\n", toChars(), type);
//members.print();
sc2.pop();
if (global.errors != errors)
{
// The type is no good.
idec.type = Type.terror;
}
version (none)
{
if (type.ty == Tclass && (cast(TypeClass)idec.type).sym != idec)
{
printf("this = %p %s\n", idec, idec.toChars());
printf("type = %d sym = %p\n", idec.type.ty, (cast(TypeClass)idec.type).sym);
}
}
assert(idec.type.ty != Tclass || (cast(TypeClass)idec.type).sym == idec);
}
}
void templateInstanceSemantic(TemplateInstance tempinst, Scope* sc, Expressions* fargs)
{
//printf("[%s] TemplateInstance.dsymbolSemantic('%s', this=%p, gag = %d, sc = %p)\n", loc.toChars(), toChars(), this, global.gag, sc);
version (none)
{
for (Dsymbol s = tempinst; s; s = s.parent)
{
printf("\t%s\n", s.toChars());
}
printf("Scope\n");
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
printf("\t%s parent %s\n", scx._module ? scx._module.toChars() : "null", scx.parent ? scx.parent.toChars() : "null");
}
}
static if (LOG)
{
printf("\n+TemplateInstance.dsymbolSemantic('%s', this=%p)\n", tempinst.toChars(), tempinst);
}
if (tempinst.inst) // if semantic() was already run
{
static if (LOG)
{
printf("-TemplateInstance.dsymbolSemantic('%s', this=%p) already run\n", inst.toChars(), tempinst.inst);
}
return;
}
if (tempinst.semanticRun != PASSinit)
{
static if (LOG)
{
printf("Recursive template expansion\n");
}
auto ungag = Ungag(global.gag);
if (!tempinst.gagged)
global.gag = 0;
tempinst.error(tempinst.loc, "recursive template expansion");
if (tempinst.gagged)
tempinst.semanticRun = PASSinit;
else
tempinst.inst = tempinst;
tempinst.errors = true;
return;
}
// Get the enclosing template instance from the scope tinst
tempinst.tinst = sc.tinst;
// Get the instantiating module from the scope minst
tempinst.minst = sc.minst;
// https://issues.dlang.org/show_bug.cgi?id=10920
// If the enclosing function is non-root symbol,
// this instance should be speculative.
if (!tempinst.tinst && sc.func && sc.func.inNonRoot())
{
tempinst.minst = null;
}
tempinst.gagged = (global.gag > 0);
tempinst.semanticRun = PASSsemantic;
static if (LOG)
{
printf("\tdo semantic\n");
}
/* Find template declaration first,
* then run semantic on each argument (place results in tiargs[]),
* last find most specialized template from overload list/set.
*/
if (!tempinst.findTempDecl(sc, null) || !tempinst.semanticTiargs(sc) || !tempinst.findBestMatch(sc, fargs))
{
Lerror:
if (tempinst.gagged)
{
// https://issues.dlang.org/show_bug.cgi?id=13220
// Roll back status for later semantic re-running
tempinst.semanticRun = PASSinit;
}
else
tempinst.inst = tempinst;
tempinst.errors = true;
return;
}
TemplateDeclaration tempdecl = tempinst.tempdecl.isTemplateDeclaration();
assert(tempdecl);
// If tempdecl is a mixin, disallow it
if (tempdecl.ismixin)
{
tempinst.error("mixin templates are not regular templates");
goto Lerror;
}
tempinst.hasNestedArgs(tempinst.tiargs, tempdecl.isstatic);
if (tempinst.errors)
goto Lerror;
/* See if there is an existing TemplateInstantiation that already
* implements the typeargs. If so, just refer to that one instead.
*/
tempinst.inst = tempdecl.findExistingInstance(tempinst, fargs);
TemplateInstance errinst = null;
if (!tempinst.inst)
{
// So, we need to implement 'this' instance.
}
else if (tempinst.inst.gagged && !tempinst.gagged && tempinst.inst.errors)
{
// If the first instantiation had failed, re-run semantic,
// so that error messages are shown.
errinst = tempinst.inst;
}
else
{
// It's a match
tempinst.parent = tempinst.inst.parent;
tempinst.errors = tempinst.inst.errors;
// If both this and the previous instantiation were gagged,
// use the number of errors that happened last time.
global.errors += tempinst.errors;
global.gaggedErrors += tempinst.errors;
// If the first instantiation was gagged, but this is not:
if (tempinst.inst.gagged)
{
// It had succeeded, mark it is a non-gagged instantiation,
// and reuse it.
tempinst.inst.gagged = tempinst.gagged;
}
tempinst.tnext = tempinst.inst.tnext;
tempinst.inst.tnext = tempinst;
/* A module can have explicit template instance and its alias
* in module scope (e,g, `alias Base64 = Base64Impl!('+', '/');`).
* If the first instantiation 'inst' had happened in non-root module,
* compiler can assume that its instantiated code would be included
* in the separately compiled obj/lib file (e.g. phobos.lib).
*
* However, if 'this' second instantiation happened in root module,
* compiler might need to invoke its codegen
* (https://issues.dlang.org/show_bug.cgi?id=2500 & https://issues.dlang.org/show_bug.cgi?id=2644).
* But whole import graph is not determined until all semantic pass finished,
* so 'inst' should conservatively finish the semantic3 pass for the codegen.
*/
if (tempinst.minst && tempinst.minst.isRoot() && !(tempinst.inst.minst && tempinst.inst.minst.isRoot()))
{
/* Swap the position of 'inst' and 'this' in the instantiation graph.
* Then, the primary instance `inst` will be changed to a root instance.
*
* Before:
* non-root -> A!() -> B!()[inst] -> C!()
* |
* root -> D!() -> B!()[this]
*
* After:
* non-root -> A!() -> B!()[this]
* |
* root -> D!() -> B!()[inst] -> C!()
*/
Module mi = tempinst.minst;
TemplateInstance ti = tempinst.tinst;
tempinst.minst = tempinst.inst.minst;
tempinst.tinst = tempinst.inst.tinst;
tempinst.inst.minst = mi;
tempinst.inst.tinst = ti;
if (tempinst.minst) // if inst was not speculative
{
/* Add 'inst' once again to the root module members[], then the
* instance members will get codegen chances.
*/
tempinst.inst.appendToModuleMember();
}
}
static if (LOG)
{
printf("\tit's a match with instance %p, %d\n", tempinst.inst, tempinst.inst.semanticRun);
}
return;
}
static if (LOG)
{
printf("\timplement template instance %s '%s'\n", tempdecl.parent.toChars(), tempinst.toChars());
printf("\ttempdecl %s\n", tempdecl.toChars());
}
uint errorsave = global.errors;
tempinst.inst = tempinst;
tempinst.parent = tempinst.enclosing ? tempinst.enclosing : tempdecl.parent;
//printf("parent = '%s'\n", parent.kind());
TemplateInstance tempdecl_instance_idx = tempdecl.addInstance(tempinst);
//getIdent();
// Store the place we added it to in target_symbol_list(_idx) so we can
// remove it later if we encounter an error.
Dsymbols* target_symbol_list = tempinst.appendToModuleMember();
size_t target_symbol_list_idx = target_symbol_list ? target_symbol_list.dim - 1 : 0;
// Copy the syntax trees from the TemplateDeclaration
tempinst.members = Dsymbol.arraySyntaxCopy(tempdecl.members);
// resolve TemplateThisParameter
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
if ((*tempdecl.parameters)[i].isTemplateThisParameter() is null)
continue;
Type t = isType((*tempinst.tiargs)[i]);
assert(t);
if (StorageClass stc = ModToStc(t.mod))
{
//printf("t = %s, stc = x%llx\n", t.toChars(), stc);
auto s = new Dsymbols();
s.push(new StorageClassDeclaration(stc, tempinst.members));
tempinst.members = s;
}
break;
}
// Create our own scope for the template parameters
Scope* _scope = tempdecl._scope;
if (tempdecl.semanticRun == PASSinit)
{
tempinst.error("template instantiation %s forward references template declaration %s", tempinst.toChars(), tempdecl.toChars());
return;
}
static if (LOG)
{
printf("\tcreate scope for template parameters '%s'\n", tempinst.toChars());
}
tempinst.argsym = new ScopeDsymbol();
tempinst.argsym.parent = _scope.parent;
_scope = _scope.push(tempinst.argsym);
_scope.tinst = tempinst;
_scope.minst = tempinst.minst;
//scope.stc = 0;
// Declare each template parameter as an alias for the argument type
Scope* paramscope = _scope.push();
paramscope.stc = 0;
paramscope.protection = Prot(PROTpublic); // https://issues.dlang.org/show_bug.cgi?id=14169
// template parameters should be public
tempinst.declareParameters(paramscope);
paramscope.pop();
// Add members of template instance to template instance symbol table
//parent = scope.scopesym;
tempinst.symtab = new DsymbolTable();
for (size_t i = 0; i < tempinst.members.dim; i++)
{
Dsymbol s = (*tempinst.members)[i];
static if (LOG)
{
printf("\t[%d] adding member '%s' %p kind %s to '%s'\n", i, s.toChars(), s, s.kind(), tempinst.toChars());
}
s.addMember(_scope, tempinst);
}
static if (LOG)
{
printf("adding members done\n");
}
/* See if there is only one member of template instance, and that
* member has the same name as the template instance.
* If so, this template instance becomes an alias for that member.
*/
//printf("members.dim = %d\n", members.dim);
if (tempinst.members.dim)
{
Dsymbol s;
if (Dsymbol.oneMembers(tempinst.members, &s, tempdecl.ident) && s)
{
//printf("tempdecl.ident = %s, s = '%s'\n", tempdecl.ident.toChars(), s.kind(), s.toPrettyChars());
//printf("setting aliasdecl\n");
tempinst.aliasdecl = s;
}
}
/* If function template declaration
*/
if (fargs && tempinst.aliasdecl)
{
FuncDeclaration fd = tempinst.aliasdecl.isFuncDeclaration();
if (fd)
{
/* Transmit fargs to type so that TypeFunction.dsymbolSemantic() can
* resolve any "auto ref" storage classes.
*/
TypeFunction tf = cast(TypeFunction)fd.type;
if (tf && tf.ty == Tfunction)
tf.fargs = fargs;
}
}
// Do semantic() analysis on template instance members
static if (LOG)
{
printf("\tdo semantic() on template instance members '%s'\n", tempinst.toChars());
}
Scope* sc2;
sc2 = _scope.push(tempinst);
//printf("enclosing = %d, sc.parent = %s\n", enclosing, sc.parent.toChars());
sc2.parent = tempinst;
sc2.tinst = tempinst;
sc2.minst = tempinst.minst;
tempinst.tryExpandMembers(sc2);
tempinst.semanticRun = PASSsemanticdone;
/* ConditionalDeclaration may introduce eponymous declaration,
* so we should find it once again after semantic.
*/
if (tempinst.members.dim)
{
Dsymbol s;
if (Dsymbol.oneMembers(tempinst.members, &s, tempdecl.ident) && s)
{
if (!tempinst.aliasdecl || tempinst.aliasdecl != s)
{
//printf("tempdecl.ident = %s, s = '%s'\n", tempdecl.ident.toChars(), s.kind(), s.toPrettyChars());
//printf("setting aliasdecl 2\n");
tempinst.aliasdecl = s;
}
}
}
if (global.errors != errorsave)
goto Laftersemantic;
/* If any of the instantiation members didn't get semantic() run
* on them due to forward references, we cannot run semantic2()
* or semantic3() yet.
*/
{
bool found_deferred_ad = false;
for (size_t i = 0; i < Module.deferred.dim; i++)
{
Dsymbol sd = Module.deferred[i];
AggregateDeclaration ad = sd.isAggregateDeclaration();
if (ad && ad.parent && ad.parent.isTemplateInstance())
{
//printf("deferred template aggregate: %s %s\n",
// sd.parent.toChars(), sd.toChars());
found_deferred_ad = true;
if (ad.parent == tempinst)
{
ad.deferred = tempinst;
break;
}
}
}
if (found_deferred_ad || Module.deferred.dim)
goto Laftersemantic;
}
/* The problem is when to parse the initializer for a variable.
* Perhaps VarDeclaration.dsymbolSemantic() should do it like it does
* for initializers inside a function.
*/
//if (sc.parent.isFuncDeclaration())
{
/* https://issues.dlang.org/show_bug.cgi?id=782
* this has problems if the classes this depends on
* are forward referenced. Find a way to defer semantic()
* on this template.
*/
tempinst.semantic2(sc2);
}
if (global.errors != errorsave)
goto Laftersemantic;
if ((sc.func || (sc.flags & SCOPEfullinst)) && !tempinst.tinst)
{
/* If a template is instantiated inside function, the whole instantiation
* should be done at that position. But, immediate running semantic3 of
* dependent templates may cause unresolved forward reference.
* https://issues.dlang.org/show_bug.cgi?id=9050
* To avoid the issue, don't run semantic3 until semantic and semantic2 done.
*/
TemplateInstances deferred;
tempinst.deferred = &deferred;
//printf("Run semantic3 on %s\n", toChars());
tempinst.trySemantic3(sc2);
for (size_t i = 0; i < deferred.dim; i++)
{
//printf("+ run deferred semantic3 on %s\n", deferred[i].toChars());
deferred[i].semantic3(null);
}
tempinst.deferred = null;
}
else if (tempinst.tinst)
{
bool doSemantic3 = false;
if (sc.func && tempinst.aliasdecl && tempinst.aliasdecl.toAlias().isFuncDeclaration())
{
/* Template function instantiation should run semantic3 immediately
* for attribute inference.
*/
doSemantic3 = true;
}
else if (sc.func)
{
/* A lambda function in template arguments might capture the
* instantiated scope context. For the correct context inference,
* all instantiated functions should run the semantic3 immediately.
* See also compilable/test14973.d
*/
foreach (oarg; tempinst.tdtypes)
{
auto s = getDsymbol(oarg);
if (!s)
continue;
if (auto td = s.isTemplateDeclaration())
{
if (!td.literal)
continue;
assert(td.members && td.members.dim == 1);
s = (*td.members)[0];
}
if (auto fld = s.isFuncLiteralDeclaration())
{
if (fld.tok == TOKreserved)
{
doSemantic3 = true;
break;
}
}
}
//printf("[%s] %s doSemantic3 = %d\n", loc.toChars(), toChars(), doSemantic3);
}
if (doSemantic3)
tempinst.trySemantic3(sc2);
TemplateInstance ti = tempinst.tinst;
int nest = 0;
while (ti && !ti.deferred && ti.tinst)
{
ti = ti.tinst;
if (++nest > 500)
{
global.gag = 0; // ensure error message gets printed
tempinst.error("recursive expansion");
fatal();
}
}
if (ti && ti.deferred)
{
//printf("deferred semantic3 of %p %s, ti = %s, ti.deferred = %p\n", this, toChars(), ti.toChars());
for (size_t i = 0;; i++)
{
if (i == ti.deferred.dim)
{
ti.deferred.push(tempinst);
break;
}
if ((*ti.deferred)[i] == tempinst)
break;
}
}
}
if (tempinst.aliasdecl)
{
/* https://issues.dlang.org/show_bug.cgi?id=13816
* AliasDeclaration tries to resolve forward reference
* twice (See inuse check in AliasDeclaration.toAlias()). It's
* necessary to resolve mutual references of instantiated symbols, but
* it will left a true recursive alias in tuple declaration - an
* AliasDeclaration A refers TupleDeclaration B, and B contains A
* in its elements. To correctly make it an error, we strictly need to
* resolve the alias of eponymous member.
*/
tempinst.aliasdecl = tempinst.aliasdecl.toAlias2();
}
Laftersemantic:
sc2.pop();
_scope.pop();
// Give additional context info if error occurred during instantiation
if (global.errors != errorsave)
{
if (!tempinst.errors)
{
if (!tempdecl.literal)
tempinst.error(tempinst.loc, "error instantiating");
if (tempinst.tinst)
tempinst.tinst.printInstantiationTrace();
}
tempinst.errors = true;
if (tempinst.gagged)
{
// Errors are gagged, so remove the template instance from the
// instance/symbol lists we added it to and reset our state to
// finish clean and so we can try to instantiate it again later
// (see https://issues.dlang.org/show_bug.cgi?id=4302 and https://issues.dlang.org/show_bug.cgi?id=6602).
tempdecl.removeInstance(tempdecl_instance_idx);
if (target_symbol_list)
{
// Because we added 'this' in the last position above, we
// should be able to remove it without messing other indices up.
assert((*target_symbol_list)[target_symbol_list_idx] == tempinst);
target_symbol_list.remove(target_symbol_list_idx);
tempinst.memberOf = null; // no longer a member
}
tempinst.semanticRun = PASSinit;
tempinst.inst = null;
tempinst.symtab = null;
}
}
else if (errinst)
{
/* https://issues.dlang.org/show_bug.cgi?id=14541
* If the previous gagged instance had failed by
* circular references, currrent "error reproduction instantiation"
* might succeed, because of the difference of instantiated context.
* On such case, the cached error instance needs to be overridden by the
* succeeded instance.
*/
//printf("replaceInstance()\n");
assert(errinst.errors);
auto ti1 = TemplateInstanceBox(errinst);
tempdecl.instances.remove(ti1);
auto ti2 = TemplateInstanceBox(tempinst);
tempdecl.instances[ti2] = tempinst;
}
static if (LOG)
{
printf("-TemplateInstance.dsymbolSemantic('%s', this=%p)\n", toChars(), this);
}
}
// function used to perform semantic on AliasDeclaration
void aliasSemantic(AliasDeclaration ds, Scope* sc)
{
//printf("AliasDeclaration::semantic() %s\n", toChars());
if (ds.aliassym)
{
auto fd = ds.aliassym.isFuncLiteralDeclaration();
auto td = ds.aliassym.isTemplateDeclaration();
if (fd || td && td.literal)
{
if (fd && fd.semanticRun >= PASSsemanticdone)
return;
Expression e = new FuncExp(ds.loc, ds.aliassym);
e = e.expressionSemantic(sc);
if (e.op == TOKfunction)
{
FuncExp fe = cast(FuncExp)e;
ds.aliassym = fe.td ? cast(Dsymbol)fe.td : fe.fd;
}
else
{
ds.aliassym = null;
ds.type = Type.terror;
}
return;
}
if (ds.aliassym.isTemplateInstance())
ds.aliassym.dsymbolSemantic(sc);
return;
}
ds.inuse = 1;
// Given:
// alias foo.bar.abc def;
// it is not knowable from the syntax whether this is an alias
// for a type or an alias for a symbol. It is up to the semantic()
// pass to distinguish.
// If it is a type, then type is set and getType() will return that
// type. If it is a symbol, then aliassym is set and type is NULL -
// toAlias() will return aliasssym.
uint errors = global.errors;
Type oldtype = ds.type;
// Ungag errors when not instantiated DeclDefs scope alias
auto ungag = Ungag(global.gag);
//printf("%s parent = %s, gag = %d, instantiated = %d\n", toChars(), parent, global.gag, isInstantiated());
if (ds.parent && global.gag && !ds.isInstantiated() && !ds.toParent2().isFuncDeclaration())
{
//printf("%s type = %s\n", toPrettyChars(), type.toChars());
global.gag = 0;
}
/* This section is needed because Type.resolve() will:
* const x = 3;
* alias y = x;
* try to convert identifier x to 3.
*/
auto s = ds.type.toDsymbol(sc);
if (errors != global.errors)
{
s = null;
ds.type = Type.terror;
}
if (s && s == ds)
{
ds.error("cannot resolve");
s = null;
ds.type = Type.terror;
}
if (!s || !s.isEnumMember())
{
Type t;
Expression e;
Scope* sc2 = sc;
if (ds.storage_class & (STCref | STCnothrow | STCnogc | STCpure | STCdisable))
{
// For 'ref' to be attached to function types, and picked
// up by Type.resolve(), it has to go into sc.
sc2 = sc.push();
sc2.stc |= ds.storage_class & (STCref | STCnothrow | STCnogc | STCpure | STCshared | STCdisable);
}
ds.type = ds.type.addSTC(ds.storage_class);
ds.type.resolve(ds.loc, sc2, &e, &t, &s);
if (sc2 != sc)
sc2.pop();
if (e) // Try to convert Expression to Dsymbol
{
s = getDsymbol(e);
if (!s)
{
if (e.op != TOKerror)
ds.error("cannot alias an expression %s", e.toChars());
t = Type.terror;
}
}
ds.type = t;
}
if (s == ds)
{
assert(global.errors);
ds.type = Type.terror;
s = null;
}
if (!s) // it's a type alias
{
//printf("alias %s resolved to type %s\n", toChars(), type.toChars());
ds.type = ds.type.typeSemantic(ds.loc, sc);
ds.aliassym = null;
}
else // it's a symbolic alias
{
//printf("alias %s resolved to %s %s\n", toChars(), s.kind(), s.toChars());
ds.type = null;
ds.aliassym = s;
}
if (global.gag && errors != global.errors)
{
ds.type = oldtype;
ds.aliassym = null;
}
ds.inuse = 0;
ds.semanticRun = PASSsemanticdone;
if (auto sx = ds.overnext)
{
ds.overnext = null;
if (!ds.overloadInsert(sx))
ScopeDsymbol.multiplyDefined(Loc(), sx, ds);
}
}
| D |
/**
* Implements conversion from expressions to delegates for lazy parameters.
*
* Specification: $(LINK2 https://dlang.org/spec/function.html#lazy-params, Lazy Parameters)
*
* Copyright: Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/delegatize.d, _delegatize.d)
* Documentation: https://dlang.org/phobos/dmd_delegatize.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/delegatize.d
*/
module dmd.delegatize;
import core.stdc.stdio;
import dmd.astenums;
import dmd.declaration;
import dmd.dscope;
import dmd.dsymbol;
import dmd.expression;
import dmd.expressionsem;
import dmd.func;
import dmd.globals;
import dmd.init;
import dmd.initsem;
import dmd.location;
import dmd.mtype;
import dmd.postordervisitor;
import dmd.statement;
import dmd.tokens;
import dmd.visitor;
/*********************************
* Convert expression into a delegate.
*
* Used to convert the argument to a lazy parameter.
*
* Params:
* e = argument to convert to a delegate
* t = the type to be returned by the delegate
* sc = context
* Returns:
* A delegate literal
*/
Expression toDelegate(Expression e, Type t, Scope* sc)
{
//printf("Expression::toDelegate(t = %s) %s\n", t.toChars(), e.toChars());
Loc loc = e.loc;
auto tf = new TypeFunction(ParameterList(), t, LINK.d);
if (t.hasWild())
tf.mod = MODFlags.wild;
auto fld = new FuncLiteralDeclaration(loc, loc, tf, TOK.delegate_, null);
lambdaSetParent(e, fld);
sc = sc.push();
sc.parent = fld; // set current function to be the delegate
bool r = lambdaCheckForNestedRef(e, sc);
sc = sc.pop();
if (r)
return ErrorExp.get();
Statement s;
if (t.ty == Tvoid)
s = new ExpStatement(loc, e);
else
s = new ReturnStatement(loc, e);
fld.fbody = s;
e = new FuncExp(loc, fld);
e = e.expressionSemantic(sc);
return e;
}
/******************************************
* Patch the parent of declarations to be the new function literal.
*
* Since the expression is going to be moved into a function literal,
* the parent for declarations in the expression needs to be
* reset to that function literal.
* Params:
* e = expression to check
* fd = function literal symbol (the new parent)
*/
private void lambdaSetParent(Expression e, FuncDeclaration fd)
{
extern (C++) final class LambdaSetParent : StoppableVisitor
{
alias visit = typeof(super).visit;
FuncDeclaration fd;
private void setParent(Dsymbol s)
{
VarDeclaration vd = s.isVarDeclaration();
FuncDeclaration pfd = s.parent ? s.parent.isFuncDeclaration() : null;
s.parent = fd;
if (!vd || !pfd)
return;
// move to fd's closure when applicable
foreach (i; 0 .. pfd.closureVars.length)
{
if (vd == pfd.closureVars[i])
{
pfd.closureVars.remove(i);
fd.closureVars.push(vd);
break;
}
}
}
public:
extern (D) this(FuncDeclaration fd) scope
{
this.fd = fd;
}
override void visit(Expression)
{
}
override void visit(DeclarationExp e)
{
setParent(e.declaration);
e.declaration.accept(this);
}
override void visit(IndexExp e)
{
if (e.lengthVar)
{
//printf("lengthVar\n");
setParent(e.lengthVar);
e.lengthVar.accept(this);
}
}
override void visit(SliceExp e)
{
if (e.lengthVar)
{
//printf("lengthVar\n");
setParent(e.lengthVar);
e.lengthVar.accept(this);
}
}
override void visit(Dsymbol)
{
}
override void visit(VarDeclaration v)
{
if (v._init)
v._init.accept(this);
}
override void visit(Initializer)
{
}
override void visit(ExpInitializer ei)
{
walkPostorder(ei.exp ,this);
}
override void visit(StructInitializer si)
{
foreach (i, const id; si.field)
if (Initializer iz = si.value[i])
iz.accept(this);
}
override void visit(ArrayInitializer ai)
{
foreach (i, ex; ai.index)
{
if (ex)
walkPostorder(ex, this);
if (Initializer iz = ai.value[i])
iz.accept(this);
}
}
}
scope LambdaSetParent lsp = new LambdaSetParent(fd);
walkPostorder(e, lsp);
}
/*******************************************
* Look for references to variables in a scope enclosing the new function literal.
*
* Essentially just calls `checkNestedReference() for each variable reference in `e`.
* Params:
* sc = context
* e = expression to check
* Returns:
* true if error occurs.
*/
bool lambdaCheckForNestedRef(Expression e, Scope* sc)
{
extern (C++) final class LambdaCheckForNestedRef : StoppableVisitor
{
alias visit = typeof(super).visit;
public:
Scope* sc;
bool result;
extern (D) this(Scope* sc) scope
{
this.sc = sc;
}
override void visit(Expression)
{
}
override void visit(SymOffExp e)
{
VarDeclaration v = e.var.isVarDeclaration();
if (v)
result = v.checkNestedReference(sc, Loc.initial);
}
override void visit(VarExp e)
{
VarDeclaration v = e.var.isVarDeclaration();
if (v)
result = v.checkNestedReference(sc, Loc.initial);
}
override void visit(ThisExp e)
{
if (e.var)
result = e.var.checkNestedReference(sc, Loc.initial);
}
override void visit(DeclarationExp e)
{
VarDeclaration v = e.declaration.isVarDeclaration();
if (v)
{
result = v.checkNestedReference(sc, Loc.initial);
if (result)
return;
/* Some expressions cause the frontend to create a temporary.
* For example, structs with cpctors replace the original
* expression e with:
* __cpcttmp = __cpcttmp.cpctor(e);
*
* In this instance, we need to ensure that the original
* expression e does not have any nested references by
* checking the declaration initializer too.
*/
if (v._init && v._init.isExpInitializer())
{
Expression ie = v._init.initializerToExpression();
result = lambdaCheckForNestedRef(ie, sc);
}
}
}
}
scope LambdaCheckForNestedRef v = new LambdaCheckForNestedRef(sc);
walkPostorder(e, v);
return v.result;
}
/*****************************************
* See if context `s` is nested within context `p`, meaning
* it `p` is reachable at runtime by walking the static links.
* If any of the intervening contexts are function literals,
* make sure they are delegates.
* Params:
* s = inner context
* p = outer context
* Returns:
* true means it is accessible by walking the context pointers at runtime
* References:
* for static links see https://en.wikipedia.org/wiki/Call_stack#Functions_of_the_call_stack
*/
bool ensureStaticLinkTo(Dsymbol s, Dsymbol p)
{
while (s)
{
if (s == p) // hit!
return true;
if (auto fd = s.isFuncDeclaration())
{
if (!fd.isThis() && !fd.isNested())
break;
// https://issues.dlang.org/show_bug.cgi?id=15332
// change to delegate if fd is actually nested.
if (auto fld = fd.isFuncLiteralDeclaration())
fld.tok = TOK.delegate_;
}
if (auto ad = s.isAggregateDeclaration())
{
if (ad.storage_class & STC.static_)
break;
}
s = s.toParentP(p);
}
return false;
}
| D |
// Copyright © 2012, Jakob Bornecrantz. All rights reserved.
// Copyright © 2012, Bernard Helyer. All rights reserved.
// See copyright notice in src/volt/license.d (BOOST ver. 1.0).
module volt.ir.toplevel;
import volt.ir.base;
import volt.ir.type;
import volt.ir.context;
import volt.ir.expression;
import volt.ir.declaration;
import volt.ir.statement;
/**
* @defgroup irTopLevel IR TopLevel Nodes
*
* Top level nodes are Nodes relating to the the module system.
* They either are part of the machinery that it works with
* (modules, imports) or define types and friends that work with
* the module system (structs, classes), or simply things that
* can only live in top level contexts (e.g. unittest blocks).
*
* As you can see, it's a fairly nebulous group. There are things
* here that could be arguably placed elsewhere (an Enum is a Type,
* for instance). Or things that are elsewhere could arguably belong
* here! (Functions, as an example).
*
* The reason for this nebulousity is that Volt is a child of
* the curly brace languages -- particularly D, and through that
* heritage, C++ and C. In C there was a very strict line about
* what could be defined where, and resulting languages have stretched
* that somewhat -- functions and structs inlined inside of functions,
* for example, a place where traditionally only statements reside.
*
* So perhaps not the most elegant system, but usability trumps
* elegance, much to the chagrin of architect astronaughts everywhere.
*
* @ingroup irNode
*/
/**
* The toplevelest node.
*
* In Volt, there is no truly global scope, as in C or C++
* (the object module is the closest thing, and by and large
* the user can't change that), everything can be disambiguated
* by its module. This means things primitive forms of namespacing
* found in C (glGetString vs gl.GetString, for example) are not
* needed (except when interfacing with C, of course) and ambiguous
* names are not a major issue.
*
* A module has name. Zero or more package names, followed by the
* name of the module. This name must be unique for any given run
* of the compiler -- two modules cannot have the same name.
*
* The module contains the declarations that other modules can
* retrieve (or not retrieve, depending on access levels).
*
* @ingroup irNode irTopLevel
*/
class Module : Node
{
public:
QualifiedName name; ///< Name used for mangling.
TopLevelBlock children; ///< Toplevel nodes.
/**
* Scope for this module.
*
* Does not contain any imports public or otherwise.
*/
Scope myScope;
/**
* Has phase 1 be started on this module.
*/
bool hasPhase1;
bool gathered;
public:
this() { super(NodeType.Module); }
}
/**
* A TopLevelBlock contains a series of nodes, appropriate
* for things like modules, classes, structs, and so on.
*
* This allows visitors to handle such things uniformly when
* needed.
*/
class TopLevelBlock : Node
{
public:
Node[] nodes;
public:
this() { super(NodeType.TopLevelBlock); }
}
/**
* An Import adds a module to the search path of identifiers
* inside the module it's in.
*
* For example. In a module with no imports, the symbol 'foo'
* is only looked for in the current module -- if it's found,
* there's no problem.
*
* If we add an import, when the symbol 'foo' is looked up,
* nothing changes if 'foo' is found in the module with the
* import -- local declarations trump anything found in imports.
* This is to prevent changes in external modules affecting
* the behaviour of a program silently.
*
* However, if there is no local 'foo', then all imported modules are
* modules are searched for accessible 'foo' symbols. If one is found,
* it is used, if more than one is found -- it is an error. This can
* be resolved by the user defining a local alias of that symbol
* (see 'local declarations trump import', above for why that works),
* or explicitly importing symbols, or making a module have to be
* accessed in long form (the.module.foo vs just foo).
*
* @ingroup irNode irTopLevel
*/
class Import : Node
{
public:
/// public, private, package or protected.
Access access = Access.Private;
/// Optional
bool isStatic;
/// import <a>
QualifiedName name;
/// Optional, import @<foo> = a
Identifier bind;
/// Optional, import a : <b = c, d>
Identifier[2][] aliases;
/// This points at the imported module -- filled in by ImportResolver.
Module targetModule;
public:
this() { super(NodeType.Import); }
}
abstract class Aggregate : Type
{
public:
Access access; ///< default public.
Scope myScope; ///< Context for this struct.
string name; ///< Unmangled name of the struct.
TopLevelBlock members; ///< Toplevel nodes.
Attribute[] userAttrs;
bool isActualized;
public:
this(NodeType nt) { super(nt); }
}
/**
* Attributes apply different behaviours and access levels
* to one or more top level nodes. These are lowered onto the
* object by the attribremoval pass.
*
* @ingroup irNode irTopLevel
*/
class Attribute : Node
{
public:
/**
* Used to specify the exact sort of attribute.
*/
enum Kind
{
LinkageVolt,
LinkageC,
LinkageCPlusPlus,
LinkageD,
LinkageWindows,
LinkagePascal,
LinkageSystem,
LoadDynamic,
Align,
Deprecated,
Private,
Protected,
Package,
Public,
Export,
Static,
Extern,
Final,
Synchronized,
Override,
Abstract,
Const,
Auto,
Scope,
Global,
Local,
Shared,
Immutable,
Inout,
Disable,
Property,
Trusted,
System,
Safe,
NoThrow,
Pure,
UserAttribute,
MangledName,
}
public:
/// What kind of attribute.
Kind kind;
TopLevelBlock members;
QualifiedName userAttributeName; ///< Optional.
Exp[] arguments; ///< If kind == UserAttribute or MangledName.
UserAttribute userAttribute; ///< Filled in by the exptyper.
/// Only if type == Align.
int alignAmount;
public:
this() { super(NodeType.Attribute); }
}
/**
* Java style class declaration. Classes enable polymorphism,
* and are always accessed through opaque references (to prevent
* slicing -- look it up!)
*
* @p Classes are mangled as "C" + @p name.
*
* @ingroup irNode irTopLevel irType irDecl
*/
class Class : Aggregate
{
public:
QualifiedName parent; //< Optional.
QualifiedName[] interfaces; //< Optional.
Function[] wrapperConstructors;
Function[] userConstructors;
Struct vtableStruct;
Variable vtableVariable;
Class parentClass; ///< Filled in by the typeverifier.
/// How a lowered class will look internally.
Struct layoutStruct;
/// Is this the one true 'Object' to rule them all?
bool isObject;
bool isAbstract;
public:
this() { super(NodeType.Class); }
}
/**
* Java style interface declaration.
* An interface defines multiple functions that an implementing
* class must define. A class can inherit from multiple interfaces,
* and can be treated as an instance of any one of them.
*
* @ingroup irNode irTopLevel irType irDecl
*/
class _Interface : Type
{
public:
Access access; ///< default public.
Scope myScope; ///< Context for this Interface.
string name; ///< Unmangled name of the Interface.
QualifiedName[] interfaces; ///< Super interfaces to this.
TopLevelBlock members; ///< Toplevel nodes.
Attribute[] userAttrs;
public:
this() { super(NodeType.Interface); }
}
/**
* C style union.
* Structs are a POD data type, and should be binary compatible
* with the same union as defined by your friendly neighbourhood
* C compiler.
*
* @p Union are mangled as "U" + @p name.
*
* @ingroup irNode irTopLevel irType irDecl
*/
class Union : Aggregate
{
public:
int totalSize; // Total size in memory.
public:
this() { super(NodeType.Union); }
}
/**
* C style struct.
* Structs are a POD data type, and should be binary compatible
* with the same struct as defined by your friendly neighbourhood
* C compiler.
*
* @p Structs are mangled as "S" + @p name.
*
* @ingroup irNode irTopLevel irType irDecl
*/
class Struct : Aggregate
{
public:
Node loweredNode; ///< If not null, this struct was lowered from this.
public:
this() { super(NodeType.Struct); }
}
/**
* C style Enum.
* Enums create symbols that are associated with compile
* time constants. By default, they are enumerated with
* ascending numbers, hence the name.
*
* @p Enums are mangled as "E" + @p name.
*
* @ingroup irNode irTopLevel irType irDecl
*/
class Enum : Type
{
public:
Access access; ///< default public.
string name; ///< Optional.
Scope myScope;
EnumDeclaration[] members; ///< At least one.
/**
* With an anonymous enum, the base type (specified with a colon)
* is the type of using that enum declaration. With a named enum the
* type of the enum declaration is Enum, and the base type determines
* what the declarations can be initialised with.
*/
Type base;
bool resolved;
public:
this() { super(NodeType.Enum); }
}
/**
* Compile time assert.
* If the expression is false, then compilation is halted with
* an optional message.
*
* @ingroup irNode irTopLevel
*/
class StaticAssert : Node
{
public:
Exp exp; ///< Often just false.
Exp message; ///< Optional.
public:
this() { super(NodeType.StaticAssert); }
}
/**
* Unittest code to be run on if selected by user.
*
* @ingroup irNode irTopLevel
*/
class Unittest : Node
{
public:
BlockStatement _body; ///< Contains statements.
public:
this() { super(NodeType.Unittest); }
}
/**
* Node represention a compile time conditional compilation.
*
* Several types Condition is collapsed into this class, including
* version, debug and static if. Used together with ConditionStatement
* and ConditionTopLevel.
*
* @ingroup irNode irTopLevel irStatement
*/
class Condition : Node
{
public:
/**
* Used to specify the exact sort of condition.
*/
enum Kind
{
/// version(identifier) {}
Version,
/// debug {}, debug (identifier) {}
Debug,
/// static if (exp) {}
StaticIf,
}
public:
/// What kind of Condition is this?
Kind kind;
Exp exp;
public:
this() { super(NodeType.Condition); }
}
/**
* Node represention a compile time conditional compilation, at the
* toplevel. Uses Condition to specify the if it should be compiled.
*
* @ingroup irNode irTopLevel
*/
class ConditionTopLevel : Node
{
public:
/// Specifier.
Condition condition;
/// If a else is following.
bool elsePresent;
/// version(foo) { @<members> }
TopLevelBlock members;
/// version(foo) { @<members> } else { @<_else> }
TopLevelBlock _else;
public:
this() { super(NodeType.ConditionTopLevel); }
}
/**
* Is a ";". short and simple.
*
* @ingroup irNode irTopLevel
*/
class EmptyTopLevel : Node
{
public:
this() { super(NodeType.EmptyTopLevel); }
}
/**
* Node represention of a function mixin.
*
* @ingroup irNode irTopLevel
*/
class MixinFunction : Node
{
public:
string name; //< Not optional.
/**
* Contains statements. These nodes are raw nodes and are
* processed in any form and as such should not be visited.
* They are copied and processed when the mixin is instanciated.
*/
BlockStatement raw;
public:
this() { super(NodeType.MixinFunction); }
}
/**
* Node represention of a template mixin.
*
* @ingroup irNode irTopLevel
*/
class MixinTemplate : Node
{
public:
string name; //< Not optional.
/**
* Toplevel nodes. These nodes are raw nodes and are not
* processed in any form and as such should not be visited.
* They are copied and processed when the mixin is instanciated.
*/
TopLevelBlock raw;
public:
this() { super(NodeType.MixinTemplate); }
}
/**
* The building block of user defined attributes.
*
* Defined fairly simply:
* ---
* @interface Name {
* int someVar;
* string someOtherVar;
* bool somethingWithADefault = true;
* }
* ---
*
* Only variables can be present. Any assign (or when initializing them
* normally, in fact) must be known at compile time.
*
* @p UserAttributes are mangled as 'T' + name.
*
* @ingroup irNode irTopLevel
*/
class UserAttribute : Type
{
public:
string name;
Variable[] fields;
Scope myScope;
Class layoutClass;
bool isActualized;
public:
this() { super(NodeType.UserAttribute); }
}
| D |
/*
* Copyright (C) 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package benchmarks.regression;
import com.google.caliper.Param;
import java.io.File;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
public class JarFileBenchmark {
@Param({
"/system/framework/core-oj.jar",
"/system/priv-app/Phonesky/Phonesky.apk"
})
private String filename;
public void time(int reps) throws Exception {
File f = new File(filename);
for (int i = 0; i < reps; ++i) {
JarFile jf = new JarFile(f);
Manifest m = jf.getManifest();
jf.close();
}
}
}
| D |
module bamboo.integration;
version (unittest) : // Example
import std.conv;
import std.file;
import std.stdio;
import pegged.parser;
import bamboo.astgen;
import bamboo.codegen;
import bamboo.parser;
import bamboo.types;
import bamboo.hashgen;
import bamboo.legacy_hash;
unittest
{
Module file = parseModule("tests/astron_example.dc");
assert(file !is null);
HashGenerator gen;
hashModule(gen, file);
auto hash = gen.hash;
assert(hash == 205_656_144, hash.to!string() ~ " != 205,656,144");
file = parseModule("tests/simple_example.dc");
hash = computeHash(file);
assert(hash == 4_275_592, hash.to!string() ~ " != 4,275,592");
}
enum simple_example = `
// Some abstractions for readability.
typedef uint32 doId;
typedef uint32 zoneId;
typedef uint64 channel;
// The Python Views for these distributed classes.
from simple_example.objects import LoginManager/AI/UD
from simple_example.objects import DistributedMaproot/AI/UD
from simple_example.objects import DistributedAvatar/AI/OV
// A simple DOG for username/password authentication and handoff to
// the DistributedMaproot for avatar creation.
dclass LoginManager {
setMaproot(doId maproot);
login(string username, string password) clsend;
};
// The root object of the map, container for the DistributedAvatars.
dclass DistributedMaproot {
createAvatar(channel client) airecv;
};
// The actual class for avatar control.
// The idea is that a Client can set its intention for its heading
// and speed, but only the controlling AI can set its actual
// position and heading.
dclass DistributedAvatar {
string name broadcast required;
setXYZH(float32, float32, float32, int16 % 360) broadcast required;
indicateIntent(float32 x, float32 y) ownsend airecv;
};
`;
unittest
{
import std.stdio : File;
Module file = parseModule("tests/simple_example.dc");
string generated = generateFile(file, "simple_example");
// Write to file
//File output = File("tests/simple_example.d", "w");
//output.writeln(generated);
// These are needed for the dclass system to work.
class DistributedObject
{
}
enum Keyword
{
required,
broadcast,
ownrecv,
ram,
db,
clsend,
clrecv,
ownsend,
airecv,
}
alias required = Keyword.required;
alias broadcast = Keyword.broadcast;
alias ownrecv = Keyword.ownrecv;
alias ram = Keyword.ram;
alias db = Keyword.db;
alias clsend = Keyword.clsend;
alias clrecv = Keyword.clrecv;
alias ownsend = Keyword.ownsend;
alias airecv = Keyword.airecv;
// Mix in the module.
enum str = generateModule(parseString(simple_example));
mixin(str);
// Test that the types exist.
static assert(is(LoginManager));
static assert(is(DistributedMaproot));
static assert(is(DistributedAvatar));
// Can we override one?
class DistributedAvatarTest : DistributedAvatar
{
}
auto obj = new DistributedAvatarTest();
obj.xyzh = tuple(1, 1, 1, short(1));
assert(obj.xyzh == tuple(1f, 1f, 1f, short(1)));
}
unittest
{
import std.stdio : File;
Module file = parseModule("tests/direct.dc");
string generated = generateFile(file);
assert(file.symbol == "direct.distributed");
}
| D |
/*
* hunt-proton: AMQP Protocol library for D programming language.
*
* Copyright (C) 2018-2019 HuntLabs
*
* Website: https://www.huntlabs.net/
*
* Licensed under the Apache-2.0 License.
*
*/
module hunt.proton.codec.transport.CloseType;
import hunt.collection.Collections;
import hunt.collection.List;
import hunt.proton.amqp.Symbol;
import hunt.proton.amqp.UnsignedLong;
import hunt.proton.amqp.transport.Close;
import hunt.proton.amqp.transport.ErrorCondition;
import hunt.proton.codec.AbstractDescribedType;
import hunt.proton.codec.Decoder;
import hunt.proton.codec.DescribedTypeConstructor;
import hunt.proton.codec.EncoderImpl;
import hunt.logging;
import hunt.collection.ArrayList;
import hunt.collection.Collections;
import std.concurrency : initOnce;
class CloseType : AbstractDescribedType!(Close,List!Object) , DescribedTypeConstructor!(Close)
{
//private static Object[] DESCRIPTORS =
//{
// UnsignedLong.valueOf(0x0000000000000018L), Symbol.valueOf("amqp:close:list"),
//};
//
//private static UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000018L);
static Object[] DESCRIPTORS() {
__gshared Object[] inst;
return initOnce!inst([UnsignedLong.valueOf(0x0000000000000018L), Symbol.valueOf("amqp:close:list")]);
}
static UnsignedLong DESCRIPTOR() {
__gshared UnsignedLong inst;
return initOnce!inst(UnsignedLong.valueOf(0x0000000000000018L));
}
this(EncoderImpl encoder)
{
super(encoder);
}
override
public UnsignedLong getDescriptor()
{
return DESCRIPTOR;
}
override
protected List!Object wrap(Close val)
{
ErrorCondition errorCondition = val.getError();
if (errorCondition is null) {
return Collections.emptyList!Object();
} else {
List!Object rt = new ArrayList!Object;
rt.add(errorCondition);
return rt;
}
}
public Close newInstance(Object described)
{
List!Object l = cast(List!Object) described;
Close o = new Close();
if(!l.isEmpty())
{
o.setError( cast(ErrorCondition) l.get( 0 ) );
}
return o;
}
public TypeInfo getTypeClass()
{
return typeid(Close);
}
public static void register(Decoder decoder, EncoderImpl encoder)
{
CloseType type = new CloseType(encoder);
foreach(Object descriptor ; DESCRIPTORS)
{
decoder.registerDynamic(descriptor, type);
}
encoder.register(type);
}
}
| D |
/Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/FluentProvider.build/Pagination.swift.o : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Node+Row+JSON.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Storage.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Cache.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Request+Updateable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Updateable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Query+Filterable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Filterable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Prepare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Prepare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/SQLite+Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey+String.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Model.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Pagination.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Preparation.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Provider.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Driver.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/UpdateableKey.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/SMTP.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/FormData.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Cache.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/SQLite.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Branches.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Cookies.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Configs.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sessions.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/WebSockets.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/BCrypt.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/FluentProvider.build/Pagination~partial.swiftmodule : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Node+Row+JSON.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Storage.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Cache.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Request+Updateable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Updateable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Query+Filterable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Filterable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Prepare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Prepare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/SQLite+Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey+String.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Model.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Pagination.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Preparation.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Provider.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Driver.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/UpdateableKey.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/SMTP.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/FormData.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Cache.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/SQLite.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Branches.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Cookies.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Configs.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sessions.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/WebSockets.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/BCrypt.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/FluentProvider.build/Pagination~partial.swiftdoc : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Node+Row+JSON.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Storage.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Cache.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Request+Updateable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Updateable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Query+Filterable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Filterable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Prepare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Prepare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/SQLite+Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey+String.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Model.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Pagination.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Preparation.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Provider.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Driver.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/UpdateableKey.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/SMTP.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/FormData.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Cache.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/SQLite.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Branches.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Cookies.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Configs.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sessions.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/WebSockets.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/BCrypt.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/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 |
// EXTRA_FILES: imports/test22685b.d imports/test22685c.d
module test22685;
import imports.test22685b;
void twoArgs(alias a, alias b)() { }
void main() {
twoArgs!(a => 1, overloaded);
}
| D |
#!/usr/bin/env rdmd
/**
* This is a driver script that runs the benchmarks.
*
* Copyright: Copyright Martin Nowak 2011 -.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Martin Nowak
*/
import std.stdio;
extern(C) __gshared bool rt_cmdline_enabled = false;
struct Config
{
string pattern = r".*\.d", dmd = "dmd", dflags = "-O -release -inline", args;
bool help, verbose, compile = true;
uint repeat = 10;
}
string runCmd(string cmd, bool verbose, in char[] workDir = null)
{
import std.exception : enforce;
import std.process : executeShell, Config;
if (verbose) writeln(cmd);
auto res = executeShell(cmd, null, Config.none, size_t.max, workDir);
enforce(res.status == 0, res.output);
return res.output;
}
string extraSourceOf(string path)
{
import std.path, std.string;
string dir = path.dirName;
while(dir != path)
{
string base = dir.baseName;
if(base.endsWith(".extra"))
return dir[0..$-6] ~ ".d";
path = dir;
dir = path.dirName;
}
return null;
}
void runTests(Config cfg)
{
import std.algorithm, std.file, std.path, std.regex, std.string;
if (exists("gcx.log")) remove("gcx.log");
string[] sources;
string[string] extra_sources;
auto re = regex(cfg.pattern, "g");
auto cwd = __FILE_FULL_PATH__.dirName;
auto self = buildPath(cwd, "runbench.d");
foreach(DirEntry src; dirEntries(cwd, "*.d", SpanMode.depth))
{
if (!src.isFile || src.name == self || src.name.withExtension(".ignore").exists)
continue;
string mainsrc = extraSourceOf(src.name);
if (mainsrc)
{
if (cfg.verbose) writeln(src.name, " is extra file for ", mainsrc);
extra_sources[mainsrc] ~= " " ~ src.name;
}
else if (!match(src.name, re).empty)
sources ~= src.name;
}
import std.parallelism : parallel;
immutable bindir = absolutePath("bin", cwd);
immutable objdir = absolutePath("obj", cwd);
foreach(ref src; sources.parallel(1))
{
version (Windows) enum exe = "exe"; else enum exe = "";
auto bin = buildPath(bindir, src.relativePath(cwd).setExtension(exe));
auto obj = buildPath(objdir, src.relativePath(cwd).setExtension(exe));
auto cmd = std.string.format("%s %s -op -od%s -of%s %s", cfg.dmd, cfg.dflags, obj, bin, src);
if (auto ex = src in extra_sources)
cmd ~= " -I" ~ src[0..$-2] ~ ".extra" ~ *ex;
if (cfg.compile)
{
writeln("COMPILING ", src);
runCmd(cmd, cfg.verbose);
}
src = bin;
}
foreach(bin; sources)
{
import core.time : Duration;
import std.algorithm : min;
import std.datetime.stopwatch : AutoStart, StopWatch;
auto sw = StopWatch(AutoStart.yes);
auto minDur = Duration.max;
string minGCProf;
immutable benchName = bin.baseName.stripExtension;
void report(string pfx, Duration dur, string gcProf)
{
auto parts = dur.split!("seconds", "msecs");
if (gcProf.length)
writefln("%s %-16s %s.%03s s, %s", pfx, benchName, parts.seconds, parts.msecs, gcProf);
else
writefln("%s %-16s %s.%03s s", pfx, benchName, parts.seconds, parts.msecs);
}
auto cmd = bin ~ " " ~ cfg.args;
foreach (_; 0 .. cfg.repeat)
{
sw.reset;
auto output = runCmd(cmd, cfg.verbose, cwd);
auto dur = cast(Duration)sw.peek;
auto parts = dur.split!("seconds", "msecs");
if (cfg.verbose) stdout.write(output);
string gcProf;
if (exists("gcx.log"))
{
auto tgt = bin.setExtension("gcx.log");
rename("gcx.log", tgt);
auto lines = File(tgt, "r").byLine()
.find!(ln => ln.canFind("GC summary:"));
if (!lines.empty) gcProf = lines.front.find("GC summary:")[11..$].idup;
}
else
{
auto lines = output.splitter(ctRegex!`\r\n|\r|\n`)
.find!(ln => ln.startsWith("GC summary:"));
if (!lines.empty) gcProf = lines.front[11..$];
}
if (cfg.verbose) report("RUN", dur, gcProf);
if (dur < minDur)
{
minDur = dur;
minGCProf = gcProf;
}
}
report("MIN", minDur, minGCProf);
}
}
void printHelp()
{
import std.ascii : nl=newline;
auto helpString =
"usage: runbench [-h|--help] [-v|--verbose] [-r n|--repeat=n] [<test_regex>] [<dflags>] [-- <runargs>]"~nl~nl~
" tests - Regular expressions to select tests. Default: '.*\\.d'"~nl~
" dflags - Flags passed to compiler. Default: '-O -release -inline'"~nl~
" runargs - Arguments passed to each test, e.g. '--DRT-gcopt=profile=1'"~nl~nl~
"Don't pass any argument to run all tests with optimized builds.";
writeln(helpString);
}
Config parseArgs(string[] args)
{
import std.algorithm, std.string : join;
Config cfg;
{
import std.range : only;
string[] tmp = args;
if (findSkip(tmp, only("--")))
{
import std.process : escapeShellCommand;
cfg.args = escapeShellCommand(tmp);
args = args[0 .. $ - 1 - tmp.length];
}
}
import std.getopt;
getopt(args, config.stopOnFirstNonOption,
config.passThrough,
"h|help", &cfg.help,
"v|verbose", &cfg.verbose,
"N|no-compile", (string option) { cfg.compile = false; },
"dflags", &cfg.dflags,
"r|repeat", &cfg.repeat);
if (args.length >= 2 && !args[1].startsWith("-"))
{
cfg.pattern = args[1];
args = args.remove(1);
}
if (args.length > 1)
cfg.dflags = join(args[1 .. $], " ");
return cfg;
}
unittest
{
template cfg(N...)
{
static Config cfg(T...)(T vals) if (T.length == N.length)
{
Config res;
foreach (i, ref v; vals) __traits(getMember, res, N[i]) = v;
return res;
}
}
import std.typecons : t=tuple;
auto check = [
t(["bin"], cfg),
t(["bin", "-h"], cfg!("help")(true)),
t(["bin", "-v"], cfg!("verbose")(true)),
t(["bin", "-h", "-v"], cfg!("help", "verbose")(true, true)),
t(["bin", "gcbench"], cfg!("pattern")("gcbench")),
t(["bin", "-v", "gcbench"], cfg!("pattern", "verbose")("gcbench", true)),
t(["bin", "-r", "4", "gcbench"], cfg!("pattern", "repeat")("gcbench", 4)),
t(["bin", "-g"], cfg!("dflags")("-g")),
t(["bin", "gcbench", "-g"], cfg!("pattern", "dflags")("gcbench", "-g")),
t(["bin", "-r", "2", "gcbench", "-g"], cfg!("pattern", "dflags", "repeat")("gcbench", "-g", 2)),
t(["bin", "--", "--DRT-gcopt=profile:1"], cfg!("args")("--DRT-gcopt=profile:1")),
t(["bin", "--", "foo", "bar"], cfg!("args")("foo bar")),
t(["bin", "gcbench", "--", "args"], cfg!("pattern", "args")("gcbench", "args")),
t(["bin", "--repeat=5", "gcbench", "--", "args"], cfg!("pattern", "args", "repeat")("gcbench", "args", 5)),
];
foreach (pair; check)
assert(parseArgs(pair[0]) == pair[1]);
}
void main()
{
import core.runtime;
// use Runtime.args for --DRT-gcopt
auto cfg = parseArgs(Runtime.args);
if (cfg.help) return printHelp();
import std.process : env=environment;
cfg.dmd = env.get("DMD", "dmd");
if (cfg.compile)
writeln("compiler: "~cfg.dmd~' '~cfg.dflags);
runTests(cfg);
}
| D |
/Users/eapple/Desktop/flash-chat-flutter/build/ios/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/AppDelegate.o : /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/AppDelegate.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/CoreMedia.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/CoreAudio.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/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterCallbackCache.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterEngine.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterTexture.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPluginAppLifeCycleDelegate.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/Runner-Bridging-Header.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterBinaryMessenger.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterViewController.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterHeadlessDartRunner.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/Flutter.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterMacros.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPlatformViews.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterDartProject.h /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/GeneratedPluginRegistrant.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Modules/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/CoreMedia.framework/Headers/CoreMedia.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/UserNotifications.framework/Headers/UserNotifications.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/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/eapple/Desktop/flash-chat-flutter/build/ios/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/AppDelegate.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/CoreMedia.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/CoreAudio.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/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterCallbackCache.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterEngine.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterTexture.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPluginAppLifeCycleDelegate.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/Runner-Bridging-Header.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterBinaryMessenger.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterViewController.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterHeadlessDartRunner.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/Flutter.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterMacros.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPlatformViews.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterDartProject.h /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/GeneratedPluginRegistrant.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Modules/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/CoreMedia.framework/Headers/CoreMedia.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/UserNotifications.framework/Headers/UserNotifications.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/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/eapple/Desktop/flash-chat-flutter/build/ios/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/AppDelegate.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/CoreMedia.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/CoreAudio.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/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterCallbackCache.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterEngine.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterTexture.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPluginAppLifeCycleDelegate.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/Runner-Bridging-Header.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterBinaryMessenger.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterViewController.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterHeadlessDartRunner.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/Flutter.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterMacros.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterPlatformViews.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Headers/FlutterDartProject.h /Users/eapple/Desktop/flash-chat-flutter/ios/Runner/GeneratedPluginRegistrant.h /Users/eapple/Desktop/flash-chat-flutter/ios/Flutter/Flutter.framework/Modules/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/CoreMedia.framework/Headers/CoreMedia.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/UserNotifications.framework/Headers/UserNotifications.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/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LNZTreeView.build/Objects-normal/x86_64/LNZTreeViewDelegate.o : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeViewDataSource.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeViewDelegate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeView.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/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/Target\ Support\ Files/LNZTreeView/LNZTreeView-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LNZTreeView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LNZTreeView.build/Objects-normal/x86_64/LNZTreeViewDelegate~partial.swiftmodule : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeViewDataSource.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeViewDelegate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeView.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/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/Target\ Support\ Files/LNZTreeView/LNZTreeView-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LNZTreeView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LNZTreeView.build/Objects-normal/x86_64/LNZTreeViewDelegate~partial.swiftdoc : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeViewDataSource.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeViewDelegate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/LNZTreeView/LNZTreeView/LNZTreeView.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/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/Target\ Support\ Files/LNZTreeView/LNZTreeView-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LNZTreeView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/home/hunain/Desktop/IOTQ1/mysql_project/target/debug/deps/fake_simd-bca2b6a4862029ef.rmeta: /home/hunain/.cargo/registry/src/github.com-1ecc6299db9ec823/fake-simd-0.1.2/src/lib.rs
/home/hunain/Desktop/IOTQ1/mysql_project/target/debug/deps/libfake_simd-bca2b6a4862029ef.rlib: /home/hunain/.cargo/registry/src/github.com-1ecc6299db9ec823/fake-simd-0.1.2/src/lib.rs
/home/hunain/Desktop/IOTQ1/mysql_project/target/debug/deps/fake_simd-bca2b6a4862029ef.d: /home/hunain/.cargo/registry/src/github.com-1ecc6299db9ec823/fake-simd-0.1.2/src/lib.rs
/home/hunain/.cargo/registry/src/github.com-1ecc6299db9ec823/fake-simd-0.1.2/src/lib.rs:
| D |
/Users/doriankinoocrutcher/Documents/NEAR/New_Example_Creation/simple-nft-rust-example/contract/target/rls/debug/build/byteorder-ed01c6260277aa06/build_script_build-ed01c6260277aa06: /Users/doriankinoocrutcher/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.3.4/build.rs
/Users/doriankinoocrutcher/Documents/NEAR/New_Example_Creation/simple-nft-rust-example/contract/target/rls/debug/build/byteorder-ed01c6260277aa06/build_script_build-ed01c6260277aa06.d: /Users/doriankinoocrutcher/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.3.4/build.rs
/Users/doriankinoocrutcher/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.3.4/build.rs:
| D |
/Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/build/TestProjectForSibersCompanyByKurilovP.build/Debug-iphonesimulator/TestProjectForSibersCompanyByKurilovP.build/Objects-normal/x86_64/AppDelegate.o : /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIImageView+Cache.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/ErrorResponse.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/AppDelegate.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/CharacterDetailViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/CharacterImageCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/ChararcterCellViewModels/CharacterTableCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/ChararcterDetailCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterImageTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterDetailTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/Cells/CharacterTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/DefaultCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterImageViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/DiscardableImageCacheItem.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Origin.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Location.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UITextField+ClearButton.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Info.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManager.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/СharacterDetailController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/HudHelper.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Character.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManagerError.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListCoordinator.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/RequestFeeds.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIColor+AppColors.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/NetworkRequests.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/ReachabilityConnect.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Result.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/Constant.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkEndpoint.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/Alert.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharacterImageView.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 /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/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/build/TestProjectForSibersCompanyByKurilovP.build/Debug-iphonesimulator/TestProjectForSibersCompanyByKurilovP.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIImageView+Cache.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/ErrorResponse.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/AppDelegate.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/CharacterDetailViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/CharacterImageCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/ChararcterCellViewModels/CharacterTableCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/ChararcterDetailCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterImageTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterDetailTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/Cells/CharacterTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/DefaultCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterImageViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/DiscardableImageCacheItem.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Origin.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Location.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UITextField+ClearButton.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Info.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManager.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/СharacterDetailController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/HudHelper.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Character.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManagerError.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListCoordinator.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/RequestFeeds.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIColor+AppColors.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/NetworkRequests.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/ReachabilityConnect.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Result.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/Constant.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkEndpoint.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/Alert.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharacterImageView.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 /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/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/build/TestProjectForSibersCompanyByKurilovP.build/Debug-iphonesimulator/TestProjectForSibersCompanyByKurilovP.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIImageView+Cache.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/ErrorResponse.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/AppDelegate.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/CharacterDetailViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/CharacterImageCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/ChararcterCellViewModels/CharacterTableCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/ChararcterDetailCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterImageTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterDetailTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/Cells/CharacterTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/DefaultCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterImageViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/DiscardableImageCacheItem.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Origin.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Location.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UITextField+ClearButton.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Info.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManager.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/СharacterDetailController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/HudHelper.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Character.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManagerError.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListCoordinator.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/RequestFeeds.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIColor+AppColors.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/NetworkRequests.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/ReachabilityConnect.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Result.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/Constant.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkEndpoint.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/Alert.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharacterImageView.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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Vapor.build/Sessions/SessionsMiddleware.swift.o : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/asn1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/tls1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pem2.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.9.2/include/openssl/md5.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509.h /usr/local/Cellar/libressl/2.9.2/include/openssl/sha.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dsa.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.9.2/include/openssl/rsa.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/2.9.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.9.2/include/openssl/hmac.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ec.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/2.9.2/include/openssl/rand.h /usr/local/Cellar/libressl/2.9.2/include/openssl/conf.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dh.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.9.2/include/openssl/lhash.h /usr/local/Cellar/libressl/2.9.2/include/openssl/stack.h /usr/local/Cellar/libressl/2.9.2/include/openssl/safestack.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pem.h /usr/local/Cellar/libressl/2.9.2/include/openssl/bn.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/2.9.2/include/openssl/bio.h /usr/local/Cellar/libressl/2.9.2/include/openssl/crypto.h /usr/local/Cellar/libressl/2.9.2/include/openssl/srtp.h /usr/local/Cellar/libressl/2.9.2/include/openssl/evp.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.9.2/include/openssl/buffer.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.9.2/include/openssl/err.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.9.2/include/openssl/objects.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslv.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509_vfy.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-ssl-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 /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/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Vapor.build/Sessions/SessionsMiddleware~partial.swiftmodule : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/asn1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/tls1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pem2.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.9.2/include/openssl/md5.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509.h /usr/local/Cellar/libressl/2.9.2/include/openssl/sha.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dsa.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.9.2/include/openssl/rsa.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/2.9.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.9.2/include/openssl/hmac.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ec.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/2.9.2/include/openssl/rand.h /usr/local/Cellar/libressl/2.9.2/include/openssl/conf.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dh.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.9.2/include/openssl/lhash.h /usr/local/Cellar/libressl/2.9.2/include/openssl/stack.h /usr/local/Cellar/libressl/2.9.2/include/openssl/safestack.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pem.h /usr/local/Cellar/libressl/2.9.2/include/openssl/bn.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/2.9.2/include/openssl/bio.h /usr/local/Cellar/libressl/2.9.2/include/openssl/crypto.h /usr/local/Cellar/libressl/2.9.2/include/openssl/srtp.h /usr/local/Cellar/libressl/2.9.2/include/openssl/evp.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.9.2/include/openssl/buffer.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.9.2/include/openssl/err.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.9.2/include/openssl/objects.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslv.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509_vfy.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-ssl-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 /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/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Vapor.build/Sessions/SessionsMiddleware~partial.swiftdoc : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/asn1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/tls1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pem2.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.9.2/include/openssl/md5.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509.h /usr/local/Cellar/libressl/2.9.2/include/openssl/sha.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dsa.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.9.2/include/openssl/rsa.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/2.9.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.9.2/include/openssl/hmac.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ec.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/2.9.2/include/openssl/rand.h /usr/local/Cellar/libressl/2.9.2/include/openssl/conf.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.9.2/include/openssl/dh.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.9.2/include/openssl/lhash.h /usr/local/Cellar/libressl/2.9.2/include/openssl/stack.h /usr/local/Cellar/libressl/2.9.2/include/openssl/safestack.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ssl.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/2.9.2/include/openssl/pem.h /usr/local/Cellar/libressl/2.9.2/include/openssl/bn.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/2.9.2/include/openssl/bio.h /usr/local/Cellar/libressl/2.9.2/include/openssl/crypto.h /usr/local/Cellar/libressl/2.9.2/include/openssl/srtp.h /usr/local/Cellar/libressl/2.9.2/include/openssl/evp.h /usr/local/Cellar/libressl/2.9.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.9.2/include/openssl/buffer.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.9.2/include/openssl/err.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.9.2/include/openssl/objects.h /usr/local/Cellar/libressl/2.9.2/include/openssl/opensslv.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/2.9.2/include/openssl/x509_vfy.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-ssl-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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
module dali.proxy.impl;
import std.string;
template method(alias Scope, string methodName, ArgTypes...){
import std.meta: AliasSeq;
import std.traits: Parameters, ParameterIdentifierTuple, ReturnType;
alias allMethodsWithThatName = AliasSeq!(__traits(getOverloads, Scope, methodName));
template chooseMethod(int chooseMethod___i){
static if (chooseMethod___i<allMethodsWithThatName.length){
static if (is(Parameters!(allMethodsWithThatName[chooseMethod___i]) == AliasSeq!ArgTypes)){
alias chooseMethod = allMethodsWithThatName[chooseMethod___i];
} else {
alias chooseMethod = chooseMethod!(chooseMethod___i+1);
}
} else {
static assert(false);
}
}
alias impl = chooseMethod!0;
alias argNames = AliasSeq!(ParameterIdentifierTuple!impl);
alias argTypes = AliasSeq!(Parameters!impl);
mixin template assertNonEmptyNames() {
mixin template assertNonEmptyNamesImpl(int i){
static if (i < argNames.length){
static assert(!empty(argNames[i]));
mixin assertNonEmptyNamesImpl!(i+1);
}
}
mixin assertNonEmptyNamesImpl!0;
}
alias returnType = ReturnType!impl;
}
import dali.tostring.annotations;
@(ToStringOptions.builder().fieldTypes(true).qualifiedFieldTypes(false).build())
struct Arguments(alias Scope, string methodName, ArgTypes...){
import std.meta: Alias;
import std.traits: isArray, isAssociativeArray, fullyQualifiedName;
import dali.tostring.mixins;
import dali.builder.annotations;
import dali.builder.mixins;
alias ____Proxy___targetMethod = method!(Scope, methodName, ArgTypes);
mixin template InjectField(int injectField____i){
static if (injectField____i < ____Proxy___targetMethod.argNames.length){
enum toInject = fullyQualifiedName!(____Proxy___targetMethod.argTypes[injectField____i])~" "~____Proxy___targetMethod.argNames[injectField____i]~";";
static if (isArray!(____Proxy___targetMethod.argTypes[injectField____i]) || isAssociativeArray!(____Proxy___targetMethod.argTypes[injectField____i]))
mixin("@Singular "~toInject);
else
mixin(toInject);
mixin InjectField!(injectField____i+1);
}
}
mixin InjectField!0;
mixin ToString;
mixin Builder;
}
interface Interceptor(alias Clazz, string methodName, Args...){
returnType intercept(Args args);
}
version(unittest){
struct ToIntercept {
void foo(int i){}
string foo(){return "";}
string foo(string x, bool b){return "";}
}
//class I1: Interceptor!(ToIntercept, "foo"){
// override void intercept(){}
//}
//class I2: Interceptor!(ToIntercept, "foo", string, bool){
// override string intercept(string s, bool b){
// return "";
// }
//}
}
unittest {
import std.stdio;
//writeln(Arguments!(ToIntercept, "foo").builder().build());
//writeln(Arguments!(ToIntercept, "foo", int).builder().build());
//writeln(Arguments!(ToIntercept, "foo", string, bool).builder().build());
} | D |
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.build/Tag/TagContext.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSource.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Uppercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Lowercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Capitalize.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateTag.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConditional.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateCustom.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateExpression.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Var.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/ViewRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/TemplateError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIterator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Contains.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/DateFormat.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConstant.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Comment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Print.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Count.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Raw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateRaw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/View.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntax.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.build/TagContext~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSource.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Uppercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Lowercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Capitalize.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateTag.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConditional.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateCustom.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateExpression.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Var.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/ViewRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/TemplateError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIterator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Contains.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/DateFormat.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConstant.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Comment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Print.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Count.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Raw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateRaw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/View.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntax.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.build/TagContext~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSource.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Uppercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Lowercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Capitalize.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateTag.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConditional.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateCustom.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateExpression.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Var.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/ViewRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/TemplateError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIterator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Contains.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/DateFormat.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConstant.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Comment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Print.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Count.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Raw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateRaw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/View.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntax.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
the temporary provision of money (usually at interest)
a word borrowed from another language
give temporarily
| D |
instance Mod_1423_BAU_Bauer_NW (Npc_Default)
{
// ------ NSC ------
name = NAME_BAUER;
guild = GIL_OUT;
id = 1423;
voice = 13;
flags = 0; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_nw_bauer;
// ------ Attribute ------
B_SetAttributesToChapter (self, 1); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_COWARD; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItMw_1h_Bau_Mace);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_Bald", Face_N_NormalBart12, BodyTex_N, ITAR_Bau_L);
Mdl_SetModelFatness (self, 2);
Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 15); //Grenzen für Talent-Level liegen bei 30 und 60
// ------ TA anmelden ------
daily_routine = Rtn_Start_1423;
};
FUNC VOID Rtn_Start_1423 ()
{
TA_Smalltalk (08,00,22,00,"NW_TAVERNE_IN_05");
TA_Smalltalk (22,00,08,00,"NW_TAVERNE_IN_05");
};
| D |
/*******************************************************************************
Contains the routing path encoding structure.
An origin node which wishes to make a payment to a destination node needs
to find a route to the destination node. Once it does, it needs to
be able to encode this in a single structure so it may forward it to the
first hop in the payment route, which in turn forwards it to the next hop,
and so on..
Consider payment of A to D via A -> B -> C -> D:
The origin node must encode the payment route for each hop (B, C, D).
It must do it in a way that each hop node only knows where to forward
the packet to next, but may not know the entire route path.
NOTE: See https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md
NOTE: See https://medium.com/softblocks/lightning-network-in-depth-part-2-htlc-and-payment-routing-db46aea445a8
Copyright:
Copyright (c) 2019-2021 BOSAGORA Foundation
All rights reserved.
License:
MIT License. See LICENSE for details.
*******************************************************************************/
module agora.flash.OnionPacket;
import agora.flash.ErrorCode;
import agora.flash.Route;
import agora.flash.Types;
import agora.common.Amount;
import agora.common.Types;
import agora.crypto.ECC;
import agora.crypto.Schnorr;
import agora.crypto.Hash;
import agora.crypto.Key;
import agora.script.Lock;
import agora.script.Script;
import agora.serialization.Serializer;
import agora.utils.Log;
import libsodium.randombytes;
import libsodium.crypto_secretbox;
import libsodium.crypto_generichash;
import std.range;
import core.stdc.time;
version (unittest)
{
import std.stdio;
}
mixin AddLogger!();
/// Onion protocol version
public const enum OnionVersion = 0;
/// Per-hop onion packet
public struct OnionPacket
{
// version byte for compatibility
public ubyte version_byte;
// ephemeral key that's used with the receiver's private key to derive the
// shared secret for decrypting
public Point ephemeral_pk;
// encrypted payload. The first one decrypts & deserializes to a `Payload`.
// the next payload may or may not be legitimate, but it depends entirely
// on the next node's ability to decrypt the payload.
public EncryptedPayload[MaxPathLength] encrypted_payloads;
}
/// Contains the encrypted payload and the nonce used to encrypt it
struct EncryptedPayload
{
/// Nonce used for encryption
public ubyte[crypto_secretbox_NONCEBYTES] nonce;
/// The serialized & encrypted payload
public ubyte[crypto_secretbox_MACBYTES + SerializedPayloadSize] payload;
}
// Payload size without the encryption metadata
private enum SerializedPayloadSize = 72;
/// always same static size, no VarInt
unittest
{
assert(serializeFull(Payload.init).length == SerializedPayloadSize);
}
/// Decrypted Payload which is originally stored encrypted in the OnionPacket
public struct Payload
{
/// The channel ID to forward the next packet to. If this is zero,
/// it means this was the destination node.
public Hash next_chan_id;
/// the amount to forward to the next node, or the total payment amount
/// if this was the final node.
///
/// for hops need to verify:
/// `incoming_htlc_amt - fee_next_node >= forward_amount`
/// for final nodes need to verify:
/// `incoming_htlc_amt == forward_amount`
public Amount forward_amount;
/// Serialization hook
public void serialize (scope SerializeDg dg) const @trusted
{
serializePart(this.next_chan_id, dg, CompactMode.No);
serializePart(this.forward_amount, dg, CompactMode.No);
}
/// Deserialization hook
public static QT fromBinary (QT) (
scope DeserializeDg dg, in DeserializerOptions opts) @safe
{
auto next_chan_id = deserializeFull!Hash(dg, opts);
auto forward_amount = deserializeFull!Amount(dg, opts);
return QT(next_chan_id, forward_amount);
}
}
/// Upper bound on the path length
public enum MaxPathLength = 20;
/*******************************************************************************
Create an onion packet for the given path. Each hop will contain an
ephemeral public key to derive a common secret with which the hop's
payload will be encrypted and may later be decrypted by the hop node
which owns their private key.
The onion packet is fixed in size, and uses encrypted padding bytes
to obfuscate its true size. When a node peels of their layer of the
encrypted packet, it adds additional pading to fill the packet size
back to its expected fixed length size.
Params:
lock_height = the initial lock height
amount = the amount for the payment
path = the individual hops (including destination hop)
total_amount = will contain the amount which needs to be paid to the
first channel along the route. Different to `amount` as it also
includes fees.
shared_secrets = shared secret used in each hop. (in reverse)
Returns:
the onion packet ready to be routed through the first payment path.
*******************************************************************************/
public OnionPacket createOnionPacket (in Amount amount, in Hop[] path,
out Amount total_amount, out Height use_lock_height,
out Point[] shared_secrets) @safe
{
assert(path.length >= 1 && path.length <= MaxPathLength);
// todo: setting fees should be part of the routing algorithm
total_amount = amount;
foreach (hop; path)
{
if (!total_amount.add(hop.fee))
assert(0);
}
Amount forward_amount = amount;
use_lock_height = Height(0);
Hash next_chan_id;
Pair ephemeral_kp = Pair.random();
OnionPacket packet = { version_byte : OnionVersion };
// onion packets have to be created from right to left
ulong last_index = path.length - 1;
foreach (hop; path.retro)
{
Payload payload =
{
next_chan_id : next_chan_id,
forward_amount : forward_amount,
};
Point shared_secret;
auto encrypted_payload = encryptPayload(payload, ephemeral_kp,
hop.pub_key, shared_secret);
shared_secrets ~= shared_secret;
packet.encrypted_payloads[last_index] = encrypted_payload;
last_index--;
if (!forward_amount.add(hop.fee))
assert(0);
// todo: use htlc_delta config here from the channel config
use_lock_height = Height(use_lock_height + hop.htlc_delta);
next_chan_id = hop.chan_id;
// keep updating last valid ephemeral key
packet.ephemeral_pk = ephemeral_kp.V;
// todo: use hashing for derivation instead
auto next_secret = ephemeral_kp.v + Scalar(hashFull(1));
ephemeral_kp = Pair(next_secret, next_secret.toPoint());
}
// fill out the rest with encrypted filler
foreach (ref payload; packet.encrypted_payloads[path.length .. $])
fillGarbage(payload);
return packet;
}
///
unittest
{
Pair kp1 = Pair.random();
Pair kp2 = Pair.random();
Pair kp3 = Pair.random();
Pair kp4 = Pair.random();
Hop[] hops = [
Hop(kp1.V, hashFull(1), Amount(100), 1),
Hop(kp2.V, hashFull(2), Amount(200), 1),
Hop(kp3.V, hashFull(3), Amount(300), 1),
Hop(kp4.V, hashFull(4), Amount(400), 1),
];
Amount total_amount;
Height use_lock_height;
Point[] shared_secrets;
auto packet = createOnionPacket(Amount(1000),
hops, total_amount, use_lock_height, shared_secrets);
assert(total_amount == Amount(2000));
assert(use_lock_height == 4);
Point shared_secret;
Payload payload;
assert(!decryptPayload(packet.encrypted_payloads[0],
kp2.v, packet.ephemeral_pk, payload)); // cannot decrypt with other keys
assert(decryptPayload(packet.encrypted_payloads[0],
kp1.v, packet.ephemeral_pk, payload, shared_secret));
assert(shared_secrets[3] == shared_secret);
assert(payload == Payload(hashFull(2), Amount(1900)));
assert(!decryptPayload(packet.encrypted_payloads[1],
kp2.v, packet.ephemeral_pk, payload)); // cannot decrypt with same ephemeral key
packet = nextPacket(packet); // switch ephemeral key
assert(decryptPayload(packet.encrypted_payloads[0],
kp2.v, packet.ephemeral_pk, payload, shared_secret));
assert(shared_secrets[2] == shared_secret);
assert(payload == Payload(hashFull(3), Amount(1700)));
packet = nextPacket(packet);
assert(decryptPayload(packet.encrypted_payloads[0],
kp3.v, packet.ephemeral_pk, payload, shared_secret));
assert(shared_secrets[1] == shared_secret);
assert(payload == Payload(hashFull(4), Amount(1400)));
packet = nextPacket(packet);
assert(decryptPayload(packet.encrypted_payloads[0],
kp4.v, packet.ephemeral_pk, payload, shared_secret));
assert(shared_secrets[0] == shared_secret);
assert(payload == Payload(Hash.init, Amount(1000)));
}
/// Fill the payload with random encrypted data so it looks real but it ain't
private void fillGarbage (ref EncryptedPayload payload) @trusted
{
randombytes_buf(payload.nonce.ptr, payload.nonce.length);
auto ephemeral_kp = Pair.random();
ubyte[32] key_bytes = ephemeral_kp.v[][0 .. 32];
randombytes_buf_deterministic(payload.payload.ptr,
payload.payload.length, key_bytes);
}
/// Create the next packet for routing (if the next channel ID is not empty)
public OnionPacket nextPacket (in OnionPacket packet)
{
OnionPacket next = packet.serializeFull.deserializeFull!OnionPacket();
next.encrypted_payloads[0 .. $ - 1] = cast(EncryptedPayload[])packet.encrypted_payloads[1 .. $];
fillGarbage(next.encrypted_payloads[$ - 1]);
auto next_point = packet.ephemeral_pk - Scalar(hashFull(1)).toPoint;
next.ephemeral_pk = next_point;
return next;
}
/*******************************************************************************
Encrypt the payload with the shared secret generated from the ephemeral
key-pair and the target node's public key.
Params:
payload = the raw payload
ephemeral_kp = the ephemeral key-pair that's generated uniquely for
each new payload
target_pk = the target node's public key
shared_secret = secret used to encrypt the payload
Returns:
the serialized and encrypted payload
*******************************************************************************/
public EncryptedPayload encryptPayload (Payload payload, Pair ephemeral_kp,
Point target_pk, out Point shared_secret) @trusted
{
EncryptedPayload result;
randombytes_buf(result.nonce.ptr, result.nonce.length);
const data = payload.serializeFull();
shared_secret = generateSharedSecret(true, ephemeral_kp.v, target_pk);
if (crypto_secretbox_easy(result.payload.ptr, data.ptr, data.length,
result.nonce.ptr, shared_secret[].ptr) != 0)
assert(0); // this should never fail
return result;
}
/// Ditto
public EncryptedPayload encryptPayload (Payload payload, Pair ephemeral_kp,
Point target_pk)
{
Point shared_secret;
return encryptPayload (payload, ephemeral_kp, target_pk, shared_secret);
}
/*******************************************************************************
Decrypt an encrypted payload with the shared secret generated from the
ephemeral public key and the target node's private key.
Params:
encrypted = the encrypted payload
our_key = the target node's private key
ephemeral_pk = the ephemeral public key
payload = on success will contain the decrypted payload
shared_secret = secret used to decrypt the payload
Returns:
true if decryption and deserialization succeeded
*******************************************************************************/
public bool decryptPayload (in EncryptedPayload encrypted,
in Scalar our_key, in Point ephemeral_pk, out Payload payload,
out Point shared_secret)
{
if (encrypted.payload.length <= crypto_secretbox_MACBYTES)
return false;
shared_secret = generateSharedSecret(false, our_key, ephemeral_pk);
ubyte[] decrypted
= new ubyte[](encrypted.payload.length - crypto_secretbox_MACBYTES);
if (crypto_secretbox_open_easy(decrypted.ptr, encrypted.payload.ptr,
encrypted.payload.length, encrypted.nonce.ptr, shared_secret[].ptr) != 0)
{
log.info("Decrypting failed for key {} and ephemeral key {}",
our_key, ephemeral_pk);
return false;
}
assert(decrypted.length == SerializedPayloadSize);
try
{
const DeserializerOptions opts = { maxLength : DefaultMaxLength,
compact : CompactMode.No };
import std.format;
scope DeserializeDg dg = (size) @safe
{
if (size > decrypted.length)
throw new Exception(
format("Requested %d bytes but only %d bytes available", size, decrypted.length));
auto res = decrypted[0 .. size];
decrypted = decrypted[size .. $];
return res;
};
payload = deserializeFull!Payload(dg, opts);
return true;
}
catch (Exception ex)
{
log.info("Failed to deserialize decrtyped payload: {}", ex);
return false;
}
}
/// Ditto
public bool decryptPayload (in EncryptedPayload encrypted,
in Scalar our_key, in Point ephemeral_pk, out Payload payload)
{
Point shared_secret;
return decryptPayload (encrypted, our_key, ephemeral_pk, payload, shared_secret);
}
///
unittest
{
Payload payload =
{
next_chan_id : hashFull(42),
forward_amount : Amount(123),
};
Pair ephemeral_kp = Pair.random();
Pair bob_kp = Pair.random();
EncryptedPayload encrypted = encryptPayload(payload, ephemeral_kp, bob_kp.V);
Payload decrypted;
assert(decryptPayload(encrypted, bob_kp.v, ephemeral_kp.V, decrypted));
assert(decrypted == payload);
}
/*******************************************************************************
Generate a shared secret to encrypt / decrypt a payload between two parties.
Params:
is_sender = the sender encrypts, therefore `our_secret` is the sender's
ephemeral secret key. The receiver must set this to false to make
sure internal hashing is consistent between sender & receiver
our_secret = either the ephemeral secret key, or the receiver's secret
key if `is_sender` is false
their_pubkey = either the ephemeral public key, or the receiver's public
key if `is_sender` is false
Returns:
a shared secret which can be used for encryption
*******************************************************************************/
public Point generateSharedSecret (bool is_sender, Scalar our_secret,
Point their_pubkey) @trusted nothrow
{
auto shared_key = our_secret * their_pubkey;
// hashing is recommended
Hash hash;
if (is_sender) // order of keys in call to hashMulti() must be preserved
hash = hashMulti(shared_key, our_secret.toPoint(), their_pubkey);
else
hash = hashMulti(shared_key, their_pubkey, our_secret.toPoint());
// need to reduce 64-byte hash to 32-bytes
ubyte[32] reduced;
assert(crypto_generichash(reduced[].ptr, typeof(reduced).sizeof,
hash[].ptr, hash.sizeof, null, 0) == 0);
return Point(reduced[]);
}
///
unittest
{
Pair alice = Pair.random();
Pair bob = Pair.random();
Point secret1 = generateSharedSecret(true, alice.v, bob.V);
Point secret2 = generateSharedSecret(false, bob.v, alice.V);
assert(secret1 == secret2);
static struct S
{
int x = 123;
}
S s;
const payload = s.serializeFull();
ubyte[crypto_secretbox_NONCEBYTES] nonce;
randombytes_buf(nonce.ptr, nonce.length);
auto ciphertext_len = crypto_secretbox_MACBYTES + payload.length;
ubyte[] ciphertext = new ubyte[](ciphertext_len);
if (crypto_secretbox_easy(ciphertext.ptr, payload.ptr, payload.length,
nonce.ptr, secret1[].ptr) != 0)
assert(0);
ubyte[] decrypted = new ubyte[](payload.length);
if (crypto_secretbox_open_easy(decrypted.ptr, ciphertext.ptr,
ciphertext_len, nonce.ptr, secret1[].ptr) != 0)
assert(0);
S deserialized = deserializeFull!S(decrypted);
assert(deserialized.x == s.x);
}
/// OnionPacket payment router
public alias PaymentRouter =
void delegate (in PublicKey pk, in Hash chan_id, in Hash payment_hash,
in Amount amount, in Height lock_height, in OnionPacket packet);
/// Routing failure packet
public struct OnionError
{
/// Failed payment hash
Hash payment_hash;
/// Point of failure
Hash chan_id;
/// Error code
ErrorCode err;
}
/*******************************************************************************
Obfuscate/deobfuscate an OnionError with the given secret.
Params:
error = Error to obfuscate/deobfuscate
secret = Shared secret
Returns:
Obfuscated/deobfuscated OnionError
*******************************************************************************/
public OnionError obfuscate (OnionError error, Point secret) @trusted
{
import libsodium.crypto_stream_chacha20;
const key = hashFull(secret);
static assert(key.sizeof >= crypto_stream_chacha20_KEYBYTES);
static assert(error.payment_hash.sizeof >= crypto_stream_chacha20_NONCEBYTES);
ubyte[OnionError.sizeof] stream;
crypto_stream_chacha20(stream.ptr, stream.length, error.payment_hash[].ptr, key[].ptr);
// Don't obfuscate payment_hash
stream[OnionError.payment_hash.offsetof ..
OnionError.payment_hash.offsetof + OnionError.payment_hash.sizeof] = 0;
ubyte* obfuscated_array = cast(ubyte*) &error;
foreach (idx; 0 .. OnionError.sizeof)
obfuscated_array[idx] ^= stream[idx];
return error;
}
unittest
{
auto org = OnionError(hashFull(2), hashFull(3),
ErrorCode.LockTooLarge);
const secret = Pair.random.V;
auto obfuscated = org.obfuscate(secret);
assert(org != obfuscated);
assert(org.payment_hash == obfuscated.payment_hash);
auto deobfuscated = obfuscated.obfuscate(secret);
assert(org == deobfuscated);
}
| D |
/**
Deals with D-specific translation, such as avoiding keywords
*/
module include.cursor.dlang;
bool isKeyword (string str) @safe @nogc pure nothrow {
switch (str) {
default: return false;
case "abstract":
case "alias":
case "align":
case "asm":
case "assert":
case "auto":
case "body":
case "bool":
case "break":
case "byte":
case "case":
case "cast":
case "catch":
case "cdouble":
case "cent":
case "cfloat":
case "char":
case "class":
case "const":
case "continue":
case "creal":
case "dchar":
case "debug":
case "default":
case "delegate":
case "delete":
case "deprecated":
case "do":
case "double":
case "else":
case "enum":
case "export":
case "extern":
case "false":
case "final":
case "finally":
case "float":
case "for":
case "foreach":
case "foreach_reverse":
case "function":
case "goto":
case "idouble":
case "if":
case "ifloat":
case "import":
case "in":
case "inout":
case "int":
case "interface":
case "invariant":
case "ireal":
case "is":
case "lazy":
case "long":
case "macro":
case "mixin":
case "module":
case "new":
case "nothrow":
case "null":
case "out":
case "override":
case "package":
case "pragma":
case "private":
case "protected":
case "public":
case "pure":
case "real":
case "ref":
case "return":
case "scope":
case "shared":
case "short":
case "static":
case "struct":
case "super":
case "switch":
case "synchronized":
case "template":
case "this":
case "throw":
case "true":
case "try":
case "typedef":
case "typeid":
case "typeof":
case "ubyte":
case "ucent":
case "uint":
case "ulong":
case "union":
case "unittest":
case "ushort":
case "version":
case "void":
case "volatile":
case "wchar":
case "while":
case "with":
case "immutable":
case "__gshared":
case "__thread":
case "__traits":
case "__EOF__":
case "__FILE__":
case "__LINE__":
case "__DATE__":
case "__TIME__":
case "__TIMESTAMP__":
case "__VENDOR__":
case "__VERSION__":
return true;
}
assert(0);
}
| D |
import std.stdio,
std.file,
std.process,
std.array,
std.algorithm;
void main(){
if(!std.file.exists("resource/primary_area.xml"))
throw new Error("File Not Found - primary_area.xml");
string[] listC = ["lib/jsonTools.d",
"lib/rssTools.d",
"lib/weather.d",
"lib/weatherNotify.d",
"main.d"];
string option = "-L-lcurl";
string[] listO;
listO.length = listC.length;
foreach(i, x; listC){
string[] y;
if(x.find("/")){
y.length = 2;
y = x.split("/")[x.split("/").length - 1].split(".");
} else {
y.length = 2;
y = x.split(".");
}
y[1] = "o";
listO[i] = y.join(".");
}
foreach(e; listC){
string buildCMD = "dmd -c " ~ e;
writeln("[compile] ", buildCMD);
system(buildCMD);
writeln("Success");
}
string linkCMD = "dmd " ~ listO.reverse.join(" ") ~ " " ~ option;
writeln("[link] ", linkCMD);
system(linkCMD);
foreach(e; listO){
string clearCMD = "rm " ~ e;
writeln("[clear] ", clearCMD);
system(clearCMD);
}
}
| D |
/Users/zhouzhenyong/project/rust-github/rust-learn/web/target/debug/build/brotli-sys-2c488f825b819445/build_script_build-2c488f825b819445: /Users/zhouzhenyong/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-sys-0.3.2/build.rs
/Users/zhouzhenyong/project/rust-github/rust-learn/web/target/debug/build/brotli-sys-2c488f825b819445/build_script_build-2c488f825b819445.d: /Users/zhouzhenyong/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-sys-0.3.2/build.rs
/Users/zhouzhenyong/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-sys-0.3.2/build.rs:
| D |
/*
* Functions.d
*
* Author: Alex Horvat <alex.horvat9@gmail.com>
*
* Copyright (c) 2013 Alex Horvat
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
module kav.Include.Functions;
debug alias std.stdio.writeln output;
import gtk.Main;
import kav.Include.Config;
import std.file;
import std.path:expandTilde;
import std.string:lastIndexOf;
public static class Functions
{
public:
/**
* Get a hashtable of all currently downloaded files.
* Returns: Hashtable containing all paths of downloaded files.
*/
static bool[string] getDownloadedFiles()
{
debug output(__FUNCTION__);
//Load all existing mp4 files into hashtable then pass to RecurseOfflineLibrary
//this is faster than accessing the disc everytime to check if a file exists
bool[string] downloadedFiles;
string downloadDirectory = expandTilde(DOWNLOAD_FILE_PATH);
foreach(DirEntry file; dirEntries(downloadDirectory, "*.mp4", SpanMode.shallow, false))
{
downloadedFiles[file[file.lastIndexOf("/") .. $]] = true;
}
downloadedFiles.rehash();
return downloadedFiles;
}
/**
* Find the local file name of a supplied url.
* This is where a file would be stored if it has been downloaded.
*
* Params:
* url = the remote file name.
*
* Returns: The local file name - regardless of whether the file exists or not.
*/
static string getLocalFileName(string url)
{
return expandTilde(DOWNLOAD_FILE_PATH) ~ url[url.lastIndexOf("/") .. $];
}
/**
* Call the main gtk thread and process any pending UI updates.
* This makes sure the UI doesn't freeze up while other stuff is going on.
*/
static void refreshUI()
{
while (Main.eventsPending)
{
Main.iteration();
}
}
} | D |
instance DIA_Hokurn_EXIT(C_Info)
{
npc = DJG_712_Hokurn;
nr = 999;
condition = DIA_Hokurn_EXIT_Condition;
information = DIA_Hokurn_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Hokurn_EXIT_Condition()
{
return TRUE;
};
func void DIA_Hokurn_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Hokurn_Hello(C_Info)
{
npc = DJG_712_Hokurn;
nr = 4;
condition = DIA_Hokurn_Hello_Condition;
information = DIA_Hokurn_Hello_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Hokurn_Hello_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (KAPITELORCATC == FALSE) && (HokFirstMeet == FALSE))
{
return TRUE;
};
};
func void DIA_Hokurn_Hello_Info()
{
AI_Output(self,other,"DIA_Hokurn_Hello_01_00"); //У тебя не найдется чего-нибудь выпить?
AI_Output(other,self,"DIA_Hokurn_Hello_15_01"); //Полагаю, вода тебе не подойдет.
AI_Output(self,other,"DIA_Hokurn_Hello_01_02"); //Нет, черт побери!!! Мне нужно что-нибудь алкогольное, чтобы я, наконец, мог избавиться от этой проклятой головной боли.
AI_Output(self,other,"DIA_Hokurn_Hello_01_03"); //Когда мне долго не удается промочить горло, мой череп раскалывается и мне кажется, что он вот-вот взорвется.
Info_ClearChoices(DIA_Hokurn_Hello);
Info_AddChoice(DIA_Hokurn_Hello,"Я ничем не могу помочь тебе.",DIA_Hokurn_Hello_No);
if((Npc_HasItems(other,ItFo_Beer) >= 1) || (Npc_HasItems(other,ItFo_Addon_Rum) >= 1) || (Npc_HasItems(other,ItFo_Addon_Grog) >= 1) || (Npc_HasItems(other,ItFo_Booze) >= 1) || (Npc_HasItems(other,ItFo_Wine) >= 1))
{
Info_AddChoice(DIA_Hokurn_Hello,"Вот, возьми это.",DIA_Hokurn_Hello_Yes);
};
};
func void DIA_Hokurn_Hello_No()
{
AI_Output(other,self,"DIA_Hokurn_Hello_No_15_00"); //Я ничем не могу помочь тебе.
AI_Output(self,other,"DIA_Hokurn_Hello_No_01_01"); //Тогда проваливай!
Info_ClearChoices(DIA_Hokurn_Hello);
Info_AddChoice(DIA_Hokurn_Hello,Dialog_Ende,DIA_Hokurn_Hello_END);
Info_AddChoice(DIA_Hokurn_Hello,"Еще одно...",DIA_Hokurn_Hello_ASK1);
};
func void DIA_Hokurn_Hello_ASK1()
{
AI_Output(other,self,"DIA_Hokurn_Hello_ASK1_15_00"); //Еще одно...
AI_Output(self,other,"DIA_Hokurn_Hello_ASK1_01_01"); //(ревет) Ты что, не понял меня? УБИРАЙСЯ!!!
Info_ClearChoices(DIA_Hokurn_Hello);
Info_AddChoice(DIA_Hokurn_Hello,Dialog_Ende,DIA_Hokurn_Hello_END);
Info_AddChoice(DIA_Hokurn_Hello,"Это важно.",DIA_Hokurn_Hello_ASK2);
};
func void DIA_Hokurn_Hello_ASK2()
{
AI_Output(other,self,"DIA_Hokurn_Hello_ASK2_15_00"); //Это важно.
AI_Output(self,other,"DIA_Hokurn_Hello_ASK2_01_01"); //(ревет) Ты сам напросился.
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
func void DIA_Hokurn_Hello_END()
{
AI_StopProcessInfos(self);
};
func void B_Hokurn_Sauf()
{
AI_Output(self,other,"B_Hokurn_Sauf_01_00"); //(рыгает) Ох, какое блаженство!
AI_Output(self,other,"B_Hokurn_Sauf_01_01"); //Теперь я опять могу размышлять здраво. Что я могу сделать для тебя?
};
func void b_hokurn_drinking()
{
if(Npc_HasItems(other,ItFo_Booze) >= 1)
{
B_GiveInvItems(other,self,ItFo_Booze,1);
B_UseItem(self,ItFo_Booze);
}
else if(Npc_HasItems(other,ItFo_Wine) >= 1)
{
B_GiveInvItems(other,self,ItFo_Wine,1);
B_UseItem(self,ItFo_Wine);
}
else if(Npc_HasItems(other,ItFo_Beer) >= 1)
{
B_GiveInvItems(other,self,ItFo_Beer,1);
B_UseItem(self,ItFo_Beer);
}
else if(Npc_HasItems(other,ItFo_Addon_Rum) >= 1)
{
B_GiveInvItems(other,self,ItFo_Addon_Rum,1);
B_UseItem(self,ItFo_Addon_Rum);
}
else if(Npc_HasItems(other,ItFo_Addon_Grog) >= 1)
{
B_GiveInvItems(other,self,ItFo_Addon_Grog,1);
B_UseItem(self,ItFo_Addon_Grog);
};
HokurnLastDrink = Wld_GetDay();
HokurnGetsDrink = TRUE;
};
func void b_hokurn_taking()
{
if(Npc_HasItems(other,ItFo_Booze) >= 1)
{
B_GiveInvItems(other,self,ItFo_Booze,1);
}
else if(Npc_HasItems(other,ItFo_Wine) >= 1)
{
B_GiveInvItems(other,self,ItFo_Wine,1);
}
else if(Npc_HasItems(other,ItFo_Beer) >= 1)
{
B_GiveInvItems(other,self,ItFo_Beer,1);
}
else if(Npc_HasItems(other,ItFo_Addon_Rum) >= 1)
{
B_GiveInvItems(other,self,ItFo_Addon_Rum,1);
}
else if(Npc_HasItems(other,ItFo_Addon_Grog) >= 1)
{
B_GiveInvItems(other,self,ItFo_Addon_Grog,1);
};
};
func void DIA_Hokurn_Hello_Yes()
{
AI_Output(other,self,"DIA_Hokurn_Hello_Yes_15_00"); //У меня есть кое-что.
b_hokurn_drinking();
B_Hokurn_Sauf();
Info_ClearChoices(DIA_Hokurn_Hello);
};
instance DIA_Hokurn_Drink(C_Info)
{
npc = DJG_712_Hokurn;
nr = 5;
condition = DIA_Hokurn_Drink_Condition;
information = DIA_Hokurn_Drink_Info;
permanent = TRUE;
description = "Я принес тебе выпивку.";
};
func int DIA_Hokurn_Drink_Condition()
{
if((KAPITELORCATC == FALSE) && (HokurnGetsDrink == FALSE) && ((Npc_HasItems(other,ItFo_Beer) >= 1) || (Npc_HasItems(other,ItFo_Addon_Rum) >= 1) || (Npc_HasItems(other,ItFo_Addon_Grog) >= 1) || (Npc_HasItems(other,ItFo_Booze) >= 1) || (Npc_HasItems(other,ItFo_Wine) >= 1)))
{
return TRUE;
};
};
func void DIA_Hokurn_Drink_Info()
{
AI_Output(other,self,"DIA_Hokurn_Drink_15_00"); //Я принес тебе выпивку.
AI_Output(self,other,"DIA_Hokurn_Drink_01_01"); //(жадно) Давай сюда!!
b_hokurn_drinking();
B_Hokurn_Sauf();
};
instance DIA_Hokurn_Question(C_Info)
{
npc = DJG_712_Hokurn;
nr = 5;
condition = DIA_Hokurn_Question_Condition;
information = DIA_Hokurn_Question_Info;
permanent = TRUE;
description = "Мне нужна кое-какая информация.";
};
func int DIA_Hokurn_Question_Condition()
{
if((HokurnGetsDrink == FALSE) && (KAPITELORCATC == FALSE))
{
return TRUE;
};
};
func void DIA_Hokurn_Question_Info()
{
AI_Output(other,self,"DIA_Hokurn_Question_15_00"); //Мне нужна кое-какая информация.
AI_Output(self,other,"DIA_Hokurn_Question_01_01"); //(раздраженно) Я думал, ты меня понял. Я говорю только с друзьями.
AI_Output(self,other,"DIA_Hokurn_Question_01_02"); //А друзья всегда делятся со мной выпивкой. Понял? Теперь проваливай!
};
instance DIA_Hokurn_Learn(C_Info)
{
npc = DJG_712_Hokurn;
nr = 6;
condition = DIA_Hokurn_Learn_Condition;
information = DIA_Hokurn_Learn_Info;
permanent = FALSE;
description = "Я ищу человека, который мог бы научить меня чему-нибудь.";
};
func int DIA_Hokurn_Learn_Condition()
{
if(HokurnGetsDrink == TRUE)
{
return TRUE;
};
};
func void DIA_Hokurn_Learn_Info()
{
AI_Output(other,self,"DIA_Hokurn_Learn_15_00"); //Я ищу человека, который мог бы научить меня чему-нибудь.
AI_Output(self,other,"DIA_Hokurn_Learn_01_01"); //Я мог бы обучить тебя некоторым вещам. Я лучший боец на многие мили вокруг.
AI_Output(self,other,"DIA_Hokurn_Learn_01_02"); //Так как мы друзья, я сделаю тебе скидку. Это будет стоить триста золотых монет.
Info_ClearChoices(DIA_Hokurn_Learn);
Info_AddChoice(DIA_Hokurn_Learn,"Это слишком дорого.",DIA_Hokurn_Learn_TooExpensive);
if(Npc_HasItems(other,ItMi_Gold) >= 300)
{
Info_AddChoice(DIA_Hokurn_Learn,"В порядке, вот золото.",DIA_Hokurn_Learn_OK);
};
};
func void DIA_Hokurn_Learn_TooExpensive()
{
AI_Output(other,self,"DIA_Hokurn_Learn_TooExpensive_15_00"); //Это для меня слишком дорого.
AI_Output(self,other,"DIA_Hokurn_Learn_TooExpensive_01_01"); //Слишком дорого? Это меньше, чем любой другой запросил бы на моем месте.
AI_Output(self,other,"DIA_Hokurn_Learn_TooExpensive_01_02"); //Ну, сам подумай.
Info_ClearChoices(DIA_Hokurn_Learn);
};
func void DIA_Hokurn_Learn_OK()
{
AI_Output(other,self,"DIA_Hokurn_Learn_OK_15_00"); //Хорошо, вот деньги.
B_GiveInvItems(other,self,ItMi_Gold,300);
Hokurn_TeachPlayer = TRUE;
Info_ClearChoices(DIA_Hokurn_Learn);
};
instance DIA_Hokurn_PayTeacher(C_Info)
{
npc = DJG_712_Hokurn;
nr = 6;
condition = DIA_Hokurn_PayTeacher_Condition;
information = DIA_Hokurn_PayTeacher_Info;
permanent = TRUE;
description = "Вот твои деньги. Я хочу, чтобы ты обучил меня.";
};
func int DIA_Hokurn_PayTeacher_Condition()
{
if(Npc_KnowsInfo(other,DIA_Hokurn_Learn) && (Npc_HasItems(other,ItMi_Gold) >= 300) && (Hokurn_TeachPlayer == FALSE))
{
return TRUE;
};
};
func void DIA_Hokurn_PayTeacher_Info()
{
AI_Output(other,self,"DIA_Hokurn_PayTeacher_15_00"); //Вот твои деньги. Я хочу, чтобы ты обучил меня.
AI_Output(self,other,"DIA_Hokurn_PayTeacher_01_01"); //Ты не пожалеешь!
B_GiveInvItems(other,self,ItMi_Gold,300);
Hokurn_TeachPlayer = TRUE;
};
instance DIA_Hokurn_DrinkAndLearn(C_Info)
{
npc = DJG_712_Hokurn;
nr = 7;
condition = DIA_Hokurn_DrinkAndLearn_Condition;
information = DIA_Hokurn_DrinkAndLearn_Info;
permanent = TRUE;
description = "Вот, держи выпивку.";
};
func int DIA_Hokurn_DrinkAndLearn_Condition()
{
if((KAPITELORCATC == FALSE) && (HokurnGetsDrink == TRUE) && ((Npc_HasItems(other,ItFo_Booze) >= 1) || (Npc_HasItems(other,ItFo_Wine) >= 1) || (Npc_HasItems(other,ItFo_Beer) >= 1)))
{
return TRUE;
};
};
func void DIA_Hokurn_DrinkAndLearn_Info()
{
AI_Output(other,self,"DIA_Hokurn_DrinkAndLearn_15_00"); //Теперь у тебя есть, что выпить.
b_hokurn_drinking();
AI_Output(self,other,"DIA_Hokurn_DrinkAndLearn_01_01"); //Мне гораздо лучше.
};
instance DIA_Hokurn_Teach(C_Info)
{
npc = DJG_712_Hokurn;
nr = 7;
condition = DIA_Hokurn_Teach_Condition;
information = DIA_Hokurn_Teach_Info;
permanent = TRUE;
description = "Начнем обучение.";
};
func int DIA_Hokurn_Teach_Condition()
{
if(Hokurn_TeachPlayer == TRUE)
{
return TRUE;
};
};
func void DIA_Hokurn_Teach_Info()
{
AI_Output(other,self,"DIA_Hokurn_Teach_15_00"); //Давай начнем обучение.
if(HokurnLastDrink < Wld_GetDay())
{
AI_Output(self,other,"DIA_Hokurn_Teach_01_01"); //Сначала принеси мне что-нибудь выпить!
}
else
{
if(hero.guild == GIL_PAL)
{
AI_Output(self,other,"DIA_Hokurn_Teach_01_02"); //А потом мы посмотрим, что можно выжать из твоих ржавых паладинских костей, ха?
}
else if((hero.guild == GIL_KDF) || (hero.guild == GIL_KDW) || (hero.guild == GIL_KDM) || (hero.guild == GIL_GUR))
{
AI_Output(self,other,"DIA_Hokurn_Teach_01_03"); //Что ты понимаешь. Даже маги не чуждаются оружия ближнего боя.
};
Info_ClearChoices(DIA_Hokurn_Teach);
Info_AddChoice(DIA_Hokurn_Teach,Dialog_Back,DIA_Hokurn_Teach_Back);
Info_AddChoice(DIA_Hokurn_Teach,b_buildlearnstringforfight(PRINT_Learn2h1,B_GetLearnCostTalent(other,NPC_TALENT_2H,1)),DIA_Hokurn_Teach_2H_1);
Info_AddChoice(DIA_Hokurn_Teach,b_buildlearnstringforfight(PRINT_Learn2h5,B_GetLearnCostTalent(other,NPC_TALENT_2H,5)),DIA_Hokurn_Teach_2H_5);
Info_AddChoice(DIA_Hokurn_Teach,b_buildlearnstringforfight(PRINT_Learn1h1,B_GetLearnCostTalent(other,NPC_TALENT_1H,1)),DIA_Hokurn_Teach_1H_1);
Info_AddChoice(DIA_Hokurn_Teach,b_buildlearnstringforfight(PRINT_Learn1h5,B_GetLearnCostTalent(other,NPC_TALENT_1H,5)),DIA_Hokurn_Teach_1H_5);
};
};
func void DIA_Hokurn_Teach_Back()
{
Info_ClearChoices(DIA_Hokurn_Teach);
};
func void B_Hokurn_TeachedEnough()
{
AI_Output(self,other,"B_Hokurn_TeachedEnough_01_00"); //Тебе больше не нужен учитель в этом виде боевого искусства.
};
func void DIA_Hokurn_Teach_2H_1()
{
B_TeachFightTalentPercent(self,other,NPC_TALENT_2H,1,100);
if(other.HitChance[NPC_TALENT_2H] >= 100)
{
B_Hokurn_TeachedEnough();
};
Info_AddChoice(DIA_Hokurn_Teach,b_buildlearnstringforfight(PRINT_Learn2h1,B_GetLearnCostTalent(other,NPC_TALENT_2H,1)),DIA_Hokurn_Teach_2H_1);
};
func void DIA_Hokurn_Teach_2H_5()
{
B_TeachFightTalentPercent(self,other,NPC_TALENT_2H,5,100);
if(other.HitChance[NPC_TALENT_2H] >= 100)
{
B_Hokurn_TeachedEnough();
};
Info_AddChoice(DIA_Hokurn_Teach,b_buildlearnstringforfight(PRINT_Learn2h5,B_GetLearnCostTalent(other,NPC_TALENT_2H,5)),DIA_Hokurn_Teach_2H_5);
};
func void DIA_Hokurn_Teach_1H_1()
{
B_TeachFightTalentPercent(self,other,NPC_TALENT_1H,1,100);
if(other.HitChance[NPC_TALENT_1H] >= 100)
{
B_Hokurn_TeachedEnough();
};
Info_AddChoice(DIA_Hokurn_Teach,b_buildlearnstringforfight(PRINT_Learn1h1,B_GetLearnCostTalent(other,NPC_TALENT_1H,1)),DIA_Hokurn_Teach_1H_1);
};
func void DIA_Hokurn_Teach_1H_5()
{
B_TeachFightTalentPercent(self,other,NPC_TALENT_1H,5,100);
if(other.HitChance[NPC_TALENT_1H] >= 100)
{
B_Hokurn_TeachedEnough();
};
Info_AddChoice(DIA_Hokurn_Teach,b_buildlearnstringforfight(PRINT_Learn1h5,B_GetLearnCostTalent(other,NPC_TALENT_1H,5)),DIA_Hokurn_Teach_1H_5);
};
instance DIA_Hokurn_StayHere(C_Info)
{
npc = DJG_712_Hokurn;
nr = 5;
condition = DIA_Hokurn_StayHere_Condition;
information = DIA_Hokurn_StayHere_Info;
permanent = FALSE;
description = "А что ты вообще здесь делаешь, кстати?";
};
func int DIA_Hokurn_StayHere_Condition()
{
if((HokurnGetsDrink == TRUE) && (KAPITELORCATC == FALSE))
{
return TRUE;
};
};
func void DIA_Hokurn_StayHere_Info()
{
AI_Output(other,self,"DIA_Hokurn_StayHere_15_00"); //Кстати, а что ты вообще здесь делаешь?
AI_Output(self,other,"DIA_Hokurn_StayHere_01_01"); //Если честно, понятия не имею, что мы делаем здесь и когда все начнется.
AI_Output(self,other,"DIA_Hokurn_StayHere_01_02"); //И пока у меня есть выпивка, меня это совершенно не волнует.
};
instance DIA_Hokurn_WhereDragon(C_Info)
{
npc = DJG_712_Hokurn;
nr = 5;
condition = DIA_Hokurn_WhereDragon_Condition;
information = DIA_Hokurn_WhereDragon_Info;
permanent = TRUE;
description = "Ты знаешь, где находятся драконы?";
};
func int DIA_Hokurn_WhereDragon_Condition()
{
if((HokurnGetsDrink == TRUE) && (HokurnTellsDragon == FALSE) && Npc_KnowsInfo(other,DIA_Hokurn_StayHere) && (KAPITELORCATC == FALSE))
{
return TRUE;
};
};
func void DIA_Hokurn_WhereDragon_Info()
{
AI_Output(other,self,"DIA_Hokurn_WhereDragon_15_00"); //Ты знаешь, где находятся драконы?
AI_Output(self,other,"DIA_Hokurn_WhereDragon_01_01"); //А что я получу за то, что скажу это тебе?
Info_ClearChoices(DIA_Hokurn_WhereDragon);
Info_AddChoice(DIA_Hokurn_WhereDragon,"Ничего, я буду искать их сам.",DIA_Hokurn_WhereDragon_FindMyself);
Info_AddChoice(DIA_Hokurn_WhereDragon,"Я мог бы купить у тебя сведения.",DIA_Hokurn_WhereDragon_Gold);
if((Npc_HasItems(other,ItFo_Beer) >= 1) || (Npc_HasItems(other,ItFo_Booze) >= 1) || (Npc_HasItems(other,ItFo_Wine) >= 1) || (Npc_HasItems(other,ItFo_Addon_Rum) >= 1) || (Npc_HasItems(other,ItFo_Addon_Grog) >= 1))
{
Info_AddChoice(DIA_Hokurn_WhereDragon,"У меня есть еще одна бутылка.",DIA_Hokurn_WhereDragon_Booze);
};
};
func void DIA_Hokurn_WhereDragon_FindMyself()
{
AI_Output(other,self,"DIA_Hokurn_WhereDragon_FindMyself_15_00"); //Ничего, я сам их найду.
AI_Output(self,other,"DIA_Hokurn_WhereDragon_FindMyself_01_01"); //Тебе лучше быть поосторожнее. Впереди тебя ждет много кровопролитных боев.
Info_ClearChoices(DIA_Hokurn_WhereDragon);
};
func void DIA_Hokurn_WhereDragon_Gold()
{
AI_Output(other,self,"DIA_Hokurn_WhereDragon_Gold_15_00"); //Я был бы не прочь заплатить тебе за эту информацию.
AI_Output(self,other,"DIA_Hokurn_WhereDragon_Gold_01_01"); //Заплатить мне? Хорошо, я продам тебе эту информацию за двести золотых монет.
Info_ClearChoices(DIA_Hokurn_WhereDragon);
Info_AddChoice(DIA_Hokurn_WhereDragon,"Слишком много.",DIA_Hokurn_WhereDragon_TooMuch);
if(Npc_HasItems(other,ItMi_Gold) >= 200)
{
Info_AddChoice(DIA_Hokurn_WhereDragon,"Согласен, здесь деньги.",DIA_Hokurn_WhereDragon_OK);
};
};
func void DIA_Hokurn_WhereDragon_TooMuch()
{
AI_Output(other,self,"DIA_Hokurn_WhereDragon_TooMuch_15_00"); //Это слишком много!
AI_Output(self,other,"DIA_Hokurn_WhereDragon_TooMuch_01_01"); //Тогда забудь об этом.
Info_ClearChoices(DIA_Hokurn_WhereDragon);
};
func void DIA_Hokurn_WhereDragon_OK()
{
AI_Output(other,self,"DIA_Hokurn_WhereDragon_OK_15_00"); //Договорились. Вот твои деньги!
B_GiveInvItems(other,self,ItMi_Gold,200);
HokurnTellsDragon = TRUE;
Info_ClearChoices(DIA_Hokurn_WhereDragon);
};
func void DIA_Hokurn_WhereDragon_Booze()
{
AI_Output(other,self,"DIA_Hokurn_WhereDragon_Booze_15_00"); //У меня еще есть бутылка!
AI_Output(self,other,"DIA_Hokurn_WhereDragon_Booze_01_01"); //За хорошую каплю я бы всех драконов на свете убил.
AI_Output(self,other,"DIA_Hokurn_WhereDragon_Booze_01_02"); //Заметано. Давай сюда!
b_hokurn_taking();
AI_Output(self,other,"DIA_Hokurn_WhereDragon_Booze_01_03"); //Я оставлю его до худших времен.
HokurnTellsDragon = TRUE;
Info_ClearChoices(DIA_Hokurn_WhereDragon);
};
instance DIA_Hokurn_Dragon(C_Info)
{
npc = DJG_712_Hokurn;
nr = 5;
condition = DIA_Hokurn_Dragon_Condition;
information = DIA_Hokurn_Dragon_Info;
permanent = FALSE;
description = "Хорошо, теперь скажи, где все эти драконы?";
};
func int DIA_Hokurn_Dragon_Condition()
{
if((HokurnTellsDragon == TRUE) && (KAPITELORCATC == FALSE) && (MIS_AllDragonsDead == FALSE))
{
return TRUE;
};
};
func void DIA_Hokurn_Dragon_Info()
{
AI_Output(other,self,"DIA_Hokurn_Dragon_15_00"); //Хорошо, теперь скажи, где все эти драконы?
AI_Output(self,other,"DIA_Hokurn_Dragon_01_01"); //Ну, если честно, я не могу сказать тебе ничего определенного, но я слышал, что всего должно быть четыре дракона.
AI_Output(self,other,"DIA_Hokurn_Dragon_01_02"); //Прошлой ночью над самой высокой горой мы видели багровое свечение.
AI_Output(self,other,"DIA_Hokurn_Dragon_01_03"); //Готов поклясться свой матерью, что если ты ищешь драконов, одного из них ты найдешь там.
};
instance DIA_Hokurn_AllDragonsDead(C_Info)
{
npc = DJG_712_Hokurn;
nr = 5;
condition = DIA_Hokurn_AllDragonsDead_Condition;
information = DIA_Hokurn_AllDragonsDead_Info;
permanent = TRUE;
description = "Я убил всех драконов.";
};
func int DIA_Hokurn_AllDragonsDead_Condition()
{
if((MIS_AllDragonsDead == TRUE) && (KAPITELORCATC == FALSE))
{
return TRUE;
};
};
func void DIA_Hokurn_AllDragonsDead_Info()
{
AI_Output(other,self,"DIA_Hokurn_AllDragonsDead_15_00"); //Я убил всех драконов.
AI_Output(self,other,"DIA_Hokurn_AllDragonsDead_01_01"); //Иди, рассказывай сказки кому-нибудь другому.
};
instance DIA_Hokurn_PICKPOCKET(C_Info)
{
npc = DJG_712_Hokurn;
nr = 900;
condition = DIA_Hokurn_PICKPOCKET_Condition;
information = DIA_Hokurn_PICKPOCKET_Info;
permanent = TRUE;
description = PICKPOCKET_COMM;
};
func int DIA_Hokurn_PICKPOCKET_Condition()
{
return C_Beklauen(69,210);
};
func void DIA_Hokurn_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Hokurn_PICKPOCKET);
Info_AddChoice(DIA_Hokurn_PICKPOCKET,Dialog_Back,DIA_Hokurn_PICKPOCKET_BACK);
Info_AddChoice(DIA_Hokurn_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Hokurn_PICKPOCKET_DoIt);
};
func void DIA_Hokurn_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Hokurn_PICKPOCKET);
};
func void DIA_Hokurn_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Hokurn_PICKPOCKET);
};
instance DIA_HOKURN_FUCKOFF(C_Info)
{
npc = DJG_712_Hokurn;
nr = 2;
condition = dia_hokurn_fuckoff_condition;
information = dia_hokurn_fuckoff_info;
permanent = TRUE;
important = TRUE;
};
func int dia_hokurn_fuckoff_condition()
{
if(Npc_IsInState(self,ZS_Talk) && (DGJREFUSEPALADIN == TRUE))
{
return TRUE;
};
};
func void dia_hokurn_fuckoff_info()
{
B_Say(self,other,"$NOTNOW");
AI_StopProcessInfos(self);
};
//----------------------------------------------------------------------------
instance DIA_Hokurn_SLD_EXIT(C_Info)
{
npc = SLD_849_Hokurn;
nr = 999;
condition = DIA_Hokurn_SLD_EXIT_Condition;
information = DIA_Hokurn_SLD_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Hokurn_SLD_EXIT_Condition()
{
return TRUE;
};
func void DIA_Hokurn_SLD_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Hokurn_SLD_PICKPOCKET(C_Info)
{
npc = SLD_849_Hokurn;
nr = 900;
condition = DIA_Hokurn_SLD_PICKPOCKET_Condition;
information = DIA_Hokurn_SLD_PICKPOCKET_Info;
permanent = TRUE;
description = PICKPOCKET_COMM;
};
func int DIA_Hokurn_SLD_PICKPOCKET_Condition()
{
return C_Beklauen(69,210);
};
func void DIA_Hokurn_SLD_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Hokurn_SLD_PICKPOCKET);
Info_AddChoice(DIA_Hokurn_SLD_PICKPOCKET,Dialog_Back,DIA_Hokurn_SLD_PICKPOCKET_BACK);
Info_AddChoice(DIA_Hokurn_SLD_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Hokurn_SLD_PICKPOCKET_DoIt);
};
func void DIA_Hokurn_SLD_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Hokurn_SLD_PICKPOCKET);
};
func void DIA_Hokurn_SLD_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Hokurn_SLD_PICKPOCKET);
};
instance DIA_Hokurn_NW_Hello(C_Info)
{
npc = SLD_849_Hokurn;
nr = 4;
condition = DIA_Hokurn_NW_Hello_Condition;
information = DIA_Hokurn_NW_Hello_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Hokurn_NW_Hello_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (KAPITELORCATC == FALSE) && (HokFirstMeet == FALSE))
{
return TRUE;
};
};
func void DIA_Hokurn_NW_Hello_Info()
{
AI_Output(self,other,"DIA_Hokurn_Hello_01_00"); //У тебя не найдется чего-нибудь выпить?
AI_Output(other,self,"DIA_Hokurn_Hello_15_01"); //Полагаю, вода тебе не подойдет.
AI_Output(self,other,"DIA_Hokurn_Hello_01_02"); //Нет, черт побери!!! Мне нужно что-нибудь алкогольное, чтобы я, наконец, мог избавиться от этой проклятой головной боли.
AI_Output(self,other,"DIA_Hokurn_Hello_01_03"); //Когда мне долго не удается промочить горло, мой череп раскалывается и мне кажется, что он вот-вот взорвется.
HokFirstMeet = TRUE;
Info_ClearChoices(DIA_Hokurn_NW_Hello);
Info_AddChoice(DIA_Hokurn_NW_Hello,"Я ничем не могу помочь тебе.",DIA_Hokurn_NW_Hello_No);
if((Npc_HasItems(other,ItFo_Beer) >= 1) || (Npc_HasItems(other,ItFo_Addon_Rum) >= 1) || (Npc_HasItems(other,ItFo_Addon_Grog) >= 1) || (Npc_HasItems(other,ItFo_Booze) >= 1) || (Npc_HasItems(other,ItFo_Wine) >= 1))
{
Info_AddChoice(DIA_Hokurn_NW_Hello,"Вот, возьми это.",DIA_Hokurn_NW_Hello_Yes);
};
};
func void DIA_Hokurn_NW_Hello_No()
{
AI_Output(other,self,"DIA_Hokurn_Hello_No_15_00"); //Я ничем не могу помочь тебе.
AI_Output(self,other,"DIA_Hokurn_Hello_No_01_01"); //Тогда проваливай!
Info_ClearChoices(DIA_Hokurn_NW_Hello);
Info_AddChoice(DIA_Hokurn_NW_Hello,Dialog_Ende,DIA_Hokurn_NW_Hello_END);
Info_AddChoice(DIA_Hokurn_NW_Hello,"Еще одно...",DIA_Hokurn_NW_Hello_ASK1);
};
func void DIA_Hokurn_NW_Hello_ASK1()
{
AI_Output(other,self,"DIA_Hokurn_Hello_ASK1_15_00"); //Еще одно...
AI_Output(self,other,"DIA_Hokurn_Hello_ASK1_01_01"); //(ревет)...Ты что, не понял меня? УБИРАЙСЯ!!!
Info_ClearChoices(DIA_Hokurn_NW_Hello);
Info_AddChoice(DIA_Hokurn_NW_Hello,Dialog_Ende,DIA_Hokurn_NW_Hello_END);
Info_AddChoice(DIA_Hokurn_NW_Hello,"Это важно.",DIA_Hokurn_NW_Hello_ASK2);
};
func void DIA_Hokurn_NW_Hello_ASK2()
{
AI_Output(other,self,"DIA_Hokurn_Hello_ASK2_15_00"); //Это важно.
AI_Output(self,other,"DIA_Hokurn_Hello_ASK2_01_01"); //(ревет)...Ты сам напросился!
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
func void DIA_Hokurn_NW_Hello_END()
{
AI_StopProcessInfos(self);
};
func void B_Hokurn_NW_Sauf()
{
AI_Output(self,other,"B_Hokurn_Sauf_01_00"); //(рыгает) Ох, какое блаженство!
AI_Output(self,other,"B_Hokurn_Sauf_01_01"); //Теперь я опять могу размышлять здраво. Что я могу сделать для тебя?
};
func void b_hokurn_NW_drinking()
{
if(Npc_HasItems(other,ItFo_Booze) >= 1)
{
B_GiveInvItems(other,self,ItFo_Booze,1);
B_UseItem(self,ItFo_Booze);
}
else if(Npc_HasItems(other,ItFo_Wine) >= 1)
{
B_GiveInvItems(other,self,ItFo_Wine,1);
B_UseItem(self,ItFo_Wine);
}
else if(Npc_HasItems(other,ItFo_Beer) >= 1)
{
B_GiveInvItems(other,self,ItFo_Beer,1);
B_UseItem(self,ItFo_Beer);
}
else if(Npc_HasItems(other,ItFo_Addon_Rum) >= 1)
{
B_GiveInvItems(other,self,ItFo_Addon_Rum,1);
B_UseItem(self,ItFo_Addon_Rum);
}
else if(Npc_HasItems(other,ItFo_Addon_Grog) >= 1)
{
B_GiveInvItems(other,self,ItFo_Addon_Grog,1);
B_UseItem(self,ItFo_Addon_Grog);
};
HokurnLastDrink = Wld_GetDay();
HokurnGetsDrink = TRUE;
};
func void b_hokurn_NW_taking()
{
if(Npc_HasItems(other,ItFo_Booze) >= 1)
{
B_GiveInvItems(other,self,ItFo_Booze,1);
}
else if(Npc_HasItems(other,ItFo_Wine) >= 1)
{
B_GiveInvItems(other,self,ItFo_Wine,1);
}
else if(Npc_HasItems(other,ItFo_Beer) >= 1)
{
B_GiveInvItems(other,self,ItFo_Beer,1);
}
else if(Npc_HasItems(other,ItFo_Addon_Rum) >= 1)
{
B_GiveInvItems(other,self,ItFo_Addon_Rum,1);
}
else if(Npc_HasItems(other,ItFo_Addon_Grog) >= 1)
{
B_GiveInvItems(other,self,ItFo_Addon_Grog,1);
};
};
func void DIA_Hokurn_NW_Hello_Yes()
{
AI_Output(other,self,"DIA_Hokurn_Hello_Yes_15_00"); //Вот, возьми это.
b_hokurn_drinking();
B_Hokurn_Sauf();
StartPashalQuest = TRUE;
Info_ClearChoices(DIA_Hokurn_NW_Hello);
};
instance DIA_Hokurn_NW_Drink(C_Info)
{
npc = SLD_849_Hokurn;
nr = 5;
condition = DIA_Hokurn_NW_Drink_Condition;
information = DIA_Hokurn_NW_Drink_Info;
permanent = TRUE;
description = "Я тебе принес немного выпить.";
};
func int DIA_Hokurn_NW_Drink_Condition()
{
if((KAPITELORCATC == FALSE) && (HokurnGetsDrink == FALSE) && ((Npc_HasItems(other,ItFo_Beer) >= 1) || (Npc_HasItems(other,ItFo_Addon_Rum) >= 1) || (Npc_HasItems(other,ItFo_Addon_Grog) >= 1) || (Npc_HasItems(other,ItFo_Booze) >= 1) || (Npc_HasItems(other,ItFo_Wine) >= 1)))
{
return TRUE;
};
};
func void DIA_Hokurn_NW_Drink_Info()
{
AI_Output(other,self,"DIA_Hokurn_Drink_15_00"); //Я тебе принес немного выпить.
AI_Output(self,other,"DIA_Hokurn_Drink_01_01"); //Давай сюда!
b_hokurn_NW_drinking();
B_Hokurn_NW_Sauf();
StartPashalQuest = TRUE;
};
//-----------------------пасхалка-----------------------------------------------
instance DIA_Hokurn_NW_PashalQuest(C_Info)
{
npc = SLD_849_Hokurn;
nr = 5;
condition = DIA_Hokurn_NW_PashalQuest_Condition;
information = DIA_Hokurn_NW_PashalQuest_Info;
permanent = FALSE;
description = "На этой ферме есть что-нибудь интересное?";
};
func int DIA_Hokurn_NW_PashalQuest_Condition()
{
if((KAPITELORCATC == FALSE) && (Kapitel < 4) && (StartPashalQuest == TRUE))
{
return TRUE;
};
};
func void DIA_Hokurn_NW_PashalQuest_Info()
{
AI_Output(other,self,"DIA_Hokurn_NW_PashalQuest_01_00"); //На вашей ферме есть что-нибудь интересное?
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_01"); //Интересное? Парень, да ты явно не в себе, коли задаешь такие вопросы.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_02"); //Оглянись, - и сам увидишь, что кругом одни тупые бараны да овцы.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_03"); //Сия печальная картина, увы, не меняется день ото дня.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_04"); //Поэтому ищи интересные вещи за пределами нашего свинарника. Здесь ты ничего не найдешь.
AI_Output(other,self,"DIA_Hokurn_NW_PashalQuest_01_05"); //А ты, похоже, знаешь, где их искать?
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_06"); //(ехидно) Ну, как тебе сказать. Знать не знаю, но кое-что слышал.
AI_Output(other,self,"DIA_Hokurn_NW_PashalQuest_01_07"); //Слышал что?
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_08"); //Ну...(замялся) Это довольно старая история. И я даже не знаю, правдива она или нет.
AI_Output(other,self,"DIA_Hokurn_NW_PashalQuest_01_09"); //Я бы с удовольствием тебя послушал.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_10"); //Эх! Ну да ладно, почему бы и нет.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_11"); //В конце концов, ты угостил меня выпивкой, а я хороших дел не забываю.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_12"); //Ну так вот... Дело было в то время, когда я сидел за Барьером в Долине Рудников.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_13"); //Однажды в таверне Нового лагеря я услышал рассказ о некоем артефакте.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_14"); //Какой-то чудак из Болотного лагеря, который принес нам очередную порцию травы, вещал о могуществе.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_15"); //Он говорил о том, что есть предмет, который позволит владельцу обрести безмерную и безграничную власть над миром! Представляешь?
AI_Output(other,self,"DIA_Hokurn_NW_PashalQuest_01_16"); //И ты ему поверил?
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_17"); //Ну, не то чтобы... Болотные братья - довольно странные ребята, от них чего угодно можно ожидать.
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_18"); //Кто знает, рассказ - чистая правда или бредни обкурившихся сектантов?
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_19"); //Я лишь одно могу с уверенностью сказать: слухи просто так не рождаются! Уж в этом ты мне поверь.
AI_Output(other,self,"DIA_Hokurn_NW_PashalQuest_01_20"); //Да, необычная история. А как звали того парня?
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_21"); //Я не знаю его имени. Припоминаю только то, что он постоянно курил болотную траву. Целыми днями напролет!
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_22"); //А когда вконец обкуривался, начинал долбиться головой об стену. Как будто пытался проткнуть ее насквозь!
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_23"); //Да, забавный был парнишка.
AI_Output(other,self,"DIA_Hokurn_NW_PashalQuest_01_24"); //А где он сейчас, ты не знаешь?
AI_Output(self,other,"DIA_Hokurn_NW_PashalQuest_01_25"); //Понятия не имею. С тех пор он больше не появлялся в нашем лагере.
AI_Output(other,self,"DIA_Hokurn_NW_PashalQuest_01_26"); //Ну ладно, спасибо за рассказ.
MIS_PashalQuest = LOG_Running;
Log_CreateTopic(TOPIC_PashalQuest,LOG_MISSION);
Log_SetTopicStatus(TOPIC_PashalQuest,LOG_Running);
B_LogEntry(TOPIC_PashalQuest,"Наемник Хокурн рассказал мне странную историю о некоем магическом артефакте, дарующем безграничную власть над всем миром! Он услышал ее в колонии от какого-то послушника Братства Спящего, торговавшего болотником в Новом лагере. Возможно, я смогу отыскать этого человека в новом лагере Братства в Хоринисе, чтобы подробнее разузнать об этом магическом предмете.");
AI_StopProcessInfos(self);
Wld_InsertNpc(SEK_4567_Unicorn,"NW_PSICAMP_UNICORN");
};
var int UNICORN_FLAG_01;
var int UNICORN_FLAG_02;
var int UNICORNTALK_YES;
instance DIA_SEK_4567_Unicorn_EXIT(C_Info)
{
npc = SEK_4567_Unicorn;
nr = 999;
condition = DIA_SEK_4567_Unicorn_exit_condition;
information = DIA_SEK_4567_Unicorn_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_SEK_4567_Unicorn_exit_condition()
{
return TRUE;
};
func void DIA_SEK_4567_Unicorn_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_SEK_4567_Unicorn_NOTALK_SLEEPER(C_Info)
{
npc = SEK_4567_Unicorn;
nr = 1;
condition = DIA_SEK_4567_Unicorn_notalk_sleeper_condition;
information = DIA_SEK_4567_Unicorn_notalk_sleeper_info;
permanent = FALSE;
important = FALSE;
description = "Да пребудет с тобой Спящий!";
};
func int DIA_SEK_4567_Unicorn_notalk_sleeper_condition()
{
if(UNICORNTALK_YES == FALSE)
{
return TRUE;
};
};
func void DIA_SEK_4567_Unicorn_notalk_sleeper_info()
{
AI_Output(other,self,"DIA_SEK_4567_Unicorn_NoTalk_Sleeper_01_00"); //Да пребудет с тобой Спящий!
AI_Output(self,other,"DIA_SEK_4567_Unicorn_NoTalk_Sleeper_01_01"); //(вздох)
UNICORN_FLAG_01 = TRUE;
AI_StopProcessInfos(self);
};
instance DIA_SEK_4567_Unicorn_NOTALK_IMP(C_Info)
{
npc = SEK_4567_Unicorn;
nr = 1;
condition = DIA_SEK_4567_Unicorn_notalk_imp_condition;
information = DIA_SEK_4567_Unicorn_notalk_imp_info;
permanent = TRUE;
important = FALSE;
description = "Все в порядке, приятель?";
};
func int DIA_SEK_4567_Unicorn_notalk_imp_condition()
{
if(UNICORNTALK_YES == FALSE)
{
return TRUE;
};
};
func void DIA_SEK_4567_Unicorn_notalk_imp_info()
{
AI_Output(other,self,"DIA_SEK_4567_Unicorn_NoTalk_Imp_01_00"); //Все в порядке, приятель?
AI_Output(self,other,"DIA_SEK_4567_Unicorn_NoTalk_Sleeper_01_01"); //(вздох)
UNICORN_FLAG_02 = TRUE;
AI_StopProcessInfos(self);
};
instance DIA_SEK_4567_Unicorn_HasSmoke(C_Info)
{
npc = SEK_4567_Unicorn;
nr = 1;
condition = DIA_SEK_4567_Unicorn_HasSmoke_condition;
information = DIA_SEK_4567_Unicorn_HasSmoke_info;
permanent = FALSE;
description = "У меня завалялись косяки из болотной травы.";
};
func int DIA_SEK_4567_Unicorn_HasSmoke_condition()
{
if((UNICORNTALK_YES == FALSE) && (UNICORN_FLAG_01 == TRUE) && (UNICORN_FLAG_02 == TRUE) && (Npc_HasItems(other,ItMi_Joint) >= 1))
{
return TRUE;
};
};
func void DIA_SEK_4567_Unicorn_HasSmoke_info()
{
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HasSmoke_01_00"); //У меня завалялись косяки из болотной травы. Тебя они интересуют?
AI_PlayAni(self,"T_SEARCH");
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HasSmoke_01_01"); //(покашливая) С этого и надо было начинать! Много их у тебя?
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HasSmoke_01_02"); //Ну так, не очень.
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HasSmoke_01_03"); //Ладно, без разницы... Давай их сюда. А то в последнее время их здесь стало трудно достать.
B_GiveInvItems(other,self,ItMi_Joint,Npc_HasItems(other,ItMi_Joint));
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HasSmoke_01_04"); //Разве Талас не выдает тебе новую порцию каждый день?
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HasSmoke_01_05"); //Выдает, но, к сожалению, мне ее мало. Я постоянно хочу курить.
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HasSmoke_01_06"); //Если я не курю болотник, у меня начинает жутко болеть голова. Хоть об стенку бейся!
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HasSmoke_01_07"); //Раньше и такое помогало, но сейчас все без толку... Все равно раскалывается.
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HasSmoke_01_08"); //Поэтому мне нужно очень много косяков из болотной травы! Понимаешь?
UNICORNTALK_YES = TRUE;
};
instance DIA_SEK_4567_Unicorn_HeyYou(C_Info)
{
npc = SEK_4567_Unicorn;
nr = 1;
condition = DIA_SEK_4567_Unicorn_HeyYou_condition;
information = DIA_SEK_4567_Unicorn_HeyYou_info;
permanent = FALSE;
description = "Эй, а ты часом не тот парень...";
};
func int DIA_SEK_4567_Unicorn_HeyYou_condition()
{
if((MIS_PashalQuest == LOG_Running) && (UNICORNTALK_YES == TRUE))
{
return TRUE;
};
};
func void DIA_SEK_4567_Unicorn_HeyYou_info()
{
B_GivePlayerXP(200);
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HeyYou_01_00"); //Эй, ты часом не тот парень, что толкал болотник в Новом лагере?
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_01"); //Ну да. Было дело. Однако я пробыл там совсем недолго.
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HeyYou_01_02"); //Почему?
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_03"); //(виновато) Ну, я скурил весь болотник, который вручили мне на продажу.
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_04"); //Поэтому меня быстро сменили Идолы Исидро и Каган. А меня отправили обратно в наш лагерь.
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HeyYou_01_05"); //Ладно, не суть важно. Меня интересует другой вопрос.
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HeyYou_01_06"); //Кое-кто помнит, что ты рассказывал о странном магическом артефакте.
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HeyYou_01_07"); //Якобы с его помощью можно управлять чуть ли не всем миром!
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_08"); //Эммм...(растерянно) Правда?! Ну, возможно, что-то такое и было... Чего не сделаешь после хорошей порции болотника.
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HeyYou_01_09"); //Ты что-нибудь помнишь об этом?
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_10"); //Почти ничего. Припоминаю только, что ту историю я и сам случайно услышал.
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HeyYou_01_11"); //Где?
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_12"); //В Старом лагере. Как-то раз, принеся очередную порцию болотника, я случайно стал свидетелем разговора двух стражников.
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_13"); //Один из них рассказывал другому о том странном предмете.
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_14"); //Потом они увидели меня и отошли дальше. Вот, собственно, и все.
AI_Output(other,self,"DIA_SEK_4567_Unicorn_HeyYou_01_15"); //А ты не помнишь, как звали тех стражников?
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_16"); //Их имен я не знаю. Помню только, что у одного из них были седые волосы.
AI_Output(self,other,"DIA_SEK_4567_Unicorn_HeyYou_01_17"); //А так, это все, что мне известно.
B_LogEntry(TOPIC_PashalQuest,"Я нашел парня, который рассказывал эту историю в Новом лагере. Мне он толком ничего не сказал, кроме того, что сам когда-то подслушал эту историю в разговоре двух стражников Старого лагеря. Если кто-то и знает об этом артефакте больше, то только они. И где мне теперь искать этих людей, ума не приложу...");
PashalQuestGuardStep = TRUE;
};
instance DIA_BDT_4568_KINJARTS_EXIT(C_Info)
{
npc = BDT_4568_KINJARTS;
nr = 999;
condition = DIA_BDT_4568_KINJARTS_exit_condition;
information = DIA_BDT_4568_KINJARTS_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_BDT_4568_KINJARTS_exit_condition()
{
return TRUE;
};
func void DIA_BDT_4568_KINJARTS_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_BDT_4568_KINJARTS_HELLO(C_Info)
{
npc = BDT_4568_KINJARTS;
nr = 1;
condition = DIA_BDT_4568_KINJARTS_HELLO_condition;
information = DIA_BDT_4568_KINJARTS_HELLO_info;
permanent = FALSE;
description = "Привет. Как дела?";
};
func int DIA_BDT_4568_KINJARTS_HELLO_condition()
{
return TRUE;
};
func void DIA_BDT_4568_KINJARTS_HELLO_info()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_HELLO_01_00"); //Привет. Как дела?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_HELLO_01_01"); //(ухмыляясь) Кто тут у нас приблудился?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_HELLO_01_02"); //Хотя не говори ничего! Дай догадаюсь... Небось очередное мясо для забоя в золотой шахте?
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_HELLO_01_03"); //Ты ошибаешься! Я здесь по другой причине.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_HELLO_01_04"); //Не старайся обмануть меня, мальчик!
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_HELLO_01_05"); //В своей жизни я повидал множество щенков, вроде тебя, которые рассказывали всем о важной миссии. Особенно в Старом лагере!
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_HELLO_01_06"); //Поначалу они выказывали себя бывалыми героями, способными свернуть горы! Если не сказать больше...
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_HELLO_01_07"); //Но всех их вылечила работа в шахте! Пару лет с киркой в руках выбивают дурь и браваду из молодых горячих голов.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_HELLO_01_08"); //И из тебя выбьют...
};
var int KinJartsTellUs;
var int KinJartsWannaOre;
instance DIA_BDT_4568_KINJARTS_Quest(C_Info)
{
npc = BDT_4568_KINJARTS;
nr = 1;
condition = DIA_BDT_4568_KINJARTS_Quest_condition;
information = DIA_BDT_4568_KINJARTS_Quest_info;
permanent = FALSE;
description = "Я что-то не припоминаю нашу встречу в Старом лагере.";
};
func int DIA_BDT_4568_KINJARTS_Quest_condition()
{
if(Npc_KnowsInfo(other,DIA_BDT_4568_KINJARTS_HELLO) == TRUE)
{
return TRUE;
};
};
func void DIA_BDT_4568_KINJARTS_Quest_info()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_01_00"); //Я что-то не припоминаю нашу встречу в Старом лагере.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_01_01"); //(ухмыляясь) Намекаешь на то, что ты тоже побывал в колонии?
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_01_02"); //Именно так. Но тебя я там не видел.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_01_03"); //Ну, это и неудивительно. Поскольку большую часть времени я проводил вне лагеря, сопровождая грузы, прибывшие из-за барьера.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_01_04"); //Возможно, именно поэтому наши дороги никогда и не пересекались.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_01_05"); //Вот если бы ты спросил знающих парней про старину Кинжартса, то тебе бы тогда рассказали, кто я такой!
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_01_06"); //Правда? Может, тогда сам расскажешь?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_01_07"); //(ухмыляясь) Ну, если тебе так хочется послушать о тех временах, то ты должен знать, что за все приходится платить.
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_01_08"); //Рудой, как обычно?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_01_09"); //А ты догадлив! Но не волнуйся, я не буду с тебя драть втридорога, как это делают местные торговцы.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_01_10"); //Так что, пожалуй, трех кусков руды мне вполне хватит.
Info_ClearChoices(DIA_BDT_4568_KINJARTS_Quest);
Info_AddChoice(DIA_BDT_4568_KINJARTS_Quest,"Я подумаю над твоим предложением.",DIA_BDT_4568_KINJARTS_Quest_Back);
if(Npc_HasItems(other,ItMi_Nugget) >= 3)
{
Info_AddChoice(DIA_BDT_4568_KINJARTS_Quest,"(отдать три куска магической руды)",DIA_BDT_4568_KINJARTS_Quest_MagicOre);
};
if((Npc_HasItems(other,ITMI_SNUGGET) >= 3) && (RhetorikSkillValue[1] >= 35))
{
Info_AddChoice(DIA_BDT_4568_KINJARTS_Quest,"(отдать три куска железной руды)",DIA_BDT_4568_KINJARTS_Quest_IronOre);
};
};
func void DIA_BDT_4568_KINJARTS_Quest_Back()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_Back_01_01"); //Я подумаю над твоим предложением.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_Back_01_02"); //Только недолго! А то вдруг я передумаю.
KinJartsWannaOre = TRUE;
Info_ClearChoices(DIA_BDT_4568_KINJARTS_Quest);
};
func void DIA_BDT_4568_KINJARTS_Quest_MagicOre()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_01"); //Вот твои три куска руды.
B_GiveInvItems(other,self,ItMi_Nugget,3);
Npc_RemoveInvItems(self,ItMi_Nugget,3);
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_02"); //Хорошо. Тогда я, пожалуй, продолжу рассказ.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_03"); //В колонию я попал в то время, когда каторжане еще видели над своей головой чистое небо.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_04"); //Вначале пришлось непросто. Я на своей шкуре прочувствовал всю тяжесть работы в шахте.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_05"); //Однако, после появления Барьера и захвата власти Гомезом, он сделал меня одним из стражников и поставил заботиться о новичках, прибывающих в колонию.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_06"); //Позже меня сменил Буллит. А нужные знакомства у других баронов позволили мне занять место главного поставщика и сопровождающего грузов.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_07"); //Это была очень опасная работа, поскольку на наши обозы постоянно нападали воры из Нового лагеря.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_08"); //В одной из таких заварушек я даже было чуть не погиб.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_09"); //Но это все в прошлом. Теперь я один из телохранителей Торуса.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_10"); //И новое место меня вполне устраивает!
KinJartsTellUs = TRUE;
Info_ClearChoices(DIA_BDT_4568_KINJARTS_Quest);
};
func void DIA_BDT_4568_KINJARTS_Quest_IronOre()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_01"); //Вот твои три куска руды.
B_GiveInvItems(other,self,ItMi_SNugget,3);
Npc_RemoveInvItems(self,ItMi_SNugget,3);
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_02"); //Что ты мне здесь суешь?!
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_03"); //Руду. Ты ведь ее хотел.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_04"); //Я имел в виду магическую руду, а не обычную!
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_05"); //Но ты об этом ни разу не обмолвился. Так что бери то, что дают.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_06"); //М-да... Похоже, обвел ты старину Кинжартса вокруг пальца. Не ожидал!
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_07"); //Так теперь ты расскажешь мне о себе и о том, чем занимался в Старом лагере?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_08"); //(ухмыляясь) Конечно. Уговор есть уговор! Так вот...
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_09"); //В колонию я попал в то время, когда каторжане еще видели над своей головой чистое небо.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_10"); //Вначале пришлось непросто. Я на своей шкуре прочувствовал всю тяжесть работы в шахте.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_11"); //Однако, после появления Барьера и захвата власти Гомезом, он сделал меня одним из стражников и поставил заботиться о новичках, прибывающих в колонию.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_12"); //Позже меня сменил Буллит. А нужные знакомства у других баронов позволили мне занять место главного поставщика и сопровождающего грузов.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_13"); //Это была очень опасная работа, поскольку на наши обозы постоянно нападали воры из Нового лагеря.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_14"); //В одной из таких заварушек я даже было чуть не погиб.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_15"); //Но это все в прошлом. Теперь я один из телохранителей Торуса.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_16"); //И новое место меня вполне устраивает!
KinJartsTellUs = TRUE;
RhetorikSkillValue[1] += 1;
AI_Print("Риторика + 1");
Info_ClearChoices(DIA_BDT_4568_KINJARTS_Quest);
};
instance DIA_BDT_4568_KINJARTS_QuestAgain(C_Info)
{
npc = BDT_4568_KINJARTS;
nr = 1;
condition = DIA_BDT_4568_KINJARTS_QuestAgain_condition;
information = DIA_BDT_4568_KINJARTS_QuestAgain_info;
permanent = TRUE;
description = "Я принес тебе руду.";
};
func int DIA_BDT_4568_KINJARTS_QuestAgain_condition()
{
if((KinJartsWannaOre == TRUE) && (KinJartsTellUs == FALSE))
{
return TRUE;
};
};
func void DIA_BDT_4568_KINJARTS_QuestAgain_info()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestAgain_01_00"); //Я принес тебе руду.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestAgain_01_01"); //Хорошо. Давай ее сюда!
Info_ClearChoices(DIA_BDT_4568_KINJARTS_QuestAgain);
Info_AddChoice(DIA_BDT_4568_KINJARTS_QuestAgain,"Я еще подумаю на этим.",DIA_BDT_4568_KINJARTS_QuestAgain_Back);
if(Npc_HasItems(other,ItMi_Nugget) >= 3)
{
Info_AddChoice(DIA_BDT_4568_KINJARTS_QuestAgain,"Отдать три куска магической руды.",DIA_BDT_4568_KINJARTS_QuestAgain_MagicOre);
};
if((Npc_HasItems(other,ITMI_SNUGGET) >= 3) && (RhetorikSkillValue[1] >= 35))
{
Info_AddChoice(DIA_BDT_4568_KINJARTS_QuestAgain,"Отдать три куска железной руды.",DIA_BDT_4568_KINJARTS_QuestAgain_IronOre);
};
};
func void DIA_BDT_4568_KINJARTS_QuestAgain_Back()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestAgain_Back_01_01"); //Я еще подумаю на этим.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestAgain_Back_01_02"); //Только недолго! А то вдруг я передумаю.
Info_ClearChoices(DIA_BDT_4568_KINJARTS_QuestAgain);
};
func void DIA_BDT_4568_KINJARTS_QuestAgain_MagicOre()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_01"); //Вот твои три куска руды.
B_GiveInvItems(other,self,ItMi_Nugget,3);
Npc_RemoveInvItems(self,ItMi_Nugget,3);
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_02"); //Хорошо. Тогда я, пожалуй, продолжу рассказ.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_03"); //В колонию я попал в то время, когда каторжане еще видели над своей головой чистое небо.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_04"); //Вначале пришлось непросто. Я на своей шкуре прочувствовал всю тяжесть работы в шахте.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_05"); //Однако, после появления Барьера и захвата власти Гомезом, он сделал меня одним из стражников и поставил заботиться о новичках, прибывающих в колонию.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_06"); //Позже меня сменил Буллит. А нужные знакомства у других баронов позволили мне занять место главного поставщика и сопровождающего грузов.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_07"); //Это была очень опасная работа, поскольку на наши обозы постоянно нападали воры из Нового лагеря.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_08"); //В одной из таких заварушек я даже было чуть не погиб.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_09"); //Но это все в прошлом. Теперь я один из телохранителей Торуса.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_MagicOre_01_10"); //И новое место меня вполне устраивает!
KinJartsTellUs = TRUE;
Info_ClearChoices(DIA_BDT_4568_KINJARTS_QuestAgain);
};
func void DIA_BDT_4568_KINJARTS_QuestAgain_IronOre()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_01"); //Вот твои три куска руды.
B_GiveInvItems(other,self,ItMi_SNugget,3);
Npc_RemoveInvItems(self,ItMi_SNugget,3);
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_02"); //Что ты мне здесь суешь?!
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_03"); //Руду. Ты ведь ее хотел.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_04"); //Я имел в виду магическую руду, а не обычную!
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_05"); //Но ты об этом ни разу не обмолвился. Так что бери то, что дают!
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_06"); //Мда... Похоже, обвел ты старину Кинжартса вокруг пальца. Не ожидал!
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_07"); //Так теперь ты расскажешь мне о себе и о том, чем занимался в Старом лагере?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_08"); //(ухмыляясь) Конечно. Уговор есть уговор! Так вот...
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_09"); //В колонию я попал в то время, когда каторжане еще видели над своей головой чистое небо.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_10"); //Вначале пришлось непросто. Я на своей шкуре прочувствовал всю тяжесть работы в шахте.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_12"); //Однако, после появления Барьера и захвата власти Гомезом, он сделал меня одним из стражников и поставил заботиться о новичках, прибывающих в колонию.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_13"); //Позже меня сменил Буллит. А нужные знакомства у других баронов позволили мне занять место главного поставщика и сопровождающего грузов.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_14"); //Это была очень опасная работа, поскольку на наши обозы постоянно нападали воры из Нового лагеря.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_15"); //В одной из таких заварушек я даже было чуть не погиб.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_16"); //Но это все в прошлом. Теперь я один из телохранителей Торуса.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Quest_IronOre_01_17"); //И новое место меня вполне устраивает!
KinJartsTellUs = TRUE;
RhetorikSkillValue[1] += 1;
AI_Print("Риторика + 1");
Info_ClearChoices(DIA_BDT_4568_KINJARTS_QuestAgain);
};
instance DIA_BDT_4568_KINJARTS_QuestDone(C_Info)
{
npc = BDT_4568_KINJARTS;
nr = 1;
condition = DIA_BDT_4568_KINJARTS_QuestDone_condition;
information = DIA_BDT_4568_KINJARTS_QuestDone_info;
permanent = FALSE;
description = "Выходит, что ты очень много знаешь про Старый лагерь.";
};
func int DIA_BDT_4568_KINJARTS_QuestDone_condition()
{
if((MIS_PashalQuest == LOG_Running) && (KinJartsTellUs == TRUE))
{
return TRUE;
};
};
func void DIA_BDT_4568_KINJARTS_QuestDone_info()
{
B_GivePlayerXP(200);
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_00"); //Выходит, что ты очень много знаешь про Старый лагерь.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_01"); //Больше, чем кто-либо! А почему ты спросил?
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_02"); //Просто у меня есть один очень щекотливый вопрос.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_03"); //Хммм. Тогда можешь задать его мне, если хочешь.
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_04"); //Я ищу одного стражника, который в свое время пустил слух о некоем магическом артефакте.
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_05"); //Якобы этот могущественный предмет способен даже влиять на судьбу этого мира.
AI_PlayAni(self,"T_SEARCH");
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_06"); //Очень интересно. Тогда позволь мне задать тебе встречный вопрос - откуда тебе это известно?
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_07"); //Об этом мне рассказал один из братьев болотного лагеря.
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_08"); //Он как-то подслушал разговор двух стражников, которые говорили об этом артефакте.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_09"); //(задумчиво) Ну да, такое вполне возможно.
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_10"); //Что ты хочешь этим сказать?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_11"); //Я хочу сказать то, что, похоже, с этим вопросом ты обратился по адресу.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_12"); //Поскольку тот стражник, которого ты ищешь, - я!
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_13"); //Да ну! Правда?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_14"); //Разве я похож на вруна? Или, может быть, произвожу подобное впечатление?
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_15"); //Я бы так не сказал.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_16"); //Тогда поверь мне, сынок. Все это чистая правда!
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_17"); //А тот укурок, видимо, подслушал мой разговор с моим приятелем Скорпио, когда я рассказывал ему эту историю.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_18"); //Тогда Скорпио сказал, что это полная чушь и посоветовал мне не забивать себе этим голову.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_19"); //Но, по всей видимости, не все так посчитали.
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_20"); //Значит, артефакт на самом деле существует?
AI_PlayAni(self,"T_SEARCH");
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_21"); //Послушай меня, приятель. Я не говорил, что он существует.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_22"); //Однако о нем в свое время упоминали маги Огня, а к их словам, я полагаю, все-таки стоит прислушаться.
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_23"); //Но все маги Огня были убиты по приказу Гомеза. Как же теперь быть?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_24"); //Я это знаю. Но, насколько мне известно, кое-кому из них все-таки удалось выжить.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_25"); //Кажется, этого мага звали Милтен! Возможно, что тебе стоит найти его и поговорить уже с ним об этом артефакте.
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_QuestDone_01_26"); //Мне же тебе больше нечего сказать.
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_QuestDone_01_27"); //Я тебя понял.
B_LogEntry(TOPIC_PashalQuest,"Кинжартс оказался одним из тех стражников, кто знал о той истории с артефактом. По его словам, подтвердить его существование могут только маги Огня, жившие в Старом лагере. А единственным магом, избежавшим расправы Гомеза, был Милтен.");
PashalQuestMageStep = TRUE;
};
instance DIA_BDT_4568_KINJARTS_Perm(C_Info)
{
npc = BDT_4568_KINJARTS;
nr = 1;
condition = DIA_BDT_4568_KINJARTS_Perm_condition;
information = DIA_BDT_4568_KINJARTS_Perm_info;
permanent = TRUE;
description = "Как обстановка?";
};
func int DIA_BDT_4568_KINJARTS_Perm_condition()
{
if(Npc_KnowsInfo(other,DIA_BDT_4568_KINJARTS_QuestDone) == TRUE)
{
return TRUE;
};
};
func void DIA_BDT_4568_KINJARTS_Perm_info()
{
AI_Output(other,self,"DIA_BDT_4568_KINJARTS_Perm_01_00"); //Как обстановка?
AI_Output(self,other,"DIA_BDT_4568_KINJARTS_Perm_01_01"); //Пока все тихо. Надеюсь, так все и останется.
};
instance DIA_KDF_4569_AlexOne_EXIT(C_Info)
{
npc = KDF_4569_AlexOne;
nr = 999;
condition = DIA_KDF_4569_AlexOne_exit_condition;
information = DIA_KDF_4569_AlexOne_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_KDF_4569_AlexOne_exit_condition()
{
return TRUE;
};
func void DIA_KDF_4569_AlexOne_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_KDF_4569_AlexOne_HELLO(C_Info)
{
npc = KDF_4569_AlexOne;
nr = 1;
condition = DIA_KDF_4569_AlexOne_HELLO_condition;
information = DIA_KDF_4569_AlexOne_HELLO_info;
permanent = FALSE;
important = TRUE;
};
func int DIA_KDF_4569_AlexOne_HELLO_condition()
{
return TRUE;
};
func void DIA_KDF_4569_AlexOne_HELLO_info()
{
AI_Output(self,other,"DIA_KDF_4569_AlexOne_HELLO_01_00"); //Эй! Ты что здесь делаешь?
AI_Output(other,self,"DIA_KDF_4569_AlexOne_HELLO_01_01"); //Я хотел задать тебе тот же вопрос.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_HELLO_01_02"); //(пренебрежительно) Мои дела тебя не касаются.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_HELLO_01_03"); //Они слишком важные, чтобы я стал рассказывать о них первому встречному!
};
instance DIA_KDF_4569_AlexOne_WhoYou(C_Info)
{
npc = KDF_4569_AlexOne;
nr = 1;
condition = DIA_KDF_4569_AlexOne_WhoYou_condition;
information = DIA_KDF_4569_AlexOne_WhoYou_info;
permanent = FALSE;
description = "Ты - маг Огня?";
};
func int DIA_KDF_4569_AlexOne_WhoYou_condition()
{
if(Npc_KnowsInfo(other,DIA_KDF_4569_AlexOne_HELLO) == TRUE)
{
return TRUE;
};
};
func void DIA_KDF_4569_AlexOne_WhoYou_info()
{
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_00"); //Ты - маг Огня?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhoYou_01_01"); //Как видишь. А что, тебя это удивляет?
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_02"); //Не припомню, чтобы встречал тебя в монастыре Хориниса.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhoYou_01_03"); //Меня приняли в Круг Огня здесь, в колонии. А про монастырь я ничего не знаю.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_04"); //Интересно! И кто же принял тебя в Круг?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhoYou_01_05"); //(важно) Сам мастер Корристо! И именно по его поручению я сейчас здесь.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_06"); //Но Корристо и другие маги Огня уже давно мертвы! Убиты по приказу Гомеза.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhoYou_01_07"); //Что ты мелешь?! Как такое может быть? Ты что, с ума сошел?
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_08"); //Так ты ничего не знаешь?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhoYou_01_09"); //А что я должен знать?!
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_10"); //Когда в Старой шахте произошел завал, Гомез пришел в ярость и решил напасть на Новый лагерь.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_11"); //Маги Огня были против этой затеи, и он просто приказал их убить.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhoYou_01_12"); //О Иннос... Неужели это правда?
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_13"); //Можешь не сомневаться. А сейчас в замке Старого лагеря расположились паладины, после чего его осадили орки.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhoYou_01_14"); //Как такое возможно?! Хотя я не был в Старом лагере уже несколько лет.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhoYou_01_15"); //Там действительно многое могло поменяться! Но то, что я услышал от тебя, разбивает мне сердце.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhoYou_01_16"); //Держись, приятель! Это не самое худшее, что случилось за последние дни.
};
instance DIA_KDF_4569_AlexOne_WhatBow(C_Info)
{
npc = KDF_4569_AlexOne;
nr = 1;
condition = DIA_KDF_4569_AlexOne_WhatBow_condition;
information = DIA_KDF_4569_AlexOne_WhatBow_info;
permanent = FALSE;
description = "Зачем тебе арбалет?";
};
func int DIA_KDF_4569_AlexOne_WhatBow_condition()
{
if(Npc_KnowsInfo(other,DIA_KDF_4569_AlexOne_WhoYou) == TRUE)
{
return TRUE;
};
};
func void DIA_KDF_4569_AlexOne_WhatBow_info()
{
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatBow_01_00"); //Зачем тебе арбалет?
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatBow_01_01"); //Ты же маг. Разве тебе недостаточно сил магических рун, чтобы защитить себя?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatBow_01_02"); //Да, я маг, но больше на словах, чем на деле...
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatBow_01_03"); //К сожалению, мое обучение так и не было завершено.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatBow_01_04"); //А потому мои магические способности не столь велики, как у других магов.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatBow_01_05"); //Другое дело - арбалет! С раннего детства отец учил меня обращаться с ним.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatBow_01_06"); //С ним я обращаюсь не хуже, чем умелый воин с мечом или маг с посохом.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatBow_01_07"); //Значит, маг-арбалетчик. Да, забавно.
};
instance DIA_KDF_4569_AlexOne_WhatDeal(C_Info)
{
npc = KDF_4569_AlexOne;
nr = 1;
condition = DIA_KDF_4569_AlexOne_WhatDeal_condition;
information = DIA_KDF_4569_AlexOne_WhatDeal_info;
permanent = FALSE;
description = "Так что у тебя здесь за дела?";
};
func int DIA_KDF_4569_AlexOne_WhatDeal_condition()
{
if((MIS_PashalQuest == LOG_Running) && (Npc_KnowsInfo(other,DIA_KDF_4569_AlexOne_WhoYou) == TRUE))
{
return TRUE;
};
};
func void DIA_KDF_4569_AlexOne_WhatDeal_info()
{
B_GivePlayerXP(300);
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_00"); //Так что у тебя здесь за дела?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_01"); //Эх... Теперь это уже вряд ли имеет значение.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_02"); //И все-таки, может быть, расскажешь?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_03"); //Ну хорошо. Если тебе это так интересно.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_04"); //Мастер Корристо послал меня найти в этой долине какую-либо информацию об одном древнем артефакте.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_05"); //Уж не тот ли, с помощью которого они собирались разрушить магический барьер?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_06"); //(удивленно) Да, о нем! А ты откуда об этом знаешь?
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_07"); //Мне рассказал об этом Милтен.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_08"); //Тогда тебе и так должно быть все известно. Мне больше нечего добавить.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_09"); //Но ты нашел что-нибудь?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_10"); //Самого артефакта мне, конечно, найти не удалось.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_11"); //Но я уверен, что напал на след, который может меня к нему привести.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_12"); //И что это?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_13"); //На другом берегу этого пруда, что под нами, находится заброшенный склеп.
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_14"); //Могу предположить, что именно там может находиться этот артефакт!
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_15"); //Ну, или по крайней мере то, что позволит определить его точное местоположение.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_16"); //Что там может находиться?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_17"); //Ты так меня спрашиваешь, как будто я уже там побывал.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_18"); //Тогда почему бы тебе просто не сходить туда и выяснить это?
AI_Output(self,other,"DIA_KDF_4569_AlexOne_WhatDeal_01_19"); //Вход в склеп закрыт! А как его открыть, я не знаю.
AI_Output(other,self,"DIA_KDF_4569_AlexOne_WhatDeal_01_20"); //Понятно.
B_LogEntry(TOPIC_PashalQuest,"Недалеко от башни Ксардаса я встретил мага Огня Лекса. Он и есть тот человек, которого Корристо послал на поиски артефакта. Лекс уверен, что разгадка местоположения этого предмета сокрыта в заброшенном склепе, что находится неподалеку, однако вход в склеп закрыт.");
PashalQuestPentaStep = TRUE;
};
instance DIA_VLK_4570_Avabul_EXIT(C_Info)
{
npc = VLK_4570_Avabul;
nr = 999;
condition = DIA_VLK_4570_Avabul_exit_condition;
information = DIA_VLK_4570_Avabul_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_VLK_4570_Avabul_exit_condition()
{
return TRUE;
};
func void DIA_VLK_4570_Avabul_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_VLK_4570_Avabul_HELLO(C_Info)
{
npc = VLK_4570_Avabul;
nr = 1;
condition = DIA_VLK_4570_Avabul_HELLO_condition;
information = DIA_VLK_4570_Avabul_HELLO_info;
permanent = FALSE;
important = TRUE;
};
func int DIA_VLK_4570_Avabul_HELLO_condition()
{
if((MIS_PashalQuest == LOG_Running) && (AvabulIsUp == TRUE))
{
return TRUE;
};
};
func void DIA_VLK_4570_Avabul_HELLO_info()
{
B_GivePlayerXP(1000);
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_00"); //Кто воззвал ко мне?! Кто посмел потревожить мой священный покой?!
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_01"); //Это был я.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_02"); //(пренебрежительно) Ну конечно! Очередной смертный, который ищет для себя власти и могущества.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_03"); //Но поверь мне, они тебе абсолютно не нужны! Смерть куда вам более к лицу, жалкие вы черви...
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_04"); //Эй, не так быстро, красавица! Ответь хотя бы на один мой вопрос.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_05"); //Что?! И тебе еще хватает наглости просить меня об этом?
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_06"); //Хотя... почему бы и нет.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_07"); //Мне доставит удовольствие увидеть твои жалкие мольбы сохранить тебе твою ничтожную жизнь.
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_08"); //Ты ошибаешься! Я хотел спросить совсем о другом.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_09"); //Правда?! И о чем же?
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_10"); //Об артефакте, сила которого способна управлять этим миром.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_11"); //(смеется) Ах вот оно что! Ну конечно...
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_12"); //Ты, как и тот некромант, возомнил себя великим и могущественным магом.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_13"); //И надеешься, что я скажу тебе, где его искать!
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_14"); //Что-то вроде того.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_15"); //Сама наивность...(хохочет) Ответь мне, зачем тебе он понадобился, смертный?
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_16"); //Неужели ты действительно думаешь, что сможешь совладать с могуществом этого предмета?
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_17"); //Ну, я и сам пока этого не знаю.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_18"); //Не знаешь что?
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_19"); //Зачем мне вообще сдался этот артефакт.
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_20"); //Просто так уж получилось, что я прослышал о нем, и мой путь привел меня сюда.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_21"); //Хммм. Как интересно!
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_22"); //Знаешь, в это сложно поверить, что человек, который ищет самую могущественную реликвию этого мира, совершенно не знает, для чего она ему нужна.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_23"); //(загадочно) Но я чувствую, что ты говоришь мне правду, смертный.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_24"); //Так что я сохраню тебе жизнь и не стану превращать в бесчувственную нежить, как я это сделала с тем магом-выскочкой!
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_25"); //Премного благодарен! Может быть, заодно и на вопрос мой ответишь?
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_26"); //Артефакт, который ты ищешь, носит имя Ниврам! Его создали творцы этого мира, дабы им было сподручнее управлять им.
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_27"); //Ты говоришь о Хранителях?
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_28"); //(с интересом) Ты и о них знаешь?
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_29"); //Немного.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_30"); //Они самые! Чтобы исключить возможность использования этого артефакта кем-либо посторонним, они надежно спрятали его.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_31"); //Но где именно, никто не знает. Даже боги.
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_32"); //Тогда нет смысла продолжать его поиски.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_33"); //Да, ты прав. Для тебя - абсолютно никакого.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_34"); //Однако мой хозяин уже давно хочет заполучить этот предмет.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_35"); //И он мог бы помочь тебе в его поисках. Естественно, в обмен на власть и могущество, которое вы, смертные, всегда так жаждете обрести!
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_36"); //А почему бы Белиару самому не поискать этот артефакт, если ему он так нужен?
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_37"); //Он не хочет привлекать к себе лишнего внимания Хранителей.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_38"); //Поэтому лучше, когда некоторые вещи делаются простыми смертными, вроде тебя.
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_39"); //Ты хотела сказать - грязную работу.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_40"); //(властно) Это не важно. Важно только то, с чем ты останешься в конце этого пути. А мой хозяин предлагает немало!
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_41"); //Ну так что, ты согласен?
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_42"); //А если я не соглашусь, что тогда?
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_43"); //Тогда ты просто глупец, а я сейчас теряю с тобой время!
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_44"); //Ладно, ладно... Вижу, ты дама серьезная. Да и лишнее могущество мне не помешает.
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_45"); //Я согласен!
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_46"); //Отлично! Только запомни: ты дал слово самому Белиару! И просто так от него ты теперь не сможешь отказаться.
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_47"); //Давай ближе к делу.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_48"); //Хорошо, смертный. Первым делом тебе необходимо найти древнейшего из древних. Когда-его звали Янус Двуликий.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_49"); //Возможно, он что-то помнит об этом артефакте.
AI_Output(other,self,"DIA_VLK_4570_Avabul_HELLO_01_50"); //И где мне его искать?
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_51"); //Насколько мне известно, он охраняет одну из реликвий самих Хранителей.
AI_Output(self,other,"DIA_VLK_4570_Avabul_HELLO_01_52"); //А теперь ступай! Не стоит более терять времени на разговоры.
B_LogEntry(TOPIC_PashalQuest,"С помощью черепа могущественного демона мне удалось вызвать одну из темных жриц Белиара - Авабюл. По ее словам, даже сам Белиар желает заполучить этот артефакт! В конце концов я согласился помочь Авабюл отыскать этот артефакт для Белиара, в обмен на предложенную им власть и могущество. Теперь мне надо найти Януса Двуликого - древнейшего из древних, того, кто может что-то помнить об этом артефакте. По словам жрицы, Янус охраняет одну из реликвий Хранителей.");
AI_StopProcessInfos(self);
PashalQuestJanusStep = TRUE;
};
instance DIA_DMT_4571_Jan_EXIT(C_Info)
{
npc = DMT_4571_Jan;
nr = 999;
condition = DIA_DMT_4571_Jan_exit_condition;
information = DIA_DMT_4571_Jan_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_DMT_4571_Jan_exit_condition()
{
return TRUE;
};
func void DIA_DMT_4571_Jan_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_DMT_4571_Jan_HELLO(C_Info)
{
npc = DMT_4571_Jan;
nr = 1;
condition = DIA_DMT_4571_Jan_HELLO_condition;
information = DIA_DMT_4571_Jan_HELLO_info;
permanent = FALSE;
important = TRUE;
};
func int DIA_DMT_4571_Jan_HELLO_condition()
{
return TRUE;
};
func void DIA_DMT_4571_Jan_HELLO_info()
{
AI_Output(self,other,"DIA_DMT_4571_Jan_HELLO_01_00"); //Остановись, смертный! Дальше для тебя дороги нет!
AI_Output(other,self,"DIA_DMT_4571_Jan_HELLO_01_01"); //Это почему?
AI_Output(self,other,"DIA_DMT_4571_Jan_HELLO_01_02"); //Только избранным дозволено входить сюда. А ты не из их числа!
AI_Output(self,other,"DIA_DMT_4571_Jan_HELLO_01_03"); //Так что поворачивай назад, если тебе дорога твоя жизнь.
AI_Output(other,self,"DIA_DMT_4571_Jan_HELLO_01_04"); //А если я этого не сделаю?
AI_Output(self,other,"DIA_DMT_4571_Jan_HELLO_01_05"); //Тогда ты умрешь. Как и остальные, кто пытался проникнуть сюда.
};
instance DIA_DMT_4571_Jan_WRATH(C_Info)
{
npc = DMT_4571_Jan;
nr = 1;
condition = DIA_DMT_4571_Jan_WRATH_condition;
information = DIA_DMT_4571_Jan_WRATH_info;
permanent = FALSE;
description = "Полагаешь, что я с тобой не справлюсь?";
};
func int DIA_DMT_4571_Jan_WRATH_condition()
{
if(Npc_KnowsInfo(other,DIA_DMT_4571_Jan_HELLO) == TRUE)
{
return TRUE;
};
};
func void DIA_DMT_4571_Jan_WRATH_info()
{
AI_Output(other,self,"DIA_DMT_4571_Jan_WRATH_01_00"); //Полагаешь, что я с тобой не справлюсь?
AI_Output(self,other,"DIA_DMT_4571_Jan_WRATH_01_01"); //(смеется) Ты можешь попробовать, смертный!
AI_Output(self,other,"DIA_DMT_4571_Jan_WRATH_01_02"); //Но ты только потеряешь свое время и жизнь в жалких попытках одолеть меня.
AI_Output(self,other,"DIA_DMT_4571_Jan_WRATH_01_03"); //Те, кто поставил меня хранить этот путь, наделили меня огромной силой и могуществом.
AI_Output(self,other,"DIA_DMT_4571_Jan_WRATH_01_04"); //И сделали одним из бессмертных Стражей Вечности!
AI_Output(self,other,"DIA_DMT_4571_Jan_WRATH_01_05"); //Однако такому жалкому червю, как ты, это наверняка ни о чем не говорит.
AI_Output(self,other,"DIA_DMT_4571_Jan_WRATH_01_06"); //Так что лучше поворачивай назад!
AI_Output(self,other,"DIA_DMT_4571_Jan_WRATH_01_07"); //Здесь ты не найдешь ничего, кроме своей собственной смерти.
};
instance DIA_DMT_4571_Jan_Pashal(C_Info)
{
npc = DMT_4571_Jan;
nr = 1;
condition = DIA_DMT_4571_Jan_Pashal_condition;
information = DIA_DMT_4571_Jan_Pashal_info;
permanent = FALSE;
description = "Так ты и есть Янус Двуликий?";
};
func int DIA_DMT_4571_Jan_Pashal_condition()
{
if((Npc_KnowsInfo(other,DIA_DMT_4571_Jan_HELLO) == TRUE) && (MIS_PashalQuest == LOG_Running) && (PashalQuestJanusStep == TRUE))
{
return TRUE;
};
};
func void DIA_DMT_4571_Jan_Pashal_info()
{
B_GivePlayerXP(1500);
AI_Output(other,self,"DIA_DMT_4571_Jan_Pashal_01_00"); //Так ты и есть Янус Двуликий? А я ведь искал тебя!
AI_Output(self,other,"DIA_DMT_4571_Jan_Pashal_01_01"); //Ты искал меня, смертный? Но зачем, позволь узнать?
AI_Output(other,self,"DIA_DMT_4571_Jan_Pashal_01_02"); //Мне рассказала про тебя жрица Белиара по имени Авабюл.
AI_Output(other,self,"DIA_DMT_4571_Jan_Pashal_01_03"); //По ее словам, ты можешь знать про судьбу одного из древнейших артефактов.
AI_Output(other,self,"DIA_DMT_4571_Jan_Pashal_01_04"); //Его называют Ниврам. Ты что-нибудь слышал о нем?
AI_Output(self,other,"DIA_DMT_4571_Jan_Pashal_01_05"); //Никогда бы не подумал, что когда-нибудь услышу подобный вопрос от обычного человека.
AI_Output(self,other,"DIA_DMT_4571_Jan_Pashal_01_06"); //Выходит, что ты посланник Белиара, раз тебя прислала сама Авабюл.
AI_Output(other,self,"DIA_DMT_4571_Jan_Pashal_01_07"); //А разве это что-то меняет?
AI_Output(self,other,"DIA_DMT_4571_Jan_Pashal_01_08"); //Нет, абсолютно ничего.
AI_Output(self,other,"DIA_DMT_4571_Jan_Pashal_01_09"); //Но раз сильные мира сего доверяют тебе хранить подобные тайны, то, по всей видимости, это не просто так.
AI_Output(other,self,"DIA_DMT_4571_Jan_Pashal_01_10"); //Тогда, может быть, расскажешь мне про этот артефакт?
AI_Output(self,other,"DIA_DMT_4571_Jan_Pashal_01_11"); //Рассказ будет коротким. Ибо ответ на твой вопрос находится за этими дверьми.
AI_Output(self,other,"DIA_DMT_4571_Jan_Pashal_01_12"); //Однако, как я уже сказал, ты не войдешь в них до тех пор, пока я сам не решу впустить тебя.
B_LogEntry(TOPIC_PashalQuest,"Я отыскал Януса Двуликого. Он сказал, что ответ на интересующий меня вопрос находится за огромными вратами, которые он охраняет. Правда, я не смогу пройти через них до тех пор, пока сам Янус не разрешит мне сделать это.");
};
instance DIA_DMT_4571_Jan_Dual(C_Info)
{
npc = DMT_4571_Jan;
nr = 2;
condition = DIA_DMT_4571_Jan_Dual_condition;
information = DIA_DMT_4571_Jan_Dual_info;
permanent = FALSE;
description = "Почему тебя называют Двуликим?";
};
func int DIA_DMT_4571_Jan_Dual_condition()
{
if(Npc_KnowsInfo(other,DIA_DMT_4571_Jan_Pashal) == TRUE)
{
return TRUE;
};
};
func void DIA_DMT_4571_Jan_Dual_info()
{
AI_Output(other,self,"DIA_DMT_4571_Jan_Dual_01_00"); //Почему тебя называют Двуликим?
AI_Output(self,other,"DIA_DMT_4571_Jan_Dual_01_01"); //Как ты, наверное, уже заметил, смертный, я ношу золотую маску.
AI_Output(self,other,"DIA_DMT_4571_Jan_Dual_01_02"); //На протяжении всей моей жизни она скрывала мое истинное лицо от людей.
AI_Output(other,self,"DIA_DMT_4571_Jan_Dual_01_03"); //Зачем?
AI_Output(self,other,"DIA_DMT_4571_Jan_Dual_01_04"); //На то были свои причины. Однако именно поэтому меня и прозвали Двуликим.
AI_Output(self,other,"DIA_DMT_4571_Jan_Dual_01_05"); //Правда, то, что оно скрывает сейчас, уже трудно назвать лицом.
AI_Output(self,other,"DIA_DMT_4571_Jan_Dual_01_06"); //Но, как видишь, привычка носить маску осталась до сих пор.
};
instance DIA_DMT_4571_Jan_His(C_Info)
{
npc = DMT_4571_Jan;
nr = 2;
condition = DIA_DMT_4571_Jan_His_condition;
information = DIA_DMT_4571_Jan_His_info;
permanent = FALSE;
description = "А кем ты был при жизни?";
};
func int DIA_DMT_4571_Jan_His_condition()
{
if(Npc_KnowsInfo(other,DIA_DMT_4571_Jan_Pashal) == TRUE)
{
return TRUE;
};
};
func void DIA_DMT_4571_Jan_His_info()
{
AI_Output(other,self,"DIA_DMT_4571_Jan_His_01_00"); //А кем ты был при жизни?
AI_Output(self,other,"DIA_DMT_4571_Jan_His_01_01"); //Я был охотником на драконов.
AI_Output(other,self,"DIA_DMT_4571_Jan_His_01_02"); //Ты сражался с драконами?
AI_Output(self,other,"DIA_DMT_4571_Jan_His_01_03"); //И не один раз. В те времена, когда я жил, драконы не были такой уж редкостью, как сейчас.
AI_Output(self,other,"DIA_DMT_4571_Jan_His_01_04"); //В одном из таких сражений я и погиб.
AI_Output(self,other,"DIA_DMT_4571_Jan_His_01_05"); //Правда, как видишь, мое пребывание в этом мире на этом не закончилось. Теперь я страж этих врат.
AI_Output(other,self,"DIA_DMT_4571_Jan_His_01_06"); //А что сокрыто за ними?
AI_Output(self,other,"DIA_DMT_4571_Jan_His_01_07"); //Ты сам об этом узнаешь, - если, конечно, окажешься достоин этой чести.
};
instance DIA_DMT_4571_Jan_Proof(C_Info)
{
npc = DMT_4571_Jan;
nr = 1;
condition = DIA_DMT_4571_Jan_Proof_condition;
information = DIA_DMT_4571_Jan_Proof_info;
permanent = FALSE;
description = "Что я должен сделать, чтобы убедить тебя?";
};
func int DIA_DMT_4571_Jan_Proof_condition()
{
if((Npc_KnowsInfo(other,DIA_DMT_4571_Jan_Pashal) == TRUE) && (MIS_PashalQuest == LOG_Running) && (PashalQuestJanusStep == TRUE))
{
return TRUE;
};
};
func void DIA_DMT_4571_Jan_Proof_info()
{
AI_Output(other,self,"DIA_DMT_4571_Jan_Proof_01_00"); //Что я должен сделать, чтобы убедить тебя?
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_01"); //Ты должен будешь пройти мое испытание. Но это будет довольно непросто.
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_02"); //Ты действительно уверен в том, что готов к нему?
AI_Output(other,self,"DIA_DMT_4571_Jan_Proof_01_03"); //Абсолютно! Давай, говори уже, - в чем оно заключается?
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_04"); //Хорошо. Поскольку ты являешься посланником Белиара, я попрошу тебя принести мне душу его Избранного!
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_05"); //Душу того, кто являет собой его суть, его силу и его власть в этом мире.
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_06"); //Уж если Темный бог так хочет заполучить этот артефакт, то ему придется дорого заплатить за это.
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_07"); //В ином случае эти двери никогда не откроются перед тобой.
if(UndeadDragonIsDead == FALSE)
{
AI_Output(other,self,"DIA_DMT_4571_Jan_Proof_01_08"); //Хорошо. Где мне его искать?
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_09"); //В одном из священных храмов самого Белиара, конечно! Где же еще.
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_10"); //Но я сомневаюсь, что тебе удастся добраться хотя бы до одного из них.
AI_Output(other,self,"DIA_DMT_4571_Jan_Proof_01_11"); //Ну, это мы еще посмотрим. Сюда ведь я как-то добрался.
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_12"); //Что, по правде говоря, меня очень сильно удивляет.
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_13"); //Однако ты не производишь впечатление того, кто способен одолеть одно из самых могущественных созданий этого мира.
AI_Output(self,other,"DIA_DMT_4571_Jan_Proof_01_14"); //И изменю я свое мнение только тогда, когда увижу перед собой душу этого существа.
};
B_LogEntry(TOPIC_PashalQuest,"Янус пропустит меня, если я принесу ему душу Избранного самого Белиара!");
};
instance DIA_DMT_4571_Jan_ProofDone(C_Info)
{
npc = DMT_4571_Jan;
nr = 1;
condition = DIA_DMT_4571_Jan_ProofDone_condition;
information = DIA_DMT_4571_Jan_ProofDone_info;
permanent = FALSE;
description = "Вот душа Избранного Белиара!";
};
func int DIA_DMT_4571_Jan_ProofDone_condition()
{
if((Npc_KnowsInfo(other,DIA_DMT_4571_Jan_Proof) == TRUE) && (MIS_PashalQuest == LOG_Running) && (PashalQuestJanusStep == TRUE) && (Npc_HasItems(other,ItAt_UndeadDragonSoulStone) >= 1))
{
return TRUE;
};
};
func void DIA_DMT_4571_Jan_ProofDone_info()
{
B_GivePlayerXP(2000);
AI_Output(other,self,"DIA_DMT_4571_Jan_ProofDone_01_00"); //Вот душа Избранного Белиара!
AI_Output(self,other,"DIA_DMT_4571_Jan_ProofDone_01_01"); //Воистину это она. Я преклоняюсь перед тобой, о великий воин!
AI_Output(other,self,"DIA_DMT_4571_Jan_ProofDone_01_02"); //Теперь ты пропустишь меня?
AI_Output(self,other,"DIA_DMT_4571_Jan_ProofDone_01_03"); //Как и обещал. Просто возложи принесенную тобой душу на алтарь, что позади тебя.
AI_Output(self,other,"DIA_DMT_4571_Jan_ProofDone_01_04"); //После этого двери откроются, и ты сможешь пройти.
B_LogEntry(TOPIC_PashalQuest,"Я принес Янусу душу. Теперь нужно возложить ее на алтарь, что находится рядом, и после этого двери должны открыться.");
PashalQuestEgezartStep = TRUE;
AI_StopProcessInfos(self);
};
instance DIA_DMT_4572_Trazege_EXIT(C_Info)
{
npc = DMT_4572_Trazege;
nr = 999;
condition = DIA_DMT_4572_Trazege_exit_condition;
information = DIA_DMT_4572_Trazege_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_DMT_4572_Trazege_exit_condition()
{
return TRUE;
};
func void DIA_DMT_4572_Trazege_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_DMT_4572_Trazege_HELLO(C_Info)
{
npc = DMT_4572_Trazege;
nr = 1;
condition = DIA_DMT_4572_Trazege_HELLO_condition;
information = DIA_DMT_4572_Trazege_HELLO_info;
permanent = FALSE;
important = TRUE;
};
func int DIA_DMT_4572_Trazege_HELLO_condition()
{
if(XranFregIsDead == TRUE)
{
return TRUE;
};
};
func void DIA_DMT_4572_Trazege_HELLO_info()
{
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_00"); //Что тебе здесь надо?! И как ты вообще попал сюда?
AI_Output(other,self,"DIA_DMT_4572_Trazege_HELLO_01_01"); //Через магический портал.
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_02"); //(ухмыляясь) Об этом я уже и сам догадался, умник.
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_03"); //Меня интересует другое - какого дьявола Янус впустил тебя сюда?!
AI_Output(other,self,"DIA_DMT_4572_Trazege_HELLO_01_04"); //Я выполнил его испытание и тем самым доказал, что достоин этого.
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_05"); //Достоин? И что же ты сделал, герой?
AI_Output(other,self,"DIA_DMT_4572_Trazege_HELLO_01_06"); //Я убил Избранного самого Белиара! Разве этого мало?
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_07"); //(небрежно) По правде говоря, меня это не особо впечатляет.
AI_Output(other,self,"DIA_DMT_4572_Trazege_HELLO_01_08"); //Почему?
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_09"); //Я уже привык к тому, что его избранники не особо-то и долго живут в этом мире.
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_10"); //Обязательно находится тот, кто с завидным постоянством отправляет их обратно к своему хозяину в царство Тьмы!
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_11"); //Так что ты не первый и не последний, кто сделал это.
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_12"); //А сам Белиар уже давно подыскал себе новую замену. Так что видишь - история повторяется вновь!
AI_Output(other,self,"DIA_DMT_4572_Trazege_HELLO_01_13"); //И кто же теперь его избранный?
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_14"); //Насколько мне известно, Ксардас, могущественный темный маг.
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_15"); //Что же. Посмотрим, на сколько его хватит.
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_16"); //Но хватит уже пустой болтовни! Если ты хотел заслужить мое внимание, то ты это сделал.
AI_Output(self,other,"DIA_DMT_4572_Trazege_HELLO_01_17"); //А теперь отвечай немедленно, зачем ты пожаловал сюда?
};
instance DIA_DMT_4572_Trazege_GiveMePower(C_Info)
{
npc = DMT_4572_Trazege;
nr = 1;
condition = DIA_DMT_4572_Trazege_GiveMePower_condition;
information = DIA_DMT_4572_Trazege_GiveMePower_info;
permanent = FALSE;
description = "Я ищу один артефакт.";
};
func int DIA_DMT_4572_Trazege_GiveMePower_condition()
{
if(Npc_KnowsInfo(other,DIA_DMT_4572_Trazege_HELLO) == TRUE)
{
return TRUE;
};
};
func void DIA_DMT_4572_Trazege_GiveMePower_info()
{
B_GivePlayerXP(5000);
AI_Output(other,self,"DIA_DMT_4572_Trazege_GiveMePower_01_00"); //Я ищу один артефакт. Его называют Ниврам.
AI_Output(other,self,"DIA_DMT_4572_Trazege_GiveMePower_01_01"); //Насколько я знаю, с его помощью...
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_02"); //Можешь дальше не продолжать. Я уже и так все понял.
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_03"); //Ты, видимо, один из тех, кто с помощью него хочет заполучить безграничную власть и могущество в этом мире.
AI_Output(other,self,"DIA_DMT_4572_Trazege_GiveMePower_01_04"); //Ну, не совсем. Его хочет заполучить Белиар.
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_05"); //(смеется) Кем возомнил себя этот жалкий божок!
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_06"); //Никто - ни он, ни его брат Иннос никогда не получат этот артефакт.
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_07"); //Они слишком алчны и самолюбивы, чтобы обладать его безграничной властью.
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_08"); //Возможно, я бы отдал его Аданосу, но он слишком мудр, чтобы принять этот дар.
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_09"); //Поэтому, если ты не возражаешь, я оставлю его себе.
AI_Output(other,self,"DIA_DMT_4572_Trazege_GiveMePower_01_10"); //А тебе он зачем?
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_12"); //С помощью этого артефакта я слежу за балансом этого мира, исправляя ошибки все тех же богов.
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_13"); //Я тот, благодаря кому этот мир еще живет и дышит! И ты в том числе.
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_14"); //Поэтому он останется здесь до тех пор, пока не придет время разрушить этот мир и возродить его заново.
AI_Output(self,other,"DIA_DMT_4572_Trazege_GiveMePower_01_15"); //И уж поверь мне, так оно и будет!
B_LogEntry(TOPIC_PashalQuest,"Внутри храма я встретил Эгезарта, стража интересующего меня артефакта. Как и ожидалось, он не захотел мне его отдавать.");
};
instance DIA_DMT_4572_Trazege_NoAtAll(C_Info)
{
npc = DMT_4572_Trazege;
nr = 1;
condition = DIA_DMT_4572_Trazege_NoAtAll_condition;
information = DIA_DMT_4572_Trazege_NoAtAll_info;
permanent = FALSE;
description = "А если я заберу его у тебя силой?";
};
func int DIA_DMT_4572_Trazege_NoAtAll_condition()
{
if(Npc_KnowsInfo(other,DIA_DMT_4572_Trazege_GiveMePower) == TRUE)
{
return TRUE;
};
};
func void DIA_DMT_4572_Trazege_NoAtAll_info()
{
AI_Output(other,self,"DIA_DMT_4572_Trazege_NoAtAll_01_00"); //А если я заберу его у тебя силой?
AI_Output(self,other,"DIA_DMT_4572_Trazege_NoAtAll_01_01"); //(смеется) Глупец!
AI_Output(self,other,"DIA_DMT_4572_Trazege_NoAtAll_01_02"); //Неужели ты полагаешь, что твое оружие или магия способны причинить мне вред?
AI_Output(self,other,"DIA_DMT_4572_Trazege_NoAtAll_01_03"); //Мне же достаточно только подумать, и ты прямо тут умрешь в ужасных муках.
AI_PlayAni(hero,"T_INSANE");
AI_Output(self,other,"DIA_DMT_4572_Trazege_NoAtAll_01_04"); //Ну как, теперь ты понимаешь всю нелепость своей идеи?
AI_Output(other,self,"DIA_DMT_4572_Trazege_NoAtAll_01_05"); //Хорошо, я все понял! Только больше так не делай.
B_LogEntry(TOPIC_PashalQuest,"Я собирался силой отобрать артефакт у Эгезарта, но вовремя понял, что этот бой мне не выиграть никогда.");
};
instance DIA_DMT_4572_Trazege_BuyGift(C_Info)
{
npc = DMT_4572_Trazege;
nr = 1;
condition = DIA_DMT_4572_Trazege_BuyGift_condition;
information = DIA_DMT_4572_Trazege_BuyGift_info;
permanent = FALSE;
description = "И что мне теперь делать?";
};
func int DIA_DMT_4572_Trazege_BuyGift_condition()
{
if(Npc_KnowsInfo(other,DIA_DMT_4572_Trazege_NoAtAll) == TRUE)
{
return TRUE;
};
};
func void DIA_DMT_4572_Trazege_BuyGift_info()
{
AI_Output(other,self,"DIA_DMT_4572_Trazege_BuyGift_01_00"); //И что мне теперь делать?
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_01_01"); //Тебе лучше уйти и больше никогда сюда не возвращаться!
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_01_02"); //Артефакт, что ты искал, останется тут навсегда.
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_01_03"); //Ну или, по крайней мере, до тех пор, пока его Создатели сами не решат его дальнейшую судьбу.
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_01_04"); //Что же касается тебя... То ты наверняка за все это время проделал очень долгий и опасный путь.
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_01_05"); //Все это, безусловно, заслуживает уважения. Поэтому с пустыми руками я тебя не отпущу.
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_01_06"); //Выбирай свою награду, смертный. И будь мудр в своем решении.
B_LogEntry(TOPIC_PashalQuest,"Я смирился с тем, что мне никогда не заполучить этот предмет. Он навсегда останется тут, внутри этого храма. Однако я не ушел оттуда с пустыми руками - Эгезарт преподнес мне дар за то, что я смог добраться до него. Думаю, на этом стоит закончить эту историю.");
Info_ClearChoices(DIA_DMT_4572_Trazege_BuyGift);
Info_AddChoice(DIA_DMT_4572_Trazege_BuyGift,"Даруй мне жизнь и выносливость!",DIA_DMT_4572_Trazege_BuyGift_Hp);
Info_AddChoice(DIA_DMT_4572_Trazege_BuyGift,"Даруй мне мудрость и знания!",DIA_DMT_4572_Trazege_BuyGift_Mana);
Info_AddChoice(DIA_DMT_4572_Trazege_BuyGift,"Сделай меня невероятно ловким!",DIA_DMT_4572_Trazege_BuyGift_Dex);
Info_AddChoice(DIA_DMT_4572_Trazege_BuyGift,"Надели меня огромной силой!",DIA_DMT_4572_Trazege_BuyGift_Str);
};
func void DIA_DMT_4572_Trazege_BuyGift_Str()
{
AI_Output(other,self,"DIA_DMT_4572_Trazege_BuyGift_Str_01_00"); //Надели меня огромной силой!
B_RaiseAttribute_Bonus(other,ATR_STRENGTH,50);
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_Str_01_01"); //Как скажешь. Ты сделал свой выбор! Теперь прощай.
MIS_PashalQuest = LOG_SUCCESS;
Log_SetTopicStatus(TOPIC_PashalQuest,LOG_SUCCESS);
AI_StopProcessInfos(self);
};
func void DIA_DMT_4572_Trazege_BuyGift_Dex()
{
AI_Output(other,self,"DIA_DMT_4572_Trazege_BuyGift_Dex_01_00"); //Сделай меня невероятно ловким!
B_RaiseAttribute_Bonus(other,ATR_DEXTERITY,50);
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_Dex_01_01"); //Как скажешь. Ты сделал свой выбор! Теперь прощай.
MIS_PashalQuest = LOG_SUCCESS;
Log_SetTopicStatus(TOPIC_PashalQuest,LOG_SUCCESS);
AI_StopProcessInfos(self);
};
func void DIA_DMT_4572_Trazege_BuyGift_Mana()
{
AI_Output(other,self,"DIA_DMT_4572_Trazege_BuyGift_Mana_01_00"); //Даруй мне мудрость и знания!
B_RaiseAttribute_Bonus(other,ATR_MANA_MAX,150);
Npc_ChangeAttribute(other,ATR_MANA,150);
ATR_INTELLECT += 20;
Npc_SetTalentSkill(self,NPC_TALENT_INTELLECT,ATR_INTELLECT);
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_Mana_01_01"); //Как скажешь. Ты сделал свой выбор! Теперь прощай.
MIS_PashalQuest = LOG_SUCCESS;
Log_SetTopicStatus(TOPIC_PashalQuest,LOG_SUCCESS);
AI_StopProcessInfos(self);
};
func void DIA_DMT_4572_Trazege_BuyGift_Hp()
{
var int TempStaminaMax;
AI_Output(other,self,"DIA_DMT_4572_Trazege_BuyGift_Hp_01_00"); //Даруй мне жизнь и выносливость!
B_RaiseAttribute(other,ATR_HITPOINTS_MAX,500);
Npc_ChangeAttribute(other,ATR_HITPOINTS,500);
if(ATR_STAMINA_MAX[0] <= 90)
{
ATR_STAMINA_MAX[0] = ATR_STAMINA_MAX[0] + 10;
Npc_SetTalentSkill(hero,NPC_TALENT_STAMINA,ATR_STAMINA_MAX[0]);
}
else
{
TempStaminaMax = 100 - ATR_STAMINA_MAX[0];
ATR_STAMINA_MAX[0] = ATR_STAMINA_MAX[0] + TempStaminaMax;
Npc_SetTalentSkill(hero,NPC_TALENT_STAMINA,ATR_STAMINA_MAX[0]);
};
AI_Output(self,other,"DIA_DMT_4572_Trazege_BuyGift_Hp_01_01"); //Как скажешь. Ты сделал свой выбор! Теперь прощай.
MIS_PashalQuest = LOG_SUCCESS;
Log_SetTopicStatus(TOPIC_PashalQuest,LOG_SUCCESS);
AI_StopProcessInfos(self);
};
instance DIA_KDW_4573_Oddler_EXIT(C_Info)
{
npc = KDW_4573_Oddler;
nr = 999;
condition = DIA_KDW_4573_Oddler_exit_condition;
information = DIA_KDW_4573_Oddler_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_KDW_4573_Oddler_exit_condition()
{
return TRUE;
};
func void DIA_KDW_4573_Oddler_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_KDW_4573_Oddler_HELLO(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_HELLO_condition;
information = DIA_KDW_4573_Oddler_HELLO_info;
permanent = FALSE;
important = TRUE;
};
func int DIA_KDW_4573_Oddler_HELLO_condition()
{
return TRUE;
};
func void DIA_KDW_4573_Oddler_HELLO_info()
{
AI_Output(self,other,"DIA_KDW_4573_Oddler_HELLO_01_00"); //Приветствую тебя, путник. Ты заблудился?
AI_Output(other,self,"DIA_KDW_4573_Oddler_HELLO_01_01"); //С чего ты взял?
AI_Output(self,other,"DIA_KDW_4573_Oddler_HELLO_01_02"); //Это место слишком опасно для обычных прогулок.
AI_Output(self,other,"DIA_KDW_4573_Oddler_HELLO_01_03"); //Никто, будучи в здравом уме, просто так не решится прийти сюда.
AI_Output(self,other,"DIA_KDW_4573_Oddler_HELLO_01_04"); //Следовательно, ты либо заблудился, либо, возможно, что-то ищешь.
AI_Output(self,other,"DIA_KDW_4573_Oddler_HELLO_01_05"); //И это что-то настолько важно для тебя, что ты готов рискнуть своей жизнью ради этого.
};
instance DIA_KDW_4573_Oddler_WhoYou(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_WhoYou_condition;
information = DIA_KDW_4573_Oddler_WhoYou_info;
permanent = FALSE;
description = "А ты что тут делаешь?";
};
func int DIA_KDW_4573_Oddler_WhoYou_condition()
{
if(Npc_KnowsInfo(other,DIA_KDW_4573_Oddler_HELLO) == TRUE)
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_WhoYou_info()
{
AI_Output(other,self,"DIA_KDW_4573_Oddler_WhoYou_01_00"); //А ты что тут делаешь?
AI_Output(self,other,"DIA_KDW_4573_Oddler_WhoYou_01_01"); //Как видишь, живу. По мне лучше места просто не найти.
AI_Output(self,other,"DIA_KDW_4573_Oddler_WhoYou_01_02"); //Тишина и спокойствие - это все, что мне нужно. И, самое главное, подальше от людей.
AI_Output(other,self,"DIA_KDW_4573_Oddler_WhoYou_01_03"); //И тебя абсолютно не беспокоит то, что кругом может быть полно орков или других хищных тварей?
AI_Output(self,other,"DIA_KDW_4573_Oddler_WhoYou_01_04"); //Орков тут нет. Их лагеря находятся в другой части этих гор.
AI_Output(self,other,"DIA_KDW_4573_Oddler_WhoYou_01_05"); //А что касается всего остального, то с этим я как-нибудь справлюсь.
AI_Output(self,other,"DIA_KDW_4573_Oddler_WhoYou_01_06"); //(улыбаясь) Я же все-таки маг.
};
instance DIA_KDW_4573_Oddler_Mage(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_Mage_condition;
information = DIA_KDW_4573_Oddler_Mage_info;
permanent = FALSE;
description = "Так ты еще и маг?";
};
func int DIA_KDW_4573_Oddler_Mage_condition()
{
if(Npc_KnowsInfo(other,DIA_KDW_4573_Oddler_WhoYou) == TRUE)
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_Mage_info()
{
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mage_01_00"); //Так ты еще и маг?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_01"); //Маг Воды, если быть более точным.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mage_01_02"); //Из Нового лагеря?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_03"); //(задумчиво) Хммм. Что еще за Новый лагерь?
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mage_01_04"); //Тот, что в Долине Рудников, конечно.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_05"); //Извини, но я никогда не слышал о нем.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mage_01_06"); //Тогда откуда ты?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_07"); //Сам я родом из Сильдена. Это небольшой городок в Миртане.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mage_01_08"); //А как ты оказался в Хоринисе?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_09"); //Приплыл сюда на корабле, как же еще.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mage_01_10"); //Зачем?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_11"); //У меня было послание для верховного мага Огня Корристо.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_12"); //Он был наставником в монастыре Инноса, который находился на этом острове.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_13"); //Правда, это было очень давно. С тех пор прошел не один десяток лет.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mage_01_14"); //Ну хорошо. А как ты попал сюда?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_15"); //Вместе с остальными магами Огня я принимал участие в одной из исследовательских экспедиций.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_16"); //Мы хотели получше изучить эти горы и, возможно, найти тут что-нибудь интересное.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_17"); //В итоге вместо этого я угодил в плен к оркам.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_18"); //Они бы меня убили, не будь я магом! Но их верховный шаман почему-то заинтересовался моей магией.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_19"); //Это и спасло мою жизнь.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_20"); //Через несколько лет мне удалось бежать из их лагеря.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_21"); //Скитаясь по горам, я набрел на это место. И теперь живу тут.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mage_01_22"); //Вот, собственно, и вся история.
};
instance DIA_KDW_4573_Oddler_Blind(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_Blind_condition;
information = DIA_KDW_4573_Oddler_Blind_info;
permanent = FALSE;
description = "У тебя повязка на глазах.";
};
func int DIA_KDW_4573_Oddler_Blind_condition()
{
if(Npc_KnowsInfo(other,DIA_KDW_4573_Oddler_Mage) == TRUE)
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_Blind_info()
{
AI_Output(other,self,"DIA_KDW_4573_Oddler_Blind_01_00"); //У тебя повязка на глазах. Ты слепой?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Blind_01_01"); //(вздыхая) Да. Как видишь.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Blind_01_02"); //Как же это случилось?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Blind_01_03"); //Чтобы сделать невозможной для меня саму мысль о побеге, орки выкололи мне глаза.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Blind_01_04"); //Поначалу, конечно, было невыносимо тяжело. Я не мог пройти даже и двух метров без чьей-либо помощи.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Blind_01_05"); //Но со временем у меня обострились другие мои чувства, - например, слух или обоняние.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Blind_01_06"); //Все это помогло мне тут выжить. Теперь мне необязательно быть зрячим, чтобы понять, кто стоит передо мной.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Blind_01_07"); //Кстати, ты только поднимался на эту гору, а я уже знал, что сюда кто-то идет.
};
instance DIA_KDW_4573_Oddler_Away(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_Away_condition;
information = DIA_KDW_4573_Oddler_Away_info;
permanent = FALSE;
description = "Ты не хотел бы убраться отсюда?";
};
func int DIA_KDW_4573_Oddler_Away_condition()
{
if(Npc_KnowsInfo(other,DIA_KDW_4573_Oddler_Mage) == TRUE)
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_Away_info()
{
AI_Output(other,self,"DIA_KDW_4573_Oddler_Getout_01_00"); //Ты не хотел бы убраться отсюда?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Getout_01_01"); //Нет. Мне здесь нравится! Здесь тихо и спокойно.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Getout_01_02"); //К тому же переход через горы будет крайне опасным делом.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Getout_01_03"); //Без должной подготовки можно легко погибнуть.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Getout_01_04"); //Или, что еще хуже, попасть в плен к оркам.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Getout_01_05"); //Так что подобные мысли меня посещают все реже и реже.
};
instance DIA_KDW_4573_Oddler_Mount(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_Mount_condition;
information = DIA_KDW_4573_Oddler_Mount_info;
permanent = FALSE;
description = "Что тут есть интересного в горах?";
};
func int DIA_KDW_4573_Oddler_Mount_condition()
{
if(Npc_KnowsInfo(other,DIA_KDW_4573_Oddler_Mage) == TRUE)
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_Mount_info()
{
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mount_01_00"); //Что тут есть интересного в горах?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mount_01_01"); //Ничего особенного.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mount_01_02"); //Где-то внизу должен располагаться небольшой форт.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mount_01_03"); //Его построили паладины, которые сопровождали нас в той злосчастной экспедиции.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mount_01_04"); //Недалеко от него находится древнее святилище орков. Там они меня и взяли в плен.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mount_01_05"); //А где сам их лагерь?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mount_01_06"); //Далеко отсюда. На другом конце этих гор.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mount_01_07"); //Но я тебе туда ходить не советую, если ты, конечно, не хочешь разделить мою участь.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mount_01_08"); //Понятно. Больше ничего?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Mount_01_09"); //Это все, что я знаю. Больше мне нечего добавить.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Mount_01_10"); //Ладно, благодарю тебя.
};
instance DIA_KDW_4573_Oddler_Work(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_Work_condition;
information = DIA_KDW_4573_Oddler_Work_info;
permanent = FALSE;
description = "Что ты тут строишь?";
};
func int DIA_KDW_4573_Oddler_Work_condition()
{
if(Npc_KnowsInfo(other,DIA_KDW_4573_Oddler_Blind) == TRUE)
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_Work_info()
{
AI_Output(other,self,"DIA_KDW_4573_Oddler_Work_01_00"); //Что ты тут строишь?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Work_01_01"); //Ты что, тоже слепой? Разве не видно?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Work_01_02"); //Я строю для себя хижину.
AI_Output(other,self,"DIA_KDW_4573_Oddler_Work_01_03"); //Зачем? Разве тебе в пещере не уютно?
AI_Output(self,other,"DIA_KDW_4573_Oddler_Work_01_04"); //В ней, конечно, тепло, но и она не всегда спасает от здешних морозов.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Work_01_05"); //Правда, мне чертовски не хватает инструментов. Ржавая пила - это единственное, что мне удалось тут отыскать.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Work_01_06"); //А с ней одной немного-то и сделаешь.
};
instance DIA_KDW_4573_Oddler_WorkDo(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_WorkDo_condition;
information = DIA_KDW_4573_Oddler_WorkDo_info;
permanent = FALSE;
description = "Я могу достать для тебя инструменты.";
};
func int DIA_KDW_4573_Oddler_WorkDo_condition()
{
if(Npc_KnowsInfo(other,DIA_KDW_4573_Oddler_Blind) == TRUE)
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_WorkDo_info()
{
AI_Output(other,self,"DIA_KDW_4573_Oddler_WorkDo_01_00"); //Я могу достать для тебя инструменты.
AI_Output(self,other,"DIA_KDW_4573_Oddler_WorkDo_01_01"); //Правда? Ну, тогда, пожалуй, я не буду отказываться от твоей помощи.
AI_Output(self,other,"DIA_KDW_4573_Oddler_WorkDo_01_02"); //Мне нужен молоток, новая пила и кирка, чтобы обтесывать камни.
AI_Output(self,other,"DIA_KDW_4573_Oddler_WorkDo_01_03"); //Если сможешь все это для меня достать, я буду очень признателен.
AI_Output(other,self,"DIA_KDW_4573_Oddler_WorkDo_01_04"); //Договорились.
MIS_OddlerlTools = LOG_Running;
Log_CreateTopic(TOPIC_OddlerlTools,LOG_MISSION);
Log_SetTopicStatus(TOPIC_OddlerlTools,LOG_Running);
B_LogEntry(TOPIC_OddlerlTools,"Оддлеру нужны новые инструменты для постройки хижины. Он попросил принести ему молоток, новую пилу и кирку.");
};
instance DIA_KDW_4573_Oddler_Done(C_Info)
{
npc = KDW_4573_Oddler;
nr = 99;
condition = DIA_KDW_4573_Oddler_Done_Condition;
information = DIA_KDW_4573_Oddler_Done_Info;
description = "Вот новые инструменты.";
};
func int DIA_KDW_4573_Oddler_Done_Condition()
{
if((MIS_OddlerlTools == LOG_Running) && (Npc_HasItems(other,ItMi_Hammer) >= 1) && (Npc_HasItems(other,ItMi_Saw) >= 1) && (Npc_HasItems(other,ItMw_2H_Axe_L_01) >= 1))
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_Done_Info()
{
B_GivePlayerXP(500);
AI_Output(other,self,"DIA_KDW_4573_Oddler_Done_01_00"); //Вот новые инструменты.
B_GiveInvItemsManyThings(other,self);
Npc_RemoveInvItems(hero,ItMi_Hammer,1);
Npc_RemoveInvItems(hero,ItMi_Saw,1);
Npc_RemoveInvItems(hero,ItMw_2H_Axe_L_01,1);
AI_Output(self,other,"DIA_KDW_4573_Oddler_Done_01_01"); //Спасибо! Теперь постройка хижины пойдет намного быстрей.
AI_Output(self,other,"DIA_KDW_4573_Oddler_Done_01_02"); //Вот, возьми этот магический свиток в знак моей благодарности.
B_GiveInvItems(self,other,ItSc_Shrink,1);
MIS_OddlerlTools = LOG_Success;
Log_SetTopicStatus(TOPIC_OddlerlTools,LOG_Success);
B_LogEntry(TOPIC_OddlerlTools,"Я принес Оддлеру нужные ему инструменты.");
};
instance DIA_KDW_4573_Oddler_XRANFREG(C_Info)
{
npc = KDW_4573_Oddler;
nr = 1;
condition = DIA_KDW_4573_Oddler_XRANFREG_condition;
information = DIA_KDW_4573_Oddler_XRANFREG_info;
permanent = FALSE;
description = "Расскажи мне о той экспедиции.";
};
func int DIA_KDW_4573_Oddler_XRANFREG_condition()
{
if((Npc_KnowsInfo(other,DIA_KDW_4573_Oddler_Mage) == TRUE) && (MIS_XRANFREG == LOG_Running))
{
return TRUE;
};
};
func void DIA_KDW_4573_Oddler_XRANFREG_info()
{
B_GivePlayerXP(500);
AI_Output(other,self,"DIA_KDW_4573_Oddler_XRANFREG_01_00"); //Расскажи мне о той экспедиции.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_01"); //Эх. Давно это было!
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_02"); //В ней принимали участие только маги Огня и несколько паладинов, которые вызвались в качестве сопровождения.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_03"); //Мастер Корристо предложил мне отправиться вместе с ними, дабы помочь им исследовать эту неизвестную часть острова.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_04"); //Поначалу я думал отказаться от этой опасной затеи.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_05"); //Но Корристо смог убедить меня в необходимости моего присутствия, и я решил согласиться.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_06"); //Переход через горы нам дался довольно легко.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_07"); //Когда мы попали сюда, Корристо распорядился построить тут небольшой лагерь, где мы все и обосновались.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_08"); //Позже часть магов ушла на север, а остальные, в том числе и я, решили осмотреть восточную часть этих земель.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_09"); //Так мы натолкнулись на заброшенное святилище орков.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_10"); //Точнее, оно выглядело как заброшенное, но на самом деле все оказалось иначе.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_11"); //В один прекрасный день, когда я занимался тем, что изучал древние алтари святилища, туда пришли орки.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_12"); //Хотя меня и сопровождало несколько паладинов, но исход боя был уже предрешен.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_13"); //Паладинов орки убили сразу. А меня, увидев, что я маг, решили отвести в лагерь.
AI_Output(self,other,"DIA_KDW_4573_Oddler_XRANFREG_01_14"); //На этом моя история участия в этой экспедиции заканчивается.
B_LogEntry(TOPIC_XRANFREG,"Оддлер - один из тех, кто принимал участие в экспедиции магов Огня. По его словам, на востоке находится древнее святилище орков. Надо бы наведаться туда при случае.");
};
instance DIA_VLK_5570_Avabul_EXIT(C_Info)
{
npc = VLK_5570_Avabul;
nr = 999;
condition = DIA_VLK_5570_Avabul_exit_condition;
information = DIA_VLK_5570_Avabul_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_VLK_5570_Avabul_exit_condition()
{
return TRUE;
};
func void DIA_VLK_5570_Avabul_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_VLK_5570_Avabul_HELLO(C_Info)
{
npc = VLK_5570_Avabul;
nr = 1;
condition = DIA_VLK_5570_Avabul_HELLO_condition;
information = DIA_VLK_5570_Avabul_HELLO_info;
permanent = FALSE;
important = TRUE;
};
func int DIA_VLK_5570_Avabul_HELLO_condition()
{
if(MIS_PashalQuest == LOG_SUCCESS)
{
return TRUE;
};
};
func void DIA_VLK_5570_Avabul_HELLO_info()
{
AI_Output(self,other,"DIA_VLK_5570_Avabul_HELLO_01_00"); //Смертный! Ты достал артефакт, который ищет мой господин?
AI_Output(other,self,"DIA_VLK_5570_Avabul_HELLO_01_01"); //Боюсь огорчить тебя, но его у меня нет.
AI_Output(self,other,"DIA_VLK_5570_Avabul_HELLO_01_02"); //Что ты сказал?!
AI_Output(other,self,"DIA_VLK_5570_Avabul_HELLO_01_03"); //Ты что, оглохла? Я сказал, что у меня его нет. Его настоящий владелец не захотел с ним расставаться.
AI_Output(self,other,"DIA_VLK_5570_Avabul_HELLO_01_04"); //Меня это не волнует. Ты должен был принести его мне! Это была часть нашего договора!
AI_Output(other,self,"DIA_VLK_5570_Avabul_HELLO_01_05"); //Тогда тебе и твоему хозяину придется немного поумерить свои аппетиты. Артефакт навсегда останется внутри этого храма, так что забудь о нашем соглашении.
AI_Output(self,other,"DIA_VLK_5570_Avabul_HELLO_01_06"); //Да как ты смеешь?! Жалкий червяк! За свою наглость ты сейчас умрешь!
AI_Output(self,other,"DIA_VLK_5570_Avabul_HELLO_01_07"); //А когда это случится, я вдоволь наиграюсь с твоей душой, словно с куклой!
Info_ClearChoices(DIA_VLK_5570_Avabul_HELLO);
Info_AddChoice(DIA_VLK_5570_Avabul_HELLO,Dialog_Ende,DIA_VLK_5570_Avabul_HELLO_End);
};
func void DIA_VLK_5570_Avabul_HELLO_End()
{
AI_StopProcessInfos(self);
self.aivar[AIV_EnemyOverride] = FALSE;
self.flags = 0;
Snd_Play("MFX_FEAR_CAST");
Wld_PlayEffect("SPELLFX_MASSDEATH_EXPLOSION",self,other,0,250,DAM_MAGIC,TRUE);
}; | D |
/Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/IQKeyboardManagerSwift.build/Objects-normal/x86_64/IQKeyboardManagerConstants.o : /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstantsInternal.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQBarButtonItem.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQTitleBarButtonItem.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQToolbar.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQKeyboardManager.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQKeyboardReturnKeyHandler.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIViewController+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUITextFieldView+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIScrollView+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstants.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQNSArray+Sort.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQPreviousNextView.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQTextView/IQTextView.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIView+Hierarchy.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIWindow+Hierarchy.swift /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/zaidtayyab/Desktop/Template/Pods/Target\ Support\ Files/IQKeyboardManagerSwift/IQKeyboardManagerSwift-umbrella.h /Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/IQKeyboardManagerSwift.build/unextended-module.modulemap
/Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/IQKeyboardManagerSwift.build/Objects-normal/x86_64/IQKeyboardManagerConstants~partial.swiftmodule : /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstantsInternal.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQBarButtonItem.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQTitleBarButtonItem.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQToolbar.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQKeyboardManager.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQKeyboardReturnKeyHandler.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIViewController+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUITextFieldView+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIScrollView+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstants.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQNSArray+Sort.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQPreviousNextView.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQTextView/IQTextView.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIView+Hierarchy.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIWindow+Hierarchy.swift /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/zaidtayyab/Desktop/Template/Pods/Target\ Support\ Files/IQKeyboardManagerSwift/IQKeyboardManagerSwift-umbrella.h /Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/IQKeyboardManagerSwift.build/unextended-module.modulemap
/Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/IQKeyboardManagerSwift.build/Objects-normal/x86_64/IQKeyboardManagerConstants~partial.swiftdoc : /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstantsInternal.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQBarButtonItem.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQTitleBarButtonItem.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQToolbar.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQKeyboardManager.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQKeyboardReturnKeyHandler.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIViewController+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUITextFieldView+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIScrollView+Additions.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstants.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQNSArray+Sort.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQPreviousNextView.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQTextView/IQTextView.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIView+Hierarchy.swift /Users/zaidtayyab/Desktop/Template/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIWindow+Hierarchy.swift /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/zaidtayyab/Desktop/Template/Pods/Target\ Support\ Files/IQKeyboardManagerSwift/IQKeyboardManagerSwift-umbrella.h /Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/IQKeyboardManagerSwift.build/unextended-module.modulemap
| D |
# FIXED
list.obj: C:/Projects/embedded-software/src/list.c
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/string.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/_ti_config.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/linkage.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/sys/cdefs.h
list.obj: C:/Projects/embedded-software/include/list.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/stdint.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/sys/stdint.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/sys/_types.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/machine/_types.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/machine/_stdint.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/sys/_stdint.h
list.obj: C:/Users/sglas/embeddedSoftware/stephenGame/project_settings.h
list.obj: C:/Projects/embedded-software/include/library.h
list.obj: C:/Projects/embedded-software/include/macros.h
list.obj: C:/Projects/embedded-software/include/int_def.h
list.obj: C:/Projects/embedded-software/hal/MSP430/MSP430F5529/hal_general.h
list.obj: C:/ti/ccsv8/ccs_base/msp430/include/msp430.h
list.obj: C:/ti/ccsv8/ccs_base/msp430/include/msp430f5529.h
list.obj: C:/ti/ccsv8/ccs_base/msp430/include/in430.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/intrinsics.h
list.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/intrinsics_legacy_undefs.h
C:/Projects/embedded-software/src/list.c:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/string.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/_ti_config.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/linkage.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/sys/cdefs.h:
C:/Projects/embedded-software/include/list.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/sys/stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/sys/_types.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/machine/_types.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/machine/_stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/sys/_stdint.h:
C:/Users/sglas/embeddedSoftware/stephenGame/project_settings.h:
C:/Projects/embedded-software/include/library.h:
C:/Projects/embedded-software/include/macros.h:
C:/Projects/embedded-software/include/int_def.h:
C:/Projects/embedded-software/hal/MSP430/MSP430F5529/hal_general.h:
C:/ti/ccsv8/ccs_base/msp430/include/msp430.h:
C:/ti/ccsv8/ccs_base/msp430/include/msp430f5529.h:
C:/ti/ccsv8/ccs_base/msp430/include/in430.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/intrinsics.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include/intrinsics_legacy_undefs.h:
| D |
/** winnt.d
Converted from 'winnt.h'.
Version: V7.0
Authors: Koji Kishita
*/
module c.windows.winnt;
import std.c.string;
import c.windows.sdkddkver;
import c.windows.windef;
import c.windows.guiddef;
import c.windows.winternl;
import c.windows.ktmtypes;
extern(C){
// Dummy -->
struct EXCEPTION_REGISTRATION_RECORD {
}
alias void* EXCEPTION_DISPOSITION;
struct ACTIVATION_CONTEXT {
}
// <--
enum ANYSIZE_ARRAY = 1;
version(Win64){
enum MAX_NATURAL_ALIGNMENT = ULONGLONG.sizeof;
enum MEMORY_ALLOCATION_ALIGNMENT = 16;
}else{
enum MAX_NATURAL_ALIGNMENT = DWORD.sizeof;
enum MEMORY_ALLOCATION_ALIGNMENT = 8;
}
version(X86)
enum SYSTEM_CACHE_ALIGNMENT_SIZE = 64;
else version(X86_64)
enum SYSTEM_CACHE_ALIGNMENT_SIZE = 64;
else
enum SYSTEM_CACHE_ALIGNMENT_SIZE = 128;
enum ALL_PROCESSOR_GROUPS = 0xffff;
struct PROCESSOR_NUMBER {
WORD Group;
BYTE Number;
BYTE Reserved;
}
alias PROCESSOR_NUMBER* PPROCESSOR_NUMBER;
struct GROUP_AFFINITY {
KAFFINITY Mask;
WORD Group;
WORD[3] Reserved;
}
alias GROUP_AFFINITY* PGROUP_AFFINITY;
/* --> to windef
alias BYTE FCHAR;
alias WORD FSHORT;
alias DWORD FLONG;
alias LONG HRESULT;
alias char CCHAR;
alias DWORD LCID;
alias PDWORD PLCID;
alias WORD LANGID;
*/ // <--
enum {
APPLICATION_ERROR_MASK = 0x20000000,
ERROR_SEVERITY_SUCCESS = 0x00000000,
ERROR_SEVERITY_INFORMATIONAL = 0x40000000,
ERROR_SEVERITY_WARNING = 0x80000000,
ERROR_SEVERITY_ERROR = 0xC0000000,
}
version(none){ // _M_IA64
align(16)
struct FLOAT128 {
long LowPart;
long HighPart;
}
}else{
struct FLOAT128 {
long LowPart;
long HighPart;
}
}
alias FLOAT128* PFLOAT128;
alias LONGLONG USN;
/* --> to windef
union LARGE_INTEGER {
struct {
DWORD LowPart;
LONG HighPart;
}
LONGLONG QuadPart;
}
alias LARGE_INTEGER* PLARGE_INTEGER;
struct ULARGE_INTEGER {
struct {
DWORD LowPart;
DWORD HighPart;
}
ULONGLONG QuadPart;
}
alias ULARGE_INTEGER* PULARGE_INTEGER;
struct LUID {
DWORD LowPart;
LONG HighPart;
}
alias LUID* PLUID;
alias ULONGLONG DWORDLONG;
alias DWORDLONG* PDWORDLONG;
*/ // <-- to windef
version(X86_64){
pure nothrow
long Int32x32To64(int a, int b)
{
return cast(long)a * cast(long)b;
}
pure nothrow
ulong UInt32x32To64(uint a, uint b)
{
return cast(ulong)a * cast(ulong)b;
}
pure nothrow
ulong Int64ShllMod32(uint a, int b)
{
return (cast(ulong)a) << b;
}
pure nothrow
long Int64ShraMod32(int a, int b)
{
return (cast(long)a) >> b;
}
pure nothrow
ulong Int64ShrlMod32(int a, int b)
{
return (cast(ulong)a) >> b;
}
}else version(X86){
pure nothrow
long Int32x32To64(int a, int b)
{
return cast(long)a * cast(long)b;
}
pure nothrow
ulong UInt32x32To64(uint a, uint b)
{
return cast(ulong)a * cast(ulong)b;
}
version(D_InlineAsm_X86){
extern(Windows){
ULONGLONG Int64ShllMod32(ULONGLONG Value, DWORD ShiftCount)
{
asm{
mov ECX, ShiftCount;
mov EAX, dword ptr [Value];
mov EDX, dword ptr [Value+4];
shld EDX, EAX, CL;
shl EAX, CL;
}
}
LONGLONG Int64ShraMod32(LONGLONG Value, DWORD ShiftCount)
{
asm {
mov ECX, ShiftCount;
mov EAX, dword ptr [Value];
mov EDX, dword ptr [Value+4];
shrd EAX, EDX, CL;
sar EDX, CL;
}
}
ULONGLONG Int64ShrlMod32(ULONGLONG Value, DWORD ShiftCount)
{
asm {
mov ECX, ShiftCount;
mov EAX, dword ptr [Value];
mov EDX, dword ptr [Value+4];
shrd EAX, EDX, CL;
shr EDX, CL;
}
}
} // extern
} // asm
}else{
static assert("architecture");
}
extern(C){
version(X86_64){
ubyte _rotl8(ubyte Value, ubyte Shift);
ubyte _rotl16(ushort Value, ubyte Shift);
ubyte _rotr8 (ubyte Value, ubyte Shift);
ushort _rotr16(ushort Value, ubyte Shift);
alias _rotl8 RotateLeft8;
alias _rotl16 RotateLeft16;
alias _rotr8 RotateRight8;
alias _rotr16 RotateRight16;
}
uint _rotl(uint Value, int Shift);
ulong _rotl64 (ulong Value, int Shift);
uint _rotr(uint Value, int Shift);
ulong _rotr64(ulong Value, int Shift);
alias _rotl RotateLeft32;
alias _rotl64 RotateLeft64;
alias _rotr RotateRight32;
alias _rotr64 RotateRight64;
} // extern
enum {
ANSI_NULL = 0,
UNICODE_NULL = 0,
UNICODE_STRING_MAX_BYTES = 65534,
UNICODE_STRING_MAX_CHARS = 32767,
}
/* to windef -->
alias BYTE BOOLEAN;
alias BOOLEAN* PBOOLEAN;
struct LIST_ENTRY {
LIST_ENTRY* Flink;
LIST_ENTRY* Blink;
}
alias LIST_ENTRY* PLIST_ENTRY;
alias LIST_ENTRY* RESTRICTED_POINTER;
alias LIST_ENTRY* PRLIST_ENTRY;
struct SINGLE_LIST_ENTRY {
SINGLE_LIST_ENTRY* Next;
}
alias SINGLE_LIST_ENTRY* PSINGLE_LIST_ENTRY;
struct LIST_ENTRY32 {
DWORD Flink;
DWORD Blink;
}
alias LIST_ENTRY32* PLIST_ENTRY32;
struct LIST_ENTRY64 {
ULONGLONG Flink;
ULONGLONG Blink;
}
alias LIST_ENTRY64* PLIST_ENTRY64;
*/ // <-- to windef
struct OBJECTID {
GUID Lineage;
DWORD Uniquifier;
}
enum {
MINCHAR = 0x80,
MAXCHAR = 0x7f,
MINSHORT = 0x8000,
MAXSHORT = 0x7fff,
MINLONG = 0x80000000,
MAXLONG = 0x7fffffff,
MAXBYTE = 0xff,
MAXWORD = 0xffff,
MAXDWORD = 0xffffffff,
}
alias extern(Windows) EXCEPTION_DISPOSITION function(EXCEPTION_RECORD* ExceptionRecord, PVOID EstablisherFrame, CONTEXT* ContextRecord, PVOID DispatcherContext) EXCEPTION_ROUTINE;
alias EXCEPTION_ROUTINE PEXCEPTION_ROUTINE;
enum {
VER_SERVER_NT = 0x80000000,
VER_WORKSTATION_NT = 0x40000000,
VER_SUITE_SMALLBUSINESS = 0x00000001,
VER_SUITE_ENTERPRISE = 0x00000002,
VER_SUITE_BACKOFFICE = 0x00000004,
VER_SUITE_COMMUNICATIONS = 0x00000008,
VER_SUITE_TERMINAL = 0x00000010,
VER_SUITE_SMALLBUSINESS_RESTRICTED = 0x00000020,
VER_SUITE_EMBEDDEDNT = 0x00000040,
VER_SUITE_DATACENTER = 0x00000080,
VER_SUITE_SINGLEUSERTS = 0x00000100,
VER_SUITE_PERSONAL = 0x00000200,
VER_SUITE_BLADE = 0x00000400,
VER_SUITE_EMBEDDED_RESTRICTED = 0x00000800,
VER_SUITE_SECURITY_APPLIANCE = 0x00001000,
VER_SUITE_STORAGE_SERVER = 0x00002000,
VER_SUITE_COMPUTE_SERVER = 0x00004000,
VER_SUITE_WH_SERVER = 0x00008000,
}
enum {
PRODUCT_UNDEFINED = 0x00000000,
PRODUCT_ULTIMATE = 0x00000001,
PRODUCT_HOME_BASIC = 0x00000002,
PRODUCT_HOME_PREMIUM = 0x00000003,
PRODUCT_ENTERPRISE = 0x00000004,
PRODUCT_HOME_BASIC_N = 0x00000005,
PRODUCT_BUSINESS = 0x00000006,
PRODUCT_STANDARD_SERVER = 0x00000007,
PRODUCT_DATACENTER_SERVER = 0x00000008,
PRODUCT_SMALLBUSINESS_SERVER = 0x00000009,
PRODUCT_ENTERPRISE_SERVER = 0x0000000A,
PRODUCT_STARTER = 0x0000000B,
PRODUCT_DATACENTER_SERVER_CORE = 0x0000000C,
PRODUCT_STANDARD_SERVER_CORE = 0x0000000D,
PRODUCT_ENTERPRISE_SERVER_CORE = 0x0000000E,
PRODUCT_ENTERPRISE_SERVER_IA64 = 0x0000000F,
PRODUCT_BUSINESS_N = 0x00000010,
PRODUCT_WEB_SERVER = 0x00000011,
PRODUCT_CLUSTER_SERVER = 0x00000012,
PRODUCT_HOME_SERVER = 0x00000013,
PRODUCT_STORAGE_EXPRESS_SERVER = 0x00000014,
PRODUCT_STORAGE_STANDARD_SERVER = 0x00000015,
PRODUCT_STORAGE_WORKGROUP_SERVER = 0x00000016,
PRODUCT_STORAGE_ENTERPRISE_SERVER = 0x00000017,
PRODUCT_SERVER_FOR_SMALLBUSINESS = 0x00000018,
PRODUCT_SMALLBUSINESS_SERVER_PREMIUM = 0x00000019,
PRODUCT_HOME_PREMIUM_N = 0x0000001A,
PRODUCT_ENTERPRISE_N = 0x0000001B,
PRODUCT_ULTIMATE_N = 0x0000001C,
PRODUCT_WEB_SERVER_CORE = 0x0000001D,
PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT = 0x0000001E,
PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY = 0x0000001F,
PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING = 0x00000020,
PRODUCT_SERVER_FOUNDATION = 0x00000021,
PRODUCT_HOME_PREMIUM_SERVER = 0x00000022,
PRODUCT_SERVER_FOR_SMALLBUSINESS_V = 0x00000023,
PRODUCT_STANDARD_SERVER_V = 0x00000024,
PRODUCT_DATACENTER_SERVER_V = 0x00000025,
PRODUCT_ENTERPRISE_SERVER_V = 0x00000026,
PRODUCT_DATACENTER_SERVER_CORE_V = 0x00000027,
PRODUCT_STANDARD_SERVER_CORE_V = 0x00000028,
PRODUCT_ENTERPRISE_SERVER_CORE_V = 0x00000029,
PRODUCT_HYPERV = 0x0000002A,
PRODUCT_STORAGE_EXPRESS_SERVER_CORE = 0x0000002B,
PRODUCT_STORAGE_STANDARD_SERVER_CORE = 0x0000002C,
PRODUCT_STORAGE_WORKGROUP_SERVER_CORE = 0x0000002D,
PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE = 0x0000002E,
PRODUCT_STARTER_N = 0x0000002F,
PRODUCT_PROFESSIONAL = 0x00000030,
PRODUCT_PROFESSIONAL_N = 0x00000031,
PRODUCT_SB_SOLUTION_SERVER = 0x00000032,
PRODUCT_SERVER_FOR_SB_SOLUTIONS = 0x00000033,
PRODUCT_STANDARD_SERVER_SOLUTIONS = 0x00000034,
PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE = 0x00000035,
PRODUCT_SB_SOLUTION_SERVER_EM = 0x00000036,
PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM = 0x00000037,
PRODUCT_SOLUTION_EMBEDDEDSERVER = 0x00000038,
PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE = 0x00000039,
PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE = 0x0000003F,
PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT = 0x0000003B,
PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL = 0x0000003C,
PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC = 0x0000003D,
PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC = 0x0000003E,
PRODUCT_CLUSTER_SERVER_V = 0x00000040,
PRODUCT_EMBEDDED = 0x00000041,
PRODUCT_STARTER_E = 0x00000042,
PRODUCT_HOME_BASIC_E = 0x00000043,
PRODUCT_HOME_PREMIUM_E = 0x00000044,
PRODUCT_PROFESSIONAL_E = 0x00000045,
PRODUCT_ENTERPRISE_E = 0x00000046,
PRODUCT_ULTIMATE_E = 0x00000047,
PRODUCT_UNLICENSED = 0xABCDABCD,
}
enum {
LANG_NEUTRAL = 0x00,
LANG_INVARIANT = 0x7f,
LANG_AFRIKAANS = 0x36,
LANG_ALBANIAN = 0x1c,
LANG_ALSATIAN = 0x84,
LANG_AMHARIC = 0x5e,
LANG_ARABIC = 0x01,
LANG_ARMENIAN = 0x2b,
LANG_ASSAMESE = 0x4d,
LANG_AZERI = 0x2c,
LANG_BASHKIR = 0x6d,
LANG_BASQUE = 0x2d,
LANG_BELARUSIAN = 0x23,
LANG_BENGALI = 0x45,
LANG_BRETON = 0x7e,
LANG_BOSNIAN = 0x1a,
LANG_BOSNIAN_NEUTRAL = 0x781a,
LANG_BULGARIAN = 0x02,
LANG_CATALAN = 0x03,
LANG_CHINESE = 0x04,
LANG_CHINESE_SIMPLIFIED = 0x04,
LANG_CHINESE_TRADITIONAL = 0x7c04,
LANG_CORSICAN = 0x83,
LANG_CROATIAN = 0x1a,
LANG_CZECH = 0x05,
LANG_DANISH = 0x06,
LANG_DARI = 0x8c,
LANG_DIVEHI = 0x65,
LANG_DUTCH = 0x13,
LANG_ENGLISH = 0x09,
LANG_ESTONIAN = 0x25,
LANG_FAEROESE = 0x38,
LANG_FARSI = 0x29,
LANG_FILIPINO = 0x64,
LANG_FINNISH = 0x0b,
LANG_FRENCH = 0x0c,
LANG_FRISIAN = 0x62,
LANG_GALICIAN = 0x56,
LANG_GEORGIAN = 0x37,
LANG_GERMAN = 0x07,
LANG_GREEK = 0x08,
LANG_GREENLANDIC = 0x6f,
LANG_GUJARATI = 0x47,
LANG_HAUSA = 0x68,
LANG_HEBREW = 0x0d,
LANG_HINDI = 0x39,
LANG_HUNGARIAN = 0x0e,
LANG_ICELANDIC = 0x0f,
LANG_IGBO = 0x70,
LANG_INDONESIAN = 0x21,
LANG_INUKTITUT = 0x5d,
LANG_IRISH = 0x3c,
LANG_ITALIAN = 0x10,
LANG_JAPANESE = 0x11,
LANG_KANNADA = 0x4b,
LANG_KASHMIRI = 0x60,
LANG_KAZAK = 0x3f,
LANG_KHMER = 0x53,
LANG_KICHE = 0x86,
LANG_KINYARWANDA = 0x87,
LANG_KONKANI = 0x57,
LANG_KOREAN = 0x12,
LANG_KYRGYZ = 0x40,
LANG_LAO = 0x54,
LANG_LATVIAN = 0x26,
LANG_LITHUANIAN = 0x27,
LANG_LOWER_SORBIAN = 0x2e,
LANG_LUXEMBOURGISH = 0x6e,
LANG_MACEDONIAN = 0x2f,
LANG_MALAY = 0x3e,
LANG_MALAYALAM = 0x4c,
LANG_MALTESE = 0x3a,
LANG_MANIPURI = 0x58,
LANG_MAORI = 0x81,
LANG_MAPUDUNGUN = 0x7a,
LANG_MARATHI = 0x4e,
LANG_MOHAWK = 0x7c,
LANG_MONGOLIAN = 0x50,
LANG_NEPALI = 0x61,
LANG_NORWEGIAN = 0x14,
LANG_OCCITAN = 0x82,
LANG_ORIYA = 0x48,
LANG_PASHTO = 0x63,
LANG_PERSIAN = 0x29,
LANG_POLISH = 0x15,
LANG_PORTUGUESE = 0x16,
LANG_PUNJABI = 0x46,
LANG_QUECHUA = 0x6b,
LANG_ROMANIAN = 0x18,
LANG_ROMANSH = 0x17,
LANG_RUSSIAN = 0x19,
LANG_SAMI = 0x3b,
LANG_SANSKRIT = 0x4f,
LANG_SCOTTISH_GAELIC = 0x91,
LANG_SERBIAN = 0x1a,
LANG_SERBIAN_NEUTRAL = 0x7c1a,
LANG_SINDHI = 0x59,
LANG_SINHALESE = 0x5b,
LANG_SLOVAK = 0x1b,
LANG_SLOVENIAN = 0x24,
LANG_SOTHO = 0x6c,
LANG_SPANISH = 0x0a,
LANG_SWAHILI = 0x41,
LANG_SWEDISH = 0x1d,
LANG_SYRIAC = 0x5a,
LANG_TAJIK = 0x28,
LANG_TAMAZIGHT = 0x5f,
LANG_TAMIL = 0x49,
LANG_TATAR = 0x44,
LANG_TELUGU = 0x4a,
LANG_THAI = 0x1e,
LANG_TIBETAN = 0x51,
LANG_TIGRIGNA = 0x73,
LANG_TSWANA = 0x32,
LANG_TURKISH = 0x1f,
LANG_TURKMEN = 0x42,
LANG_UIGHUR = 0x80,
LANG_UKRAINIAN = 0x22,
LANG_UPPER_SORBIAN = 0x2e,
LANG_URDU = 0x20,
LANG_UZBEK = 0x43,
LANG_VIETNAMESE = 0x2a,
LANG_WELSH = 0x52,
LANG_WOLOF = 0x88,
LANG_XHOSA = 0x34,
LANG_YAKUT = 0x85,
LANG_YI = 0x78,
LANG_YORUBA = 0x6a,
LANG_ZULU = 0x35,
}
enum {
SUBLANG_NEUTRAL = 0x00,
SUBLANG_DEFAULT = 0x01,
SUBLANG_SYS_DEFAULT = 0x02,
SUBLANG_CUSTOM_DEFAULT = 0x03,
SUBLANG_CUSTOM_UNSPECIFIED = 0x04,
SUBLANG_UI_CUSTOM_DEFAULT = 0x05,
SUBLANG_AFRIKAANS_SOUTH_AFRICA = 0x01,
SUBLANG_ALBANIAN_ALBANIA = 0x01,
SUBLANG_ALSATIAN_FRANCE = 0x01,
SUBLANG_AMHARIC_ETHIOPIA = 0x01,
SUBLANG_ARABIC_SAUDI_ARABIA = 0x01,
SUBLANG_ARABIC_IRAQ = 0x02,
SUBLANG_ARABIC_EGYPT = 0x03,
SUBLANG_ARABIC_LIBYA = 0x04,
SUBLANG_ARABIC_ALGERIA = 0x05,
SUBLANG_ARABIC_MOROCCO = 0x06,
SUBLANG_ARABIC_TUNISIA = 0x07,
SUBLANG_ARABIC_OMAN = 0x08,
SUBLANG_ARABIC_YEMEN = 0x09,
SUBLANG_ARABIC_SYRIA = 0x0a,
SUBLANG_ARABIC_JORDAN = 0x0b,
SUBLANG_ARABIC_LEBANON = 0x0c,
SUBLANG_ARABIC_KUWAIT = 0x0d,
SUBLANG_ARABIC_UAE = 0x0e,
SUBLANG_ARABIC_BAHRAIN = 0x0f,
SUBLANG_ARABIC_QATAR = 0x10,
SUBLANG_ARMENIAN_ARMENIA = 0x01,
SUBLANG_ASSAMESE_INDIA = 0x01,
SUBLANG_AZERI_LATIN = 0x01,
SUBLANG_AZERI_CYRILLIC = 0x02,
SUBLANG_BASHKIR_RUSSIA = 0x01,
SUBLANG_BASQUE_BASQUE = 0x01,
SUBLANG_BELARUSIAN_BELARUS = 0x01,
SUBLANG_BENGALI_INDIA = 0x01,
SUBLANG_BENGALI_BANGLADESH = 0x02,
SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN = 0x05,
SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x08,
SUBLANG_BRETON_FRANCE = 0x01,
SUBLANG_BULGARIAN_BULGARIA = 0x01,
SUBLANG_CATALAN_CATALAN = 0x01,
SUBLANG_CHINESE_TRADITIONAL = 0x01,
SUBLANG_CHINESE_SIMPLIFIED = 0x02,
SUBLANG_CHINESE_HONGKONG = 0x03,
SUBLANG_CHINESE_SINGAPORE = 0x04,
SUBLANG_CHINESE_MACAU = 0x05,
SUBLANG_CORSICAN_FRANCE = 0x01,
SUBLANG_CZECH_CZECH_REPUBLIC = 0x01,
SUBLANG_CROATIAN_CROATIA = 0x01,
SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN = 0x04,
SUBLANG_DANISH_DENMARK = 0x01,
SUBLANG_DARI_AFGHANISTAN = 0x01,
SUBLANG_DIVEHI_MALDIVES = 0x01,
SUBLANG_DUTCH = 0x01,
SUBLANG_DUTCH_BELGIAN = 0x02,
SUBLANG_ENGLISH_US = 0x01,
SUBLANG_ENGLISH_UK = 0x02,
SUBLANG_ENGLISH_AUS = 0x03,
SUBLANG_ENGLISH_CAN = 0x04,
SUBLANG_ENGLISH_NZ = 0x05,
SUBLANG_ENGLISH_EIRE = 0x06,
SUBLANG_ENGLISH_SOUTH_AFRICA = 0x07,
SUBLANG_ENGLISH_JAMAICA = 0x08,
SUBLANG_ENGLISH_CARIBBEAN = 0x09,
SUBLANG_ENGLISH_BELIZE = 0x0a,
SUBLANG_ENGLISH_TRINIDAD = 0x0b,
SUBLANG_ENGLISH_ZIMBABWE = 0x0c,
SUBLANG_ENGLISH_PHILIPPINES = 0x0d,
SUBLANG_ENGLISH_INDIA = 0x10,
SUBLANG_ENGLISH_MALAYSIA = 0x11,
SUBLANG_ENGLISH_SINGAPORE = 0x12,
SUBLANG_ESTONIAN_ESTONIA = 0x01,
SUBLANG_FAEROESE_FAROE_ISLANDS = 0x01,
SUBLANG_FILIPINO_PHILIPPINES = 0x01,
SUBLANG_FINNISH_FINLAND = 0x01,
SUBLANG_FRENCH = 0x01,
SUBLANG_FRENCH_BELGIAN = 0x02,
SUBLANG_FRENCH_CANADIAN = 0x03,
SUBLANG_FRENCH_SWISS = 0x04,
SUBLANG_FRENCH_LUXEMBOURG = 0x05,
SUBLANG_FRENCH_MONACO = 0x06,
SUBLANG_FRISIAN_NETHERLANDS = 0x01,
SUBLANG_GALICIAN_GALICIAN = 0x01,
SUBLANG_GEORGIAN_GEORGIA = 0x01,
SUBLANG_GERMAN = 0x01,
SUBLANG_GERMAN_SWISS = 0x02,
SUBLANG_GERMAN_AUSTRIAN = 0x03,
SUBLANG_GERMAN_LUXEMBOURG = 0x04,
SUBLANG_GERMAN_LIECHTENSTEIN = 0x05,
SUBLANG_GREEK_GREECE = 0x01,
SUBLANG_GREENLANDIC_GREENLAND = 0x01,
SUBLANG_GUJARATI_INDIA = 0x01,
SUBLANG_HAUSA_NIGERIA_LATIN = 0x01,
SUBLANG_HEBREW_ISRAEL = 0x01,
SUBLANG_HINDI_INDIA = 0x01,
SUBLANG_HUNGARIAN_HUNGARY = 0x01,
SUBLANG_ICELANDIC_ICELAND = 0x01,
SUBLANG_IGBO_NIGERIA = 0x01,
SUBLANG_INDONESIAN_INDONESIA = 0x01,
SUBLANG_INUKTITUT_CANADA = 0x01,
SUBLANG_INUKTITUT_CANADA_LATIN = 0x02,
SUBLANG_IRISH_IRELAND = 0x02,
SUBLANG_ITALIAN = 0x01,
SUBLANG_ITALIAN_SWISS = 0x02,
SUBLANG_JAPANESE_JAPAN = 0x01,
SUBLANG_KANNADA_INDIA = 0x01,
SUBLANG_KASHMIRI_SASIA = 0x02,
SUBLANG_KASHMIRI_INDIA = 0x02,
SUBLANG_KAZAK_KAZAKHSTAN = 0x01,
SUBLANG_KHMER_CAMBODIA = 0x01,
SUBLANG_KICHE_GUATEMALA = 0x01,
SUBLANG_KINYARWANDA_RWANDA = 0x01,
SUBLANG_KONKANI_INDIA = 0x01,
SUBLANG_KOREAN = 0x01,
SUBLANG_KYRGYZ_KYRGYZSTAN = 0x01,
SUBLANG_LAO_LAO = 0x01,
SUBLANG_LATVIAN_LATVIA = 0x01,
SUBLANG_LITHUANIAN = 0x01,
SUBLANG_LOWER_SORBIAN_GERMANY = 0x02,
SUBLANG_LUXEMBOURGISH_LUXEMBOURG = 0x01,
SUBLANG_MACEDONIAN_MACEDONIA = 0x01,
SUBLANG_MALAY_MALAYSIA = 0x01,
SUBLANG_MALAY_BRUNEI_DARUSSALAM = 0x02,
SUBLANG_MALAYALAM_INDIA = 0x01,
SUBLANG_MALTESE_MALTA = 0x01,
SUBLANG_MAORI_NEW_ZEALAND = 0x01,
SUBLANG_MAPUDUNGUN_CHILE = 0x01,
SUBLANG_MARATHI_INDIA = 0x01,
SUBLANG_MOHAWK_MOHAWK = 0x01,
SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA = 0x01,
SUBLANG_MONGOLIAN_PRC = 0x02,
SUBLANG_NEPALI_INDIA = 0x02,
SUBLANG_NEPALI_NEPAL = 0x01,
SUBLANG_NORWEGIAN_BOKMAL = 0x01,
SUBLANG_NORWEGIAN_NYNORSK = 0x02,
SUBLANG_OCCITAN_FRANCE = 0x01,
SUBLANG_ORIYA_INDIA = 0x01,
SUBLANG_PASHTO_AFGHANISTAN = 0x01,
SUBLANG_PERSIAN_IRAN = 0x01,
SUBLANG_POLISH_POLAND = 0x01,
SUBLANG_PORTUGUESE = 0x02,
SUBLANG_PORTUGUESE_BRAZILIAN = 0x01,
SUBLANG_PUNJABI_INDIA = 0x01,
SUBLANG_QUECHUA_BOLIVIA = 0x01,
SUBLANG_QUECHUA_ECUADOR = 0x02,
SUBLANG_QUECHUA_PERU = 0x03,
SUBLANG_ROMANIAN_ROMANIA = 0x01,
SUBLANG_ROMANSH_SWITZERLAND = 0x01,
SUBLANG_RUSSIAN_RUSSIA = 0x01,
SUBLANG_SAMI_NORTHERN_NORWAY = 0x01,
SUBLANG_SAMI_NORTHERN_SWEDEN = 0x02,
SUBLANG_SAMI_NORTHERN_FINLAND = 0x03,
SUBLANG_SAMI_LULE_NORWAY = 0x04,
SUBLANG_SAMI_LULE_SWEDEN = 0x05,
SUBLANG_SAMI_SOUTHERN_NORWAY = 0x06,
SUBLANG_SAMI_SOUTHERN_SWEDEN = 0x07,
SUBLANG_SAMI_SKOLT_FINLAND = 0x08,
SUBLANG_SAMI_INARI_FINLAND = 0x09,
SUBLANG_SANSKRIT_INDIA = 0x01,
SUBLANG_SCOTTISH_GAELIC = 0x01,
SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN = 0x06,
SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x07,
SUBLANG_SERBIAN_MONTENEGRO_LATIN = 0x0b,
SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC = 0x0c,
SUBLANG_SERBIAN_SERBIA_LATIN = 0x09,
SUBLANG_SERBIAN_SERBIA_CYRILLIC = 0x0a,
SUBLANG_SERBIAN_CROATIA = 0x01,
SUBLANG_SERBIAN_LATIN = 0x02,
SUBLANG_SERBIAN_CYRILLIC = 0x03,
SUBLANG_SINDHI_INDIA = 0x01,
SUBLANG_SINDHI_PAKISTAN = 0x02,
SUBLANG_SINDHI_AFGHANISTAN = 0x02,
SUBLANG_SINHALESE_SRI_LANKA = 0x01,
SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA = 0x01,
SUBLANG_SLOVAK_SLOVAKIA = 0x01,
SUBLANG_SLOVENIAN_SLOVENIA = 0x01,
SUBLANG_SPANISH = 0x01,
SUBLANG_SPANISH_MEXICAN = 0x02,
SUBLANG_SPANISH_MODERN = 0x03,
SUBLANG_SPANISH_GUATEMALA = 0x04,
SUBLANG_SPANISH_COSTA_RICA = 0x05,
SUBLANG_SPANISH_PANAMA = 0x06,
SUBLANG_SPANISH_DOMINICAN_REPUBLIC = 0x07,
SUBLANG_SPANISH_VENEZUELA = 0x08,
SUBLANG_SPANISH_COLOMBIA = 0x09,
SUBLANG_SPANISH_PERU = 0x0a,
SUBLANG_SPANISH_ARGENTINA = 0x0b,
SUBLANG_SPANISH_ECUADOR = 0x0c,
SUBLANG_SPANISH_CHILE = 0x0d,
SUBLANG_SPANISH_URUGUAY = 0x0e,
SUBLANG_SPANISH_PARAGUAY = 0x0f,
SUBLANG_SPANISH_BOLIVIA = 0x10,
SUBLANG_SPANISH_EL_SALVADOR = 0x11,
SUBLANG_SPANISH_HONDURAS = 0x12,
SUBLANG_SPANISH_NICARAGUA = 0x13,
SUBLANG_SPANISH_PUERTO_RICO = 0x14,
SUBLANG_SPANISH_US = 0x15,
SUBLANG_SWAHILI_KENYA = 0x01,
SUBLANG_SWEDISH = 0x01,
SUBLANG_SWEDISH_FINLAND = 0x02,
SUBLANG_SYRIAC_SYRIA = 0x01,
SUBLANG_TAJIK_TAJIKISTAN = 0x01,
SUBLANG_TAMAZIGHT_ALGERIA_LATIN = 0x02,
SUBLANG_TAMIL_INDIA = 0x01,
SUBLANG_TATAR_RUSSIA = 0x01,
SUBLANG_TELUGU_INDIA = 0x01,
SUBLANG_THAI_THAILAND = 0x01,
SUBLANG_TIBETAN_PRC = 0x01,
SUBLANG_TIGRIGNA_ERITREA = 0x02,
SUBLANG_TSWANA_SOUTH_AFRICA = 0x01,
SUBLANG_TURKISH_TURKEY = 0x01,
SUBLANG_TURKMEN_TURKMENISTAN = 0x01,
SUBLANG_UIGHUR_PRC = 0x01,
SUBLANG_UKRAINIAN_UKRAINE = 0x01,
SUBLANG_UPPER_SORBIAN_GERMANY = 0x01,
SUBLANG_URDU_PAKISTAN = 0x01,
SUBLANG_URDU_INDIA = 0x02,
SUBLANG_UZBEK_LATIN = 0x01,
SUBLANG_UZBEK_CYRILLIC = 0x02,
SUBLANG_VIETNAMESE_VIETNAM = 0x01,
SUBLANG_WELSH_UNITED_KINGDOM = 0x01,
SUBLANG_WOLOF_SENEGAL = 0x01,
SUBLANG_XHOSA_SOUTH_AFRICA = 0x01,
SUBLANG_YAKUT_RUSSIA = 0x01,
SUBLANG_YI_PRC = 0x01,
SUBLANG_YORUBA_NIGERIA = 0x01,
SUBLANG_ZULU_SOUTH_AFRICA = 0x01,
}
enum {
SORT_DEFAULT = 0x0,
SORT_INVARIANT_MATH = 0x1,
SORT_JAPANESE_XJIS = 0x0,
SORT_JAPANESE_UNICODE = 0x1,
SORT_JAPANESE_RADICALSTROKE = 0x4,
SORT_CHINESE_BIG5 = 0x0,
SORT_CHINESE_PRCP = 0x0,
SORT_CHINESE_UNICODE = 0x1,
SORT_CHINESE_PRC = 0x2,
SORT_CHINESE_BOPOMOFO = 0x3,
SORT_CHINESE_RADICALSTROKE = 0x4,
SORT_KOREAN_KSC = 0x0,
SORT_KOREAN_UNICODE = 0x1,
SORT_GERMAN_PHONE_BOOK = 0x1,
SORT_HUNGARIAN_DEFAULT = 0x0,
SORT_HUNGARIAN_TECHNICAL = 0x1,
SORT_GEORGIAN_TRADITIONAL = 0x0,
SORT_GEORGIAN_MODERN = 0x1,
}
pure nothrow
WORD MAKELANGID(USHORT p, USHORT s)
{
return cast(USHORT)(s << 10) | p;
}
pure nothrow
WORD PRIMARYLANGID(WORD lgid)
{
return lgid & 0x3ff;
}
pure nothrow
WORD SUBLANGID(WORD lgid)
{
return cast(WORD)(lgid >> 10);
}
enum NLS_VALID_LOCALE_MASK = 0x000fffff;
pure nothrow
DWORD MAKELCID(WORD lgid, WORD srtid)
{
return ((cast(DWORD)srtid) << 16) | (cast(DWORD)lgid);
}
pure nothrow
DWORD MAKESORTLCID(WORD lgid, WORD srtid, WORD ver)
{
return (cast(DWORD)MAKELCID(lgid, srtid)) | ((cast(DWORD)ver) << 20);
}
pure nothrow
WORD LANGIDFROMLCID(LCID lcid)
{
return cast(WORD)lcid;
}
pure nothrow
WORD SORTIDFROMLCID(LCID lcid)
{
return cast(WORD)(((cast(DWORD)lcid) >> 16) & 0xf);
}
pure nothrow
WORD SORTVERSIONFROMLCID(LCID lcid)
{
return cast(WORD)(((cast(DWORD)lcid) >> 20) & 0xf);
}
enum LOCALE_NAME_MAX_LENGTH = 85;
enum {
LANG_SYSTEM_DEFAULT = MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT),
LANG_USER_DEFAULT = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
}
enum {
LOCALE_SYSTEM_DEFAULT = MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT),
LOCALE_USER_DEFAULT = MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT),
LOCALE_CUSTOM_DEFAULT = MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT),
LOCALE_CUSTOM_UNSPECIFIED = MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT),
LOCALE_CUSTOM_UI_DEFAULT = MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT),
LOCALE_NEUTRAL = MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT),
LOCALE_INVARIANT = MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT),
}
enum {
//STATUS_WAIT_0 = 0x00000000, at ntstatus.
//STATUS_ABANDONED_WAIT_0 = 0x00000080,
//STATUS_USER_APC = 0x000000C0,
STATUS_TIMEOUT = 0x00000102,
//STATUS_PENDING = 0x00000103,
DBG_EXCEPTION_HANDLED = 0x00010001,
DBG_CONTINUE = 0x00010002,
STATUS_SEGMENT_NOTIFICATION = 0x40000005,
DBG_TERMINATE_THREAD = 0x40010003,
DBG_TERMINATE_PROCESS = 0x40010004,
DBG_CONTROL_C = 0x40010005,
DBG_PRINTEXCEPTION_C = 0x40010006,
DBG_RIPEXCEPTION = 0x40010007,
DBG_CONTROL_BREAK = 0x40010008,
DBG_COMMAND_EXCEPTION = 0x40010009,
//STATUS_GUARD_PAGE_VIOLATION = 0x80000001,
//STATUS_DATATYPE_MISALIGNMENT = 0x80000002,
//STATUS_BREAKPOINT = 0x80000003,
//STATUS_SINGLE_STEP = 0x80000004,
STATUS_LONGJUMP = 0x80000026,
STATUS_UNWIND_CONSOLIDATE = 0x80000029,
DBG_EXCEPTION_NOT_HANDLED = 0x80010001,
//STATUS_ACCESS_VIOLATION = 0xC0000005,
//STATUS_IN_PAGE_ERROR = 0xC0000006,
//STATUS_INVALID_HANDLE = 0xC0000008,
STATUS_INVALID_PARAMETER = 0xC000000D,
STATUS_NO_MEMORY = 0xC0000017,
//STATUS_ILLEGAL_INSTRUCTION = 0xC000001D,
//STATUS_NONCONTINUABLE_EXCEPTION = 0xC0000025,
//STATUS_INVALID_DISPOSITION = 0xC0000026,
//STATUS_ARRAY_BOUNDS_EXCEEDED = 0xC000008C,
//STATUS_FLOAT_DENORMAL_OPERAND = 0xC000008D,
//STATUS_FLOAT_DIVIDE_BY_ZERO = 0xC000008E,
//STATUS_FLOAT_INEXACT_RESULT = 0xC000008F,
//STATUS_FLOAT_INVALID_OPERATION = 0xC0000090,
//STATUS_FLOAT_OVERFLOW = 0xC0000091,
//STATUS_FLOAT_STACK_CHECK = 0xC0000092,
//STATUS_FLOAT_UNDERFLOW = 0xC0000093,
//STATUS_INTEGER_DIVIDE_BY_ZERO = 0xC0000094,
//STATUS_INTEGER_OVERFLOW = 0xC0000095,
//STATUS_PRIVILEGED_INSTRUCTION = 0xC0000096,
//STATUS_STACK_OVERFLOW = 0xC00000FD,
STATUS_DLL_NOT_FOUND = 0xC0000135,
STATUS_ORDINAL_NOT_FOUND = 0xC0000138,
STATUS_ENTRYPOINT_NOT_FOUND = 0xC0000139,
//STATUS_CONTROL_C_EXIT = 0xC000013A,
STATUS_DLL_INIT_FAILED = 0xC0000142,
STATUS_FLOAT_MULTIPLE_FAULTS = 0xC00002B4,
STATUS_FLOAT_MULTIPLE_TRAPS = 0xC00002B5,
STATUS_REG_NAT_CONSUMPTION = 0xC00002C9,
STATUS_STACK_BUFFER_OVERRUN = 0xC0000409,
STATUS_INVALID_CRUNTIME_PARAMETER = 0xC0000417,
STATUS_ASSERTION_FAILURE = 0xC0000420,
STATUS_SXS_EARLY_DEACTIVATION = 0xC015000F,
STATUS_SXS_INVALID_DEACTIVATION = 0xC0150010,
}
enum MAXIMUM_WAIT_OBJECTS = 64;
enum MAXIMUM_SUSPEND_COUNT = MAXCHAR;
alias ULONG_PTR KSPIN_LOCK;
alias KSPIN_LOCK* PKSPIN_LOCK;
align(16)
struct M128A {
ULONGLONG Low;
LONGLONG High;
}
alias M128A* PM128A;
align(16)
struct XSAVE_FORMAT {
WORD ControlWord;
WORD StatusWord;
BYTE TagWord;
BYTE Reserved1;
WORD ErrorOpcode;
DWORD ErrorOffset;
WORD ErrorSelector;
WORD Reserved2;
DWORD DataOffset;
WORD DataSelector;
WORD Reserved3;
DWORD MxCsr;
DWORD MxCsr_Mask;
M128A[8] FloatRegisters;
version(Win64){
M128A[16] XmmRegisters;
BYTE[96] Reserved4;
}else{
M128A[8] XmmRegisters;
BYTE[192] Reserved4;
DWORD[7] StackControl;
DWORD Cr0NpxState;
}
}
alias XSAVE_FORMAT* PXSAVE_FORMAT;
align(8)
struct XSAVE_AREA_HEADER {
DWORD64 Mask;
DWORD64[7] Reserved;
}
alias XSAVE_AREA_HEADER* PXSAVE_AREA_HEADER;
align(16)
struct XSAVE_AREA {
XSAVE_FORMAT LegacyState;
XSAVE_AREA_HEADER Header;
}
alias XSAVE_AREA* PXSAVE_AREA;
struct XSTATE_CONTEXT {
DWORD64 Mask;
DWORD Length;
DWORD Reserved1;
PXSAVE_AREA Area;
version(X86)
DWORD Reserved2;
PVOID Buffer;
version(X86)
DWORD Reserved3;
}
alias XSTATE_CONTEXT* PXSTATE_CONTEXT;
enum XSAVE_ALIGN = 64;
enum MINIMAL_XSTATE_AREA_LENGTH = XSAVE_AREA.sizeof;
struct CONTEXT_CHUNK {
LONG Offset;
DWORD Length;
}
alias CONTEXT_CHUNK* PCONTEXT_CHUNK;
struct CONTEXT_EX {
CONTEXT_CHUNK All;
CONTEXT_CHUNK Legacy;
CONTEXT_CHUNK XState;
}
alias CONTEXT_EX* PCONTEXT_EX;
enum CONTEXT_EX_LENGTH = CONTEXT_EX.sizeof;
static assert((XSAVE_FORMAT.sizeof & (XSAVE_ALIGN - 1)) == 0);
static assert((XSAVE_AREA.Header.offsetof & (XSAVE_ALIGN - 1)) == 0);
static assert(MINIMAL_XSTATE_AREA_LENGTH == 512 + 64);
version(all){ //_AMD64_
version(X86_64){
extern(C){
alias _bittest BitTest;
alias _bittestandcomplement BitTestAndComplement;
alias _bittestandset BitTestAndSet;
alias _bittestandreset BitTestAndReset;
alias _interlockedbittestandset InterlockedBitTestAndSet;
alias _interlockedbittestandreset InterlockedBitTestAndReset;
alias _bittest64 BitTest64;
alias _bittestandcomplement64 BitTestAndComplement64;
alias _bittestandset64 BitTestAndSet64;
alias _bittestandreset64 BitTestAndReset64;
alias _interlockedbittestandset64 InterlockedBitTestAndSet64;
alias _interlockedbittestandreset64 InterlockedBitTestAndReset64;
BOOLEAN _bittest(LONG* Base, LONG Offset);
BOOLEAN _bittestandcomplement(LONG* Base, LONG Offset);
BOOLEAN _bittestandset(LONG* Base, LONG Offset);
BOOLEAN _bittestandreset(LONG* Base, LONG Offset);
BOOLEAN _interlockedbittestandset(LONG* Base, LONG Offset);
BOOLEAN _interlockedbittestandreset(LONG* Base, LONG Offset);
BOOLEAN _bittest64(LONG64* Base, LONG64 Offset);
BOOLEAN _bittestandcomplement64(LONG64* Base, LONG64 Offset);
BOOLEAN _bittestandset64(LONG64* Base, LONG64 Offset);
BOOLEAN _bittestandreset64(LONG64* Base, LONG64 Offset);
BOOLEAN _interlockedbittestandset64(LONG64* Base, LONG64 Offset);
BOOLEAN _interlockedbittestandreset64(LONG64* Base, LONG64 Offset);
alias _BitScanForward BitScanForward;
alias _BitScanReverse BitScanReverse;
alias _BitScanForward64 BitScanForward64;
alias _BitScanReverse64 BitScanReverse64;
BOOLEAN _BitScanForward(DWORD* Index, DWORD Mask);
BOOLEAN _BitScanReverse(DWORD* Index, DWORD Mask);
BOOLEAN _BitScanForward64(DWORD* Index, DWORD64 Mask);
BOOLEAN _BitScanReverse64(DWORD* Index, DWORD64 Mask);
//alias _InterlockedIncrement16 InterlockedIncrement16;
//alias _InterlockedDecrement16 InterlockedDecrement16;
//alias _InterlockedCompareExchange16 InterlockedCompareExchange16;
//alias _InterlockedAnd InterlockedAnd;
//alias _InterlockedAnd InterlockedAndAcquire;
//alias _InterlockedAnd InterlockedAndRelease;
//alias _InterlockedOr InterlockedOr;
//alias _InterlockedOr InterlockedOrAcquire;
//alias _InterlockedOr InterlockedOrRelease;
//alias _InterlockedXor InterlockedXor; intrinsic
//alias _InterlockedIncrement InterlockedIncrement;
//alias InterlockedIncrementAcquire InterlockedIncrementAcquire;
//alias InterlockedIncrement InterlockedIncrementRelease;
//alias _InterlockedDecrement InterlockedDecrement;
//alias InterlockedDecrement InterlockedDecrementAcquire;
//alias InterlockedDecrement InterlockedDecrementRelease;
//alias _InterlockedAdd InterlockedAdd;
//alias _InterlockedExchange InterlockedExchange;
//alias _InterlockedExchangeAdd InterlockedExchangeAdd;
//alias _InterlockedCompareExchange InterlockedCompareExchange;
//alias InterlockedCompareExchange InterlockedCompareExchangeAcquire;
//alias InterlockedCompareExchange InterlockedCompareExchangeRelease;
//alias _InterlockedAnd64 InterlockedAnd64
//alias _InterlockedAnd64 InterlockedAnd64Acquire;
//alias _InterlockedAnd64 InterlockedAnd64Release;
//alias InterlockedAnd64 InterlockedAndAffinity;
//alias _InterlockedOr64 InterlockedOr64;
//alias _InterlockedOr64 InterlockedOr64Acquire;
//alias _InterlockedOr64 InterlockedOr64Release;
//alias InterlockedOr64 InterlockedOrAffinity;
//alias _InterlockedXor64 InterlockedXor64; intrinsic
//alias _InterlockedIncrement64 InterlockedIncrement64;
//alias _InterlockedDecrement64 InterlockedDecrement64;
//alias _InterlockedAdd64 InterlockedAdd64;
//alias _InterlockedExchange64 InterlockedExchange64;
//alias InterlockedExchange64 InterlockedExchangeAcquire64;
//alias _InterlockedExchangeAdd64 InterlockedExchangeAdd64;
//alias _InterlockedCompareExchange64 InterlockedCompareExchange64;
//alias InterlockedCompareExchange64 InterlockedCompareExchangeAcquire64;
//alias InterlockedCompareExchange64 InterlockedCompareExchangeRelease64;
//alias _InterlockedExchangePointer InterlockedExchangePointer;
//alias _InterlockedCompareExchangePointer InterlockedCompareExchangePointer;
//alias _InterlockedCompareExchangePointer InterlockedCompareExchangePointerAcquire;
//alias _InterlockedCompareExchangePointer InterlockedCompareExchangePointerRelease;
alias InterlockedExchangeAdd64 InterlockedExchangeAddSizeT;
alias InterlockedIncrement64 InterlockedIncrementSizeT;
alias InterlockedDecrement64 InterlockedDecrementSizeT;
SHORT InterlockedIncrement16(SHORT* Addend);
SHORT InterlockedDecrement16(SHORT* Addend);
SHORT InterlockedCompareExchange16(SHORT* Destination, SHORT ExChange, SHORT Comperand);
LONG InterlockedAnd(LONG* Destination, LONG Value);
LONG InterlockedOr(LONG* Destination, LONG Value);
LONG InterlockedXor(LONG* Destination, LONG Value);
LONG64 InterlockedAnd64(LONG64* Destination, LONG64 Value);
LONG64 InterlockedOr64(LONG64* Destination, LONG64 Value);
LONG64 InterlockedXor64(LONG64* Destination, LONG64 Value);
LONG InterlockedIncrement(LONG* Addend);
LONG InterlockedDecrement(LONG* Addend);
LONG InterlockedExchange(LONG* Target, LONG Value);
LONG InterlockedExchangeAdd(LONG* Addend, LONG Value);
// Not AMD64
LONG InterlockedAdd(LONG* Addend, LONG Value)
{
return InterlockedExchangeAdd(Addend, Value) + Value;
}
LONG InterlockedCompareExchange(LONG* Destination, LONG ExChange, LONG Comperand);
LONG64 InterlockedIncrement64(LONG64* Addend);
LONG64 InterlockedDecrement64(LONG64* Addend);
LONG64 InterlockedExchange64(LONG64* Target, LONG64 Value);
LONG64 InterlockedExchangeAdd64(LONG64* Addend, LONG64 Value);
// Not AMD64
LONG64 InterlockedAdd64(LONG64* Addend, LONG64 Value)
{
return InterlockedExchangeAdd64(Addend, Value) + Value;
}
LONG64 InterlockedCompareExchange64(LONG64* Destination, LONG64 ExChange, LONG64 Comperand);
PVOID InterlockedCompareExchangePointer(PVOID* Destination, PVOID Exchange, PVOID Comperand);
PVOID InterlockedExchangePointer(PVOID*Target, PVOID Value);
//alias _InterlockedAnd8 InterlockedAnd8;
//alias _InterlockedOr8 InterlockedOr8;
//alias _InterlockedXor8 InterlockedXor8;
//alias _InterlockedAnd16 InterlockedAnd16;
//alias _InterlockedOr16 InterlockedOr16;
//alias _InterlockedXor16 InterlockedXor16;
byte InterlockedAnd8(byte* Destination, byte Value);
byte InterlockedOr8(byte* Destination, byte Value);
byte InterlockedXor8 (byte* Destination, byte Value);
SHORT InterlockedAnd16(SHORT* Destination, SHORT Value);
SHORT InterlockedOr16(SHORT* Destination, SHORT Value);
SHORT InterlockedXor16(SHORT* Destination, SHORT Value);
alias _mm_clflush CacheLineFlush;
VOID _mm_clflush(VOID* Address);
VOID _ReadWriteBarrier();
alias __faststorefence FastFence;
alias _mm_lfence LoadFence;
alias _mm_mfence MemoryFence;
alias _mm_sfence StoreFence;
VOID __faststorefence();
VOID _mm_lfence();
VOID _mm_mfence();
VOID _mm_sfence();
VOID _mm_pause();
VOID _mm_prefetch(byte* a, int sel);
VOID _m_prefetchw(VOID* Source);
enum {
_MM_HINT_T0 = 1,
_MM_HINT_T1 = 2,
_MM_HINT_T2 = 3,
_MM_HINT_NTA = 0,
}
alias _mm_pause YieldProcessor;
alias __faststorefence MemoryBarrier;
void PreFetchCacheLine(int l, byte* a)
{
_mm_prefetch(a, l);
}
alias _m_prefetchw PrefetchForWrite;
void* ReadForWriteAccess(void** p)
{
_m_prefetchw(p);
return *p;
}
enum {
PF_TEMPORAL_LEVEL_1 = _MM_HINT_T0,
PF_TEMPORAL_LEVEL_2 = _MM_HINT_T1,
PF_TEMPORAL_LEVEL_3 = _MM_HINT_T2,
PF_NON_TEMPORAL_LEVEL_ALL = _MM_HINT_NTA,
}
alias _mm_getcsr ReadMxCsr;
alias _mm_setcsr WriteMxCsr;
uint _mm_getcsr();
VOID _mm_setcsr(uint MxCsr);
VOID __int2c();
alias __int2c DbgRaiseAssertionFailure;
alias __getcallerseflags GetCallersEflags;
uint __getcallerseflags();
alias __segmentlimit GetSegmentLimit;
DWORD __segmentlimit(DWORD Selector);
alias __readpmc ReadPMC;
DWORD64 __readpmc(DWORD Counter);
alias __rdtsc ReadTimeStampCounter;
DWORD64 __rdtsc();
VOID __movsb(PBYTE Destination, BYTE* Source, SIZE_T Count);
VOID __movsw(PWORD Destination, WORD* Source, SIZE_T Count);
VOID __movsd(PDWORD Destination, DWORD* Source, SIZE_T Count);
VOID __movsq(PDWORD64 Destination, DWORD64* Source, SIZE_T Count);
VOID __stosb(PBYTE Destination, BYTE Value, SIZE_T Count);
VOID __stosw(PWORD Destination, WORD Value, SIZE_T Count);
VOID __stosd(PDWORD Destination, DWORD Value, SIZE_T Count);
VOID __stosq(PDWORD64 Destination, DWORD64 Value, SIZE_T Count);
//alias __mulh MultiplyHigh;
//alias __umulh UnsignedMultiplyHigh;
LONGLONG MultiplyHigh(LONG64 Multiplier, LONG64 Multiplicand);
ULONGLONG UnsignedMultiplyHigh(DWORD64 Multiplier, DWORD64 Multiplicand);
//alias __shiftleft128 ShiftLeft128;
//alias __shiftright128 ShiftRight128;
DWORD64 ShiftLeft128(DWORD64 LowPart, DWORD64 HighPart, BYTE Shift);
DWORD64 ShiftRight128(DWORD64 LowPart, DWORD64 HighPart, BYTE Shift);
//alias _mul128 Multiply128;
LONG64 Multiply128(LONG64 Multiplier, LONG64 Multiplicand, LONG64* HighProduct);
//alias _umul128 UnsignedMultiply128;
DWORD64 UnsignedMultiply128(DWORD64 Multiplier, DWORD64 Multiplicand, DWORD64* HighProduct);
LONG64 MultiplyExtract128(LONG64 Multiplier, LONG64 Multiplicand, BYTE Shift)
{
LONG64 extractedProduct;
LONG64 highProduct;
LONG64 lowProduct;
BOOLEAN negate;
DWORD64 uhighProduct;
DWORD64 ulowProduct;
lowProduct = Multiply128(Multiplier, Multiplicand, &highProduct);
negate = FALSE;
uhighProduct = cast(DWORD64)highProduct;
ulowProduct = cast(DWORD64)lowProduct;
if(highProduct < 0){
negate = TRUE;
uhighProduct = cast(DWORD64)(-highProduct);
ulowProduct = cast(DWORD64)(-lowProduct);
if(ulowProduct != 0){
uhighProduct -= 1;
}
}
extractedProduct = cast(LONG64)ShiftRight128(ulowProduct, uhighProduct, Shift);
if(negate != FALSE){
extractedProduct = -extractedProduct;
}
return extractedProduct;
}
DWORD64 UnsignedMultiplyExtract128(DWORD64 Multiplier, DWORD64 Multiplicand, BYTE Shift)
{
DWORD64 extractedProduct;
DWORD64 highProduct;
DWORD64 lowProduct;
lowProduct = UnsignedMultiply128(Multiplier, Multiplicand, &highProduct);
extractedProduct = ShiftRight128(lowProduct, highProduct, Shift);
return extractedProduct;
}
BYTE __readgsbyte(DWORD Offset);
WORD __readgsword(DWORD Offset);
DWORD __readgsdword(DWORD Offset);
DWORD64 __readgsqword(DWORD Offset);
VOID __writegsbyte(DWORD Offset, BYTE Data);
VOID __writegsword(DWORD Offset, WORD Data);
VOID __writegsdword(DWORD Offset, DWORD Data);
VOID __writegsqword(DWORD Offset, DWORD64 Data);
VOID __incgsbyte(DWORD Offset);
VOID __addgsbyte(DWORD Offset, BYTE Value);
VOID __incgsword(DWORD Offset);
VOID __addgsword(DWORD Offset, WORD Value);
VOID __incgsdword(DWORD Offset);
VOID __addgsdword(DWORD Offset, DWORD Value);
VOID __incgsqword(DWORD Offset);
VOID __addgsqword(DWORD Offset, DWORD64 Value);
} // extern(C)
} // version(X86_64)
enum {
EXCEPTION_READ_FAULT = 0,
EXCEPTION_WRITE_FAULT = 1,
EXCEPTION_EXECUTE_FAULT = 8,
}
enum {
CONTEXT_AMD64 = 0x100000,
CONTEXT_CONTROL = CONTEXT_AMD64 | 0x1,
CONTEXT_INTEGER = CONTEXT_AMD64 | 0x2,
CONTEXT_SEGMENTS = CONTEXT_AMD64 | 0x4,
CONTEXT_FLOATING_POINT = CONTEXT_AMD64 | 0x8,
CONTEXT_DEBUG_REGISTERS = CONTEXT_AMD64 | 0x10,
CONTEXT_FULL = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT,
CONTEXT_ALL = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS,
CONTEXT_XSTATE = CONTEXT_AMD64 | 0x20,
CONTEXT_EXCEPTION_ACTIVE = 0x8000000,
CONTEXT_SERVICE_ACTIVE = 0x10000000,
CONTEXT_EXCEPTION_REQUEST = 0x40000000,
CONTEXT_EXCEPTION_REPORTING = 0x80000000,
}
enum {
INITIAL_MXCSR = 0x1f80,
INITIAL_FPCSR = 0x027f,
}
alias XSAVE_FORMAT XMM_SAVE_AREA32;
alias XSAVE_FORMAT* PXMM_SAVE_AREA32;
align(16)
struct CONTEXT {
DWORD64 P1Home;
DWORD64 P2Home;
DWORD64 P3Home;
DWORD64 P4Home;
DWORD64 P5Home;
DWORD64 P6Home;
DWORD ContextFlags;
DWORD MxCsr;
WORD SegCs;
WORD SegDs;
WORD SegEs;
WORD SegFs;
WORD SegGs;
WORD SegSs;
DWORD EFlags;
DWORD64 Dr0;
DWORD64 Dr1;
DWORD64 Dr2;
DWORD64 Dr3;
DWORD64 Dr6;
DWORD64 Dr7;
DWORD64 Rax;
DWORD64 Rcx;
DWORD64 Rdx;
DWORD64 Rbx;
DWORD64 Rsp;
DWORD64 Rbp;
DWORD64 Rsi;
DWORD64 Rdi;
DWORD64 R8;
DWORD64 R9;
DWORD64 R10;
DWORD64 R11;
DWORD64 R12;
DWORD64 R13;
DWORD64 R14;
DWORD64 R15;
DWORD64 Rip;
union {
XMM_SAVE_AREA32 FltSave;
struct {
M128A[2] Header;
M128A[8] Legacy;
M128A Xmm0;
M128A Xmm1;
M128A Xmm2;
M128A Xmm3;
M128A Xmm4;
M128A Xmm5;
M128A Xmm6;
M128A Xmm7;
M128A Xmm8;
M128A Xmm9;
M128A Xmm10;
M128A Xmm11;
M128A Xmm12;
M128A Xmm13;
M128A Xmm14;
M128A Xmm15;
}
}
M128A[26] VectorRegister;
DWORD64 VectorControl;
DWORD64 DebugControl;
DWORD64 LastBranchToRip;
DWORD64 LastBranchFromRip;
DWORD64 LastExceptionToRip;
DWORD64 LastExceptionFromRip;
}
alias CONTEXT* PCONTEXT;
enum RUNTIME_FUNCTION_INDIRECT = 0x1;
struct RUNTIME_FUNCTION {
DWORD BeginAddress;
DWORD EndAddress;
DWORD UnwindData;
}
alias RUNTIME_FUNCTION* PRUNTIME_FUNCTION;
enum UNWIND_HISTORY_TABLE_SIZE = 12;
struct UNWIND_HISTORY_TABLE_ENTRY {
DWORD64 ImageBase;
PRUNTIME_FUNCTION FunctionEntry;
}
alias UNWIND_HISTORY_TABLE_ENTRY* PUNWIND_HISTORY_TABLE_ENTRY;
struct UNWIND_HISTORY_TABLE {
DWORD Count;
BYTE LocalHint;
BYTE GlobalHint;
BYTE Search;
BYTE Once;
DWORD64 LowAddress;
DWORD64 HighAddress;
UNWIND_HISTORY_TABLE_ENTRY[UNWIND_HISTORY_TABLE_SIZE] Entry;
}
alias UNWIND_HISTORY_TABLE PUNWIND_HISTORY_TABLE;
alias extern(Windows) PRUNTIME_FUNCTION function(DWORD64 ControlPc, PVOID Context) GET_RUNTIME_FUNCTION_CALLBACK;
alias GET_RUNTIME_FUNCTION_CALLBACK* PGET_RUNTIME_FUNCTION_CALLBACK;
alias DWORD function(HANDLE Process, PVOID TableAddress, PDWORD Entries, PRUNTIME_FUNCTION* Functions) OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK;
alias OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK;
immutable char[] OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME = "OutOfProcessFunctionTableCallback\0";
export extern(C)
VOID RtlRestoreContext(PCONTEXT ContextRecord, EXCEPTION_RECORD* ExceptionRecord);
export extern(C)
BOOLEAN RtlAddFunctionTable(PRUNTIME_FUNCTION FunctionTable, DWORD EntryCount, DWORD64 BaseAddress);
export extern(Windows)
PRUNTIME_FUNCTION RtlLookupFunctionEntry(DWORD64 ControlPc, PDWORD64 ImageBase, PUNWIND_HISTORY_TABLE HistoryTable);
struct KNONVOLATILE_CONTEXT_POINTERS {
union {
PM128A[16] FloatingContext;
struct {
PM128A Xmm0;
PM128A Xmm1;
PM128A Xmm2;
PM128A Xmm3;
PM128A Xmm4;
PM128A Xmm5;
PM128A Xmm6;
PM128A Xmm7;
PM128A Xmm8;
PM128A Xmm9;
PM128A Xmm10;
PM128A Xmm11;
PM128A Xmm12;
PM128A Xmm13;
PM128A Xmm14;
PM128A Xmm15;
}
}
union {
PDWORD64[16] IntegerContext;
struct {
PDWORD64 Rax;
PDWORD64 Rcx;
PDWORD64 Rdx;
PDWORD64 Rbx;
PDWORD64 Rsp;
PDWORD64 Rbp;
PDWORD64 Rsi;
PDWORD64 Rdi;
PDWORD64 R8;
PDWORD64 R9;
PDWORD64 R10;
PDWORD64 R11;
PDWORD64 R12;
PDWORD64 R13;
PDWORD64 R14;
PDWORD64 R15;
}
}
}
alias KNONVOLATILE_CONTEXT_POINTERS* PKNONVOLATILE_CONTEXT_POINTERS;
export extern(Windows)
PEXCEPTION_ROUTINE RtlVirtualUnwind(DWORD HandlerType, DWORD64 ImageBase, DWORD64 ControlPc, PRUNTIME_FUNCTION FunctionEntry, PCONTEXT ContextRecord, PVOID* HandlerData, PDWORD64 EstablisherFrame, PKNONVOLATILE_CONTEXT_POINTERS ContextPointers);
export extern(C)
BOOLEAN RtlInstallFunctionTableCallback(DWORD64 TableIdentifier, DWORD64 BaseAddress, DWORD Length, PGET_RUNTIME_FUNCTION_CALLBACK Callback, PVOID Context, PCWSTR OutOfProcessCallbackDll);
export extern(C)
BOOLEAN RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable);
} // version() _AMD64_
version(X86){
extern(C){
alias _bittest BitTest;
alias _bittestandcomplement BitTestAndComplement;
alias _bittestandset BitTestAndSet;
alias _bittestandreset BitTestAndReset;
alias _interlockedbittestandset InterlockedBitTestAndSet;
alias _interlockedbittestandreset InterlockedBitTestAndReset;
BOOLEAN _bittest(LONG* Base, LONG Offset);
BOOLEAN _bittestandcomplement(LONG* Base, LONG Offset);
BOOLEAN _bittestandset(LONG* Base, LONG Offset);
BOOLEAN _bittestandreset(LONG* Base, LONG Offset);
BOOLEAN _interlockedbittestandset(LONG* Base, LONG Offset);
BOOLEAN _interlockedbittestandreset(LONG* Base, LONG Offset);
alias _BitScanForward BitScanForward;
alias _BitScanReverse BitScanReverse;
BOOLEAN _BitScanForward(DWORD* Index, DWORD Mask);
BOOLEAN _BitScanReverse(DWORD* Index, DWORD Mask);
alias _InterlockedAnd16 InterlockedAnd16;
alias _InterlockedCompareExchange16 InterlockedCompareExchange16;
alias _InterlockedOr16 InterlockedOr16;
SHORT _InterlockedAnd16(SHORT* Destination, SHORT Value);
SHORT _InterlockedCompareExchange16(SHORT* Destination, SHORT ExChange, SHORT Comperand);
SHORT _InterlockedOr16(SHORT* Destination, SHORT Value);
BOOLEAN InterlockedBitTestAndComplement(LONG* Base, LONG Bit)
{
asm{
mov EAX, Bit;
mov ECX, Base;
lock;
btc [ECX], EAX;
setc AL;
}
}
BYTE __readfsbyte(DWORD Offset);
WORD __readfsword(DWORD Offset);
DWORD __readfsdword(DWORD Offset);
VOID __writefsbyte(DWORD Offset, BYTE Data);
VOID __writefsword(DWORD Offset, WORD Data);
VOID __writefsdword(DWORD Offset, DWORD Data);
VOID __incfsbyte(DWORD Offset);
VOID __addfsbyte(DWORD Offset, BYTE Value);
VOID __incfsword(DWORD Offset);
VOID __addfsword(DWORD Offset, WORD Value);
VOID __incfsdword(DWORD Offset);
VOID __addfsdword(DWORD Offset, DWORD Value);
VOID _mm_pause();
alias _mm_pause YieldProcessor;
} // extern(C)
VOID MemoryBarrier()
{
LONG Barrier;
asm {
xchg Barrier, EAX;
}
}
alias __readpmc ReadPMC;
DWORD64 __readpmc(DWORD Counter);
alias __rdtsc ReadTimeStampCounter;
DWORD64 __rdtsc();
VOID __int2c ();
alias __int2c DbgRaiseAssertionFailure;
PVOID GetFiberData()
{
return *cast(PVOID*)cast(ULONG_PTR) __readfsdword(0x10);
}
PVOID GetCurrentFiber()
{
return cast(PVOID)cast(ULONG_PTR)__readfsdword (0x10);
}
enum {
EXCEPTION_READ_FAULT = 0,
EXCEPTION_WRITE_FAULT = 1,
EXCEPTION_EXECUTE_FAULT = 8,
}
enum SIZE_OF_80387_REGISTERS = 80;
enum {
CONTEXT_i386 = 0x00010000,
CONTEXT_i486 = 0x00010000,
CONTEXT_CONTROL = CONTEXT_i386 | 0x00000001,
CONTEXT_INTEGER = CONTEXT_i386 | 0x00000002,
CONTEXT_SEGMENTS = CONTEXT_i386 | 0x00000004,
CONTEXT_FLOATING_POINT = CONTEXT_i386 | 0x00000008,
CONTEXT_DEBUG_REGISTERS = CONTEXT_i386 | 0x00000010,
CONTEXT_EXTENDED_REGISTERS = CONTEXT_i386 | 0x00000020,
CONTEXT_FULL = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS,
CONTEXT_ALL = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | CONTEXT_EXTENDED_REGISTERS,
CONTEXT_XSTATE = CONTEXT_i386 | 0x00000040,
}
struct FLOATING_SAVE_AREA {
DWORD ControlWord;
DWORD StatusWord;
DWORD TagWord;
DWORD ErrorOffset;
DWORD ErrorSelector;
DWORD DataOffset;
DWORD DataSelector;
BYTE[SIZE_OF_80387_REGISTERS] RegisterArea;
DWORD Cr0NpxState;
}
alias FLOATING_SAVE_AREA* PFLOATING_SAVE_AREA;
enum MAXIMUM_SUPPORTED_EXTENSION = 512;
static assert(XSAVE_FORMAT.sizeof == MAXIMUM_SUPPORTED_EXTENSION);
align(4)
struct CONTEXT {
DWORD ContextFlags;
DWORD Dr0;
DWORD Dr1;
DWORD Dr2;
DWORD Dr3;
DWORD Dr6;
DWORD Dr7;
FLOATING_SAVE_AREA FloatSave;
DWORD SegGs;
DWORD SegFs;
DWORD SegEs;
DWORD SegDs;
DWORD Edi;
DWORD Esi;
DWORD Ebx;
DWORD Edx;
DWORD Ecx;
DWORD Eax;
DWORD Ebp;
DWORD Eip;
DWORD SegCs;
DWORD EFlags;
DWORD Esp;
DWORD SegSs;
BYTE[MAXIMUM_SUPPORTED_EXTENSION] ExtendedRegisters;
}
alias CONTEXT* PCONTEXT;
} // version(X86)
struct LDT_ENTRY {
WORD LimitLow;
WORD BaseLow;
union {
struct {
BYTE BaseMid;
BYTE Flags1; // Declare as bytes to avoid alignment
BYTE Flags2; // Problems.
BYTE BaseHi;
}
uint Bits; // not supported bit field.
}
}
alias LDT_ENTRY* PLDT_ENTRY;
version(none){ // Intel64
extern(C){
alias _bittest BitTest;
alias _bittestandcomplement BitTestAndComplement;
alias _bittestandset BitTestAndSet;
alias _bittestandreset BitTestAndReset;
alias _bittest64 BitTest64;
alias _bittestandcomplement64 BitTestAndComplement64;
alias _bittestandset64 BitTestAndSet64;
alias _bittestandreset64 BitTestAndReset64;
BOOLEAN _bittest(LONG* Base, LONG Offset);
BOOLEAN _bittestandcomplement(LONG* Base, LONG Offset);
BOOLEAN _bittestandset(LONG* Base, LONG Offset);
BOOLEAN _bittestandreset(LONG* Base, LONG Offset);
BOOLEAN _bittest64(LONG64* Base, LONG64 Offset);
BOOLEAN _bittestandcomplement64(LONG64* Base, LONG64 Offset);
BOOLEAN _bittestandset64(LONG64* Base, LONG64 Offset);
BOOLEAN _bittestandreset64(LONG64* Base, LONG64 Offset);
alias BitScanForward _BitScanForward;
alias BitScanReverse _BitScanReverse;
alias BitScanForward64 _BitScanForward64;
alias BitScanReverse64 _BitScanReverse64;
BOOLEAN _BitScanForward(DWORD* Index, DWORD Mask);
BOOLEAN _BitScanReverse(DWORD* Index, DWORD Mask);
BOOLEAN _BitScanForward64(DWORD* Index, DWORD64 Mask);
BOOLEAN _BitScanReverse64(DWORD* Index, DWORD64 Mask);
alias _InterlockedCompareExchange16 InterlockedCompareExchange16;
SHORT _InterlockedCompareExchange16(SHORT* Destination, SHORT ExChange, SHORT Comperand);
} // extern(C)
alias _InterlockedAdd InterlockedAdd;
alias _InterlockedAdd_acq InterlockedAddAcquire;
alias _InterlockedAdd_rel InterlockedAddRelease;
alias _InterlockedIncrement InterlockedIncrement;
alias _InterlockedIncrement_acq InterlockedIncrementAcquire;
alias _InterlockedIncrement_rel InterlockedIncrementRelease;
alias _InterlockedDecrement InterlockedDecrement;
alias _InterlockedDecrement_acq InterlockedDecrementAcquire;
alias _InterlockedDecrement_rel InterlockedDecrementRelease;
alias _InterlockedExchange InterlockedExchange;
alias _InterlockedExchange_acq InterlockedExchangeAcquire;
alias _InterlockedExchangeAdd InterlockedExchangeAdd;
alias _InterlockedExchangeAdd_acq InterlockedExchangeAddAcquire;
alias _InterlockedExchangeAdd_rel InterlockedExchangeAddRelease;
alias _InterlockedAdd64 InterlockedAdd64;
alias _InterlockedAdd64_acq InterlockedAddAcquire64;
alias _InterlockedAdd64_rel InterlockedAddRelease64;
alias _InterlockedIncrement64 InterlockedIncrement64;
alias _InterlockedIncrement64_acq InterlockedIncrementAcquire64;
alias _InterlockedIncrement64_rel InterlockedIncrementRelease64;
alias _InterlockedDecrement64 InterlockedDecrement64;
alias _InterlockedDecrement64_acq InterlockedDecrementAcquire64;
alias _InterlockedDecrement64_rel InterlockedDecrementRelease64;
alias _InterlockedExchange64 InterlockedExchange64;
alias _InterlockedExchange64_acq InterlockedExchangeAcquire64;
alias _InterlockedExchangeAdd64 InterlockedExchangeAdd64;
alias _InterlockedExchangeAdd64_acq InterlockedExchangeAddAcquire64;
alias _InterlockedExchangeAdd64_rel InterlockedExchangeAddRelease64;
alias _InterlockedCompareExchange64 InterlockedCompareExchange64;
alias _InterlockedCompareExchange64_acq InterlockedCompareExchangeAcquire64;
alias _InterlockedCompareExchange64_rel InterlockedCompareExchangeRelease64;
alias _InterlockedCompare64Exchange128 InterlockedCompare64Exchange128;
alias _InterlockedCompare64Exchange128_acq InterlockedCompare64ExchangeAcquire128;
alias _InterlockedCompare64Exchange128_rel InterlockedCompare64ExchangeRelease128;
alias _InterlockedCompareExchange InterlockedCompareExchange;
alias _InterlockedCompareExchange_acq InterlockedCompareExchangeAcquire;
alias _InterlockedCompareExchange_rel InterlockedCompareExchangeRelease;
alias _InterlockedExchangePointer InterlockedExchangePointer;
alias _InterlockedExchangePointer_acq InterlockedExchangePointerAcquire;
alias _InterlockedCompareExchangePointer InterlockedCompareExchangePointer;
alias _InterlockedCompareExchangePointer_rel InterlockedCompareExchangePointerRelease;
alias _InterlockedCompareExchangePointer_acq InterlockedCompareExchangePointerAcquire;
alias InterlockedExchangeAdd64 InterlockedExchangeAddSizeT;
alias InterlockedIncrement64 InterlockedIncrementSizeT;
alias InterlockedDecrement64 InterlockedDecrementSizeT;
alias _InterlockedOr InterlockedOr;
alias _InterlockedOr_acq InterlockedOrAcquire;
alias _InterlockedOr_rel InterlockedOrRelease;
alias _InterlockedOr8 InterlockedOr8;
alias _InterlockedOr8_acq InterlockedOr8Acquire;
alias _InterlockedOr8_rel InterlockedOr8Release;
alias _InterlockedOr16 InterlockedOr16;
alias _InterlockedOr16_acq InterlockedOr16Acquire;
alias _InterlockedOr16_rel InterlockedOr16Release;
alias _InterlockedOr64 InterlockedOr64;
alias _InterlockedOr64_acq InterlockedOr64Acquire;
alias _InterlockedOr64_rel InterlockedOr64Release;
alias _InterlockedXor InterlockedXor;
alias _InterlockedXor_acq InterlockedXorAcquire;
alias _InterlockedXor_rel InterlockedXorRelease;
alias _InterlockedXor8 InterlockedXor8;
alias _InterlockedXor8_acq InterlockedXor8Acquire;
alias _InterlockedXor8_rel InterlockedXor8Release;
alias _InterlockedXor16 InterlockedXor16;
alias _InterlockedXor16_acq InterlockedXor16Acquire;
alias _InterlockedXor16_rel InterlockedXor16Release;
alias _InterlockedXor64 InterlockedXor64;
alias _InterlockedXor64_acq InterlockedXor64Acquire;
alias _InterlockedXor64_rel InterlockedXor64Release;
alias _InterlockedAnd InterlockedAnd;
alias _InterlockedAnd_acq InterlockedAndAcquire;
alias _InterlockedAnd_rel InterlockedAndRelease;
alias _InterlockedAnd8 InterlockedAnd8;
alias _InterlockedAnd8_acq InterlockedAnd8Acquire;
alias _InterlockedAnd8_rel InterlockedAnd8Release;
alias _InterlockedAnd16 InterlockedAnd16;
alias _InterlockedAnd16_acq InterlockedAnd16Acquire;
alias _InterlockedAnd16_rel InterlockedAnd16Release;
alias _InterlockedAnd64 InterlockedAnd64;
alias _InterlockedAnd64_acq InterlockedAnd64Acquire;
alias _InterlockedAnd64_rel InterlockedAnd64Release;
extern(C){
LONG InterlockedAdd(LONG* Addend, LONG Value);
LONG InterlockedAddAcquire(LONG* Addend, LONG Value);
LONG InterlockedAddRelease(LONG* Addend, LONG Value);
LONGLONG InterlockedAdd64(LONGLONG* Addend, LONGLONG Value);
LONGLONG InterlockedAddAcquire64(LONGLONG* Addend, LONGLONG Value);
LONGLONG InterlockedAddRelease64(LONGLONG* Addend, LONGLONG Value);
LONG InterlockedIncrement(LONG* Addend);
LONG InterlockedDecrement(LONG* Addend);
LONG InterlockedIncrementAcquire(LONG* Addend);
LONG InterlockedDecrementAcquire(LONG* Addend);
LONG InterlockedIncrementRelease(LONG* Addend);
LONG InterlockedDecrementRelease(LONG* Addend);
LONG InterlockedExchange(LONG* Target, LONG Value);
LONG InterlockedExchangeAcquire(LONG* Target, LONG Value);
LONG InterlockedExchangeAdd(LONG* Addend, LONG Value);
LONG InterlockedExchangeAddAcquire(LONG* Addend, LONG Value);
LONG InterlockedExchangeAddRelease(LONG* Addend, LONG Value);
LONG InterlockedCompareExchange(LONG* Destination, LONG ExChange, LONG Comperand);
LONG InterlockedCompareExchangeRelease(LONG* Destination, LONG ExChange, LONG Comperand);
LONG InterlockedCompareExchangeAcquire(LONG* Destination, LONG ExChange, LONG Comperand);
LONGLONG InterlockedIncrement64(LONGLONG* Addend);
LONGLONG InterlockedIncrementAcquire64(LONGLONG* Addend);
LONGLONG InterlockedIncrementRelease64(LONGLONG* Addend);
LONGLONG InterlockedDecrement64(LONGLONG* Addend);
LONGLONG InterlockedDecrementAcquire64(LONGLONG* Addend);
LONGLONG InterlockedDecrementRelease64(LONGLONG* Addend);
LONGLONG InterlockedExchange64(LONGLONG* Target, LONGLONG Value);
LONGLONG InterlockedExchangeAcquire64(LONGLONG* Target, LONGLONG Value);
LONGLONG InterlockedExchangeAdd64(LONGLONG* Addend, LONGLONG Value);
LONGLONG InterlockedExchangeAddAcquire64(LONGLONG* Addend, LONGLONG Value);
LONGLONG InterlockedExchangeAddRelease64(LONGLONG* Addend, LONGLONG Value);
LONGLONG InterlockedCompareExchange64(LONGLONG* Destination, LONGLONG ExChange, LONGLONG Comperand);
LONGLONG InterlockedCompareExchangeAcquire64(LONGLONG* Destination, LONGLONG ExChange, LONGLONG Comperand);
LONGLONG InterlockedCompareExchangeRelease64(LONGLONG* Destination, LONGLONG ExChange, LONGLONG Comperand);
LONG64 InterlockedCompare64Exchange128(LONG64* Destination, LONG64 ExchangeHigh, LONG64 ExchangeLow, LONG64 Comperand);
LONG64 InterlockedCompare64ExchangeAcquire128(LONG64* Destination, LONG64 ExchangeHigh, LONG64 ExchangeLow, LONG64 Comperand);
LONG64 InterlockedCompare64ExchangeRelease128(LONG64* Destination, LONG64 ExchangeHigh, LONG64 ExchangeLow, LONG64 Comperand);
PVOID InterlockedCompareExchangePointer(PVOID* Destination, PVOID Exchange, PVOID Comperand);
PVOID InterlockedCompareExchangePointerAcquire(PVOID* Destination, PVOID Exchange, PVOID Comperand);
PVOID InterlockedCompareExchangePointerRelease(PVOID* Destination, PVOID Exchange, PVOID Comperand);
PVOID InterlockedExchangePointer(PVOID* Target, PVOID Value);
PVOID InterlockedExchangePointerAcquire(PVOID* Target, PVOID Value);
LONG InterlockedOr(LONG* Destination, LONG Value);
LONG InterlockedOrAcquire(LONG* Destination, LONG Value);
LONG InterlockedOrRelease(LONG* Destination, LONG Value);
CHAR InterlockedOr8(CHAR* Destination, CHAR Value);
CHAR InterlockedOr8Acquire(CHAR* Destination, CHAR Value);
CHAR InterlockedOr8Release(CHAR* Destination, CHAR Value);
SHORT InterlockedOr16(SHORT* Destination, SHORT Value);
SHORT InterlockedOr16Acquire(SHORT* Destination, SHORT Value);
SHORT InterlockedOr16Release(SHORT* Destination, SHORT Value);
LONGLONG InterlockedOr64(LONGLONG* Destination, LONGLONG Value);
LONGLONG InterlockedOr64Acquire(LONGLONG* Destination, LONGLONG Value);
LONGLONG InterlockedOr64Release(LONGLONG* Destination, LONGLONG Value);
LONG InterlockedXor(LONG* Destination, LONG Value);
LONG InterlockedXorAcquire(LONG* Destination, LONG Value);
LONG InterlockedXorRelease(LONG* Destination, LONG Value);
CHAR InterlockedXor8(CHAR* Destination, CHAR Value);
CHAR InterlockedXor8Acquire(CHAR* Destination, CHAR Value);
CHAR InterlockedXor8Release(CHAR* Destination, CHAR Value);
SHORT InterlockedXor16(SHORT* Destination, SHORT Value);
SHORT InterlockedXor16Acquire(SHORT* Destination, SHORT Value);
SHORT InterlockedXor16Release(SHORT* Destination, SHORT Value);
LONGLONG InterlockedXor64(LONGLONG* Destination, LONGLONG Value);
LONGLONG InterlockedXor64Acquire(LONGLONG* Destination, LONGLONG Value);
LONGLONG InterlockedXor64Release(LONGLONG* Destination, LONGLONG Value);
LONG InterlockedAnd(LONG* Destination, LONG Value);
LONG InterlockedAndAcquire(LONG* Destination, LONG Value);
LONG InterlockedAndRelease(LONG* Destination, LONG Value);
CHAR InterlockedAnd8(CHAR* Destination, CHAR Value);
CHAR InterlockedAnd8Acquire(CHAR* Destination, CHAR Value);
CHAR InterlockedAnd8Release(CHAR* Destination, CHAR Value);
SHORT InterlockedAnd16(SHORT* Destination, SHORT Value);
SHORT InterlockedAnd16Acquire(SHORT* Destination, SHORT Value);
SHORT InterlockedAnd16Release(SHORT* Destination, SHORT Value);
LONGLONG InterlockedAnd64(LONGLONG* Destination, LONGLONG Value);
LONGLONG InterlockedAnd64Acquire(LONGLONG* Destination, LONGLONG Value);
LONGLONG InterlockedAnd64Release(LONGLONG* Destination, LONGLONG Value);
LONGLONG InterlockedAnd64_Inline(LONGLONG* Destination, LONGLONG Value)
{
LONGLONG Old;
do{
Old = *Destination;
}while(InterlockedCompareExchange64(Destination, Old & Value, Old) != Old);
return Old;
}
alias InterlockedAnd64_Inline InterlockedAnd64;
alias InterlockedAnd64 InterlockedAndAffinity;
LONGLONG InterlockedOr64_Inline(LONGLONG* Destination, LONGLONG Value)
{
LONGLONG Old;
do{
Old = *Destination;
}while(InterlockedCompareExchange64(Destination, Old | Value, Old) != Old);
return Old;
}
alias InterlockedOr64_Inline InterlockedOr64;
alias InterlockedOr64 InterlockedOrAffinity;
LONGLONG InterlockedXor64_Inline(LONGLONG* Destination, LONGLONG Value)
{
LONGLONG Old;
do{
Old = *Destination;
}while(InterlockedCompareExchange64(Destination, Old ^ Value, Old) != Old);
return Old;
}
alias InterlockedXor64_Inline InterlockedXor64;
BOOLEAN InterlockedBitTestAndSet_Inline(LONG* Base, LONG Bit)
{
LONG tBit;
tBit = 1 << (Bit & ((*Base).sizeof * 8 - 1));
return cast(BOOLEAN)((InterlockedOr(&Base[Bit / ((*Base).sizeof * 8)], tBit) & tBit) != 0);
}
alias InterlockedBitTestAndSet_Inline InterlockedBitTestAndSet;
BOOLEAN InterlockedBitTestAndReset_Inline(LONG* Base, LONG Bit)
{
LONG tBit;
tBit = 1 << (Bit & ((*Base).sizeof * 8 - 1));
return cast(BOOLEAN)((InterlockedAnd(&Base[Bit / ((*Base).sizeof * 8)], ~tBit) & tBit) != 0);
}
alias InterlockedBitTestAndReset_Inline InterlockedBitTestAndReset;
BOOLEAN InterlockedBitTestAndSet64_Inline(LONG64* Base, LONG64 Bit)
{
LONG64 tBit;
tBit = 1L << (Bit & ((*Base).sizeof * 8 - 1));
return cast(BOOLEAN)((InterlockedOr64(&Base[Bit / ((*Base).sizeof * 8)], tBit) & tBit) != 0);
}
alias InterlockedBitTestAndSet64_Inline InterlockedBitTestAndSet64;
BOOLEAN InterlockedBitTestAndReset64_Inline(LONG64* Base, LONG64 Bit)
{
LONG64 tBit;
tBit = 1L << (Bit & ((*Base).sieof * 8 - 1));
return cast(BOOLEAN)((InterlockedAnd64(&Base[Bit / ((*Base).sizeof * 8)], ~tBit) & tBit) != 0);
}
alias InterlockedBitTestAndReset64_Inline InterlockedBitTestAndReset64;
BOOLEAN InterlockedBitTestAndComplement_Inline(LONG* Base, LONG Bit)
{
LONG tBit;
tBit = 1 << (Bit & ((*Base).sizeof * 8 - 1));
return cast(BOOLEAN)((InterlockedXor(&Base[Bit / ((*Base).sizeof * 8)], tBit) & tBit) != 0);
}
alias InterlockedBitTestAndComplement_Inline InterlockedBitTestAndComplement;
BOOLEAN InterlockedBitTestAndComplement64_Inline(LONG64* Base, LONG64 Bit)
{
LONG64 tBit;
tBit = 1L << (Bit & ((*Base).sizeof * 8 - 1));
return cast(BOOLEAN)((InterlockedXor64(&Base[Bit / ((*Base).sizeof * 8)], tBit) & tBit) != 0);
}
alias InterlockedBitTestAndComplement64_Inline InterlockedBitTestAndComplement64;
} //extern C
} // version(none) _IA64_
version(none){ // _IA64_
extern(C) void* _rdteb();
extern(C) void* _rdtebex();
version(none){ // _M_IA64
TEB* NtCurrentTeb()
{
return cast(TEB*)_rdtebex();
}
PNT_TIB GetCurrentFiber()
{
cast(PNT_TIB)(NtCurrentTeb().FiberData);
}
void* GetFiberData()
{
return *(cast(PVOID*)GetCurrentFiber());
}
extern(C){
void __break(int StIIM);
enum {
BREAK_DEBUG_BASE = 0x080000,
ASSERT_BREAKPOINT = BREAK_DEBUG_BASE + 3,
}
VOID DbgRaiseAssertionFailure()
{
__break(ASSERT_BREAKPOINT);
}
void __yield();
void __mf();
void __lfetch(int Level, VOID* Address);
void __lfetchfault(int Level, VOID* Address);
void __lfetch_excl(int Level, VOID* Address);
void __lfetchfault_excl(int Level, VOID* Address);
enum {
MD_LFHINT_NONE = 0x00,
MD_LFHINT_NT1 = 0x01,
MD_LFHINT_NT2 = 0x02,
MD_LFHINT_NTA = 0x03,
}
//#define ReadTimeStampCounter() __getReg(3116)
uint __getReg(int Number);
alias __yield YieldProcessor;
alias __mf MemoryBarrier;
alias __lfetch PreFetchCacheLine;
//#define PrefetchForWrite(p)
//#define ReadForWriteAccess(p) (__lfetch_excl(MD_LFHINT_NONE, (p)), (*(p)))
enum {
PF_TEMPORAL_LEVEL_1 = MD_LFHINT_NONE,
PF_TEMPORAL_LEVEL_2 = MD_LFHINT_NT1,
PF_TEMPORAL_LEVEL_3 = MD_LFHINT_NT2,
PF_NON_TEMPORAL_LEVEL_ALL = MD_LFHINT_NTA,
}
alias __UMULH UnsignedMultiplyHigh;
ULONGLONG UnsignedMultiplyHigh(ULONGLONG Multiplier, ULONGLONG Multiplicand);
alias _umul128 UnsignedMultiply128;
DWORD64 UnsignedMultiply128(ulong Multiplier, ulong Multiplicand, ulong* HighProduct);
} // extern(C)
}else{ // not _M_IA64
TEB* NtCurrentTeb();
}
} // version(none) _IA64_
version(none){ // _IA64_
enum {
EXCEPTION_READ_FAULT = 0,
EXCEPTION_WRITE_FAULT = 1,
EXCEPTION_EXECUTE_FAULT = 2,
}
enum {
CONTEXT_IA64 = 0x00080000,
CONTEXT_CONTROL = CONTEXT_IA64 | 0x00000001,
CONTEXT_LOWER_FLOATING_POINT = CONTEXT_IA64 | 0x00000002,
CONTEXT_HIGHER_FLOATING_POINT = CONTEXT_IA64 | 0x00000004,
CONTEXT_INTEGER = CONTEXT_IA64 | 0x00000008,
CONTEXT_DEBUG = CONTEXT_IA64 | 0x00000010,
CONTEXT_IA32_CONTROL = CONTEXT_IA64 | 0x00000020,
CONTEXT_FLOATING_POINT = CONTEXT_LOWER_FLOATING_POINT | CONTEXT_HIGHER_FLOATING_POINT,
CONTEXT_FULL = CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER | CONTEXT_IA32_CONTROL,
CONTEXT_ALL = CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER | CONTEXT_DEBUG | CONTEXT_IA32_CONTROL,
CONTEXT_EXCEPTION_ACTIVE = 0x8000000,
CONTEXT_SERVICE_ACTIVE = 0x10000000,
CONTEXT_EXCEPTION_REQUEST = 0x40000000,
CONTEXT_EXCEPTION_REPORTING = 0x80000000,
}
struct CONTEXT {
DWORD ContextFlags;
DWORD[3] Fill1;
ULONGLONG DbI0;
ULONGLONG DbI1;
ULONGLONG DbI2;
ULONGLONG DbI3;
ULONGLONG DbI4;
ULONGLONG DbI5;
ULONGLONG DbI6;
ULONGLONG DbI7;
ULONGLONG DbD0;
ULONGLONG DbD1;
ULONGLONG DbD2;
ULONGLONG DbD3;
ULONGLONG DbD4;
ULONGLONG DbD5;
ULONGLONG DbD6;
ULONGLONG DbD7;
FLOAT128 FltS0;
FLOAT128 FltS1;
FLOAT128 FltS2;
FLOAT128 FltS3;
FLOAT128 FltT0;
FLOAT128 FltT1;
FLOAT128 FltT2;
FLOAT128 FltT3;
FLOAT128 FltT4;
FLOAT128 FltT5;
FLOAT128 FltT6;
FLOAT128 FltT7;
FLOAT128 FltT8;
FLOAT128 FltT9;
FLOAT128 FltS4;
FLOAT128 FltS5;
FLOAT128 FltS6;
FLOAT128 FltS7;
FLOAT128 FltS8;
FLOAT128 FltS9;
FLOAT128 FltS10;
FLOAT128 FltS11;
FLOAT128 FltS12;
FLOAT128 FltS13;
FLOAT128 FltS14;
FLOAT128 FltS15;
FLOAT128 FltS16;
FLOAT128 FltS17;
FLOAT128 FltS18;
FLOAT128 FltS19;
FLOAT128 FltF32;
FLOAT128 FltF33;
FLOAT128 FltF34;
FLOAT128 FltF35;
FLOAT128 FltF36;
FLOAT128 FltF37;
FLOAT128 FltF38;
FLOAT128 FltF39;
FLOAT128 FltF40;
FLOAT128 FltF41;
FLOAT128 FltF42;
FLOAT128 FltF43;
FLOAT128 FltF44;
FLOAT128 FltF45;
FLOAT128 FltF46;
FLOAT128 FltF47;
FLOAT128 FltF48;
FLOAT128 FltF49;
FLOAT128 FltF50;
FLOAT128 FltF51;
FLOAT128 FltF52;
FLOAT128 FltF53;
FLOAT128 FltF54;
FLOAT128 FltF55;
FLOAT128 FltF56;
FLOAT128 FltF57;
FLOAT128 FltF58;
FLOAT128 FltF59;
FLOAT128 FltF60;
FLOAT128 FltF61;
FLOAT128 FltF62;
FLOAT128 FltF63;
FLOAT128 FltF64;
FLOAT128 FltF65;
FLOAT128 FltF66;
FLOAT128 FltF67;
FLOAT128 FltF68;
FLOAT128 FltF69;
FLOAT128 FltF70;
FLOAT128 FltF71;
FLOAT128 FltF72;
FLOAT128 FltF73;
FLOAT128 FltF74;
FLOAT128 FltF75;
FLOAT128 FltF76;
FLOAT128 FltF77;
FLOAT128 FltF78;
FLOAT128 FltF79;
FLOAT128 FltF80;
FLOAT128 FltF81;
FLOAT128 FltF82;
FLOAT128 FltF83;
FLOAT128 FltF84;
FLOAT128 FltF85;
FLOAT128 FltF86;
FLOAT128 FltF87;
FLOAT128 FltF88;
FLOAT128 FltF89;
FLOAT128 FltF90;
FLOAT128 FltF91;
FLOAT128 FltF92;
FLOAT128 FltF93;
FLOAT128 FltF94;
FLOAT128 FltF95;
FLOAT128 FltF96;
FLOAT128 FltF97;
FLOAT128 FltF98;
FLOAT128 FltF99;
FLOAT128 FltF100;
FLOAT128 FltF101;
FLOAT128 FltF102;
FLOAT128 FltF103;
FLOAT128 FltF104;
FLOAT128 FltF105;
FLOAT128 FltF106;
FLOAT128 FltF107;
FLOAT128 FltF108;
FLOAT128 FltF109;
FLOAT128 FltF110;
FLOAT128 FltF111;
FLOAT128 FltF112;
FLOAT128 FltF113;
FLOAT128 FltF114;
FLOAT128 FltF115;
FLOAT128 FltF116;
FLOAT128 FltF117;
FLOAT128 FltF118;
FLOAT128 FltF119;
FLOAT128 FltF120;
FLOAT128 FltF121;
FLOAT128 FltF122;
FLOAT128 FltF123;
FLOAT128 FltF124;
FLOAT128 FltF125;
FLOAT128 FltF126;
FLOAT128 FltF127;
ULONGLONG StFPSR;
ULONGLONG IntGp;
ULONGLONG IntT0;
ULONGLONG IntT1;
ULONGLONG IntS0;
ULONGLONG IntS1;
ULONGLONG IntS2;
ULONGLONG IntS3;
ULONGLONG IntV0;
ULONGLONG IntT2;
ULONGLONG IntT3;
ULONGLONG IntT4;
ULONGLONG IntSp;
ULONGLONG IntTeb;
ULONGLONG IntT5;
ULONGLONG IntT6;
ULONGLONG IntT7;
ULONGLONG IntT8;
ULONGLONG IntT9;
ULONGLONG IntT10;
ULONGLONG IntT11;
ULONGLONG IntT12;
ULONGLONG IntT13;
ULONGLONG IntT14;
ULONGLONG IntT15;
ULONGLONG IntT16;
ULONGLONG IntT17;
ULONGLONG IntT18;
ULONGLONG IntT19;
ULONGLONG IntT20;
ULONGLONG IntT21;
ULONGLONG IntT22;
ULONGLONG IntNats;
ULONGLONG Preds;
ULONGLONG BrRp;
ULONGLONG BrS0;
ULONGLONG BrS1;
ULONGLONG BrS2;
ULONGLONG BrS3;
ULONGLONG BrS4;
ULONGLONG BrT0;
ULONGLONG BrT1;
ULONGLONG ApUNAT;
ULONGLONG ApLC;
ULONGLONG ApEC;
ULONGLONG ApCCV;
ULONGLONG ApDCR;
ULONGLONG RsPFS;
ULONGLONG RsBSP;
ULONGLONG RsBSPSTORE;
ULONGLONG RsRSC;
ULONGLONG RsRNAT;
ULONGLONG StIPSR;
ULONGLONG StIIP;
ULONGLONG StIFS;
ULONGLONG StFCR;
ULONGLONG Eflag;
ULONGLONG SegCSD;
ULONGLONG SegSSD;
ULONGLONG Cflag;
ULONGLONG StFSR;
ULONGLONG StFIR;
ULONGLONG StFDR;
ULONGLONG UNUSEDPACK;
}
alias CONTEXT* PCONTEXT;
struct PLABEL_DESCRIPTOR {
ULONGLONG EntryPoint;
ULONGLONG GlobalPointer;
}
alias PLABEL_DESCRIPTOR* PPLABEL_DESCRIPTOR;
struct RUNTIME_FUNCTION {
DWORD BeginAddress;
DWORD EndAddress;
DWORD UnwindInfoAddress;
}
alias RUNTIME_FUNCTION* PRUNTIME_FUNCTION;
enum UNWIND_HISTORY_TABLE_SIZE = 12;
struct UNWIND_HISTORY_TABLE_ENTRY {
DWORD64 ImageBase;
DWORD64 Gp;
PRUNTIME_FUNCTION FunctionEntry;
}
alias UNWIND_HISTORY_TABLE_ENTRY* PUNWIND_HISTORY_TABLE_ENTRY;
struct _UNWIND_HISTORY_TABLE {
DWORD Count;
BYTE LocalHint;
BYTE GlobalHint;
BYTE Search;
BYTE Once;
DWORD64 LowAddress;
DWORD64 HighAddress;
UNWIND_HISTORY_TABLE_ENTRY[UNWIND_HISTORY_TABLE_SIZE] Entry;
}
alias UNWIND_HISTORY_TABLE* PUNWIND_HISTORY_TABLE;
alias PRUNTIME_FUNCTION function(DWORD64 ControlPc, PVOID Context) GET_RUNTIME_FUNCTION_CALLBACK;
alias GET_RUNTIME_FUNCTION_CALLBACK PGET_RUNTIME_FUNCTION_CALLBACK;
alias DWORD function(HANDLE Process, PVOID TableAddress, PDWORD Entries, PRUNTIME_FUNCTION* Functions) OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK;
alias OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK;
const char* OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME = "OutOfProcessFunctionTableCallback";
export extern(Windows)
BOOLEAN RtlAddFunctionTable(PRUNTIME_FUNCTION FunctionTable, DWORD EntryCount, ULONGLONG BaseAddress, ULONGLONG TargetGp);
export extern(Windows)
BOOLEAN RtlInstallFunctionTableCallback ( DWORD64 TableIdentifier, DWORD64 BaseAddress, DWORD Length, DWORD64 TargetGp, PGET_RUNTIME_FUNCTION_CALLBACK Callback, PVOID Context, PCWSTR OutOfProcessCallbackDll);
export extern(Windows)
BOOLEAN RtlDeleteFunctionTable (PRUNTIME_FUNCTION FunctionTable);
export extern(Windows)
PRUNTIME_FUNCTION RtlLookupFunctionEntry(ULONGLONG ControlPc, PULONGLONG ImageBase, PULONGLONG TargetGp);
struct KNONVOLATILE_CONTEXT_POINTERS {
PFLOAT128 FltS0;
PFLOAT128 FltS1;
PFLOAT128 FltS2;
PFLOAT128 FltS3;
PFLOAT128[10] HighFloatingContext;
PFLOAT128 FltS4;
PFLOAT128 FltS5;
PFLOAT128 FltS6;
PFLOAT128 FltS7;
PFLOAT128 FltS8;
PFLOAT128 FltS9;
PFLOAT128 FltS10;
PFLOAT128 FltS11;
PFLOAT128 FltS12;
PFLOAT128 FltS13;
PFLOAT128 FltS14;
PFLOAT128 FltS15;
PFLOAT128 FltS16;
PFLOAT128 FltS17;
PFLOAT128 FltS18;
PFLOAT128 FltS19;
PULONGLONG IntS0;
PULONGLONG IntS1;
PULONGLONG IntS2;
PULONGLONG IntS3;
PULONGLONG IntSp;
PULONGLONG IntS0Nat;
PULONGLONG IntS1Nat;
PULONGLONG IntS2Nat;
PULONGLONG IntS3Nat;
PULONGLONG IntSpNat;
PULONGLONG Preds;
PULONGLONG BrRp;
PULONGLONG BrS0;
PULONGLONG BrS1;
PULONGLONG BrS2;
PULONGLONG BrS3;
PULONGLONG BrS4;
PULONGLONG ApUNAT;
PULONGLONG ApLC;
PULONGLONG ApEC;
PULONGLONG RsPFS;
PULONGLONG StFSR;
PULONGLONG StFIR;
PULONGLONG StFDR;
PULONGLONG Cflag;
PULONGLONG StFPSR;
}
alias KNONVOLATILE_CONTEXT_POINTERS* PKNONVOLATILE_CONTEXT_POINTERS;
struct FRAME_POINTERS {
ULONGLONG MemoryStackFp;
ULONGLONG BackingStoreFp;
}
alias FRAME_POINTERS* PFRAME_POINTERS;
export extern(Windows)
ULONGLONG RtlVirtualUnwind(ULONGLONG ImageBase, ULONGLONG ControlPc, PRUNTIME_FUNCTION FunctionEntry, PCONTEXT ContextRecord, PBOOLEAN InFunction, PFRAME_POINTERS EstablisherFrame, PKNONVOLATILE_CONTEXT_POINTERS ContextPointers);
export extern(Windows)
VOID RtlRestoreContext(PCONTEXT ContextRecord, EXCEPTION_RECORD* ExceptionRecord);
export extern(Windows)
VOID __jump_unwind(ULONGLONG TargetMsFrame, ULONGLONG TargetBsFrame, ULONGLONG TargetPc);
} // _IA64_
enum {
WOW64_CONTEXT_i386 = 0x00010000,
WOW64_CONTEXT_i486 = 0x00010000,
WOW64_CONTEXT_CONTROL = WOW64_CONTEXT_i386 | 0x00000001,
WOW64_CONTEXT_INTEGER = WOW64_CONTEXT_i386 | 0x00000002,
WOW64_CONTEXT_SEGMENTS = WOW64_CONTEXT_i386 | 0x00000004,
WOW64_CONTEXT_FLOATING_POINT = WOW64_CONTEXT_i386 | 0x00000008,
WOW64_CONTEXT_DEBUG_REGISTERS = WOW64_CONTEXT_i386 | 0x00000010,
WOW64_CONTEXT_EXTENDED_REGISTERS = WOW64_CONTEXT_i386 | 0x00000020,
WOW64_CONTEXT_FULL = WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS,
WOW64_CONTEXT_ALL = WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS | WOW64_CONTEXT_FLOATING_POINT | WOW64_CONTEXT_DEBUG_REGISTERS | WOW64_CONTEXT_EXTENDED_REGISTERS,
WOW64_CONTEXT_XSTATE = WOW64_CONTEXT_i386 | 0x00000040,
}
enum WOW64_SIZE_OF_80387_REGISTERS = 80;
enum WOW64_MAXIMUM_SUPPORTED_EXTENSION = 512;
struct WOW64_FLOATING_SAVE_AREA {
DWORD ControlWord;
DWORD StatusWord;
DWORD TagWord;
DWORD ErrorOffset;
DWORD ErrorSelector;
DWORD DataOffset;
DWORD DataSelector;
BYTE[WOW64_SIZE_OF_80387_REGISTERS] RegisterArea;
DWORD Cr0NpxState;
}
alias WOW64_FLOATING_SAVE_AREA* PWOW64_FLOATING_SAVE_AREA;
align(4)
struct WOW64_CONTEXT {
DWORD ContextFlags;
DWORD Dr0;
DWORD Dr1;
DWORD Dr2;
DWORD Dr3;
DWORD Dr6;
DWORD Dr7;
WOW64_FLOATING_SAVE_AREA FloatSave;
DWORD SegGs;
DWORD SegFs;
DWORD SegEs;
DWORD SegDs;
DWORD Edi;
DWORD Esi;
DWORD Ebx;
DWORD Edx;
DWORD Ecx;
DWORD Eax;
DWORD Ebp;
DWORD Eip;
DWORD SegCs;
DWORD EFlags;
DWORD Esp;
DWORD SegSs;
BYTE[WOW64_MAXIMUM_SUPPORTED_EXTENSION] ExtendedRegisters;
}
alias WOW64_CONTEXT* PWOW64_CONTEXT;
struct WOW64_LDT_ENTRY {
WORD LimitLow;
WORD BaseLow;
union {
struct {
BYTE BaseMid;
BYTE Flags1;
BYTE Flags2;
BYTE BaseHi;
}
DWORD Bits;
}
}
alias WOW64_LDT_ENTRY* PWOW64_LDT_ENTRY;
struct WOW64_DESCRIPTOR_TABLE_ENTRY {
DWORD Selector;
WOW64_LDT_ENTRY Descriptor;
}
alias WOW64_DESCRIPTOR_TABLE_ENTRY* PWOW64_DESCRIPTOR_TABLE_ENTRY;
enum EXCEPTION_NONCONTINUABLE = 0x1;
enum EXCEPTION_MAXIMUM_PARAMETERS = 15;
struct EXCEPTION_RECORD {
DWORD ExceptionCode;
DWORD ExceptionFlags;
EXCEPTION_RECORD* ExceptionRecord;
PVOID ExceptionAddress;
DWORD NumberParameters;
ULONG_PTR[EXCEPTION_MAXIMUM_PARAMETERS] ExceptionInformation;
}
alias EXCEPTION_RECORD* PEXCEPTION_RECORD;
struct EXCEPTION_RECORD32 {
DWORD ExceptionCode;
DWORD ExceptionFlags;
DWORD ExceptionRecord;
DWORD ExceptionAddress;
DWORD NumberParameters;
DWORD[EXCEPTION_MAXIMUM_PARAMETERS] ExceptionInformation;
}
alias EXCEPTION_RECORD32* PEXCEPTION_RECORD32;
struct EXCEPTION_RECORD64 {
DWORD ExceptionCode;
DWORD ExceptionFlags;
DWORD64 ExceptionRecord;
DWORD64 ExceptionAddress;
DWORD NumberParameters;
DWORD __unusedAlignment;
DWORD64 [EXCEPTION_MAXIMUM_PARAMETERS]ExceptionInformation;
}
alias EXCEPTION_RECORD64* PEXCEPTION_RECORD64;
struct EXCEPTION_POINTERS {
PEXCEPTION_RECORD ExceptionRecord;
PCONTEXT ContextRecord;
}
alias EXCEPTION_POINTERS* PEXCEPTION_POINTERS;
export extern(Windows)
VOID RtlUnwind(PVOID TargetFrame, PVOID TargetIp, PEXCEPTION_RECORD ExceptionRecord, PVOID ReturnValue);
version(none){ // _IA64_
export extern(Windows)
VOID RtlUnwind2(FRAME_POINTERS TargetFrame, PVOID TargetIp, PEXCEPTION_RECORD ExceptionRecord, PVOID ReturnValue, PCONTEXT ContextRecord);
}
version(X86_64){
export extern(Windows)
VOID RtlUnwindEx(PVOID TargetFrame, PVOID TargetIp, PEXCEPTION_RECORD ExceptionRecord, PVOID ReturnValue, PCONTEXT ContextRecord, PUNWIND_HISTORY_TABLE HistoryTable);
}else version(none){ // _IA64_
export extern(Windows)
VOID RtlUnwindEx(FRAME_POINTERS TargetFrame, PVOID TargetIp, PEXCEPTION_RECORD ExceptionRecord, PVOID ReturnValue, PCONTEXT ContextRecord, PUNWIND_HISTORY_TABLE HistoryTable);
}
/* -> moved to windef
alias PVOID PACCESS_TOKEN;
alias PVOID PSECURITY_DESCRIPTOR;
alias PVOID PSID;
alias DWORD ACCESS_MASK;
alias ACCESS_MASK* PACCESS_MASK;
<-- moved to windef */
enum {
DELETE = 0x00010000,
READ_CONTROL = 0x00020000,
WRITE_DAC = 0x00040000,
WRITE_OWNER = 0x00080000,
SYNCHRONIZE = 0x00100000,
STANDARD_RIGHTS_REQUIRED = 0x000F0000,
STANDARD_RIGHTS_READ = READ_CONTROL,
STANDARD_RIGHTS_WRITE = READ_CONTROL,
STANDARD_RIGHTS_EXECUTE = READ_CONTROL,
STANDARD_RIGHTS_ALL = 0x001F0000,
SPECIFIC_RIGHTS_ALL = 0x0000FFFF,
ACCESS_SYSTEM_SECURITY = 0x01000000,
MAXIMUM_ALLOWED = 0x02000000,
GENERIC_READ = 0x80000000,
GENERIC_WRITE = 0x40000000,
GENERIC_EXECUTE = 0x20000000,
GENERIC_ALL = 0x10000000,
}
struct GENERIC_MAPPING {
ACCESS_MASK GenericRead;
ACCESS_MASK GenericWrite;
ACCESS_MASK GenericExecute;
ACCESS_MASK GenericAll;
}
alias GENERIC_MAPPING* PGENERIC_MAPPING;
align(4)
struct LUID_AND_ATTRIBUTES {
LUID Luid;
DWORD Attributes;
}
alias LUID_AND_ATTRIBUTES* PLUID_AND_ATTRIBUTES;
alias LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY] LUID_AND_ATTRIBUTES_ARRAY;
alias LUID_AND_ATTRIBUTES_ARRAY* PLUID_AND_ATTRIBUTES_ARRAY;
struct SID_IDENTIFIER_AUTHORITY {
BYTE[6] Value;
}
alias SID_IDENTIFIER_AUTHORITY* PSID_IDENTIFIER_AUTHORITY;
struct SID {
BYTE Revision;
BYTE SubAuthorityCount;
SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
DWORD[ANYSIZE_ARRAY] SubAuthority;
}
alias SID* PISID;
enum {
SID_REVISION = 1,
SID_MAX_SUB_AUTHORITIES = 15,
SID_RECOMMENDED_SUB_AUTHORITIES = 1,
}
enum SECURITY_MAX_SID_SIZE = (SID.sizeof - DWORD.sizeof + (SID_MAX_SUB_AUTHORITIES * DWORD.sizeof));
enum {
SidTypeUser = 1,
SidTypeGroup,
SidTypeDomain,
SidTypeAlias,
SidTypeWellKnownGroup,
SidTypeDeletedAccount,
SidTypeInvalid,
SidTypeUnknown,
SidTypeComputer,
SidTypeLabel
}
alias int SID_NAME_USE;
alias SID_NAME_USE* PSID_NAME_USE;
struct SID_AND_ATTRIBUTES {
PSID Sid;
DWORD Attributes;
}
alias SID_AND_ATTRIBUTES* PSID_AND_ATTRIBUTES;
alias SID_AND_ATTRIBUTES[ANYSIZE_ARRAY] SID_AND_ATTRIBUTES_ARRAY;
alias SID_AND_ATTRIBUTES_ARRAY* PSID_AND_ATTRIBUTES_ARRAY;
enum SID_HASH_SIZE = 32;
alias ULONG_PTR SID_HASH_ENTRY;
alias SID_HASH_ENTRY* PSID_HASH_ENTRY;
struct SID_AND_ATTRIBUTES_HASH {
DWORD SidCount;
PSID_AND_ATTRIBUTES SidAttr;
SID_HASH_ENTRY[SID_HASH_SIZE] Hash;
}
alias SID_AND_ATTRIBUTES_HASH* PSID_AND_ATTRIBUTES_HASH;
const SID_IDENTIFIER_AUTHORITY SECURITY_NULL_SID_AUTHORITY = {[0,0,0,0,0,0]};
const SID_IDENTIFIER_AUTHORITY SECURITY_WORLD_SID_AUTHORITY = {[0,0,0,0,0,1]};
const SID_IDENTIFIER_AUTHORITY SECURITY_LOCAL_SID_AUTHORITY = {[0,0,0,0,0,2]};
const SID_IDENTIFIER_AUTHORITY SECURITY_CREATOR_SID_AUTHORITY = {[0,0,0,0,0,3]};
const SID_IDENTIFIER_AUTHORITY SECURITY_NON_UNIQUE_AUTHORITY = {[0,0,0,0,0,4]};
const SID_IDENTIFIER_AUTHORITY SECURITY_RESOURCE_MANAGER_AUTHORITY = {[0,0,0,0,0,9]};
enum {
SECURITY_NULL_RID = 0x00000000,
SECURITY_WORLD_RID = 0x00000000,
SECURITY_LOCAL_RID = 0x00000000,
SECURITY_LOCAL_LOGON_RID = 0x00000001,
SECURITY_CREATOR_OWNER_RID = 0x00000000,
SECURITY_CREATOR_GROUP_RID = 0x00000001,
SECURITY_CREATOR_OWNER_SERVER_RID = 0x00000002,
SECURITY_CREATOR_GROUP_SERVER_RID = 0x00000003,
SECURITY_CREATOR_OWNER_RIGHTS_RID = 0x00000004,
}
const SID_IDENTIFIER_AUTHORITY SECURITY_NT_AUTHORITY = {[0,0,0,0,0,5]};
enum {
SECURITY_DIALUP_RID = 0x00000001,
SECURITY_NETWORK_RID = 0x00000002,
SECURITY_BATCH_RID = 0x00000003,
SECURITY_INTERACTIVE_RID = 0x00000004,
SECURITY_LOGON_IDS_RID = 0x00000005,
SECURITY_LOGON_IDS_RID_COUNT = 3,
SECURITY_SERVICE_RID = 0x00000006,
SECURITY_ANONYMOUS_LOGON_RID = 0x00000007,
SECURITY_PROXY_RID = 0x00000008,
SECURITY_ENTERPRISE_CONTROLLERS_RID = 0x00000009,
SECURITY_SERVER_LOGON_RID = SECURITY_ENTERPRISE_CONTROLLERS_RID,
SECURITY_PRINCIPAL_SELF_RID = 0x0000000A,
SECURITY_AUTHENTICATED_USER_RID = 0x0000000B,
SECURITY_RESTRICTED_CODE_RID = 0x0000000C,
SECURITY_TERMINAL_SERVER_RID = 0x0000000D,
SECURITY_REMOTE_LOGON_RID = 0x0000000E,
SECURITY_THIS_ORGANIZATION_RID = 0x0000000F,
SECURITY_IUSER_RID = 0x00000011,
SECURITY_LOCAL_SYSTEM_RID = 0x00000012,
SECURITY_LOCAL_SERVICE_RID = 0x00000013,
SECURITY_NETWORK_SERVICE_RID = 0x00000014,
SECURITY_NT_NON_UNIQUE = 0x00000015,
SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT = 3,
SECURITY_ENTERPRISE_READONLY_CONTROLLERS_RID = 0x00000016,
SECURITY_BUILTIN_DOMAIN_RID = 0x00000020,
SECURITY_WRITE_RESTRICTED_CODE_RID = 0x00000021,
SECURITY_PACKAGE_BASE_RID = 0x00000040,
SECURITY_PACKAGE_RID_COUNT = 2,
SECURITY_PACKAGE_NTLM_RID = 0x0000000A,
SECURITY_PACKAGE_SCHANNEL_RID = 0x0000000E,
SECURITY_PACKAGE_DIGEST_RID = 0x00000015,
SECURITY_CRED_TYPE_BASE_RID = 0x00000041,
SECURITY_CRED_TYPE_RID_COUNT = 2,
SECURITY_CRED_TYPE_THIS_ORG_CERT_RID = 0x00000001,
SECURITY_MIN_BASE_RID = 0x00000050,
SECURITY_SERVICE_ID_BASE_RID = 0x00000050,
SECURITY_SERVICE_ID_RID_COUNT = 6,
SECURITY_RESERVED_ID_BASE_RID = 0x00000051,
SECURITY_APPPOOL_ID_BASE_RID = 0x00000052,
SECURITY_APPPOOL_ID_RID_COUNT = 6,
SECURITY_VIRTUALSERVER_ID_BASE_RID = 0x00000053,
SECURITY_VIRTUALSERVER_ID_RID_COUNT = 6,
SECURITY_USERMODEDRIVERHOST_ID_BASE_RID = 0x00000054,
SECURITY_USERMODEDRIVERHOST_ID_RID_COUNT = 6,
SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_BASE_RID = 0x00000055,
SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_RID_COUNT = 6,
SECURITY_WMIHOST_ID_BASE_RID = 0x00000056,
SECURITY_WMIHOST_ID_RID_COUNT = 6,
SECURITY_TASK_ID_BASE_RID = 0x00000057,
SECURITY_NFS_ID_BASE_RID = 0x00000058,
SECURITY_COM_ID_BASE_RID = 0x00000059,
SECURITY_VIRTUALACCOUNT_ID_RID_COUNT = 6,
SECURITY_MAX_BASE_RID = 0x0000006F,
SECURITY_MAX_ALWAYS_FILTERED = 0x000003E7,
SECURITY_MIN_NEVER_FILTERED = 0x000003E8,
SECURITY_OTHER_ORGANIZATION_RID = 0x000003E8,
SECURITY_WINDOWSMOBILE_ID_BASE_RID = 0x00000070,
DOMAIN_GROUP_RID_ENTERPRISE_READONLY_DOMAIN_CONTROLLERS = 0x000001F2,
FOREST_USER_RID_MAX = 0x000001F3,
DOMAIN_USER_RID_ADMIN = 0x000001F4,
DOMAIN_USER_RID_GUEST = 0x000001F5,
DOMAIN_USER_RID_KRBTGT = 0x000001F6,
DOMAIN_USER_RID_MAX = 0x000003E7,
DOMAIN_GROUP_RID_ADMINS = 0x00000200,
DOMAIN_GROUP_RID_USERS = 0x00000201,
DOMAIN_GROUP_RID_GUESTS = 0x00000202,
DOMAIN_GROUP_RID_COMPUTERS = 0x00000203,
DOMAIN_GROUP_RID_CONTROLLERS = 0x00000204,
DOMAIN_GROUP_RID_CERT_ADMINS = 0x00000205,
DOMAIN_GROUP_RID_SCHEMA_ADMINS = 0x00000206,
DOMAIN_GROUP_RID_ENTERPRISE_ADMINS = 0x00000207,
DOMAIN_GROUP_RID_POLICY_ADMINS = 0x00000208,
DOMAIN_GROUP_RID_READONLY_CONTROLLERS = 0x00000209,
DOMAIN_ALIAS_RID_ADMINS = 0x00000220,
DOMAIN_ALIAS_RID_USERS = 0x00000221,
DOMAIN_ALIAS_RID_GUESTS = 0x00000222,
DOMAIN_ALIAS_RID_POWER_USERS = 0x00000223,
DOMAIN_ALIAS_RID_ACCOUNT_OPS = 0x00000224,
DOMAIN_ALIAS_RID_SYSTEM_OPS = 0x00000225,
DOMAIN_ALIAS_RID_PRINT_OPS = 0x00000226,
DOMAIN_ALIAS_RID_BACKUP_OPS = 0x00000227,
DOMAIN_ALIAS_RID_REPLICATOR = 0x00000228,
DOMAIN_ALIAS_RID_RAS_SERVERS = 0x00000229,
DOMAIN_ALIAS_RID_PREW2KCOMPACCESS = 0x0000022A,
DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS = 0x0000022B,
DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS = 0x0000022C,
DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = 0x0000022D,
DOMAIN_ALIAS_RID_MONITORING_USERS = 0x0000022E,
DOMAIN_ALIAS_RID_LOGGING_USERS = 0x0000022F,
DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS = 0x00000230,
DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS = 0x00000231,
DOMAIN_ALIAS_RID_DCOM_USERS = 0x00000232,
DOMAIN_ALIAS_RID_IUSERS = 0x00000238,
DOMAIN_ALIAS_RID_CRYPTO_OPERATORS = 0x00000239,
DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP = 0x0000023B,
DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP = 0x0000023C,
DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP = 0x0000023D,
DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP = 0x0000023E,
}
const SID_IDENTIFIER_AUTHORITY SECURITY_MANDATORY_LABEL_AUTHORITY = {[0,0,0,0,0,16]};
enum {
SECURITY_MANDATORY_UNTRUSTED_RID = 0x00000000,
SECURITY_MANDATORY_LOW_RID = 0x00001000,
SECURITY_MANDATORY_MEDIUM_RID = 0x00002000,
SECURITY_MANDATORY_MEDIUM_PLUS_RID = SECURITY_MANDATORY_MEDIUM_RID + 0x100,
SECURITY_MANDATORY_HIGH_RID = 0x00003000,
SECURITY_MANDATORY_SYSTEM_RID = 0x00004000,
SECURITY_MANDATORY_PROTECTED_PROCESS_RID = 0x00005000,
SECURITY_MANDATORY_MAXIMUM_USER_RID = SECURITY_MANDATORY_SYSTEM_RID,
}
pure nothrow
uint MANDATORY_LEVEL_TO_MANDATORY_RID(uint IL)
{
return IL * 0x1000;
}
enum {
WinNullSid = 0,
WinWorldSid = 1,
WinLocalSid = 2,
WinCreatorOwnerSid = 3,
WinCreatorGroupSid = 4,
WinCreatorOwnerServerSid = 5,
WinCreatorGroupServerSid = 6,
WinNtAuthoritySid = 7,
WinDialupSid = 8,
WinNetworkSid = 9,
WinBatchSid = 10,
WinInteractiveSid = 11,
WinServiceSid = 12,
WinAnonymousSid = 13,
WinProxySid = 14,
WinEnterpriseControllersSid = 15,
WinSelfSid = 16,
WinAuthenticatedUserSid = 17,
WinRestrictedCodeSid = 18,
WinTerminalServerSid = 19,
WinRemoteLogonIdSid = 20,
WinLogonIdsSid = 21,
WinLocalSystemSid = 22,
WinLocalServiceSid = 23,
WinNetworkServiceSid = 24,
WinBuiltinDomainSid = 25,
WinBuiltinAdministratorsSid = 26,
WinBuiltinUsersSid = 27,
WinBuiltinGuestsSid = 28,
WinBuiltinPowerUsersSid = 29,
WinBuiltinAccountOperatorsSid = 30,
WinBuiltinSystemOperatorsSid = 31,
WinBuiltinPrintOperatorsSid = 32,
WinBuiltinBackupOperatorsSid = 33,
WinBuiltinReplicatorSid = 34,
WinBuiltinPreWindows2000CompatibleAccessSid = 35,
WinBuiltinRemoteDesktopUsersSid = 36,
WinBuiltinNetworkConfigurationOperatorsSid = 37,
WinAccountAdministratorSid = 38,
WinAccountGuestSid = 39,
WinAccountKrbtgtSid = 40,
WinAccountDomainAdminsSid = 41,
WinAccountDomainUsersSid = 42,
WinAccountDomainGuestsSid = 43,
WinAccountComputersSid = 44,
WinAccountControllersSid = 45,
WinAccountCertAdminsSid = 46,
WinAccountSchemaAdminsSid = 47,
WinAccountEnterpriseAdminsSid = 48,
WinAccountPolicyAdminsSid = 49,
WinAccountRasAndIasServersSid = 50,
WinNTLMAuthenticationSid = 51,
WinDigestAuthenticationSid = 52,
WinSChannelAuthenticationSid = 53,
WinThisOrganizationSid = 54,
WinOtherOrganizationSid = 55,
WinBuiltinIncomingForestTrustBuildersSid = 56,
WinBuiltinPerfMonitoringUsersSid = 57,
WinBuiltinPerfLoggingUsersSid = 58,
WinBuiltinAuthorizationAccessSid = 59,
WinBuiltinTerminalServerLicenseServersSid = 60,
WinBuiltinDCOMUsersSid = 61,
WinBuiltinIUsersSid = 62,
WinIUserSid = 63,
WinBuiltinCryptoOperatorsSid = 64,
WinUntrustedLabelSid = 65,
WinLowLabelSid = 66,
WinMediumLabelSid = 67,
WinHighLabelSid = 68,
WinSystemLabelSid = 69,
WinWriteRestrictedCodeSid = 70,
WinCreatorOwnerRightsSid = 71,
WinCacheablePrincipalsGroupSid = 72,
WinNonCacheablePrincipalsGroupSid = 73,
WinEnterpriseReadonlyControllersSid = 74,
WinAccountReadonlyControllersSid = 75,
WinBuiltinEventLogReadersGroup = 76,
WinNewEnterpriseReadonlyControllersSid = 77,
WinBuiltinCertSvcDComAccessGroup = 78,
WinMediumPlusLabelSid = 79,
WinLocalLogonSid = 80,
WinConsoleLogonSid = 81,
WinThisOrganizationCertificateSid = 82,
}
alias int WELL_KNOWN_SID_TYPE;
const LUID SYSTEM_LUID = {0x3e7, 0x0};
const LUID ANONYMOUS_LOGON_LUID = {0x3e6, 0x0};
const LUID LOCALSERVICE_LUID = {0x3e5, 0x0};
const LUID NETWORKSERVICE_LUID = {0x3e4, 0x0};
const LUID IUSER_LUID = {0x3e3, 0x0};
enum {
SE_GROUP_MANDATORY = 0x00000001,
SE_GROUP_ENABLED_BY_DEFAULT = 0x00000002,
SE_GROUP_ENABLED = 0x00000004,
SE_GROUP_OWNER = 0x00000008,
SE_GROUP_USE_FOR_DENY_ONLY = 0x00000010,
SE_GROUP_INTEGRITY = 0x00000020,
SE_GROUP_INTEGRITY_ENABLED = 0x00000040,
SE_GROUP_LOGON_ID = 0xC0000000,
SE_GROUP_RESOURCE = 0x20000000,
SE_GROUP_VALID_ATTRIBUTES = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED | SE_GROUP_OWNER | SE_GROUP_USE_FOR_DENY_ONLY | SE_GROUP_LOGON_ID | SE_GROUP_RESOURCE | SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED,
}
enum {
ACL_REVISION = 2,
ACL_REVISION_DS = 4,
}
enum {
ACL_REVISION1 = 1,
ACL_REVISION2 = 2,
ACL_REVISION3 = 3,
ACL_REVISION4 = 4,
MIN_ACL_REVISION = ACL_REVISION2,
MAX_ACL_REVISION = ACL_REVISION4,
}
struct ACL {
BYTE AclRevision;
BYTE Sbz1;
WORD AclSize;
WORD AceCount;
WORD Sbz2;
}
alias ACL* PACL;
struct ACE_HEADER {
BYTE AceType;
BYTE AceFlags;
WORD AceSize;
}
alias ACE_HEADER* PACE_HEADER;
enum {
ACCESS_MIN_MS_ACE_TYPE = 0x0,
ACCESS_ALLOWED_ACE_TYPE = 0x0,
ACCESS_DENIED_ACE_TYPE = 0x1,
SYSTEM_AUDIT_ACE_TYPE = 0x2,
SYSTEM_ALARM_ACE_TYPE = 0x3,
ACCESS_MAX_MS_V2_ACE_TYPE = 0x3,
ACCESS_ALLOWED_COMPOUND_ACE_TYPE = 0x4,
ACCESS_MAX_MS_V3_ACE_TYPE = 0x4,
ACCESS_MIN_MS_OBJECT_ACE_TYPE = 0x5,
ACCESS_ALLOWED_OBJECT_ACE_TYPE = 0x5,
ACCESS_DENIED_OBJECT_ACE_TYPE = 0x6,
SYSTEM_AUDIT_OBJECT_ACE_TYPE = 0x7,
SYSTEM_ALARM_OBJECT_ACE_TYPE = 0x8,
ACCESS_MAX_MS_OBJECT_ACE_TYPE = 0x8,
ACCESS_MAX_MS_V4_ACE_TYPE = 0x8,
ACCESS_MAX_MS_ACE_TYPE = 0x8,
ACCESS_ALLOWED_CALLBACK_ACE_TYPE = 0x9,
ACCESS_DENIED_CALLBACK_ACE_TYPE = 0xA,
ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE = 0xB,
ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE = 0xC,
SYSTEM_AUDIT_CALLBACK_ACE_TYPE = 0xD,
SYSTEM_ALARM_CALLBACK_ACE_TYPE = 0xE,
SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE = 0xF,
SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE = 0x10,
SYSTEM_MANDATORY_LABEL_ACE_TYPE = 0x11,
ACCESS_MAX_MS_V5_ACE_TYPE = 0x11,
}
enum {
OBJECT_INHERIT_ACE = 0x1,
CONTAINER_INHERIT_ACE = 0x2,
NO_PROPAGATE_INHERIT_ACE = 0x4,
INHERIT_ONLY_ACE = 0x8,
INHERITED_ACE = 0x10,
VALID_INHERIT_FLAGS = 0x1F,
}
enum {
SUCCESSFUL_ACCESS_ACE_FLAG = 0x40,
FAILED_ACCESS_ACE_FLAG = 0x80,
}
struct ACCESS_ALLOWED_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias ACCESS_ALLOWED_ACE* PACCESS_ALLOWED_ACE;
struct ACCESS_DENIED_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias ACCESS_DENIED_ACE* PACCESS_DENIED_ACE;
struct SYSTEM_AUDIT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias SYSTEM_AUDIT_ACE* PSYSTEM_AUDIT_ACE;
struct SYSTEM_ALARM_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias SYSTEM_ALARM_ACE* PSYSTEM_ALARM_ACE;
struct SYSTEM_MANDATORY_LABEL_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias SYSTEM_MANDATORY_LABEL_ACE* PSYSTEM_MANDATORY_LABEL_ACE;
enum {
SYSTEM_MANDATORY_LABEL_NO_WRITE_UP = 0x1,
SYSTEM_MANDATORY_LABEL_NO_READ_UP = 0x2,
SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP = 0x4,
SYSTEM_MANDATORY_LABEL_VALID_MASK = SYSTEM_MANDATORY_LABEL_NO_WRITE_UP | SYSTEM_MANDATORY_LABEL_NO_READ_UP | SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP,
}
struct ACCESS_ALLOWED_OBJECT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD Flags;
GUID ObjectType;
GUID InheritedObjectType;
DWORD SidStart;
}
alias ACCESS_ALLOWED_OBJECT_ACE* PACCESS_ALLOWED_OBJECT_ACE;
struct ACCESS_DENIED_OBJECT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD Flags;
GUID ObjectType;
GUID InheritedObjectType;
DWORD SidStart;
}
alias ACCESS_DENIED_OBJECT_ACE* PACCESS_DENIED_OBJECT_ACE;
struct SYSTEM_AUDIT_OBJECT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD Flags;
GUID ObjectType;
GUID InheritedObjectType;
DWORD SidStart;
}
alias SYSTEM_AUDIT_OBJECT_ACE* PSYSTEM_AUDIT_OBJECT_ACE;
struct SYSTEM_ALARM_OBJECT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD Flags;
GUID ObjectType;
GUID InheritedObjectType;
DWORD SidStart;
}
alias SYSTEM_ALARM_OBJECT_ACE* PSYSTEM_ALARM_OBJECT_ACE;
struct ACCESS_ALLOWED_CALLBACK_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias ACCESS_ALLOWED_CALLBACK_ACE* PACCESS_ALLOWED_CALLBACK_ACE;
struct ACCESS_DENIED_CALLBACK_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias ACCESS_DENIED_CALLBACK_ACE* PACCESS_DENIED_CALLBACK_ACE;
struct SYSTEM_AUDIT_CALLBACK_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias SYSTEM_AUDIT_CALLBACK_ACE* PSYSTEM_AUDIT_CALLBACK_ACE;
struct SYSTEM_ALARM_CALLBACK_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD SidStart;
}
alias SYSTEM_ALARM_CALLBACK_ACE* PSYSTEM_ALARM_CALLBACK_ACE;
struct ACCESS_ALLOWED_CALLBACK_OBJECT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD Flags;
GUID ObjectType;
GUID InheritedObjectType;
DWORD SidStart;
}
alias ACCESS_ALLOWED_CALLBACK_OBJECT_ACE* PACCESS_ALLOWED_CALLBACK_OBJECT_ACE;
struct ACCESS_DENIED_CALLBACK_OBJECT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD Flags;
GUID ObjectType;
GUID InheritedObjectType;
DWORD SidStart;
}
alias ACCESS_DENIED_CALLBACK_OBJECT_ACE* PACCESS_DENIED_CALLBACK_OBJECT_ACE;
struct SYSTEM_AUDIT_CALLBACK_OBJECT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD Flags;
GUID ObjectType;
GUID InheritedObjectType;
DWORD SidStart;
}
alias SYSTEM_AUDIT_CALLBACK_OBJECT_ACE* PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE;
struct SYSTEM_ALARM_CALLBACK_OBJECT_ACE {
ACE_HEADER Header;
ACCESS_MASK Mask;
DWORD Flags;
GUID ObjectType;
GUID InheritedObjectType;
DWORD SidStart;
}
alias SYSTEM_ALARM_CALLBACK_OBJECT_ACE* PSYSTEM_ALARM_CALLBACK_OBJECT_ACE;
enum {
ACE_OBJECT_TYPE_PRESENT = 0x1,
ACE_INHERITED_OBJECT_TYPE_PRESENT = 0x2,
}
enum {
AclRevisionInformation = 1,
AclSizeInformation
}
alias int ACL_INFORMATION_CLASS;
struct ACL_REVISION_INFORMATION {
DWORD AclRevision;
}
alias ACL_REVISION_INFORMATION* PACL_REVISION_INFORMATION;
struct ACL_SIZE_INFORMATION {
DWORD AceCount;
DWORD AclBytesInUse;
DWORD AclBytesFree;
}
alias ACL_SIZE_INFORMATION* PACL_SIZE_INFORMATION;
enum {
SECURITY_DESCRIPTOR_REVISION = 1,
SECURITY_DESCRIPTOR_REVISION1 = 1,
}
enum SECURITY_DESCRIPTOR_MIN_LENGTH = SECURITY_DESCRIPTOR.sizeof;
alias WORD SECURITY_DESCRIPTOR_CONTROL;
alias SECURITY_DESCRIPTOR_CONTROL* PSECURITY_DESCRIPTOR_CONTROL;
enum {
SE_OWNER_DEFAULTED = 0x0001,
SE_GROUP_DEFAULTED = 0x0002,
SE_DACL_PRESENT = 0x0004,
SE_DACL_DEFAULTED = 0x0008,
SE_SACL_PRESENT = 0x0010,
SE_SACL_DEFAULTED = 0x0020,
SE_DACL_AUTO_INHERIT_REQ = 0x0100,
SE_SACL_AUTO_INHERIT_REQ = 0x0200,
SE_DACL_AUTO_INHERITED = 0x0400,
SE_SACL_AUTO_INHERITED = 0x0800,
SE_DACL_PROTECTED = 0x1000,
SE_SACL_PROTECTED = 0x2000,
SE_RM_CONTROL_VALID = 0x4000,
SE_SELF_RELATIVE = 0x8000,
}
struct SECURITY_DESCRIPTOR_RELATIVE {
BYTE Revision;
BYTE Sbz1;
SECURITY_DESCRIPTOR_CONTROL Control;
DWORD Owner;
DWORD Group;
DWORD Sacl;
DWORD Dacl;
}
alias SECURITY_DESCRIPTOR_RELATIVE* PISECURITY_DESCRIPTOR_RELATIVE;
struct SECURITY_DESCRIPTOR {
BYTE Revision;
BYTE Sbz1;
SECURITY_DESCRIPTOR_CONTROL Control;
PSID Owner;
PSID Group;
PACL Sacl;
PACL Dacl;
}
alias SECURITY_DESCRIPTOR* PISECURITY_DESCRIPTOR;
struct OBJECT_TYPE_LIST {
WORD Level;
WORD Sbz;
GUID* ObjectType;
}
alias OBJECT_TYPE_LIST* POBJECT_TYPE_LIST;
enum {
ACCESS_OBJECT_GUID = 0,
ACCESS_PROPERTY_SET_GUID = 1,
ACCESS_PROPERTY_GUID = 2,
ACCESS_MAX_LEVEL = 4,
}
enum {
AuditEventObjectAccess,
AuditEventDirectoryServiceAccess
}
alias int AUDIT_EVENT_TYPE;
alias AUDIT_EVENT_TYPE* PAUDIT_EVENT_TYPE;
enum AUDIT_ALLOW_NO_PRIVILEGE = 0x1;
const char* ACCESS_DS_SOURCE_A = "DS";
const wchar* ACCESS_DS_SOURCE_W = "DS";
const char* ACCESS_DS_OBJECT_TYPE_NAME_A = "Directory Service Object";
const wchar* ACCESS_DS_OBJECT_TYPE_NAME_W = "Directory Service Object";
enum {
SE_PRIVILEGE_ENABLED_BY_DEFAULT = 0x00000001,
SE_PRIVILEGE_ENABLED = 0x00000002,
SE_PRIVILEGE_REMOVED = 0X00000004,
SE_PRIVILEGE_USED_FOR_ACCESS = 0x80000000,
SE_PRIVILEGE_VALID_ATTRIBUTES = SE_PRIVILEGE_ENABLED_BY_DEFAULT | SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_REMOVED | SE_PRIVILEGE_USED_FOR_ACCESS,
}
enum PRIVILEGE_SET_ALL_NECESSARY = 1;
struct PRIVILEGE_SET {
DWORD PrivilegeCount;
DWORD Control;
LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY] Privilege;
}
alias PRIVILEGE_SET* PPRIVILEGE_SET;
enum {
ACCESS_REASON_TYPE_MASK = 0xffff0000,
ACCESS_REASON_DATA_MASK = 0x0000ffff,
}
enum {
AccessReasonNone = 0x00000000,
AccessReasonAllowedAce = 0x00010000,
AccessReasonDeniedAce = 0x00020000,
AccessReasonAllowedParentAce = 0x00030000,
AccessReasonDeniedParentAce = 0x00040000,
AccessReasonMissingPrivilege = 0x00100000,
AccessReasonFromPrivilege = 0x00200000,
AccessReasonIntegrityLevel = 0x00300000,
AccessReasonOwnership = 0x00400000,
AccessReasonNullDacl = 0x00500000,
AccessReasonEmptyDacl = 0x00600000,
AccessReasonNoSD = 0x00700000,
AccessReasonNoGrant = 0x00800000
}
alias int ACCESS_REASON_TYPE;
alias DWORD ACCESS_REASON;
struct ACCESS_REASONS {
ACCESS_REASON[32] Data;
}
alias ACCESS_REASONS* PACCESS_REASONS;
enum {
SE_SECURITY_DESCRIPTOR_FLAG_NO_OWNER_ACE = 0x00000001,
SE_SECURITY_DESCRIPTOR_FLAG_NO_LABEL_ACE = 0x00000002,
SE_SECURITY_DESCRIPTOR_VALID_FLAGS = 0x00000003,
}
struct SE_SECURITY_DESCRIPTOR {
DWORD Size;
DWORD Flags;
PSECURITY_DESCRIPTOR SecurityDescriptor;
}
alias SE_SECURITY_DESCRIPTOR* PSE_SECURITY_DESCRIPTOR;
struct SE_ACCESS_REQUEST {
DWORD Size;
PSE_SECURITY_DESCRIPTOR SeSecurityDescriptor;
ACCESS_MASK DesiredAccess;
ACCESS_MASK PreviouslyGrantedAccess;
PSID PrincipalSelfSid;
PGENERIC_MAPPING GenericMapping;
DWORD ObjectTypeListCount;
POBJECT_TYPE_LIST ObjectTypeList;
}
alias SE_ACCESS_REQUEST* PSE_ACCESS_REQUEST;
struct SE_ACCESS_REPLY {
DWORD Size;
DWORD ResultListCount;
PACCESS_MASK GrantedAccess;
PDWORD AccessStatus;
PACCESS_REASONS AccessReason;
PPRIVILEGE_SET* Privileges;
}
alias SE_ACCESS_REPLY* PSE_ACCESS_REPLY;
version(UNICODE){
const wchar* SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege";
const wchar* SE_ASSIGNPRIMARYTOKEN_NAME = "SeAssignPrimaryTokenPrivilege";
const wchar* SE_LOCK_MEMORY_NAME = "SeLockMemoryPrivilege";
const wchar* SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege";
const wchar* SE_UNSOLICITED_INPUT_NAME = "SeUnsolicitedInputPrivilege";
const wchar* SE_MACHINE_ACCOUNT_NAME = "SeMachineAccountPrivilege";
const wchar* SE_TCB_NAME = "SeTcbPrivilege";
const wchar* SE_SECURITY_NAME = "SeSecurityPrivilege";
const wchar* SE_TAKE_OWNERSHIP_NAME = "SeTakeOwnershipPrivilege";
const wchar* SE_LOAD_DRIVER_NAME = "SeLoadDriverPrivilege";
const wchar* SE_SYSTEM_PROFILE_NAME = "SeSystemProfilePrivilege";
const wchar* SE_SYSTEMTIME_NAME = "SeSystemtimePrivilege";
const wchar* SE_PROF_SINGLE_PROCESS_NAME = "SeProfileSingleProcessPrivilege";
const wchar* SE_INC_BASE_PRIORITY_NAME = "SeIncreaseBasePriorityPrivilege";
const wchar* SE_CREATE_PAGEFILE_NAME = "SeCreatePagefilePrivilege";
const wchar* SE_CREATE_PERMANENT_NAME = "SeCreatePermanentPrivilege";
const wchar* SE_BACKUP_NAME = "SeBackupPrivilege";
const wchar* SE_RESTORE_NAME = "SeRestorePrivilege";
const wchar* SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
const wchar* SE_DEBUG_NAME = "SeDebugPrivilege";
const wchar* SE_AUDIT_NAME = "SeAuditPrivilege";
const wchar* SE_SYSTEM_ENVIRONMENT_NAME = "SeSystemEnvironmentPrivilege";
const wchar* SE_CHANGE_NOTIFY_NAME = "SeChangeNotifyPrivilege";
const wchar* SE_REMOTE_SHUTDOWN_NAME = "SeRemoteShutdownPrivilege";
const wchar* SE_UNDOCK_NAME = "SeUndockPrivilege";
const wchar* SE_SYNC_AGENT_NAME = "SeSyncAgentPrivilege";
const wchar* SE_ENABLE_DELEGATION_NAME = "SeEnableDelegationPrivilege";
const wchar* SE_MANAGE_VOLUME_NAME = "SeManageVolumePrivilege";
const wchar* SE_IMPERSONATE_NAME = "SeImpersonatePrivilege";
const wchar* SE_CREATE_GLOBAL_NAME = "SeCreateGlobalPrivilege";
const wchar* SE_TRUSTED_CREDMAN_ACCESS_NAME = "SeTrustedCredManAccessPrivilege";
const wchar* SE_RELABEL_NAME = "SeRelabelPrivilege";
const wchar* SE_INC_WORKING_SET_NAME = "SeIncreaseWorkingSetPrivilege";
const wchar* SE_TIME_ZONE_NAME = "SeTimeZonePrivilege";
const wchar* SE_CREATE_SYMBOLIC_LINK_NAME = "SeCreateSymbolicLinkPrivilege";
}else{
const char* SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege";
const char* SE_ASSIGNPRIMARYTOKEN_NAME = "SeAssignPrimaryTokenPrivilege";
const char* SE_LOCK_MEMORY_NAME = "SeLockMemoryPrivilege";
const char* SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege";
const char* SE_UNSOLICITED_INPUT_NAME = "SeUnsolicitedInputPrivilege";
const char* SE_MACHINE_ACCOUNT_NAME = "SeMachineAccountPrivilege";
const char* SE_TCB_NAME = "SeTcbPrivilege";
const char* SE_SECURITY_NAME = "SeSecurityPrivilege";
const char* SE_TAKE_OWNERSHIP_NAME = "SeTakeOwnershipPrivilege";
const char* SE_LOAD_DRIVER_NAME = "SeLoadDriverPrivilege";
const char* SE_SYSTEM_PROFILE_NAME = "SeSystemProfilePrivilege";
const char* SE_SYSTEMTIME_NAME = "SeSystemtimePrivilege";
const char* SE_PROF_SINGLE_PROCESS_NAME = "SeProfileSingleProcessPrivilege";
const char* SE_INC_BASE_PRIORITY_NAME = "SeIncreaseBasePriorityPrivilege";
const char* SE_CREATE_PAGEFILE_NAME = "SeCreatePagefilePrivilege";
const char* SE_CREATE_PERMANENT_NAME = "SeCreatePermanentPrivilege";
const char* SE_BACKUP_NAME = "SeBackupPrivilege";
const char* SE_RESTORE_NAME = "SeRestorePrivilege";
const char* SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
const char* SE_DEBUG_NAME = "SeDebugPrivilege";
const char* SE_AUDIT_NAME = "SeAuditPrivilege";
const char* SE_SYSTEM_ENVIRONMENT_NAME = "SeSystemEnvironmentPrivilege";
const char* SE_CHANGE_NOTIFY_NAME = "SeChangeNotifyPrivilege";
const char* SE_REMOTE_SHUTDOWN_NAME = "SeRemoteShutdownPrivilege";
const char* SE_UNDOCK_NAME = "SeUndockPrivilege";
const char* SE_SYNC_AGENT_NAME = "SeSyncAgentPrivilege";
const char* SE_ENABLE_DELEGATION_NAME = "SeEnableDelegationPrivilege";
const char* SE_MANAGE_VOLUME_NAME = "SeManageVolumePrivilege";
const char* SE_IMPERSONATE_NAME = "SeImpersonatePrivilege";
const char* SE_CREATE_GLOBAL_NAME = "SeCreateGlobalPrivilege";
const char* SE_TRUSTED_CREDMAN_ACCESS_NAME = "SeTrustedCredManAccessPrivilege";
const char* SE_RELABEL_NAME = "SeRelabelPrivilege";
const char* SE_INC_WORKING_SET_NAME = "SeIncreaseWorkingSetPrivilege";
const char* SE_TIME_ZONE_NAME = "SeTimeZonePrivilege";
const char* SE_CREATE_SYMBOLIC_LINK_NAME = "SeCreateSymbolicLinkPrivilege";
}
enum {
SecurityAnonymous,
SecurityIdentification,
SecurityImpersonation,
SecurityDelegation
}
alias int SECURITY_IMPERSONATION_LEVEL;
alias SECURITY_IMPERSONATION_LEVEL* PSECURITY_IMPERSONATION_LEVEL;
enum {
SECURITY_MAX_IMPERSONATION_LEVEL = SecurityDelegation,
SECURITY_MIN_IMPERSONATION_LEVEL = SecurityAnonymous,
DEFAULT_IMPERSONATION_LEVEL = SecurityImpersonation
}
bool VALID_IMPERSONATION_LEVEL(int L)
{
return (((L) >= SECURITY_MIN_IMPERSONATION_LEVEL) && ((L) <= SECURITY_MAX_IMPERSONATION_LEVEL));
}
enum {
TOKEN_ASSIGN_PRIMARY = 0x0001,
TOKEN_DUPLICATE = 0x0002,
TOKEN_IMPERSONATE = 0x0004,
TOKEN_QUERY = 0x0008,
TOKEN_QUERY_SOURCE = 0x0010,
TOKEN_ADJUST_PRIVILEGES = 0x0020,
TOKEN_ADJUST_GROUPS = 0x0040,
TOKEN_ADJUST_DEFAULT = 0x0080,
TOKEN_ADJUST_SESSIONID = 0x0100,
TOKEN_ALL_ACCESS_P = STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT
}
enum TOKEN_ALL_ACCESS = TOKEN_ALL_ACCESS_P | TOKEN_ADJUST_SESSIONID;
enum {
TOKEN_READ = STANDARD_RIGHTS_READ | TOKEN_QUERY,
TOKEN_WRITE = STANDARD_RIGHTS_WRITE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT,
TOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE,
}
enum {
TokenPrimary = 1,
TokenImpersonation
}
alias int TOKEN_TYPE;
alias TOKEN_TYPE* PTOKEN_TYPE;
enum {
TokenElevationTypeDefault = 1,
TokenElevationTypeFull,
TokenElevationTypeLimited,
}
alias int TOKEN_ELEVATION_TYPE;
alias TOKEN_ELEVATION_TYPE* PTOKEN_ELEVATION_TYPE;
enum {
TokenUser = 1,
TokenGroups,
TokenPrivileges,
TokenOwner,
TokenPrimaryGroup,
TokenDefaultDacl,
TokenSource,
TokenType,
TokenImpersonationLevel,
TokenStatistics,
TokenRestrictedSids,
TokenSessionId,
TokenGroupsAndPrivileges,
TokenSessionReference,
TokenSandBoxInert,
TokenAuditPolicy,
TokenOrigin,
TokenElevationType,
TokenLinkedToken,
TokenElevation,
TokenHasRestrictions,
TokenAccessInformation,
TokenVirtualizationAllowed,
TokenVirtualizationEnabled,
TokenIntegrityLevel,
TokenUIAccess,
TokenMandatoryPolicy,
TokenLogonSid,
MaxTokenInfoClass
}
alias int TOKEN_INFORMATION_CLASS;
alias TOKEN_INFORMATION_CLASS* PTOKEN_INFORMATION_CLASS;
struct TOKEN_USER {
SID_AND_ATTRIBUTES User;
}
alias TOKEN_USER* PTOKEN_USER;
struct TOKEN_GROUPS {
DWORD GroupCount;
SID_AND_ATTRIBUTES[ANYSIZE_ARRAY] Groups;
}
alias TOKEN_GROUPS* PTOKEN_GROUPS;
struct TOKEN_PRIVILEGES {
DWORD PrivilegeCount;
LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY] Privileges;
}
alias TOKEN_PRIVILEGES* PTOKEN_PRIVILEGES;
struct TOKEN_OWNER {
PSID Owner;
}
alias TOKEN_OWNER* PTOKEN_OWNER;
struct TOKEN_PRIMARY_GROUP {
PSID PrimaryGroup;
}
alias TOKEN_PRIMARY_GROUP* PTOKEN_PRIMARY_GROUP;
struct TOKEN_DEFAULT_DACL {
PACL DefaultDacl;
}
alias TOKEN_DEFAULT_DACL* PTOKEN_DEFAULT_DACL;
struct TOKEN_GROUPS_AND_PRIVILEGES {
DWORD SidCount;
DWORD SidLength;
PSID_AND_ATTRIBUTES Sids;
DWORD RestrictedSidCount;
DWORD RestrictedSidLength;
PSID_AND_ATTRIBUTES RestrictedSids;
DWORD PrivilegeCount;
DWORD PrivilegeLength;
PLUID_AND_ATTRIBUTES Privileges;
LUID AuthenticationId;
}
alias TOKEN_GROUPS_AND_PRIVILEGES* PTOKEN_GROUPS_AND_PRIVILEGES;
struct TOKEN_LINKED_TOKEN {
HANDLE LinkedToken;
}
alias TOKEN_LINKED_TOKEN* PTOKEN_LINKED_TOKEN;
struct TOKEN_ELEVATION {
DWORD TokenIsElevated;
}
alias TOKEN_ELEVATION* PTOKEN_ELEVATION;
struct TOKEN_MANDATORY_LABEL {
SID_AND_ATTRIBUTES Label;
}
alias TOKEN_MANDATORY_LABEL* PTOKEN_MANDATORY_LABEL;
enum {
TOKEN_MANDATORY_POLICY_OFF = 0x0,
TOKEN_MANDATORY_POLICY_NO_WRITE_UP = 0x1,
TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN = 0x2,
TOKEN_MANDATORY_POLICY_VALID_MASK = TOKEN_MANDATORY_POLICY_NO_WRITE_UP | TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN,
}
struct TOKEN_MANDATORY_POLICY {
DWORD Policy;
}
alias TOKEN_MANDATORY_POLICY* PTOKEN_MANDATORY_POLICY;
struct TOKEN_ACCESS_INFORMATION {
PSID_AND_ATTRIBUTES_HASH SidHash;
PSID_AND_ATTRIBUTES_HASH RestrictedSidHash;
PTOKEN_PRIVILEGES Privileges;
LUID AuthenticationId;
TOKEN_TYPE TokenType;
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
TOKEN_MANDATORY_POLICY MandatoryPolicy;
DWORD Flags;
}
alias TOKEN_ACCESS_INFORMATION* PTOKEN_ACCESS_INFORMATION;
enum POLICY_AUDIT_SUBCATEGORY_COUNT = 53;
struct TOKEN_AUDIT_POLICY {
BYTE[((POLICY_AUDIT_SUBCATEGORY_COUNT) >> 1) + 1] PerUserPolicy;
}
alias TOKEN_AUDIT_POLICY* PTOKEN_AUDIT_POLICY;
enum TOKEN_SOURCE_LENGTH = 8;
struct TOKEN_SOURCE {
CHAR[TOKEN_SOURCE_LENGTH] SourceName;
LUID SourceIdentifier;
}
alias TOKEN_SOURCE* PTOKEN_SOURCE;
struct TOKEN_STATISTICS {
LUID TokenId;
LUID AuthenticationId;
LARGE_INTEGER ExpirationTime;
TOKEN_TYPE TokenType;
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
DWORD DynamicCharged;
DWORD DynamicAvailable;
DWORD GroupCount;
DWORD PrivilegeCount;
LUID ModifiedId;
}
alias TOKEN_STATISTICS* PTOKEN_STATISTICS;
struct TOKEN_CONTROL {
LUID TokenId;
LUID AuthenticationId;
LUID ModifiedId;
TOKEN_SOURCE TokenSource;
}
alias TOKEN_CONTROL* PTOKEN_CONTROL;
struct TOKEN_ORIGIN {
LUID OriginatingLogonSession;
}
alias TOKEN_ORIGIN* PTOKEN_ORIGIN;
enum {
MandatoryLevelUntrusted = 0,
MandatoryLevelLow,
MandatoryLevelMedium,
MandatoryLevelHigh,
MandatoryLevelSystem,
MandatoryLevelSecureProcess,
MandatoryLevelCount
}
alias int MANDATORY_LEVEL;
alias MANDATORY_LEVEL* PMANDATORY_LEVEL;
enum {
SECURITY_DYNAMIC_TRACKING = TRUE,
SECURITY_STATIC_TRACKING = FALSE,
}
alias BOOLEAN SECURITY_CONTEXT_TRACKING_MODE;
alias SECURITY_CONTEXT_TRACKING_MODE* PSECURITY_CONTEXT_TRACKING_MODE;
struct SECURITY_QUALITY_OF_SERVICE {
DWORD Length;
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
BOOLEAN EffectiveOnly;
}
alias SECURITY_QUALITY_OF_SERVICE* PSECURITY_QUALITY_OF_SERVICE;
struct SE_IMPERSONATION_STATE {
PACCESS_TOKEN Token;
BOOLEAN CopyOnOpen;
BOOLEAN EffectiveOnly;
SECURITY_IMPERSONATION_LEVEL Level;
}
alias SE_IMPERSONATION_STATE* PSE_IMPERSONATION_STATE;
enum {
DISABLE_MAX_PRIVILEGE = 0x1,
SANDBOX_INERT = 0x2,
LUA_TOKEN = 0x4,
WRITE_RESTRICTED = 0x8,
}
alias DWORD SECURITY_INFORMATION;
alias SECURITY_INFORMATION* PSECURITY_INFORMATION;
enum {
OWNER_SECURITY_INFORMATION = 0x00000001,
GROUP_SECURITY_INFORMATION = 0x00000002,
DACL_SECURITY_INFORMATION = 0x00000004,
SACL_SECURITY_INFORMATION = 0x00000008,
LABEL_SECURITY_INFORMATION = 0x00000010,
}
enum {
PROTECTED_DACL_SECURITY_INFORMATION = 0x80000000,
PROTECTED_SACL_SECURITY_INFORMATION = 0x40000000,
UNPROTECTED_DACL_SECURITY_INFORMATION = 0x20000000,
UNPROTECTED_SACL_SECURITY_INFORMATION = 0x10000000,
}
enum {
PROCESS_TERMINATE = 0x0001,
PROCESS_CREATE_THREAD = 0x0002,
PROCESS_SET_SESSIONID = 0x0004,
PROCESS_VM_OPERATION = 0x0008,
PROCESS_VM_READ = 0x0010,
PROCESS_VM_WRITE = 0x0020,
PROCESS_DUP_HANDLE = 0x0040,
PROCESS_CREATE_PROCESS = 0x0080,
PROCESS_SET_QUOTA = 0x0100,
PROCESS_SET_INFORMATION = 0x0200,
PROCESS_QUERY_INFORMATION = 0x0400,
PROCESS_SUSPEND_RESUME = 0x0800,
PROCESS_QUERY_LIMITED_INFORMATION = 0x1000,
}
//(NTDDI_VERSION >= NTDDI_VISTA)
enum PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF;
//}else{
// enum PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF;
//}
version(Win64){
enum MAXIMUM_PROC_PER_GROUP = 64;
}else{
enum MAXIMUM_PROC_PER_GROUP = 32;
}
enum MAXIMUM_PROCESSORS = MAXIMUM_PROC_PER_GROUP;
enum {
THREAD_TERMINATE = 0x0001,
THREAD_SUSPEND_RESUME = 0x0002,
THREAD_GET_CONTEXT = 0x0008,
THREAD_SET_CONTEXT = 0x0010,
THREAD_QUERY_INFORMATION = 0x0040,
THREAD_SET_INFORMATION = 0x0020,
THREAD_SET_THREAD_TOKEN = 0x0080,
THREAD_IMPERSONATE = 0x0100,
THREAD_DIRECT_IMPERSONATION = 0x0200,
THREAD_SET_LIMITED_INFORMATION = 0x0400,
THREAD_QUERY_LIMITED_INFORMATION = 0x0800,
}
//(NTDDI_VERSION >= NTDDI_VISTA)
enum THREAD_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF;
//}else{
// enum THREAD_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3FF;
//}
enum {
JOB_OBJECT_ASSIGN_PROCESS = 0x0001,
JOB_OBJECT_SET_ATTRIBUTES = 0x0002,
JOB_OBJECT_QUERY = 0x0004,
JOB_OBJECT_TERMINATE = 0x0008,
JOB_OBJECT_SET_SECURITY_ATTRIBUTES = 0x0010,
JOB_OBJECT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1F,
}
struct JOB_SET_ARRAY {
HANDLE JobHandle;
DWORD MemberLevel;
DWORD Flags;
}
alias JOB_SET_ARRAY* PJOB_SET_ARRAY;
enum {
FLS_MAXIMUM_AVAILABLE = 128,
TLS_MINIMUM_AVAILABLE = 64,
}
struct NT_TIB {
EXCEPTION_REGISTRATION_RECORD* ExceptionList;
PVOID StackBase;
PVOID StackLimit;
PVOID SubSystemTib;
union {
PVOID FiberData;
DWORD Version;
}
PVOID ArbitraryUserPointer;
NT_TIB* Self;
}
alias NT_TIB* PNT_TIB;
struct NT_TIB32 {
DWORD ExceptionList;
DWORD StackBase;
DWORD StackLimit;
DWORD SubSystemTib;
union {
DWORD FiberData;
DWORD Version;
}
DWORD ArbitraryUserPointer;
DWORD Self;
}
alias NT_TIB32* PNT_TIB32;
struct NT_TIB64 {
DWORD64 ExceptionList;
DWORD64 StackBase;
DWORD64 StackLimit;
DWORD64 SubSystemTib;
union {
DWORD64 FiberData;
DWORD Version;
}
DWORD64 ArbitraryUserPointer;
DWORD64 Self;
}
alias NT_TIB64* PNT_TIB64;
enum {
THREAD_BASE_PRIORITY_LOWRT = 15,
THREAD_BASE_PRIORITY_MAX = 2,
THREAD_BASE_PRIORITY_MIN = -2,
THREAD_BASE_PRIORITY_IDLE = -15,
}
struct UMS_CREATE_THREAD_ATTRIBUTES {
DWORD UmsVersion;
PVOID UmsContext;
PVOID UmsCompletionList;
}
alias UMS_CREATE_THREAD_ATTRIBUTES* PUMS_CREATE_THREAD_ATTRIBUTES;
struct QUOTA_LIMITS {
SIZE_T PagedPoolLimit;
SIZE_T NonPagedPoolLimit;
SIZE_T MinimumWorkingSetSize;
SIZE_T MaximumWorkingSetSize;
SIZE_T PagefileLimit;
LARGE_INTEGER TimeLimit;
}
alias QUOTA_LIMITS* PQUOTA_LIMITS;
enum {
QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001,
QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002,
QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004,
QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008,
QUOTA_LIMITS_USE_DEFAULT_LIMITS = 0x00000010,
}
union RATE_QUOTA_LIMIT {
DWORD RateData;
DWORD RatePercent7Reserved025;
}
alias RATE_QUOTA_LIMIT* PRATE_QUOTA_LIMIT;
struct QUOTA_LIMITS_EX {
SIZE_T PagedPoolLimit;
SIZE_T NonPagedPoolLimit;
SIZE_T MinimumWorkingSetSize;
SIZE_T MaximumWorkingSetSize;
SIZE_T PagefileLimit;
LARGE_INTEGER TimeLimit;
SIZE_T WorkingSetLimit;
SIZE_T Reserved2;
SIZE_T Reserved3;
SIZE_T Reserved4;
DWORD Flags;
RATE_QUOTA_LIMIT CpuRateLimit;
}
alias QUOTA_LIMITS_EX* PQUOTA_LIMITS_EX;
struct IO_COUNTERS {
ULONGLONG ReadOperationCount;
ULONGLONG WriteOperationCount;
ULONGLONG OtherOperationCount;
ULONGLONG ReadTransferCount;
ULONGLONG WriteTransferCount;
ULONGLONG OtherTransferCount;
}
alias IO_COUNTERS* PIO_COUNTERS;
enum MAX_HW_COUNTERS = 16;
enum THREAD_PROFILING_FLAG_DISPATCH = 0x00000001;
enum HARDWARE_COUNTER_TYPE {
PMCCounter,
MaxHardwareCounterType
}
alias HARDWARE_COUNTER_TYPE* PHARDWARE_COUNTER_TYPE;
struct JOBOBJECT_BASIC_ACCOUNTING_INFORMATION {
LARGE_INTEGER TotalUserTime;
LARGE_INTEGER TotalKernelTime;
LARGE_INTEGER ThisPeriodTotalUserTime;
LARGE_INTEGER ThisPeriodTotalKernelTime;
DWORD TotalPageFaultCount;
DWORD TotalProcesses;
DWORD ActiveProcesses;
DWORD TotalTerminatedProcesses;
}
alias JOBOBJECT_BASIC_ACCOUNTING_INFORMATION* PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
struct JOBOBJECT_BASIC_LIMIT_INFORMATION {
LARGE_INTEGER PerProcessUserTimeLimit;
LARGE_INTEGER PerJobUserTimeLimit;
DWORD LimitFlags;
SIZE_T MinimumWorkingSetSize;
SIZE_T MaximumWorkingSetSize;
DWORD ActiveProcessLimit;
ULONG_PTR Affinity;
DWORD PriorityClass;
DWORD SchedulingClass;
}
alias JOBOBJECT_BASIC_LIMIT_INFORMATION* PJOBOBJECT_BASIC_LIMIT_INFORMATION;
struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION {
JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation;
IO_COUNTERS IoInfo;
SIZE_T ProcessMemoryLimit;
SIZE_T JobMemoryLimit;
SIZE_T PeakProcessMemoryUsed;
SIZE_T PeakJobMemoryUsed;
}
alias JOBOBJECT_EXTENDED_LIMIT_INFORMATION* PJOBOBJECT_EXTENDED_LIMIT_INFORMATION;
struct JOBOBJECT_BASIC_PROCESS_ID_LIST {
DWORD NumberOfAssignedProcesses;
DWORD NumberOfProcessIdsInList;
ULONG_PTR[1] ProcessIdList;
}
alias JOBOBJECT_BASIC_PROCESS_ID_LIST* PJOBOBJECT_BASIC_PROCESS_ID_LIST;
struct JOBOBJECT_BASIC_UI_RESTRICTIONS {
DWORD UIRestrictionsClass;
}
alias JOBOBJECT_BASIC_UI_RESTRICTIONS* PJOBOBJECT_BASIC_UI_RESTRICTIONS;
struct JOBOBJECT_SECURITY_LIMIT_INFORMATION {
DWORD SecurityLimitFlags;
HANDLE JobToken;
PTOKEN_GROUPS SidsToDisable;
PTOKEN_PRIVILEGES PrivilegesToDelete;
PTOKEN_GROUPS RestrictedSids;
}
alias JOBOBJECT_SECURITY_LIMIT_INFORMATION* PJOBOBJECT_SECURITY_LIMIT_INFORMATION;
struct JOBOBJECT_END_OF_JOB_TIME_INFORMATION {
DWORD EndOfJobTimeAction;
}
alias JOBOBJECT_END_OF_JOB_TIME_INFORMATION* PJOBOBJECT_END_OF_JOB_TIME_INFORMATION;
struct JOBOBJECT_ASSOCIATE_COMPLETION_PORT {
PVOID CompletionKey;
HANDLE CompletionPort;
}
alias JOBOBJECT_ASSOCIATE_COMPLETION_PORT* PJOBOBJECT_ASSOCIATE_COMPLETION_PORT;
struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION {
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo;
IO_COUNTERS IoInfo;
}
alias JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION* PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;
struct JOBOBJECT_JOBSET_INFORMATION {
DWORD MemberLevel;
}
alias JOBOBJECT_JOBSET_INFORMATION* PJOBOBJECT_JOBSET_INFORMATION;
enum {
JOB_OBJECT_TERMINATE_AT_END_OF_JOB = 0,
JOB_OBJECT_POST_AT_END_OF_JOB = 1,
}
enum {
JOB_OBJECT_MSG_END_OF_JOB_TIME = 1,
JOB_OBJECT_MSG_END_OF_PROCESS_TIME = 2,
JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT = 3,
JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO = 4,
JOB_OBJECT_MSG_NEW_PROCESS = 6,
JOB_OBJECT_MSG_EXIT_PROCESS = 7,
JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS = 8,
JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT = 9,
JOB_OBJECT_MSG_JOB_MEMORY_LIMIT = 10,
}
enum {
JOB_OBJECT_LIMIT_WORKINGSET = 0x00000001,
JOB_OBJECT_LIMIT_PROCESS_TIME = 0x00000002,
JOB_OBJECT_LIMIT_JOB_TIME = 0x00000004,
JOB_OBJECT_LIMIT_ACTIVE_PROCESS = 0x00000008,
JOB_OBJECT_LIMIT_AFFINITY = 0x00000010,
JOB_OBJECT_LIMIT_PRIORITY_CLASS = 0x00000020,
JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME = 0x00000040,
JOB_OBJECT_LIMIT_SCHEDULING_CLASS = 0x00000080,
}
enum {
JOB_OBJECT_LIMIT_PROCESS_MEMORY = 0x00000100,
JOB_OBJECT_LIMIT_JOB_MEMORY = 0x00000200,
JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION = 0x00000400,
JOB_OBJECT_LIMIT_BREAKAWAY_OK = 0x00000800,
JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK = 0x00001000,
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = 0x00002000,
JOB_OBJECT_LIMIT_SUBSET_AFFINITY = 0x00004000,
JOB_OBJECT_LIMIT_RESERVED3 = 0x00008000,
JOB_OBJECT_LIMIT_RESERVED4 = 0x00010000,
JOB_OBJECT_LIMIT_RESERVED5 = 0x00020000,
JOB_OBJECT_LIMIT_RESERVED6 = 0x00040000,
}
enum JOB_OBJECT_LIMIT_VALID_FLAGS = 0x0007ffff;
enum {
JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS = 0x000000ff,
JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS = 0x00007fff,
JOB_OBJECT_RESERVED_LIMIT_VALID_FLAGS = 0x0007ffff,
}
enum {
JOB_OBJECT_UILIMIT_NONE = 0x00000000,
JOB_OBJECT_UILIMIT_HANDLES = 0x00000001,
JOB_OBJECT_UILIMIT_READCLIPBOARD = 0x00000002,
JOB_OBJECT_UILIMIT_WRITECLIPBOARD = 0x00000004,
JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS = 0x00000008,
JOB_OBJECT_UILIMIT_DISPLAYSETTINGS = 0x00000010,
JOB_OBJECT_UILIMIT_GLOBALATOMS = 0x00000020,
JOB_OBJECT_UILIMIT_DESKTOP = 0x00000040,
JOB_OBJECT_UILIMIT_EXITWINDOWS = 0x00000080,
JOB_OBJECT_UILIMIT_ALL = 0x000000FF,
}
enum JOB_OBJECT_UI_VALID_FLAGS = 0x000000FF;
enum {
JOB_OBJECT_SECURITY_NO_ADMIN = 0x00000001,
JOB_OBJECT_SECURITY_RESTRICTED_TOKEN = 0x00000002,
JOB_OBJECT_SECURITY_ONLY_TOKEN = 0x00000004,
JOB_OBJECT_SECURITY_FILTER_TOKENS = 0x00000008,
JOB_OBJECT_SECURITY_VALID_FLAGS = 0x0000000f,
}
enum {
JobObjectBasicAccountingInformation = 1,
JobObjectBasicLimitInformation,
JobObjectBasicProcessIdList,
JobObjectBasicUIRestrictions,
JobObjectSecurityLimitInformation,
JobObjectEndOfJobTimeInformation,
JobObjectAssociateCompletionPortInformation,
JobObjectBasicAndIoAccountingInformation,
JobObjectExtendedLimitInformation,
JobObjectJobSetInformation,
JobObjectGroupInformation,
MaxJobObjectInfoClass
}
alias int JOBOBJECTINFOCLASS;
enum {
EVENT_MODIFY_STATE = 0x0002,
EVENT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3,
}
enum {
MUTANT_QUERY_STATE = 0x000,
MUTANT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | MUTANT_QUERY_STATE,
}
enum {
SEMAPHORE_MODIFY_STATE = 0x0002,
SEMAPHORE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3,
}
enum {
TIMER_QUERY_STATE = 0x0001,
TIMER_MODIFY_STATE = 0x0002,
TIMER_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE| TIMER_QUERY_STATE | TIMER_MODIFY_STATE,
}
enum {
TIME_ZONE_ID_UNKNOWN = 0,
TIME_ZONE_ID_STANDARD = 1,
TIME_ZONE_ID_DAYLIGHT = 2,
}
enum {
RelationProcessorCore,
RelationNumaNode,
RelationCache,
RelationProcessorPackage,
RelationGroup,
RelationAll = 0xffff
}
alias int LOGICAL_PROCESSOR_RELATIONSHIP;
enum LTP_PC_SMT = 0x1;
enum {
CacheUnified,
CacheInstruction,
CacheData,
CacheTrace
}
alias int PROCESSOR_CACHE_TYPE;
enum CACHE_FULLY_ASSOCIATIVE = 0xFF;
struct CACHE_DESCRIPTOR {
BYTE Level;
BYTE Associativity;
WORD LineSize;
DWORD Size;
PROCESSOR_CACHE_TYPE Type;
}
alias CACHE_DESCRIPTOR* PCACHE_DESCRIPTOR;
struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION {
ULONG_PTR ProcessorMask;
LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
union {
struct {
BYTE Flags;
}
struct {
DWORD NodeNumber;
}
CACHE_DESCRIPTOR Cache;
ULONGLONG[2] Reserved;
}
}
alias SYSTEM_LOGICAL_PROCESSOR_INFORMATION* PSYSTEM_LOGICAL_PROCESSOR_INFORMATION;
struct PROCESSOR_RELATIONSHIP {
BYTE Flags;
BYTE[21] Reserved;
WORD GroupCount;
GROUP_AFFINITY[ANYSIZE_ARRAY] GroupMask;
}
alias PROCESSOR_RELATIONSHIP* PPROCESSOR_RELATIONSHIP;
struct NUMA_NODE_RELATIONSHIP {
DWORD NodeNumber;
BYTE[20] Reserved;
GROUP_AFFINITY GroupMask;
}
alias NUMA_NODE_RELATIONSHIP* PNUMA_NODE_RELATIONSHIP;
struct CACHE_RELATIONSHIP {
BYTE Level;
BYTE Associativity;
WORD LineSize;
DWORD CacheSize;
PROCESSOR_CACHE_TYPE Type;
BYTE[20] Reserved;
GROUP_AFFINITY GroupMask;
}
alias CACHE_RELATIONSHIP* PCACHE_RELATIONSHIP;
struct PROCESSOR_GROUP_INFO {
BYTE MaximumProcessorCount;
BYTE ActiveProcessorCount;
BYTE[38] Reserved;
KAFFINITY ActiveProcessorMask;
}
alias PROCESSOR_GROUP_INFO* PPROCESSOR_GROUP_INFO;
struct GROUP_RELATIONSHIP {
WORD MaximumGroupCount;
WORD ActiveGroupCount;
BYTE[20] Reserved;
PROCESSOR_GROUP_INFO[ANYSIZE_ARRAY] GroupInfo;
}
alias GROUP_RELATIONSHIP* PGROUP_RELATIONSHIP;
struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX {
LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
DWORD Size;
union {
PROCESSOR_RELATIONSHIP Processor;
NUMA_NODE_RELATIONSHIP NumaNode;
CACHE_RELATIONSHIP Cache;
GROUP_RELATIONSHIP Group;
}
}
alias SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX* PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX;
struct SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION {
DWORD64 CycleTime;
}
alias SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION* PSYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION;
enum {
PROCESSOR_INTEL_386 = 386,
PROCESSOR_INTEL_486 = 486,
PROCESSOR_INTEL_PENTIUM = 586,
PROCESSOR_INTEL_IA64 = 2200,
PROCESSOR_AMD_X8664 = 8664,
PROCESSOR_MIPS_R4000 = 4000,
PROCESSOR_ALPHA_21064 = 21064,
PROCESSOR_PPC_601 = 601,
PROCESSOR_PPC_603 = 603,
PROCESSOR_PPC_604 = 604,
PROCESSOR_PPC_620 = 620,
PROCESSOR_HITACHI_SH3 = 10003,
PROCESSOR_HITACHI_SH3E = 10004,
PROCESSOR_HITACHI_SH4 = 10005,
PROCESSOR_MOTOROLA_821 = 821,
PROCESSOR_SHx_SH3 = 103,
PROCESSOR_SHx_SH4 = 104,
PROCESSOR_STRONGARM = 2577,
PROCESSOR_ARM720 = 1824,
PROCESSOR_ARM820 = 2080,
PROCESSOR_ARM920 = 2336,
PROCESSOR_ARM_7TDMI = 70001,
PROCESSOR_OPTIL = 0x494f,
}
enum {
PROCESSOR_ARCHITECTURE_INTEL = 0,
PROCESSOR_ARCHITECTURE_MIPS = 1,
PROCESSOR_ARCHITECTURE_ALPHA = 2,
PROCESSOR_ARCHITECTURE_PPC = 3,
PROCESSOR_ARCHITECTURE_SHX = 4,
PROCESSOR_ARCHITECTURE_ARM = 5,
PROCESSOR_ARCHITECTURE_IA64 = 6,
PROCESSOR_ARCHITECTURE_ALPHA64 = 7,
PROCESSOR_ARCHITECTURE_MSIL = 8,
PROCESSOR_ARCHITECTURE_AMD64 = 9,
PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 = 10,
PROCESSOR_ARCHITECTURE_UNKNOWN = 0xFFFF,
}
enum {
PF_FLOATING_POINT_PRECISION_ERRATA = 0,
PF_FLOATING_POINT_EMULATED = 1,
PF_COMPARE_EXCHANGE_DOUBLE = 2,
PF_MMX_INSTRUCTIONS_AVAILABLE = 3,
PF_PPC_MOVEMEM_64BIT_OK = 4,
PF_ALPHA_BYTE_INSTRUCTIONS = 5,
PF_XMMI_INSTRUCTIONS_AVAILABLE = 6,
PF_3DNOW_INSTRUCTIONS_AVAILABLE = 7,
PF_RDTSC_INSTRUCTION_AVAILABLE = 8,
PF_PAE_ENABLED = 9,
PF_XMMI64_INSTRUCTIONS_AVAILABLE = 10,
PF_SSE_DAZ_MODE_AVAILABLE = 11,
PF_NX_ENABLED = 12,
PF_SSE3_INSTRUCTIONS_AVAILABLE = 13,
PF_COMPARE_EXCHANGE128 = 14,
PF_COMPARE64_EXCHANGE128 = 15,
PF_CHANNELS_ENABLED = 16,
PF_XSAVE_ENABLED = 17,
}
enum {
XSTATE_LEGACY_FLOATING_POINT = 0,
XSTATE_LEGACY_SSE = 1,
XSTATE_GSSE = 2,
}
enum {
XSTATE_MASK_LEGACY_FLOATING_POINT = 1L << XSTATE_LEGACY_FLOATING_POINT,
XSTATE_MASK_LEGACY_SSE = 1L << XSTATE_LEGACY_SSE,
XSTATE_MASK_LEGACY = XSTATE_MASK_LEGACY_FLOATING_POINT | XSTATE_MASK_LEGACY_SSE,
XSTATE_MASK_GSSE = 1L << XSTATE_GSSE,
}
enum MAXIMUM_XSTATE_FEATURES = 64;
struct XSTATE_FEATURE {
DWORD Offset;
DWORD Size;
}
alias XSTATE_FEATURE* PXSTATE_FEATURE;
struct XSTATE_CONFIGURATION {
DWORD64 EnabledFeatures;
DWORD Size;
DWORD OptimizedSave1;
XSTATE_FEATURE[MAXIMUM_XSTATE_FEATURES] Features;
}
alias XSTATE_CONFIGURATION* PXSTATE_CONFIGURATION;
struct MEMORY_BASIC_INFORMATION {
PVOID BaseAddress;
PVOID AllocationBase;
DWORD AllocationProtect;
SIZE_T RegionSize;
DWORD State;
DWORD Protect;
DWORD Type;
}
alias MEMORY_BASIC_INFORMATION* PMEMORY_BASIC_INFORMATION;
struct MEMORY_BASIC_INFORMATION32 {
DWORD BaseAddress;
DWORD AllocationBase;
DWORD AllocationProtect;
DWORD RegionSize;
DWORD State;
DWORD Protect;
DWORD Type;
}
alias MEMORY_BASIC_INFORMATION32* PMEMORY_BASIC_INFORMATION32;
align(16)
struct MEMORY_BASIC_INFORMATION64 {
ULONGLONG BaseAddress;
ULONGLONG AllocationBase;
DWORD AllocationProtect;
DWORD __alignment1;
ULONGLONG RegionSize;
DWORD State;
DWORD Protect;
DWORD Type;
DWORD __alignment2;
}
alias MEMORY_BASIC_INFORMATION64* PMEMORY_BASIC_INFORMATION64;
enum {
SECTION_QUERY = 0x0001,
SECTION_MAP_WRITE = 0x0002,
SECTION_MAP_READ = 0x0004,
SECTION_MAP_EXECUTE = 0x0008,
SECTION_EXTEND_SIZE = 0x0010,
SECTION_MAP_EXECUTE_EXPLICIT = 0x0020,
SECTION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY| SECTION_MAP_WRITE | SECTION_MAP_READ | SECTION_MAP_EXECUTE | SECTION_EXTEND_SIZE,
SESSION_QUERY_ACCESS = 0x0001,
SESSION_MODIFY_ACCESS = 0x0002,
SESSION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SESSION_QUERY_ACCESS | SESSION_MODIFY_ACCESS,
}
enum {
PAGE_NOACCESS = 0x01,
PAGE_READONLY = 0x02,
PAGE_READWRITE = 0x04,
PAGE_WRITECOPY = 0x08,
PAGE_EXECUTE = 0x10,
PAGE_EXECUTE_READ = 0x20,
PAGE_EXECUTE_READWRITE = 0x40,
PAGE_EXECUTE_WRITECOPY = 0x80,
PAGE_GUARD = 0x100,
PAGE_NOCACHE = 0x200,
PAGE_WRITECOMBINE = 0x400,
MEM_COMMIT = 0x1000,
MEM_RESERVE = 0x2000,
MEM_DECOMMIT = 0x4000,
MEM_RELEASE = 0x8000,
MEM_FREE = 0x10000,
MEM_PRIVATE = 0x20000,
MEM_MAPPED = 0x40000,
MEM_RESET = 0x80000,
MEM_TOP_DOWN = 0x100000,
MEM_WRITE_WATCH = 0x200000,
MEM_PHYSICAL = 0x400000,
MEM_ROTATE = 0x800000,
MEM_LARGE_PAGES = 0x20000000,
MEM_4MB_PAGES = 0x80000000,
SEC_FILE = 0x800000,
SEC_IMAGE = 0x1000000,
SEC_PROTECTED_IMAGE = 0x2000000,
SEC_RESERVE = 0x4000000,
SEC_COMMIT = 0x8000000,
SEC_NOCACHE = 0x10000000,
SEC_WRITECOMBINE = 0x40000000,
SEC_LARGE_PAGES = 0x80000000,
MEM_IMAGE = SEC_IMAGE,
WRITE_WATCH_FLAG_RESET = 0x01,
}
enum {
FILE_READ_DATA = 0x0001,
FILE_LIST_DIRECTORY = 0x0001,
FILE_WRITE_DATA = 0x0002,
FILE_ADD_FILE = 0x0002,
FILE_APPEND_DATA = 0x0004,
FILE_ADD_SUBDIRECTORY = 0x0004,
FILE_CREATE_PIPE_INSTANCE = 0x0004,
FILE_READ_EA = 0x0008,
FILE_WRITE_EA = 0x0010,
FILE_EXECUTE = 0x0020,
FILE_TRAVERSE = 0x0020,
FILE_DELETE_CHILD = 0x0040,
FILE_READ_ATTRIBUTES = 0x0080,
FILE_WRITE_ATTRIBUTES = 0x0100,
FILE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF,
FILE_GENERIC_READ = STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE,
FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE,
FILE_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE,
}
enum {
FILE_SHARE_READ = 0x00000001,
FILE_SHARE_WRITE = 0x00000002,
FILE_SHARE_DELETE = 0x00000004,
FILE_ATTRIBUTE_READONLY = 0x00000001,
FILE_ATTRIBUTE_HIDDEN = 0x00000002,
FILE_ATTRIBUTE_SYSTEM = 0x00000004,
FILE_ATTRIBUTE_DIRECTORY = 0x00000010,
FILE_ATTRIBUTE_ARCHIVE = 0x00000020,
FILE_ATTRIBUTE_DEVICE = 0x00000040,
FILE_ATTRIBUTE_NORMAL = 0x00000080,
FILE_ATTRIBUTE_TEMPORARY = 0x00000100,
FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200,
FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400,
FILE_ATTRIBUTE_COMPRESSED = 0x00000800,
FILE_ATTRIBUTE_OFFLINE = 0x00001000,
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000,
FILE_ATTRIBUTE_ENCRYPTED = 0x00004000,
FILE_ATTRIBUTE_VIRTUAL = 0x00010000,
FILE_NOTIFY_CHANGE_FILE_NAME = 0x00000001,
FILE_NOTIFY_CHANGE_DIR_NAME = 0x00000002,
FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x00000004,
FILE_NOTIFY_CHANGE_SIZE = 0x00000008,
FILE_NOTIFY_CHANGE_LAST_WRITE = 0x00000010,
FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x00000020,
FILE_NOTIFY_CHANGE_CREATION = 0x00000040,
FILE_NOTIFY_CHANGE_SECURITY = 0x00000100,
FILE_ACTION_ADDED = 0x00000001,
FILE_ACTION_REMOVED = 0x00000002,
FILE_ACTION_MODIFIED = 0x00000003,
FILE_ACTION_RENAMED_OLD_NAME = 0x00000004,
FILE_ACTION_RENAMED_NEW_NAME = 0x00000005,
MAILSLOT_NO_MESSAGE = cast(DWORD)-1,
MAILSLOT_WAIT_FOREVER = cast(DWORD)-1,
FILE_CASE_SENSITIVE_SEARCH = 0x00000001,
FILE_CASE_PRESERVED_NAMES = 0x00000002,
FILE_UNICODE_ON_DISK = 0x00000004,
FILE_PERSISTENT_ACLS = 0x00000008,
FILE_FILE_COMPRESSION = 0x00000010,
FILE_VOLUME_QUOTAS = 0x00000020,
FILE_SUPPORTS_SPARSE_FILES = 0x00000040,
FILE_SUPPORTS_REPARSE_POINTS = 0x00000080,
FILE_SUPPORTS_REMOTE_STORAGE = 0x00000100,
FILE_VOLUME_IS_COMPRESSED = 0x00008000,
FILE_SUPPORTS_OBJECT_IDS = 0x00010000,
FILE_SUPPORTS_ENCRYPTION = 0x00020000,
FILE_NAMED_STREAMS = 0x00040000,
FILE_READ_ONLY_VOLUME = 0x00080000,
FILE_SEQUENTIAL_WRITE_ONCE = 0x00100000,
FILE_SUPPORTS_TRANSACTIONS = 0x00200000,
FILE_SUPPORTS_HARD_LINKS = 0x00400000,
FILE_SUPPORTS_EXTENDED_ATTRIBUTES = 0x00800000,
FILE_SUPPORTS_OPEN_BY_FILE_ID = 0x01000000,
FILE_SUPPORTS_USN_JOURNAL = 0x02000000,
}
struct FILE_NOTIFY_INFORMATION {
DWORD NextEntryOffset;
DWORD Action;
DWORD FileNameLength;
WCHAR[1] FileName;
}
alias FILE_NOTIFY_INFORMATION* PFILE_NOTIFY_INFORMATION;
union FILE_SEGMENT_ELEMENT {
PVOID64 Buffer;
ULONGLONG Alignment;
}
alias FILE_SEGMENT_ELEMENT* PFILE_SEGMENT_ELEMENT;
struct REPARSE_GUID_DATA_BUFFER {
DWORD ReparseTag;
WORD ReparseDataLength;
WORD Reserved;
GUID ReparseGuid;
struct {
BYTE[1] DataBuffer;
}
}
alias REPARSE_GUID_DATA_BUFFER* PREPARSE_GUID_DATA_BUFFER;
enum REPARSE_GUID_DATA_BUFFER_HEADER_SIZE = REPARSE_GUID_DATA_BUFFER.DataBuffer.offsetof;
enum MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024;
enum {
IO_REPARSE_TAG_RESERVED_ZERO = 0,
IO_REPARSE_TAG_RESERVED_ONE = 1,
}
enum IO_REPARSE_TAG_RESERVED_RANGE = IO_REPARSE_TAG_RESERVED_ONE;
pure nothrow
uint IsReparseTagMicrosoft(uint _tag)
{
return _tag & 0x80000000;
}
pure nothrow
uint IsReparseTagNameSurrogate(uint _tag)
{
return _tag & 0x20000000;
}
enum {
IO_REPARSE_TAG_MOUNT_POINT = 0xA0000003,
IO_REPARSE_TAG_HSM = 0xC0000004,
IO_REPARSE_TAG_HSM2 = 0x80000006,
IO_REPARSE_TAG_SIS = 0x80000007,
IO_REPARSE_TAG_WIM = 0x80000008,
IO_REPARSE_TAG_CSV = 0x80000009,
IO_REPARSE_TAG_DFS = 0x8000000A,
IO_REPARSE_TAG_SYMLINK = 0xA000000C,
IO_REPARSE_TAG_DFSR = 0x80000012,
}
enum {
IO_COMPLETION_MODIFY_STATE = 0x0002,
IO_COMPLETION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3,
}
enum {
DUPLICATE_CLOSE_SOURCE = 0x00000001,
DUPLICATE_SAME_ACCESS = 0x00000002,
}
mixin DEFINE_GUID!("GUID_MAX_POWER_SAVINGS", 0xA1841308, 0x3541, 0x4FAB, 0xBC, 0x81, 0xF7, 0x15, 0x56, 0xF2, 0x0B, 0x4A);
mixin DEFINE_GUID!("GUID_MIN_POWER_SAVINGS", 0x8C5E7FDA, 0xE8BF, 0x4A96, 0x9A, 0x85, 0xA6, 0xE2, 0x3A, 0x8C, 0x63, 0x5C);
mixin DEFINE_GUID!("GUID_TYPICAL_POWER_SAVINGS", 0x381B4222, 0xF694, 0x41F0, 0x96, 0x85, 0xFF, 0x5B, 0xB2, 0x60, 0xDF, 0x2E);
mixin DEFINE_GUID!("NO_SUBGROUP_GUID", 0xFEA3413E, 0x7E05, 0x4911, 0x9A, 0x71, 0x70, 0x03, 0x31, 0xF1, 0xC2, 0x94);
mixin DEFINE_GUID!("ALL_POWERSCHEMES_GUID", 0x68A1E95E, 0x13EA, 0x41E1, 0x80, 0x11, 0x0C, 0x49, 0x6C, 0xA4, 0x90, 0xB0);
mixin DEFINE_GUID!("GUID_POWERSCHEME_PERSONALITY", 0x245D8541, 0x3943, 0x4422, 0xB0, 0x25, 0x13, 0xA7, 0x84, 0xF6, 0x79, 0xB7);
mixin DEFINE_GUID!("GUID_ACTIVE_POWERSCHEME", 0x31F9F286, 0x5084, 0x42FE, 0xB7, 0x20, 0x2B, 0x02, 0x64, 0x99, 0x37, 0x63);
mixin DEFINE_GUID!("GUID_VIDEO_SUBGROUP", 0x7516B95F, 0xF776, 0x4464, 0x8C, 0x53, 0x06, 0x16, 0x7F, 0x40, 0xCC, 0x99);
mixin DEFINE_GUID!("GUID_VIDEO_POWERDOWN_TIMEOUT", 0x3C0BC021, 0xC8A8, 0x4E07, 0xA9, 0x73, 0x6B, 0x14, 0xCB, 0xCB, 0x2B, 0x7E);
mixin DEFINE_GUID!("GUID_VIDEO_ANNOYANCE_TIMEOUT", 0x82DBCF2D, 0xCD67, 0x40C5, 0xBF, 0xDC, 0x9F, 0x1A, 0x5C, 0xCD, 0x46, 0x63);
mixin DEFINE_GUID!("GUID_VIDEO_ADAPTIVE_PERCENT_INCREASE", 0xEED904DF, 0xB142, 0x4183, 0xB1, 0x0B, 0x5A, 0x11, 0x97, 0xA3, 0x78, 0x64);
mixin DEFINE_GUID!("GUID_VIDEO_DIM_TIMEOUT", 0x17aaa29b, 0x8b43, 0x4b94, 0xaa, 0xfe, 0x35, 0xf6, 0x4d, 0xaa, 0xf1, 0xee);
mixin DEFINE_GUID!("GUID_VIDEO_ADAPTIVE_POWERDOWN", 0x90959D22, 0xD6A1, 0x49B9, 0xAF, 0x93, 0xBC, 0xE8, 0x85, 0xAD, 0x33, 0x5B);
mixin DEFINE_GUID!("GUID_MONITOR_POWER_ON", 0x02731015, 0x4510, 0x4526, 0x99, 0xE6, 0xE5, 0xA1, 0x7E, 0xBD, 0x1A, 0xEA);
mixin DEFINE_GUID!("GUID_DEVICE_POWER_POLICY_VIDEO_BRIGHTNESS", 0xaded5e82L, 0xb909, 0x4619, 0x99, 0x49, 0xf5, 0xd7, 0x1d, 0xac, 0x0b, 0xcb);
mixin DEFINE_GUID!("GUID_DEVICE_POWER_POLICY_VIDEO_DIM_BRIGHTNESS", 0xf1fbfde2, 0xa960, 0x4165, 0x9f, 0x88, 0x50, 0x66, 0x79, 0x11, 0xce, 0x96);
mixin DEFINE_GUID!("GUID_VIDEO_CURRENT_MONITOR_BRIGHTNESS", 0x8ffee2c6, 0x2d01, 0x46be, 0xad, 0xb9, 0x39, 0x8a, 0xdd, 0xc5, 0xb4, 0xff);
mixin DEFINE_GUID!("GUID_VIDEO_ADAPTIVE_DISPLAY_BRIGHTNESS", 0xFBD9AA66, 0x9553, 0x4097, 0xBA, 0x44, 0xED, 0x6E, 0x9D, 0x65, 0xEA, 0xB8);
mixin DEFINE_GUID!("GUID_SESSION_DISPLAY_STATE", 0x73A5E93A, 0x5BB1, 0x4F93, 0x89, 0x5B, 0xDB, 0xD0, 0xDA, 0x85, 0x59, 0x67);
mixin DEFINE_GUID!("GUID_CONSOLE_DISPLAY_STATE", 0x6fe69556, 0x704a, 0x47a0, 0x8f, 0x24, 0xc2, 0x8d, 0x93, 0x6f, 0xda, 0x47);
mixin DEFINE_GUID!("GUID_ALLOW_DISPLAY_REQUIRED", 0xA9CEB8DA, 0xCD46, 0x44FB, 0xA9, 0x8B, 0x02, 0xAF, 0x69, 0xDE, 0x46, 0x23);
mixin DEFINE_GUID!("GUID_DISK_SUBGROUP", 0x0012EE47, 0x9041, 0x4B5D, 0x9B, 0x77, 0x53, 0x5F, 0xBA, 0x8B, 0x14, 0x42);
mixin DEFINE_GUID!("GUID_DISK_POWERDOWN_TIMEOUT", 0x6738E2C4, 0xE8A5, 0x4A42, 0xB1, 0x6A, 0xE0, 0x40, 0xE7, 0x69, 0x75, 0x6E);
mixin DEFINE_GUID!("GUID_DISK_BURST_IGNORE_THRESHOLD", 0x80e3c60e, 0xbb94, 0x4ad8, 0xbb, 0xe0, 0x0d, 0x31, 0x95, 0xef, 0xc6, 0x63);
mixin DEFINE_GUID!("GUID_DISK_ADAPTIVE_POWERDOWN", 0x396A32E1, 0x499A, 0x40B2, 0x91, 0x24, 0xA9, 0x6A, 0xFE, 0x70, 0x76, 0x67);
mixin DEFINE_GUID!("GUID_SLEEP_SUBGROUP", 0x238C9FA8, 0x0AAD, 0x41ED, 0x83, 0xF4, 0x97, 0xBE, 0x24, 0x2C, 0x8F, 0x20);
mixin DEFINE_GUID!("GUID_SLEEP_IDLE_THRESHOLD", 0x81cd32e0, 0x7833, 0x44f3, 0x87, 0x37, 0x70, 0x81, 0xf3, 0x8d, 0x1f, 0x70);
mixin DEFINE_GUID!("GUID_STANDBY_TIMEOUT", 0x29F6C1DB, 0x86DA, 0x48C5, 0x9F, 0xDB, 0xF2, 0xB6, 0x7B, 0x1F, 0x44, 0xDA);
mixin DEFINE_GUID!("GUID_UNATTEND_SLEEP_TIMEOUT", 0x7bc4a2f9, 0xd8fc, 0x4469, 0xb0, 0x7b, 0x33, 0xeb, 0x78, 0x5a, 0xac, 0xa0);
mixin DEFINE_GUID!("GUID_HIBERNATE_TIMEOUT", 0x9D7815A6, 0x7EE4, 0x497E, 0x88, 0x88, 0x51, 0x5A, 0x05, 0xF0, 0x23, 0x64);
mixin DEFINE_GUID!("GUID_HIBERNATE_FASTS4_POLICY", 0x94AC6D29, 0x73CE, 0x41A6, 0x80, 0x9F, 0x63, 0x63, 0xBA, 0x21, 0xB4, 0x7E);
mixin DEFINE_GUID!("GUID_CRITICAL_POWER_TRANSITION", 0xB7A27025, 0xE569, 0x46c2, 0xA5, 0x04, 0x2B, 0x96, 0xCA, 0xD2, 0x25, 0xA1);
mixin DEFINE_GUID!("GUID_SYSTEM_AWAYMODE", 0x98A7F580, 0x01F7, 0x48AA, 0x9C, 0x0F, 0x44, 0x35, 0x2C, 0x29, 0xE5, 0xC0);
mixin DEFINE_GUID!("GUID_ALLOW_AWAYMODE", 0x25dfa149, 0x5dd1, 0x4736, 0xb5, 0xab, 0xe8, 0xa3, 0x7b, 0x5b, 0x81, 0x87);
mixin DEFINE_GUID!("GUID_ALLOW_STANDBY_STATES", 0xabfc2519, 0x3608, 0x4c2a, 0x94, 0xea, 0x17, 0x1b, 0x0e, 0xd5, 0x46, 0xab);
mixin DEFINE_GUID!("GUID_ALLOW_RTC_WAKE", 0xBD3B718A, 0x0680, 0x4D9D, 0x8A, 0xB2, 0xE1, 0xD2, 0xB4, 0xAC, 0x80, 0x6D);
mixin DEFINE_GUID!("GUID_ALLOW_SYSTEM_REQUIRED", 0xA4B195F5, 0x8225, 0x47D8, 0x80, 0x12, 0x9D, 0x41, 0x36, 0x97, 0x86, 0xE2);
mixin DEFINE_GUID!("GUID_SYSTEM_BUTTON_SUBGROUP", 0x4F971E89, 0xEEBD, 0x4455, 0xA8, 0xDE, 0x9E, 0x59, 0x04, 0x0E, 0x73, 0x47);
mixin DEFINE_GUID!("GUID_POWERBUTTON_ACTION", 0x7648EFA3, 0xDD9C, 0x4E3E, 0xB5, 0x66, 0x50, 0xF9, 0x29, 0x38, 0x62, 0x80);
mixin DEFINE_GUID!("GUID_POWERBUTTON_ACTION_FLAGS", 0x857E7FAC, 0x034B, 0x4704, 0xAB, 0xB1, 0xBC, 0xA5, 0x4A, 0xA3, 0x14, 0x78);
mixin DEFINE_GUID!("GUID_SLEEPBUTTON_ACTION", 0x96996BC0, 0xAD50, 0x47EC, 0x92, 0x3B, 0x6F, 0x41, 0x87, 0x4D, 0xD9, 0xEB);
mixin DEFINE_GUID!("GUID_SLEEPBUTTON_ACTION_FLAGS", 0x2A160AB1, 0xB69D, 0x4743, 0xB7, 0x18, 0xBF, 0x14, 0x41, 0xD5, 0xE4, 0x93);
mixin DEFINE_GUID!("GUID_USERINTERFACEBUTTON_ACTION", 0xA7066653, 0x8D6C, 0x40A8, 0x91, 0x0E, 0xA1, 0xF5, 0x4B, 0x84, 0xC7, 0xE5);
mixin DEFINE_GUID!("GUID_LIDCLOSE_ACTION", 0x5CA83367, 0x6E45, 0x459F, 0xA2, 0x7B, 0x47, 0x6B, 0x1D, 0x01, 0xC9, 0x36);
mixin DEFINE_GUID!("GUID_LIDCLOSE_ACTION_FLAGS", 0x97E969AC, 0x0D6C, 0x4D08, 0x92, 0x7C, 0xD7, 0xBD, 0x7A, 0xD7, 0x85, 0x7B);
mixin DEFINE_GUID!("GUID_LIDOPEN_POWERSTATE", 0x99FF10E7, 0x23B1, 0x4C07, 0xA9, 0xD1, 0x5C, 0x32, 0x06, 0xD7, 0x41, 0xB4);
mixin DEFINE_GUID!("GUID_BATTERY_SUBGROUP", 0xE73A048D, 0xBF27, 0x4F12, 0x97, 0x31, 0x8B, 0x20, 0x76, 0xE8, 0x89, 0x1F);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_ACTION_0", 0x637EA02F, 0xBBCB, 0x4015, 0x8E, 0x2C, 0xA1, 0xC7, 0xB9, 0xC0, 0xB5, 0x46);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_LEVEL_0", 0x9A66D8D7, 0x4FF7, 0x4EF9, 0xB5, 0xA2, 0x5A, 0x32, 0x6C, 0xA2, 0xA4, 0x69);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_FLAGS_0", 0x5dbb7c9f, 0x38e9, 0x40d2, 0x97, 0x49, 0x4f, 0x8a, 0x0e, 0x9f, 0x64, 0x0f);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_ACTION_1", 0xD8742DCB, 0x3E6A, 0x4B3C, 0xB3, 0xFE, 0x37, 0x46, 0x23, 0xCD, 0xCF, 0x06);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_LEVEL_1", 0x8183BA9A, 0xE910, 0x48DA, 0x87, 0x69, 0x14, 0xAE, 0x6D, 0xC1, 0x17, 0x0A);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_FLAGS_1", 0xbcded951, 0x187b, 0x4d05, 0xbc, 0xcc, 0xf7, 0xe5, 0x19, 0x60, 0xc2, 0x58);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_ACTION_2", 0x421CBA38, 0x1A8E, 0x4881, 0xAC, 0x89, 0xE3, 0x3A, 0x8B, 0x04, 0xEC, 0xE4);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_LEVEL_2", 0x07A07CA2, 0xADAF, 0x40D7, 0xB0, 0x77, 0x53, 0x3A, 0xAD, 0xED, 0x1B, 0xFA);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_FLAGS_2", 0x7fd2f0c4, 0xfeb7, 0x4da3, 0x81, 0x17, 0xe3, 0xfb, 0xed, 0xc4, 0x65, 0x82);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_ACTION_3", 0x80472613, 0x9780, 0x455E, 0xB3, 0x08, 0x72, 0xD3, 0x00, 0x3C, 0xF2, 0xF8);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_LEVEL_3", 0x58AFD5A6, 0xC2DD, 0x47D2, 0x9F, 0xBF, 0xEF, 0x70, 0xCC, 0x5C, 0x59, 0x65);
mixin DEFINE_GUID!("GUID_BATTERY_DISCHARGE_FLAGS_3", 0x73613ccf, 0xdbfa, 0x4279, 0x83, 0x56, 0x49, 0x35, 0xf6, 0xbf, 0x62, 0xf3);
mixin DEFINE_GUID!("GUID_PROCESSOR_SETTINGS_SUBGROUP", 0x54533251, 0x82BE, 0x4824, 0x96, 0xC1, 0x47, 0xB6, 0x0B, 0x74, 0x0D, 0x00);
mixin DEFINE_GUID!("GUID_PROCESSOR_THROTTLE_POLICY", 0x57027304, 0x4AF6, 0x4104, 0x92, 0x60, 0xE3, 0xD9, 0x52, 0x48, 0xFC, 0x36);
enum {
PERFSTATE_POLICY_CHANGE_IDEAL = 0,
PERFSTATE_POLICY_CHANGE_SINGLE = 1,
PERFSTATE_POLICY_CHANGE_ROCKET = 2,
PERFSTATE_POLICY_CHANGE_MAX = PERFSTATE_POLICY_CHANGE_ROCKET,
}
mixin DEFINE_GUID!("GUID_PROCESSOR_THROTTLE_MAXIMUM", 0xBC5038F7, 0x23E0, 0x4960, 0x96, 0xDA, 0x33, 0xAB, 0xAF, 0x59, 0x35, 0xEC);
mixin DEFINE_GUID!("GUID_PROCESSOR_THROTTLE_MINIMUM", 0x893DEE8E, 0x2BEF, 0x41E0, 0x89, 0xC6, 0xB5, 0x5D, 0x09, 0x29, 0x96, 0x4C);
mixin DEFINE_GUID!("GUID_PROCESSOR_ALLOW_THROTTLING", 0x3b04d4fd, 0x1cc7, 0x4f23, 0xab, 0x1c, 0xd1, 0x33, 0x78, 0x19, 0xc4, 0xbb);
mixin DEFINE_GUID!("GUID_PROCESSOR_IDLESTATE_POLICY", 0x68f262a7, 0xf621, 0x4069, 0xb9, 0xa5, 0x48, 0x74, 0x16, 0x9b, 0xe2, 0x3c);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERFSTATE_POLICY", 0xBBDC3814, 0x18E9, 0x4463, 0x8A, 0x55, 0xD1, 0x97, 0x32, 0x7C, 0x45, 0xC0);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_INCREASE_THRESHOLD", 0x06cadf0e, 0x64ed, 0x448a, 0x89, 0x27, 0xce, 0x7b, 0xf9, 0x0e, 0xb3, 0x5d);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_DECREASE_THRESHOLD", 0x12a0ab44, 0xfe28, 0x4fa9, 0xb3, 0xbd, 0x4b, 0x64, 0xf4, 0x49, 0x60, 0xa6);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_INCREASE_POLICY", 0x465e1f50, 0xb610, 0x473a, 0xab, 0x58, 0x0, 0xd1, 0x7, 0x7d, 0xc4, 0x18);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_DECREASE_POLICY", 0x40fbefc7, 0x2e9d, 0x4d25, 0xa1, 0x85, 0xc, 0xfd, 0x85, 0x74, 0xba, 0xc6);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_INCREASE_TIME", 0x984cf492, 0x3bed, 0x4488, 0xa8, 0xf9, 0x42, 0x86, 0xc9, 0x7b, 0xf5, 0xaa);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_DECREASE_TIME", 0xd8edeb9b, 0x95cf, 0x4f95, 0xa7, 0x3c, 0xb0, 0x61, 0x97, 0x36, 0x93, 0xc8);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_TIME_CHECK", 0x4d2b0152, 0x7d5c, 0x498b, 0x88, 0xe2, 0x34, 0x34, 0x53, 0x92, 0xa2, 0xc5);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_BOOST_POLICY", 0x45bcc044, 0xd885, 0x43e2, 0x86, 0x5, 0xee, 0xe, 0xc6, 0xe9, 0x6b, 0x59);
enum {
PROCESSOR_PERF_BOOST_POLICY_DISABLED = 0,
PROCESSOR_PERF_BOOST_POLICY_MAX = 100,
}
mixin DEFINE_GUID!("GUID_PROCESSOR_IDLE_ALLOW_SCALING", 0x6c2993b0, 0x8f48, 0x481f, 0xbc, 0xc6, 0x0, 0xdd, 0x27, 0x42, 0xaa, 0x6);
mixin DEFINE_GUID!("GUID_PROCESSOR_IDLE_DISABLE", 0x5d76a2ca, 0xe8c0, 0x402f, 0xa1, 0x33, 0x21, 0x58, 0x49, 0x2d, 0x58, 0xad);
mixin DEFINE_GUID!("GUID_PROCESSOR_IDLE_TIME_CHECK", 0xc4581c31, 0x89ab, 0x4597, 0x8e, 0x2b, 0x9c, 0x9c, 0xab, 0x44, 0xe, 0x6b);
mixin DEFINE_GUID!("GUID_PROCESSOR_IDLE_DEMOTE_THRESHOLD", 0x4b92d758, 0x5a24, 0x4851, 0xa4, 0x70, 0x81, 0x5d, 0x78, 0xae, 0xe1, 0x19);
mixin DEFINE_GUID!("GUID_PROCESSOR_IDLE_PROMOTE_THRESHOLD", 0x7b224883, 0xb3cc, 0x4d79, 0x81, 0x9f, 0x83, 0x74, 0x15, 0x2c, 0xbe, 0x7c);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_INCREASE_THRESHOLD", 0xdf142941, 0x20f3, 0x4edf, 0x9a, 0x4a, 0x9c, 0x83, 0xd3, 0xd7, 0x17, 0xd1);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_DECREASE_THRESHOLD", 0x68dd2f27, 0xa4ce, 0x4e11, 0x84, 0x87, 0x37, 0x94, 0xe4, 0x13, 0x5d, 0xfa);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_INCREASE_POLICY", 0xc7be0679, 0x2817, 0x4d69, 0x9d, 0x02, 0x51, 0x9a, 0x53, 0x7e, 0xd0, 0xc6);
enum {
CORE_PARKING_POLICY_CHANGE_IDEAL = 0,
CORE_PARKING_POLICY_CHANGE_SINGLE = 1,
CORE_PARKING_POLICY_CHANGE_ROCKET = 2,
CORE_PARKING_POLICY_CHANGE_MAX = CORE_PARKING_POLICY_CHANGE_ROCKET,
}
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_DECREASE_POLICY", 0x71021b41, 0xc749, 0x4d21, 0xbe, 0x74, 0xa0, 0x0f, 0x33, 0x5d, 0x58, 0x2b);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_MAX_CORES", 0xea062031, 0x0e34, 0x4ff1, 0x9b, 0x6d, 0xeb, 0x10, 0x59, 0x33, 0x40, 0x28);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_MIN_CORES", 0x0cc5b647, 0xc1df, 0x4637, 0x89, 0x1a, 0xde, 0xc3, 0x5c, 0x31, 0x85, 0x83);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_INCREASE_TIME", 0x2ddd5a84, 0x5a71, 0x437e, 0x91, 0x2a, 0xdb, 0x0b, 0x8c, 0x78, 0x87, 0x32);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_DECREASE_TIME", 0xdfd10d17, 0xd5eb, 0x45dd, 0x87, 0x7a, 0x9a, 0x34, 0xdd, 0xd1, 0x5c, 0x82);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_DECREASE_FACTOR", 0x8f7b45e3, 0xc393, 0x480a, 0x87, 0x8c, 0xf6, 0x7a, 0xc3, 0xd0, 0x70, 0x82);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_THRESHOLD", 0x5b33697b, 0xe89d, 0x4d38, 0xaa, 0x46, 0x9e, 0x7d, 0xfb, 0x7c, 0xd2, 0xf9);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_AFFINITY_WEIGHTING", 0xe70867f1, 0xfa2f, 0x4f4e, 0xae, 0xa1, 0x4d, 0x8a, 0x0b, 0xa2, 0x3b, 0x20);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_DECREASE_FACTOR", 0x1299023c, 0xbc28, 0x4f0a, 0x81, 0xec, 0xd3, 0x29, 0x5a, 0x8d, 0x81, 0x5d);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_THRESHOLD", 0x9ac18e92, 0xaa3c, 0x4e27, 0xb3, 0x07, 0x01, 0xae, 0x37, 0x30, 0x71, 0x29);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_WEIGHTING", 0x8809c2d8, 0xb155, 0x42d4, 0xbc, 0xda, 0x0d, 0x34, 0x56, 0x51, 0xb1, 0xdb);
mixin DEFINE_GUID!("GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_THRESHOLD", 0x943c8cb6, 0x6f93, 0x4227, 0xad, 0x87, 0xe9, 0xa3, 0xfe, 0xec, 0x08, 0xd1);
mixin DEFINE_GUID!("GUID_PROCESSOR_PARKING_CORE_OVERRIDE", 0xa55612aa, 0xf624, 0x42c6, 0xa4, 0x43, 0x73, 0x97, 0xd0, 0x64, 0xc0, 0x4f);
mixin DEFINE_GUID!("GUID_PROCESSOR_PARKING_PERF_STATE", 0x447235c7, 0x6a8d, 0x4cc0, 0x8e, 0x24, 0x9e, 0xaf, 0x70, 0xb9, 0x6e, 0x2b);
mixin DEFINE_GUID!("GUID_PROCESSOR_PERF_HISTORY", 0x7d24baa7, 0x0b84, 0x480f, 0x84, 0x0c, 0x1b, 0x07, 0x43, 0xc0, 0x0f, 0x5f);
mixin DEFINE_GUID!("GUID_SYSTEM_COOLING_POLICY", 0x94D3A615, 0xA899, 0x4AC5, 0xAE, 0x2B, 0xE4, 0xD8, 0xF6, 0x34, 0x36, 0x7F);
mixin DEFINE_GUID!("GUID_LOCK_CONSOLE_ON_WAKE", 0x0E796BDB, 0x100D, 0x47D6, 0xA2, 0xD5, 0xF7, 0xD2, 0xDA, 0xA5, 0x1F, 0x51);
mixin DEFINE_GUID!("GUID_DEVICE_IDLE_POLICY", 0x4faab71a, 0x92e5, 0x4726, 0xb5, 0x31, 0x22, 0x45, 0x59, 0x67, 0x2d, 0x19);
enum {
POWER_DEVICE_IDLE_POLICY_PERFORMANCE = 0,
POWER_DEVICE_IDLE_POLICY_CONSERVATIVE = 1,
}
mixin DEFINE_GUID!("GUID_ACDC_POWER_SOURCE", 0x5D3E9A59, 0xE9D5, 0x4B00, 0xA6, 0xBD, 0xFF, 0x34, 0xFF, 0x51, 0x65, 0x48);
mixin DEFINE_GUID!("GUID_LIDSWITCH_STATE_CHANGE", 0xBA3E0F4D, 0xB817, 0x4094, 0xA2, 0xD1, 0xD5, 0x63, 0x79, 0xE6, 0xA0, 0xF3);
mixin DEFINE_GUID!("GUID_BATTERY_PERCENTAGE_REMAINING", 0xA7AD8041, 0xB45A, 0x4CAE, 0x87, 0xA3, 0xEE, 0xCB, 0xB4, 0x68, 0xA9, 0xE1);
mixin DEFINE_GUID!("GUID_IDLE_BACKGROUND_TASK", 0x515C31D8, 0xF734, 0x163D, 0xA0, 0xFD, 0x11, 0xA0, 0x8C, 0x91, 0xE8, 0xF1);
mixin DEFINE_GUID!("GUID_BACKGROUND_TASK_NOTIFICATION", 0xCF23F240, 0x2A54, 0x48D8, 0xB1, 0x14, 0xDE, 0x15, 0x18, 0xFF, 0x05, 0x2E);
mixin DEFINE_GUID!("GUID_APPLAUNCH_BUTTON", 0x1A689231, 0x7399, 0x4E9A, 0x8F, 0x99, 0xB7, 0x1F, 0x99, 0x9D, 0xB3, 0xFA);
mixin DEFINE_GUID!(" GUID_PCIEXPRESS_SETTINGS_SUBGROUP", 0x501a4d13, 0x42af,0x4429, 0x9f, 0xd1, 0xa8, 0x21, 0x8c, 0x26, 0x8e, 0x20);
mixin DEFINE_GUID!("GUID_PCIEXPRESS_ASPM_POLICY", 0xee12f906, 0xd277, 0x404b, 0xb6, 0xda, 0xe5, 0xfa, 0x1a, 0x57, 0x6d, 0xf5);
mixin DEFINE_GUID!("GUID_ENABLE_SWITCH_FORCED_SHUTDOWN", 0x833a6b62, 0xdfa4, 0x46d1, 0x82, 0xf8, 0xe0, 0x9e, 0x34, 0xd0, 0x29, 0xd6);
enum {
PowerSystemUnspecified = 0,
PowerSystemWorking = 1,
PowerSystemSleeping1 = 2,
PowerSystemSleeping2 = 3,
PowerSystemSleeping3 = 4,
PowerSystemHibernate = 5,
PowerSystemShutdown = 6,
PowerSystemMaximum = 7
}
alias int SYSTEM_POWER_STATE;
alias SYSTEM_POWER_STATE* PSYSTEM_POWER_STATE;
enum POWER_SYSTEM_MAXIMUM = 7;
enum {
PowerActionNone = 0,
PowerActionReserved,
PowerActionSleep,
PowerActionHibernate,
PowerActionShutdown,
PowerActionShutdownReset,
PowerActionShutdownOff,
PowerActionWarmEject
}
alias int POWER_ACTION;
alias POWER_ACTION* PPOWER_ACTION;
enum {
PowerDeviceUnspecified = 0,
PowerDeviceD0,
PowerDeviceD1,
PowerDeviceD2,
PowerDeviceD3,
PowerDeviceMaximum
}
alias int DEVICE_POWER_STATE;
alias DEVICE_POWER_STATE* PDEVICE_POWER_STATE;
enum {
PowerMonitorOff = 0,
PowerMonitorOn,
PowerMonitorDim
}
alias int MONITOR_DISPLAY_STATE;
alias MONITOR_DISPLAY_STATE* PMONITOR_DISPLAY_STATE;
enum {
ES_SYSTEM_REQUIRED = 0x00000001,
ES_DISPLAY_REQUIRED = 0x00000002,
ES_USER_PRESENT = 0x00000004,
ES_AWAYMODE_REQUIRED = 0x00000040,
ES_CONTINUOUS = 0x80000000,
}
alias DWORD EXECUTION_STATE;
alias EXECUTION_STATE* PEXECUTION_STATE;
enum {
LT_DONT_CARE,
LT_LOWEST_LATENCY
}
alias int LATENCY_TIME;
//(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
enum {
DIAGNOSTIC_REASON_VERSION = 0,
DIAGNOSTIC_REASON_SIMPLE_STRING = 0x00000001,
DIAGNOSTIC_REASON_DETAILED_STRING = 0x00000002,
DIAGNOSTIC_REASON_NOT_SPECIFIED = 0x80000000,
DIAGNOSTIC_REASON_INVALID_FLAGS = ~0x80000003,
}
enum {
POWER_REQUEST_CONTEXT_VERSION = 0,
POWER_REQUEST_CONTEXT_SIMPLE_STRING = 0x00000001,
POWER_REQUEST_CONTEXT_DETAILED_STRING = 0x00000002,
}
enum {
PowerRequestDisplayRequired,
PowerRequestSystemRequired,
PowerRequestAwayModeRequired
}
alias int POWER_REQUEST_TYPE;
alias POWER_REQUEST_TYPE* PPOWER_REQUEST_TYPE;
enum PowerRequestMaximum = 3;
//(NTDDI_VERSION >= NTDDI_WINXP)
enum {
PDCAP_D0_SUPPORTED = 0x00000001,
PDCAP_D1_SUPPORTED = 0x00000002,
PDCAP_D2_SUPPORTED = 0x00000004,
PDCAP_D3_SUPPORTED = 0x00000008,
PDCAP_WAKE_FROM_D0_SUPPORTED = 0x00000010,
PDCAP_WAKE_FROM_D1_SUPPORTED = 0x00000020,
PDCAP_WAKE_FROM_D2_SUPPORTED = 0x00000040,
PDCAP_WAKE_FROM_D3_SUPPORTED = 0x00000080,
PDCAP_WARM_EJECT_SUPPORTED = 0x00000100,
}
struct CM_POWER_DATA {
DWORD PD_Size;
DEVICE_POWER_STATE PD_MostRecentPowerState;
DWORD PD_Capabilities;
DWORD PD_D1Latency;
DWORD PD_D2Latency;
DWORD PD_D3Latency;
DEVICE_POWER_STATE[POWER_SYSTEM_MAXIMUM] PD_PowerStateMapping;
SYSTEM_POWER_STATE PD_DeepestSystemWake;
}
alias CM_POWER_DATA* PCM_POWER_DATA;
enum {
SystemPowerPolicyAc,
SystemPowerPolicyDc,
VerifySystemPolicyAc,
VerifySystemPolicyDc,
SystemPowerCapabilities,
SystemBatteryState,
SystemPowerStateHandler,
ProcessorStateHandler,
SystemPowerPolicyCurrent,
AdministratorPowerPolicy,
SystemReserveHiberFile,
ProcessorInformation,
SystemPowerInformation,
ProcessorStateHandler2,
LastWakeTime,
LastSleepTime,
SystemExecutionState,
SystemPowerStateNotifyHandler,
ProcessorPowerPolicyAc,
ProcessorPowerPolicyDc,
VerifyProcessorPowerPolicyAc,
VerifyProcessorPowerPolicyDc,
ProcessorPowerPolicyCurrent,
SystemPowerStateLogging,
SystemPowerLoggingEntry,
SetPowerSettingValue,
NotifyUserPowerSetting,
PowerInformationLevelUnused0,
PowerInformationLevelUnused1,
SystemVideoState,
TraceApplicationPowerMessage,
TraceApplicationPowerMessageEnd,
ProcessorPerfStates,
ProcessorIdleStates,
ProcessorCap,
SystemWakeSource,
SystemHiberFileInformation,
TraceServicePowerMessage,
ProcessorLoad,
PowerShutdownNotification,
MonitorCapabilities,
SessionPowerInit,
SessionDisplayState,
PowerRequestCreate,
PowerRequestAction,
GetPowerRequestList,
ProcessorInformationEx,
NotifyUserModeLegacyPowerEvent,
GroupPark,
ProcessorIdleDomains,
WakeTimerList,
SystemHiberFileSize,
PowerInformationLevelMaximum
}
alias int POWER_INFORMATION_LEVEL;
enum {
PoAc,
PoDc,
PoHot,
PoConditionMaximum
}
alias int SYSTEM_POWER_CONDITION;
struct SET_POWER_SETTING_VALUE {
DWORD Version;
GUID Guid;
SYSTEM_POWER_CONDITION PowerCondition;
DWORD DataLength;
BYTE[ANYSIZE_ARRAY] Data;
}
alias SET_POWER_SETTING_VALUE* PSET_POWER_SETTING_VALUE;
enum POWER_SETTING_VALUE_VERSION = 0x1;
struct NOTIFY_USER_POWER_SETTING {
GUID Guid;
}
alias NOTIFY_USER_POWER_SETTING* PNOTIFY_USER_POWER_SETTING;
struct APPLICATIONLAUNCH_SETTING_VALUE {
LARGE_INTEGER ActivationTime;
DWORD Flags;
DWORD ButtonInstanceID;
}
alias APPLICATIONLAUNCH_SETTING_VALUE* PAPPLICATIONLAUNCH_SETTING_VALUE;
enum {
PlatformRoleUnspecified = 0,
PlatformRoleDesktop,
PlatformRoleMobile,
PlatformRoleWorkstation,
PlatformRoleEnterpriseServer,
PlatformRoleSOHOServer,
PlatformRoleAppliancePC,
PlatformRolePerformanceServer,
PlatformRoleMaximum
}
alias int POWER_PLATFORM_ROLE;
//(NTDDI_VERSION >= NTDDI_WINXP)
struct BATTERY_REPORTING_SCALE {
DWORD Granularity;
DWORD Capacity;
}
alias BATTERY_REPORTING_SCALE* PBATTERY_REPORTING_SCALE;
struct PPM_WMI_LEGACY_PERFSTATE {
DWORD Frequency;
DWORD Flags;
DWORD PercentFrequency;
}
alias PPM_WMI_LEGACY_PERFSTATE* PPPM_WMI_LEGACY_PERFSTATE;
struct PPM_WMI_IDLE_STATE {
DWORD Latency;
DWORD Power;
DWORD TimeCheck;
BYTE PromotePercent;
BYTE DemotePercent;
BYTE StateType;
BYTE Reserved;
DWORD StateFlags;
DWORD Context;
DWORD IdleHandler;
DWORD Reserved1;
}
alias PPM_WMI_IDLE_STATE* PPPM_WMI_IDLE_STATE;
struct PPM_WMI_IDLE_STATES {
DWORD Type;
DWORD Count;
DWORD TargetState;
DWORD OldState;
DWORD64 TargetProcessors;
PPM_WMI_IDLE_STATE[ANYSIZE_ARRAY] State;
}
alias PPM_WMI_IDLE_STATES* PPPM_WMI_IDLE_STATES;
struct PPM_WMI_IDLE_STATES_EX {
DWORD Type;
DWORD Count;
DWORD TargetState;
DWORD OldState;
PVOID TargetProcessors;
PPM_WMI_IDLE_STATE[ANYSIZE_ARRAY] State;
}
alias PPM_WMI_IDLE_STATES_EX* PPPM_WMI_IDLE_STATES_EX;
struct PPM_WMI_PERF_STATE {
DWORD Frequency;
DWORD Power;
BYTE PercentFrequency;
BYTE IncreaseLevel;
BYTE DecreaseLevel;
BYTE Type;
DWORD IncreaseTime;
DWORD DecreaseTime;
DWORD64 Control;
DWORD64 Status;
DWORD HitCount;
DWORD Reserved1;
DWORD64 Reserved2;
DWORD64 Reserved3;
}
alias PPM_WMI_PERF_STATE* PPPM_WMI_PERF_STATE;
struct PPM_WMI_PERF_STATES {
DWORD Count;
DWORD MaxFrequency;
DWORD CurrentState;
DWORD MaxPerfState;
DWORD MinPerfState;
DWORD LowestPerfState;
DWORD ThermalConstraint;
BYTE BusyAdjThreshold;
BYTE PolicyType;
BYTE Type;
BYTE Reserved;
DWORD TimerInterval;
DWORD64 TargetProcessors;
DWORD PStateHandler;
DWORD PStateContext;
DWORD TStateHandler;
DWORD TStateContext;
DWORD FeedbackHandler;
DWORD Reserved1;
DWORD64 Reserved2;
PPM_WMI_PERF_STATE[ANYSIZE_ARRAY] State;
}
alias PPM_WMI_PERF_STATES* PPPM_WMI_PERF_STATES;
struct PPM_WMI_PERF_STATES_EX {
DWORD Count;
DWORD MaxFrequency;
DWORD CurrentState;
DWORD MaxPerfState;
DWORD MinPerfState;
DWORD LowestPerfState;
DWORD ThermalConstraint;
BYTE BusyAdjThreshold;
BYTE PolicyType;
BYTE Type;
BYTE Reserved;
DWORD TimerInterval;
PVOID TargetProcessors;
DWORD PStateHandler;
DWORD PStateContext;
DWORD TStateHandler;
DWORD TStateContext;
DWORD FeedbackHandler;
DWORD Reserved1;
DWORD64 Reserved2;
PPM_WMI_PERF_STATE[ANYSIZE_ARRAY] State;
}
alias PPM_WMI_PERF_STATES_EX* PPPM_WMI_PERF_STATES_EX;
enum PROC_IDLE_BUCKET_COUNT = 6;
struct PPM_IDLE_STATE_ACCOUNTING {
DWORD IdleTransitions;
DWORD FailedTransitions;
DWORD InvalidBucketIndex;
DWORD64 TotalTime;
DWORD[PROC_IDLE_BUCKET_COUNT] IdleTimeBuckets;
}
alias PPM_IDLE_STATE_ACCOUNTING* PPPM_IDLE_STATE_ACCOUNTING;
struct PPM_IDLE_ACCOUNTING {
DWORD StateCount;
DWORD TotalTransitions;
DWORD ResetCount;
DWORD64 StartTime;
PPM_IDLE_STATE_ACCOUNTING[ANYSIZE_ARRAY] State;
}
alias PPM_IDLE_ACCOUNTING* PPPM_IDLE_ACCOUNTING;
enum PROC_IDLE_BUCKET_COUNT_EX = 16;
struct PPM_IDLE_STATE_BUCKET_EX {
DWORD64 TotalTimeUs;
DWORD MinTimeUs;
DWORD MaxTimeUs;
DWORD Count;
}
alias PPM_IDLE_STATE_BUCKET_EX* PPPM_IDLE_STATE_BUCKET_EX;
struct PPM_IDLE_STATE_ACCOUNTING_EX {
DWORD64 TotalTime;
DWORD IdleTransitions;
DWORD FailedTransitions;
DWORD InvalidBucketIndex;
DWORD MinTimeUs;
DWORD MaxTimeUs;
PPM_IDLE_STATE_BUCKET_EX[PROC_IDLE_BUCKET_COUNT_EX] IdleTimeBuckets;
}
alias PPM_IDLE_STATE_ACCOUNTING_EX* PPPM_IDLE_STATE_ACCOUNTING_EX;
struct PPM_IDLE_ACCOUNTING_EX {
DWORD StateCount;
DWORD TotalTransitions;
DWORD ResetCount;
DWORD64 StartTime;
PPM_IDLE_STATE_ACCOUNTING_EX[ANYSIZE_ARRAY] State;
}
alias PPM_IDLE_ACCOUNTING_EX* PPPM_IDLE_ACCOUNTING_EX;
enum {
ACPI_PPM_SOFTWARE_ALL = 0xFC,
ACPI_PPM_SOFTWARE_ANY = 0xFD,
ACPI_PPM_HARDWARE_ALL = 0xFE,
}
enum {
MS_PPM_SOFTWARE_ALL = 0x1,
}
enum {
PPM_FIRMWARE_ACPI1C2 = 0x00000001,
PPM_FIRMWARE_ACPI1C3 = 0x00000002,
PPM_FIRMWARE_ACPI1TSTATES = 0x00000004,
PPM_FIRMWARE_CST = 0x00000008,
PPM_FIRMWARE_CSD = 0x00000010,
PPM_FIRMWARE_PCT = 0x00000020,
PPM_FIRMWARE_PSS = 0x00000040,
PPM_FIRMWARE_XPSS = 0x00000080,
PPM_FIRMWARE_PPC = 0x00000100,
PPM_FIRMWARE_PSD = 0x00000200,
PPM_FIRMWARE_PTC = 0x00000400,
PPM_FIRMWARE_TSS = 0x00000800,
PPM_FIRMWARE_TPC = 0x00001000,
PPM_FIRMWARE_TSD = 0x00002000,
PPM_FIRMWARE_PCCH = 0x00004000,
PPM_FIRMWARE_PCCP = 0x00008000,
}
mixin DEFINE_GUID!("PPM_PERFSTATE_CHANGE_GUID", 0xa5b32ddd, 0x7f39, 0x4abc, 0xb8, 0x92, 0x90, 0xe, 0x43, 0xb5, 0x9e, 0xbb);
mixin DEFINE_GUID!("PPM_PERFSTATE_DOMAIN_CHANGE_GUID", 0x995e6b7f, 0xd653, 0x497a, 0xb9, 0x78, 0x36, 0xa3, 0xc, 0x29, 0xbf, 0x1);
mixin DEFINE_GUID!("PPM_IDLESTATE_CHANGE_GUID", 0x4838fe4f, 0xf71c, 0x4e51, 0x9e, 0xcc, 0x84, 0x30, 0xa7, 0xac, 0x4c, 0x6c);
mixin DEFINE_GUID!("PPM_PERFSTATES_DATA_GUID", 0x5708cc20, 0x7d40, 0x4bf4, 0xb4, 0xaa, 0x2b, 0x01, 0x33, 0x8d, 0x01, 0x26);
mixin DEFINE_GUID!("PPM_IDLESTATES_DATA_GUID", 0xba138e10, 0xe250, 0x4ad7, 0x86, 0x16, 0xcf, 0x1a, 0x7a, 0xd4, 0x10, 0xe7);
mixin DEFINE_GUID!("PPM_IDLE_ACCOUNTING_GUID", 0xe2a26f78, 0xae07, 0x4ee0, 0xa3, 0x0f, 0xce, 0x54, 0xf5, 0x5a, 0x94, 0xcd);
mixin DEFINE_GUID!("PPM_IDLE_ACCOUNTING_EX_GUID", 0xd67abd39, 0x81f8, 0x4a5e, 0x81, 0x52, 0x72, 0xe3, 0x1e, 0xc9, 0x12, 0xee);
mixin DEFINE_GUID!("PPM_THERMALCONSTRAINT_GUID", 0xa852c2c8, 0x1a4c, 0x423b, 0x8c, 0x2c, 0xf3, 0x0d, 0x82, 0x93, 0x1a, 0x88);
mixin DEFINE_GUID!("PPM_PERFMON_PERFSTATE_GUID", 0x7fd18652, 0xcfe, 0x40d2, 0xb0, 0xa1, 0xb, 0x6, 0x6a, 0x87, 0x75, 0x9e);
mixin DEFINE_GUID!("PPM_THERMAL_POLICY_CHANGE_GUID", 0x48f377b8, 0x6880, 0x4c7b, 0x8b, 0xdc, 0x38, 0x1, 0x76, 0xc6, 0x65, 0x4d);
struct PPM_PERFSTATE_EVENT {
DWORD State;
DWORD Status;
DWORD Latency;
DWORD Speed;
DWORD Processor;
}
alias PPM_PERFSTATE_EVENT* PPPM_PERFSTATE_EVENT;
struct PPM_PERFSTATE_DOMAIN_EVENT {
DWORD State;
DWORD Latency;
DWORD Speed;
DWORD64 Processors;
}
alias PPM_PERFSTATE_DOMAIN_EVENT* PPPM_PERFSTATE_DOMAIN_EVENT;
struct PPM_IDLESTATE_EVENT {
DWORD NewState;
DWORD OldState;
DWORD64 Processors;
}
alias PPM_IDLESTATE_EVENT* PPPM_IDLESTATE_EVENT;
struct PPM_THERMALCHANGE_EVENT {
DWORD ThermalConstraint;
DWORD64 Processors;
}
alias PPM_THERMALCHANGE_EVENT* PPPM_THERMALCHANGE_EVENT;
struct PPM_THERMAL_POLICY_EVENT {
BYTE Mode;
DWORD64 Processors;
}
alias PPM_THERMAL_POLICY_EVENT* PPPM_THERMAL_POLICY_EVENT;
struct POWER_ACTION_POLICY {
POWER_ACTION Action;
DWORD Flags;
DWORD EventCode;
}
alias POWER_ACTION_POLICY* PPOWER_ACTION_POLICY;
enum {
POWER_ACTION_QUERY_ALLOWED = 0x00000001,
POWER_ACTION_UI_ALLOWED = 0x00000002,
POWER_ACTION_OVERRIDE_APPS = 0x00000004,
POWER_ACTION_PSEUDO_TRANSITION = 0x08000000,
POWER_ACTION_LIGHTEST_FIRST = 0x10000000,
POWER_ACTION_LOCK_CONSOLE = 0x20000000,
POWER_ACTION_DISABLE_WAKES = 0x40000000,
POWER_ACTION_CRITICAL = 0x80000000,
}
enum {
POWER_LEVEL_USER_NOTIFY_TEXT = 0x00000001,
POWER_LEVEL_USER_NOTIFY_SOUND = 0x00000002,
POWER_LEVEL_USER_NOTIFY_EXEC = 0x00000004,
POWER_USER_NOTIFY_BUTTON = 0x00000008,
POWER_USER_NOTIFY_SHUTDOWN = 0x00000010,
POWER_USER_NOTIFY_FORCED_SHUTDOWN = 0x00000020,
POWER_FORCE_TRIGGER_RESET = 0x80000000,
}
enum {
BATTERY_DISCHARGE_FLAGS_EVENTCODE_MASK = 0x00000007,
BATTERY_DISCHARGE_FLAGS_ENABLE = 0x80000000,
}
struct SYSTEM_POWER_LEVEL {
BOOLEAN Enable;
BYTE[3] Spare;
DWORD BatteryLevel;
POWER_ACTION_POLICY PowerPolicy;
SYSTEM_POWER_STATE MinSystemState;
}
alias SYSTEM_POWER_LEVEL* PSYSTEM_POWER_LEVEL;
enum {
NUM_DISCHARGE_POLICIES = 4,
DISCHARGE_POLICY_CRITICAL = 0,
DISCHARGE_POLICY_LOW = 1,
}
struct SYSTEM_POWER_POLICY {
DWORD Revision;
POWER_ACTION_POLICY PowerButton;
POWER_ACTION_POLICY SleepButton;
POWER_ACTION_POLICY LidClose;
SYSTEM_POWER_STATE LidOpenWake;
DWORD Reserved;
POWER_ACTION_POLICY Idle;
DWORD IdleTimeout;
BYTE IdleSensitivity;
BYTE DynamicThrottle;
BYTE[2] Spare2;
SYSTEM_POWER_STATE MinSleep;
SYSTEM_POWER_STATE MaxSleep;
SYSTEM_POWER_STATE ReducedLatencySleep;
DWORD WinLogonFlags;
DWORD Spare3;
DWORD DozeS4Timeout;
DWORD BroadcastCapacityResolution;
SYSTEM_POWER_LEVEL[NUM_DISCHARGE_POLICIES] DischargePolicy;
DWORD VideoTimeout;
BOOLEAN VideoDimDisplay;
DWORD[3] VideoReserved;
DWORD SpindownTimeout;
BOOLEAN OptimizeForPower;
BYTE FanThrottleTolerance;
BYTE ForcedThrottle;
BYTE MinThrottle;
POWER_ACTION_POLICY OverThrottled;
}
alias SYSTEM_POWER_POLICY* PSYSTEM_POWER_POLICY;
enum PROCESSOR_IDLESTATE_POLICY_COUNT = 0x3;
struct PROCESSOR_IDLESTATE_INFO {
DWORD TimeCheck;
BYTE DemotePercent;
BYTE PromotePercent;
BYTE[2] Spare;
}
alias PROCESSOR_IDLESTATE_INFO* PPROCESSOR_IDLESTATE_INFO;
struct PROCESSOR_IDLESTATE_POLICY {
WORD Revision;
union {
WORD AsWORD;
}
DWORD PolicyCount;
PROCESSOR_IDLESTATE_INFO[PROCESSOR_IDLESTATE_POLICY_COUNT] Policy;
}
alias PROCESSOR_IDLESTATE_POLICY* PPROCESSOR_IDLESTATE_POLICY;
enum {
PO_THROTTLE_NONE = 0,
PO_THROTTLE_CONSTANT = 1,
PO_THROTTLE_DEGRADE = 2,
PO_THROTTLE_ADAPTIVE = 3,
PO_THROTTLE_MAXIMUM = 4,
}
struct PROCESSOR_POWER_POLICY_INFO {
DWORD TimeCheck;
DWORD DemoteLimit;
DWORD PromoteLimit;
BYTE DemotePercent;
BYTE PromotePercent;
BYTE[2] Spare;
DWORD AllowDemotion1AllowPromotion1Reserved30;
}
alias PROCESSOR_POWER_POLICY_INFO* PPROCESSOR_POWER_POLICY_INFO;
struct PROCESSOR_POWER_POLICY {
DWORD Revision;
BYTE DynamicThrottle;
BYTE[3] Spare;
DWORD DisableCStates1Reserved31;
DWORD PolicyCount;
PROCESSOR_POWER_POLICY_INFO[3] Policy;
}
alias PROCESSOR_POWER_POLICY* PPROCESSOR_POWER_POLICY;
struct PROCESSOR_PERFSTATE_POLICY {
DWORD Revision;
BYTE MaxThrottle;
BYTE MinThrottle;
BYTE BusyAdjThreshold;
union {
BYTE Spare;
union {
BYTE AsBYTE;
struct {
BYTE NoDomainAccounting1IncreasePolicy2DecreasePolicy2Reserved3;
}
}
}
DWORD TimeCheck;
DWORD IncreaseTime;
DWORD DecreaseTime;
DWORD IncreasePercent;
DWORD DecreasePercent;
}
alias PROCESSOR_PERFSTATE_POLICY* PPROCESSOR_PERFSTATE_POLICY;
struct ADMINISTRATOR_POWER_POLICY {
SYSTEM_POWER_STATE MinSleep;
SYSTEM_POWER_STATE MaxSleep;
DWORD MinVideoTimeout;
DWORD MaxVideoTimeout;
DWORD MinSpindownTimeout;
DWORD MaxSpindownTimeout;
}
alias ADMINISTRATOR_POWER_POLICY* PADMINISTRATOR_POWER_POLICY;
struct SYSTEM_POWER_CAPABILITIES {
BOOLEAN PowerButtonPresent;
BOOLEAN SleepButtonPresent;
BOOLEAN LidPresent;
BOOLEAN SystemS1;
BOOLEAN SystemS2;
BOOLEAN SystemS3;
BOOLEAN SystemS4;
BOOLEAN SystemS5;
BOOLEAN HiberFilePresent;
BOOLEAN FullWake;
BOOLEAN VideoDimPresent;
BOOLEAN ApmPresent;
BOOLEAN UpsPresent;
BOOLEAN ThermalControl;
BOOLEAN ProcessorThrottle;
BYTE ProcessorMinThrottle;
BYTE ProcessorMaxThrottle;
BOOLEAN FastSystemS4;
BYTE[3] spare2;
BOOLEAN DiskSpinDown;
BYTE[8] spare3;
BOOLEAN SystemBatteriesPresent;
BOOLEAN BatteriesAreShortTerm;
BATTERY_REPORTING_SCALE[3] BatteryScale;
SYSTEM_POWER_STATE AcOnLineWake;
SYSTEM_POWER_STATE SoftLidWake;
SYSTEM_POWER_STATE RtcWake;
SYSTEM_POWER_STATE MinDeviceWakeState;
SYSTEM_POWER_STATE DefaultLowLatencyWake;
}
alias SYSTEM_POWER_CAPABILITIES* PSYSTEM_POWER_CAPABILITIES;
struct SYSTEM_BATTERY_STATE {
BOOLEAN AcOnLine;
BOOLEAN BatteryPresent;
BOOLEAN Charging;
BOOLEAN Discharging;
BOOLEAN[4] Spare1;
DWORD MaxCapacity;
DWORD RemainingCapacity;
DWORD Rate;
DWORD EstimatedTime;
DWORD DefaultAlert1;
DWORD DefaultAlert2;
}
alias SYSTEM_BATTERY_STATE* PSYSTEM_BATTERY_STATE;
align(4){
enum {
IMAGE_DOS_SIGNATURE = 0x5A4D,
IMAGE_OS2_SIGNATURE = 0x454E,
IMAGE_OS2_SIGNATURE_LE = 0x454C,
IMAGE_VXD_SIGNATURE = 0x454C,
IMAGE_NT_SIGNATURE = 0x00004550,
}
align(2){
struct IMAGE_DOS_HEADER {
WORD e_magic;
WORD e_cblp;
WORD e_cp;
WORD e_crlc;
WORD e_cparhdr;
WORD e_minalloc;
WORD e_maxalloc;
WORD e_ss;
WORD e_sp;
WORD e_csum;
WORD e_ip;
WORD e_cs;
WORD e_lfarlc;
WORD e_ovno;
WORD[4] e_res;
WORD e_oemid;
WORD e_oeminfo;
WORD[10] e_res2;
LONG e_lfanew;
}
alias IMAGE_DOS_HEADER* PIMAGE_DOS_HEADER;
struct IMAGE_OS2_HEADER {
WORD ne_magic;
CHAR ne_ver;
CHAR ne_rev;
WORD ne_enttab;
WORD ne_cbenttab;
LONG ne_crc;
WORD ne_flags;
WORD ne_autodata;
WORD ne_heap;
WORD ne_stack;
LONG ne_csip;
LONG ne_sssp;
WORD ne_cseg;
WORD ne_cmod;
WORD ne_cbnrestab;
WORD ne_segtab;
WORD ne_rsrctab;
WORD ne_restab;
WORD ne_modtab;
WORD ne_imptab;
LONG ne_nrestab;
WORD ne_cmovent;
WORD ne_align;
WORD ne_cres;
BYTE ne_exetyp;
BYTE ne_flagsothers;
WORD ne_pretthunks;
WORD ne_psegrefbytes;
WORD ne_swaparea;
WORD ne_expver;
}
alias IMAGE_OS2_HEADER* PIMAGE_OS2_HEADER;
struct IMAGE_VXD_HEADER {
WORD e32_magic;
BYTE e32_border;
BYTE e32_worder;
DWORD e32_level;
WORD e32_cpu;
WORD e32_os;
DWORD e32_ver;
DWORD e32_mflags;
DWORD e32_mpages;
DWORD e32_startobj;
DWORD e32_eip;
DWORD e32_stackobj;
DWORD e32_esp;
DWORD e32_pagesize;
DWORD e32_lastpagesize;
DWORD e32_fixupsize;
DWORD e32_fixupsum;
DWORD e32_ldrsize;
DWORD e32_ldrsum;
DWORD e32_objtab;
DWORD e32_objcnt;
DWORD e32_objmap;
DWORD e32_itermap;
DWORD e32_rsrctab;
DWORD e32_rsrccnt;
DWORD e32_restab;
DWORD e32_enttab;
DWORD e32_dirtab;
DWORD e32_dircnt;
DWORD e32_fpagetab;
DWORD e32_frectab;
DWORD e32_impmod;
DWORD e32_impmodcnt;
DWORD e32_impproc;
DWORD e32_pagesum;
DWORD e32_datapage;
DWORD e32_preload;
DWORD e32_nrestab;
DWORD e32_cbnrestab;
DWORD e32_nressum;
DWORD e32_autodata;
DWORD e32_debuginfo;
DWORD e32_debuglen;
DWORD e32_instpreload;
DWORD e32_instdemand;
DWORD e32_heapsize;
BYTE[12] e32_res3;
DWORD e32_winresoff;
DWORD e32_winreslen;
WORD e32_devid;
WORD e32_ddkver;
}
alias IMAGE_VXD_HEADER* PIMAGE_VXD_HEADER;
}
struct IMAGE_FILE_HEADER {
WORD Machine;
WORD NumberOfSections;
DWORD TimeDateStamp;
DWORD PointerToSymbolTable;
DWORD NumberOfSymbols;
WORD SizeOfOptionalHeader;
WORD Characteristics;
}
alias IMAGE_FILE_HEADER* PIMAGE_FILE_HEADER;
enum IMAGE_SIZEOF_FILE_HEADER = 20;
enum {
IMAGE_FILE_RELOCS_STRIPPED = 0x0001,
IMAGE_FILE_EXECUTABLE_IMAGE = 0x0002,
IMAGE_FILE_LINE_NUMS_STRIPPED = 0x0004,
IMAGE_FILE_LOCAL_SYMS_STRIPPED = 0x0008,
IMAGE_FILE_AGGRESIVE_WS_TRIM = 0x0010,
IMAGE_FILE_LARGE_ADDRESS_AWARE = 0x0020,
IMAGE_FILE_BYTES_REVERSED_LO = 0x0080,
IMAGE_FILE_32BIT_MACHINE = 0x0100,
IMAGE_FILE_DEBUG_STRIPPED = 0x0200,
IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 0x0400,
IMAGE_FILE_NET_RUN_FROM_SWAP = 0x0800,
IMAGE_FILE_SYSTEM = 0x1000,
IMAGE_FILE_DLL = 0x2000,
IMAGE_FILE_UP_SYSTEM_ONLY = 0x4000,
IMAGE_FILE_BYTES_REVERSED_HI = 0x8000,
IMAGE_FILE_MACHINE_UNKNOWN = 0,
IMAGE_FILE_MACHINE_I386 = 0x014c,
IMAGE_FILE_MACHINE_R3000 = 0x0162,
IMAGE_FILE_MACHINE_R4000 = 0x0166,
IMAGE_FILE_MACHINE_R10000 = 0x0168,
IMAGE_FILE_MACHINE_WCEMIPSV2 = 0x0169,
IMAGE_FILE_MACHINE_ALPHA = 0x0184,
IMAGE_FILE_MACHINE_SH3 = 0x01a2,
IMAGE_FILE_MACHINE_SH3DSP = 0x01a3,
IMAGE_FILE_MACHINE_SH3E = 0x01a4,
IMAGE_FILE_MACHINE_SH4 = 0x01a6,
IMAGE_FILE_MACHINE_SH5 = 0x01a8,
IMAGE_FILE_MACHINE_ARM = 0x01c0,
IMAGE_FILE_MACHINE_THUMB = 0x01c2,
IMAGE_FILE_MACHINE_AM33 = 0x01d3,
IMAGE_FILE_MACHINE_POWERPC = 0x01F0,
IMAGE_FILE_MACHINE_POWERPCFP = 0x01f1,
IMAGE_FILE_MACHINE_IA64 = 0x0200,
IMAGE_FILE_MACHINE_MIPS16 = 0x0266,
IMAGE_FILE_MACHINE_ALPHA64 = 0x0284,
IMAGE_FILE_MACHINE_MIPSFPU = 0x0366,
IMAGE_FILE_MACHINE_MIPSFPU16 = 0x0466,
IMAGE_FILE_MACHINE_AXP64 = IMAGE_FILE_MACHINE_ALPHA64,
IMAGE_FILE_MACHINE_TRICORE = 0x0520,
IMAGE_FILE_MACHINE_CEF = 0x0CEF,
IMAGE_FILE_MACHINE_EBC = 0x0EBC,
IMAGE_FILE_MACHINE_AMD64 = 0x8664,
IMAGE_FILE_MACHINE_M32R = 0x9041,
IMAGE_FILE_MACHINE_CEE = 0xC0EE,
}
struct IMAGE_DATA_DIRECTORY {
DWORD VirtualAddress;
DWORD Size;
}
alias IMAGE_DATA_DIRECTORY* PIMAGE_DATA_DIRECTORY;
enum IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16;
struct IMAGE_OPTIONAL_HEADER32 {
WORD Magic;
BYTE MajorLinkerVersion;
BYTE MinorLinkerVersion;
DWORD SizeOfCode;
DWORD SizeOfInitializedData;
DWORD SizeOfUninitializedData;
DWORD AddressOfEntryPoint;
DWORD BaseOfCode;
DWORD BaseOfData;
DWORD ImageBase;
DWORD SectionAlignment;
DWORD FileAlignment;
WORD MajorOperatingSystemVersion;
WORD MinorOperatingSystemVersion;
WORD MajorImageVersion;
WORD MinorImageVersion;
WORD MajorSubsystemVersion;
WORD MinorSubsystemVersion;
DWORD Win32VersionValue;
DWORD SizeOfImage;
DWORD SizeOfHeaders;
DWORD CheckSum;
WORD Subsystem;
WORD DllCharacteristics;
DWORD SizeOfStackReserve;
DWORD SizeOfStackCommit;
DWORD SizeOfHeapReserve;
DWORD SizeOfHeapCommit;
DWORD LoaderFlags;
DWORD NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] DataDirectory;
}
alias IMAGE_OPTIONAL_HEADER32* PIMAGE_OPTIONAL_HEADER32;
struct IMAGE_ROM_OPTIONAL_HEADER {
WORD Magic;
BYTE MajorLinkerVersion;
BYTE MinorLinkerVersion;
DWORD SizeOfCode;
DWORD SizeOfInitializedData;
DWORD SizeOfUninitializedData;
DWORD AddressOfEntryPoint;
DWORD BaseOfCode;
DWORD BaseOfData;
DWORD BaseOfBss;
DWORD GprMask;
DWORD[4] CprMask;
DWORD GpValue;
}
alias IMAGE_ROM_OPTIONAL_HEADER* PIMAGE_ROM_OPTIONAL_HEADER;
struct IMAGE_OPTIONAL_HEADER64 {
WORD Magic;
BYTE MajorLinkerVersion;
BYTE MinorLinkerVersion;
DWORD SizeOfCode;
DWORD SizeOfInitializedData;
DWORD SizeOfUninitializedData;
DWORD AddressOfEntryPoint;
DWORD BaseOfCode;
ULONGLONG ImageBase;
DWORD SectionAlignment;
DWORD FileAlignment;
WORD MajorOperatingSystemVersion;
WORD MinorOperatingSystemVersion;
WORD MajorImageVersion;
WORD MinorImageVersion;
WORD MajorSubsystemVersion;
WORD MinorSubsystemVersion;
DWORD Win32VersionValue;
DWORD SizeOfImage;
DWORD SizeOfHeaders;
DWORD CheckSum;
WORD Subsystem;
WORD DllCharacteristics;
ULONGLONG SizeOfStackReserve;
ULONGLONG SizeOfStackCommit;
ULONGLONG SizeOfHeapReserve;
ULONGLONG SizeOfHeapCommit;
DWORD LoaderFlags;
DWORD NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] DataDirectory;
}
alias IMAGE_OPTIONAL_HEADER64* PIMAGE_OPTIONAL_HEADER64;
enum {
IMAGE_NT_OPTIONAL_HDR32_MAGIC = 0x10b,
IMAGE_NT_OPTIONAL_HDR64_MAGIC = 0x20b,
IMAGE_ROM_OPTIONAL_HDR_MAGIC = 0x107,
}
version(Win64){
alias IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER;
alias PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER;
alias IMAGE_NT_OPTIONAL_HDR64_MAGIC IMAGE_NT_OPTIONAL_HDR_MAGIC;
}else{
alias IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER;
alias PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER;
alias IMAGE_NT_OPTIONAL_HDR32_MAGIC IMAGE_NT_OPTIONAL_HDR_MAGIC;
}
struct IMAGE_NT_HEADERS64 {
DWORD Signature;
IMAGE_FILE_HEADER FileHeader;
IMAGE_OPTIONAL_HEADER64 OptionalHeader;
}
alias IMAGE_NT_HEADERS64* PIMAGE_NT_HEADERS64;
struct IMAGE_NT_HEADERS32 {
DWORD Signature;
IMAGE_FILE_HEADER FileHeader;
IMAGE_OPTIONAL_HEADER32 OptionalHeader;
}
alias IMAGE_NT_HEADERS32* PIMAGE_NT_HEADERS32;
struct IMAGE_ROM_HEADERS {
IMAGE_FILE_HEADER FileHeader;
IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
}
alias IMAGE_ROM_HEADERS* PIMAGE_ROM_HEADERS;
version(Win64){
alias IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS;
alias PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS;
}else{
alias IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS;
alias PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS;
}
PIMAGE_SECTION_HEADER IMAGE_FIRST_SECTION(IMAGE_NT_HEADERS* ntheader)
{
return cast(PIMAGE_SECTION_HEADER)((cast(ULONG_PTR)ntheader + IMAGE_NT_HEADERS.OptionalHeader.offsetof) + ntheader.FileHeader.SizeOfOptionalHeader);
}
enum {
IMAGE_SUBSYSTEM_UNKNOWN = 0,
IMAGE_SUBSYSTEM_NATIVE = 1,
IMAGE_SUBSYSTEM_WINDOWS_GUI = 2,
IMAGE_SUBSYSTEM_WINDOWS_CUI = 3,
IMAGE_SUBSYSTEM_OS2_CUI = 5,
IMAGE_SUBSYSTEM_POSIX_CUI = 7,
IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8,
IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9,
IMAGE_SUBSYSTEM_EFI_APPLICATION = 10,
IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11,
IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12,
IMAGE_SUBSYSTEM_EFI_ROM = 13,
IMAGE_SUBSYSTEM_XBOX = 14,
IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16,
}
enum {
//IMAGE_LIBRARY_PROCESS_INIT = 0x0001,
//IMAGE_LIBRARY_PROCESS_TERM = 0x0002,
//IMAGE_LIBRARY_THREAD_INIT = 0x0004,
//IMAGE_LIBRARY_THREAD_TERM = 0x0008,
IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE = 0x0040,
IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY = 0x0080,
IMAGE_DLLCHARACTERISTICS_NX_COMPAT = 0x0100,
IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = 0x0200,
IMAGE_DLLCHARACTERISTICS_NO_SEH = 0x0400,
IMAGE_DLLCHARACTERISTICS_NO_BIND = 0x0800,
// = 0x1000,
IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 0x2000,
// = 0x4000,
IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 0x8000,
}
enum {
IMAGE_DIRECTORY_ENTRY_EXPORT = 0,
IMAGE_DIRECTORY_ENTRY_IMPORT = 1,
IMAGE_DIRECTORY_ENTRY_RESOURCE = 2,
IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3,
IMAGE_DIRECTORY_ENTRY_SECURITY = 4,
IMAGE_DIRECTORY_ENTRY_BASERELOC = 5,
IMAGE_DIRECTORY_ENTRY_DEBUG = 6,
//IMAGE_DIRECTORY_ENTRY_COPYRIGHT = 7,
IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7,
IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8,
IMAGE_DIRECTORY_ENTRY_TLS = 9,
IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10,
IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11,
IMAGE_DIRECTORY_ENTRY_IAT = 12,
IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13,
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14,
}
struct ANON_OBJECT_HEADER {
WORD Sig1;
WORD Sig2;
WORD Version;
WORD Machine;
DWORD TimeDateStamp;
CLSID ClassID;
DWORD SizeOfData;
}
struct ANON_OBJECT_HEADER_V2 {
WORD Sig1;
WORD Sig2;
WORD Version;
WORD Machine;
DWORD TimeDateStamp;
CLSID ClassID;
DWORD SizeOfData;
DWORD Flags;
DWORD MetaDataSize;
DWORD MetaDataOffset;
}
struct ANON_OBJECT_HEADER_BIGOBJ {
WORD Sig1;
WORD Sig2;
WORD Version;
WORD Machine;
DWORD TimeDateStamp;
CLSID ClassID;
DWORD SizeOfData;
DWORD Flags;
DWORD MetaDataSize;
DWORD MetaDataOffset;
DWORD NumberOfSections;
DWORD PointerToSymbolTable;
DWORD NumberOfSymbols;
}
enum IMAGE_SIZEOF_SHORT_NAME = 8;
struct IMAGE_SECTION_HEADER {
BYTE[IMAGE_SIZEOF_SHORT_NAME] Name;
union {
DWORD PhysicalAddress;
DWORD VirtualSize;
}
DWORD VirtualAddress;
DWORD SizeOfRawData;
DWORD PointerToRawData;
DWORD PointerToRelocations;
DWORD PointerToLinenumbers;
WORD NumberOfRelocations;
WORD NumberOfLinenumbers;
DWORD Characteristics;
}
alias IMAGE_SECTION_HEADER* PIMAGE_SECTION_HEADER;
enum IMAGE_SIZEOF_SECTION_HEADER = 40;
enum {
//IMAGE_SCN_TYPE_REG = 0x00000000,
//IMAGE_SCN_TYPE_DSECT = 0x00000001,
//IMAGE_SCN_TYPE_NOLOAD = 0x00000002,
//IMAGE_SCN_TYPE_GROUP = 0x00000004,
IMAGE_SCN_TYPE_NO_PAD = 0x00000008,
//IMAGE_SCN_TYPE_COPY = 0x00000010,
IMAGE_SCN_CNT_CODE = 0x00000020,
IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040,
IMAGE_SCN_CNT_UNINITIALIZED_DATA = 0x00000080,
IMAGE_SCN_LNK_OTHER = 0x00000100,
IMAGE_SCN_LNK_INFO = 0x00000200,
//IMAGE_SCN_TYPE_OVER = 0x00000400,
IMAGE_SCN_LNK_REMOVE = 0x00000800,
IMAGE_SCN_LNK_COMDAT = 0x00001000,
// = 0x00002000,
//IMAGE_SCN_MEM_PROTECTED = 0x00004000,
IMAGE_SCN_NO_DEFER_SPEC_EXC = 0x00004000,
IMAGE_SCN_GPREL = 0x00008000,
IMAGE_SCN_MEM_FARDATA = 0x00008000,
//IMAGE_SCN_MEM_SYSHEAP = 0x00010000,
IMAGE_SCN_MEM_PURGEABLE = 0x00020000,
IMAGE_SCN_MEM_16BIT = 0x00020000,
IMAGE_SCN_MEM_LOCKED = 0x00040000,
IMAGE_SCN_MEM_PRELOAD = 0x00080000,
IMAGE_SCN_ALIGN_1BYTES = 0x00100000,
IMAGE_SCN_ALIGN_2BYTES = 0x00200000,
IMAGE_SCN_ALIGN_4BYTES = 0x00300000,
IMAGE_SCN_ALIGN_8BYTES = 0x00400000,
IMAGE_SCN_ALIGN_16BYTES = 0x00500000,
IMAGE_SCN_ALIGN_32BYTES = 0x00600000,
IMAGE_SCN_ALIGN_64BYTES = 0x00700000,
IMAGE_SCN_ALIGN_128BYTES = 0x00800000,
IMAGE_SCN_ALIGN_256BYTES = 0x00900000,
IMAGE_SCN_ALIGN_512BYTES = 0x00A00000,
IMAGE_SCN_ALIGN_1024BYTES = 0x00B00000,
IMAGE_SCN_ALIGN_2048BYTES = 0x00C00000,
IMAGE_SCN_ALIGN_4096BYTES = 0x00D00000,
IMAGE_SCN_ALIGN_8192BYTES = 0x00E00000,
// = 0x00F00000,
IMAGE_SCN_ALIGN_MASK = 0x00F00000,
IMAGE_SCN_LNK_NRELOC_OVFL = 0x01000000,
IMAGE_SCN_MEM_DISCARDABLE = 0x02000000,
IMAGE_SCN_MEM_NOT_CACHED = 0x04000000,
IMAGE_SCN_MEM_NOT_PAGED = 0x08000000,
IMAGE_SCN_MEM_SHARED = 0x10000000,
IMAGE_SCN_MEM_EXECUTE = 0x20000000,
IMAGE_SCN_MEM_READ = 0x40000000,
IMAGE_SCN_MEM_WRITE = 0x80000000,
}
enum IMAGE_SCN_SCALE_INDEX = 0x00000001;
align(2){
struct IMAGE_SYMBOL {
union {
BYTE[8] ShortName;
struct {
DWORD Short;
DWORD Long;
}
DWORD[2] LongName;
}
DWORD Value;
SHORT SectionNumber;
WORD Type;
BYTE StorageClass;
BYTE NumberOfAuxSymbols;
}
alias IMAGE_SYMBOL* PIMAGE_SYMBOL;
enum IMAGE_SIZEOF_SYMBOL = 18;
struct IMAGE_SYMBOL_EX {
union {
BYTE[8] ShortName;
struct {
DWORD Short;
DWORD Long;
}
DWORD[2] LongName;
}
DWORD Value;
LONG SectionNumber;
WORD Type;
BYTE StorageClass;
BYTE NumberOfAuxSymbols;
}
alias IMAGE_SYMBOL_EX* PIMAGE_SYMBOL_EX;
enum {
IMAGE_SYM_UNDEFINED = cast(SHORT)0,
IMAGE_SYM_ABSOLUTE = cast(SHORT)-1,
IMAGE_SYM_DEBUG = cast(SHORT)-2,
IMAGE_SYM_SECTION_MAX = 0xFEFF,
IMAGE_SYM_SECTION_MAX_EX = MAXLONG,
}
enum {
IMAGE_SYM_TYPE_NULL = 0x0000,
IMAGE_SYM_TYPE_VOID = 0x0001,
IMAGE_SYM_TYPE_CHAR = 0x0002,
IMAGE_SYM_TYPE_SHORT = 0x0003,
IMAGE_SYM_TYPE_INT = 0x0004,
IMAGE_SYM_TYPE_LONG = 0x0005,
IMAGE_SYM_TYPE_FLOAT = 0x0006,
IMAGE_SYM_TYPE_DOUBLE = 0x0007,
IMAGE_SYM_TYPE_STRUCT = 0x0008,
IMAGE_SYM_TYPE_UNION = 0x0009,
IMAGE_SYM_TYPE_ENUM = 0x000A,
IMAGE_SYM_TYPE_MOE = 0x000B,
IMAGE_SYM_TYPE_BYTE = 0x000C,
IMAGE_SYM_TYPE_WORD = 0x000D,
IMAGE_SYM_TYPE_UINT = 0x000E,
IMAGE_SYM_TYPE_DWORD = 0x000F,
IMAGE_SYM_TYPE_PCODE = 0x8000,
}
enum {
IMAGE_SYM_DTYPE_NULL = 0,
IMAGE_SYM_DTYPE_POINTER = 1,
IMAGE_SYM_DTYPE_FUNCTION = 2,
IMAGE_SYM_DTYPE_ARRAY = 3,
}
enum {
IMAGE_SYM_CLASS_END_OF_FUNCTION = cast(BYTE)-1,
IMAGE_SYM_CLASS_NULL = 0x0000,
IMAGE_SYM_CLASS_AUTOMATIC = 0x0001,
IMAGE_SYM_CLASS_EXTERNAL = 0x0002,
IMAGE_SYM_CLASS_STATIC = 0x0003,
IMAGE_SYM_CLASS_REGISTER = 0x0004,
IMAGE_SYM_CLASS_EXTERNAL_DEF = 0x0005,
IMAGE_SYM_CLASS_LABEL = 0x0006,
IMAGE_SYM_CLASS_UNDEFINED_LABEL = 0x0007,
IMAGE_SYM_CLASS_MEMBER_OF_STRUCT = 0x0008,
IMAGE_SYM_CLASS_ARGUMENT = 0x0009,
IMAGE_SYM_CLASS_STRUCT_TAG = 0x000A,
IMAGE_SYM_CLASS_MEMBER_OF_UNION = 0x000B,
IMAGE_SYM_CLASS_UNION_TAG = 0x000C,
IMAGE_SYM_CLASS_TYPE_DEFINITION = 0x000D,
IMAGE_SYM_CLASS_UNDEFINED_STATIC = 0x000E,
IMAGE_SYM_CLASS_ENUM_TAG = 0x000F,
IMAGE_SYM_CLASS_MEMBER_OF_ENUM = 0x0010,
IMAGE_SYM_CLASS_REGISTER_PARAM = 0x0011,
IMAGE_SYM_CLASS_BIT_FIELD = 0x0012,
IMAGE_SYM_CLASS_FAR_EXTERNAL = 0x0044,
IMAGE_SYM_CLASS_BLOCK = 0x0064,
IMAGE_SYM_CLASS_FUNCTION = 0x0065,
IMAGE_SYM_CLASS_END_OF_STRUCT = 0x0066,
IMAGE_SYM_CLASS_FILE = 0x0067,
IMAGE_SYM_CLASS_SECTION = 0x0068,
IMAGE_SYM_CLASS_WEAK_EXTERNAL = 0x0069,
IMAGE_SYM_CLASS_CLR_TOKEN = 0x006B,
}
enum {
N_BTMASK = 0x000F,
N_TMASK = 0x0030,
N_TMASK1 = 0x00C0,
N_TMASK2 = 0x00F0,
N_BTSHFT = 4,
N_TSHIFT = 2,
}
pure nothrow
ushort BTYPE(ushort x)
{
return x & N_BTMASK;
}
pure nothrow
bool ISPTR(ushort x)
{
return (x & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT);
}
pure nothrow
bool ISFCN(ushort x)
{
return (x & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT);
}
pure nothrow
bool ISARY(ushort x)
{
return (x & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT);
}
pure nothrow
bool ISTAG(ushort x)
{
return (x == IMAGE_SYM_CLASS_STRUCT_TAG || x == IMAGE_SYM_CLASS_UNION_TAG || x == IMAGE_SYM_CLASS_ENUM_TAG);
}
//#define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
//#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
align(2){
struct IMAGE_AUX_SYMBOL_TOKEN_DEF {
BYTE bAuxType;
BYTE bReserved;
DWORD SymbolTableIndex;
BYTE[12] rgbReserved;
}
alias IMAGE_AUX_SYMBOL_TOKEN_DEF* PIMAGE_AUX_SYMBOL_TOKEN_DEF;
}
union IMAGE_AUX_SYMBOL {
struct {
DWORD TagIndex;
union {
struct {
WORD Linenumber;
WORD Size;
}
DWORD TotalSize;
}
union {
struct {
DWORD PointerToLinenumber;
DWORD PointerToNextFunction;
}
struct {
WORD[4] Dimension;
}
}
WORD TvIndex;
}
struct {
BYTE[IMAGE_SIZEOF_SYMBOL] Name;
}
struct {
DWORD Length;
WORD NumberOfRelocations;
WORD NumberOfLinenumbers;
DWORD CheckSum;
SHORT Number;
BYTE Selection;
BYTE bReserved;
SHORT HighNumber;
}
IMAGE_AUX_SYMBOL_TOKEN_DEF TokenDef;
struct {
DWORD crc;
BYTE[14] rgbReserved;
}
}
alias IMAGE_AUX_SYMBOL* PIMAGE_AUX_SYMBOL;
union IMAGE_AUX_SYMBOL_EX {
struct {
DWORD WeakDefaultSymIndex;
DWORD WeakSearchType;
BYTE[12] rgbReserved;
}
struct {
BYTE[IMAGE_SYMBOL_EX.sizeof] Name;
}
struct {
DWORD Length;
WORD NumberOfRelocations;
WORD NumberOfLinenumbers;
DWORD CheckSum;
SHORT Number;
BYTE Selection;
BYTE bReserved;
SHORT HighNumber;
BYTE[2] rgbReserved_2; // !
}
struct{
IMAGE_AUX_SYMBOL_TOKEN_DEF TokenDef;
BYTE[2] rgbReserved_3; // !
}
struct {
DWORD crc;
BYTE[16] rgbReserved_4; // !
}
}
alias IMAGE_AUX_SYMBOL_EX* PIMAGE_AUX_SYMBOL_EX;
enum {
IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1,
}
alias int IMAGE_AUX_SYMBOL_TYPE;
enum {
IMAGE_COMDAT_SELECT_NODUPLICATES = 1,
IMAGE_COMDAT_SELECT_ANY = 2,
IMAGE_COMDAT_SELECT_SAME_SIZE = 3,
IMAGE_COMDAT_SELECT_EXACT_MATCH = 4,
IMAGE_COMDAT_SELECT_ASSOCIATIVE = 5,
IMAGE_COMDAT_SELECT_LARGEST = 6,
IMAGE_COMDAT_SELECT_NEWEST = 7,
}
enum {
IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY = 1,
IMAGE_WEAK_EXTERN_SEARCH_LIBRARY = 2,
IMAGE_WEAK_EXTERN_SEARCH_ALIAS = 3,
}
struct IMAGE_RELOCATION {
union {
DWORD VirtualAddress;
DWORD RelocCount;
}
DWORD SymbolTableIndex;
WORD Type;
}
alias IMAGE_RELOCATION* PIMAGE_RELOCATION;
enum {
IMAGE_REL_I386_ABSOLUTE = 0x0000,
IMAGE_REL_I386_DIR16 = 0x0001,
IMAGE_REL_I386_REL16 = 0x0002,
IMAGE_REL_I386_DIR32 = 0x0006,
IMAGE_REL_I386_DIR32NB = 0x0007,
IMAGE_REL_I386_SEG12 = 0x0009,
IMAGE_REL_I386_SECTION = 0x000A,
IMAGE_REL_I386_SECREL = 0x000B,
IMAGE_REL_I386_TOKEN = 0x000C,
IMAGE_REL_I386_SECREL7 = 0x000D,
IMAGE_REL_I386_REL32 = 0x0014,
}
enum {
IMAGE_REL_MIPS_ABSOLUTE = 0x0000,
IMAGE_REL_MIPS_REFHALF = 0x0001,
IMAGE_REL_MIPS_REFWORD = 0x0002,
IMAGE_REL_MIPS_JMPADDR = 0x0003,
IMAGE_REL_MIPS_REFHI = 0x0004,
IMAGE_REL_MIPS_REFLO = 0x0005,
IMAGE_REL_MIPS_GPREL = 0x0006,
IMAGE_REL_MIPS_LITERAL = 0x0007,
IMAGE_REL_MIPS_SECTION = 0x000A,
IMAGE_REL_MIPS_SECREL = 0x000B,
IMAGE_REL_MIPS_SECRELLO = 0x000C,
IMAGE_REL_MIPS_SECRELHI = 0x000D,
IMAGE_REL_MIPS_TOKEN = 0x000E,
IMAGE_REL_MIPS_JMPADDR16 = 0x0010,
IMAGE_REL_MIPS_REFWORDNB = 0x0022,
IMAGE_REL_MIPS_PAIR = 0x0025,
}
enum {
IMAGE_REL_ALPHA_ABSOLUTE = 0x0000,
IMAGE_REL_ALPHA_REFLONG = 0x0001,
IMAGE_REL_ALPHA_REFQUAD = 0x0002,
IMAGE_REL_ALPHA_GPREL32 = 0x0003,
IMAGE_REL_ALPHA_LITERAL = 0x0004,
IMAGE_REL_ALPHA_LITUSE = 0x0005,
IMAGE_REL_ALPHA_GPDISP = 0x0006,
IMAGE_REL_ALPHA_BRADDR = 0x0007,
IMAGE_REL_ALPHA_HINT = 0x0008,
IMAGE_REL_ALPHA_INLINE_REFLONG = 0x0009,
IMAGE_REL_ALPHA_REFHI = 0x000A,
IMAGE_REL_ALPHA_REFLO = 0x000B,
IMAGE_REL_ALPHA_PAIR = 0x000C,
IMAGE_REL_ALPHA_MATCH = 0x000D,
IMAGE_REL_ALPHA_SECTION = 0x000E,
IMAGE_REL_ALPHA_SECREL = 0x000F,
IMAGE_REL_ALPHA_REFLONGNB = 0x0010,
IMAGE_REL_ALPHA_SECRELLO = 0x0011,
IMAGE_REL_ALPHA_SECRELHI = 0x0012,
IMAGE_REL_ALPHA_REFQ3 = 0x0013,
IMAGE_REL_ALPHA_REFQ2 = 0x0014,
IMAGE_REL_ALPHA_REFQ1 = 0x0015,
IMAGE_REL_ALPHA_GPRELLO = 0x0016,
IMAGE_REL_ALPHA_GPRELHI = 0x0017,
}
enum {
IMAGE_REL_PPC_ABSOLUTE = 0x0000,
IMAGE_REL_PPC_ADDR64 = 0x0001,
IMAGE_REL_PPC_ADDR32 = 0x0002,
IMAGE_REL_PPC_ADDR24 = 0x0003,
IMAGE_REL_PPC_ADDR16 = 0x0004,
IMAGE_REL_PPC_ADDR14 = 0x0005,
IMAGE_REL_PPC_REL24 = 0x0006,
IMAGE_REL_PPC_REL14 = 0x0007,
IMAGE_REL_PPC_TOCREL16 = 0x0008,
IMAGE_REL_PPC_TOCREL14 = 0x0009,
IMAGE_REL_PPC_ADDR32NB = 0x000A,
IMAGE_REL_PPC_SECREL = 0x000B,
IMAGE_REL_PPC_SECTION = 0x000C,
IMAGE_REL_PPC_IFGLUE = 0x000D,
IMAGE_REL_PPC_IMGLUE = 0x000E,
IMAGE_REL_PPC_SECREL16 = 0x000F,
IMAGE_REL_PPC_REFHI = 0x0010,
IMAGE_REL_PPC_REFLO = 0x0011,
IMAGE_REL_PPC_PAIR = 0x0012,
IMAGE_REL_PPC_SECRELLO = 0x0013,
IMAGE_REL_PPC_SECRELHI = 0x0014,
IMAGE_REL_PPC_GPREL = 0x0015,
IMAGE_REL_PPC_TOKEN = 0x0016,
IMAGE_REL_PPC_TYPEMASK = 0x00FF,
IMAGE_REL_PPC_NEG = 0x0100,
IMAGE_REL_PPC_BRTAKEN = 0x0200,
IMAGE_REL_PPC_BRNTAKEN = 0x0400,
IMAGE_REL_PPC_TOCDEFN = 0x0800,
}
enum {
IMAGE_REL_SH3_ABSOLUTE = 0x0000,
IMAGE_REL_SH3_DIRECT16 = 0x0001,
IMAGE_REL_SH3_DIRECT32 = 0x0002,
IMAGE_REL_SH3_DIRECT8 = 0x0003,
IMAGE_REL_SH3_DIRECT8_WORD = 0x0004,
IMAGE_REL_SH3_DIRECT8_LONG = 0x0005,
IMAGE_REL_SH3_DIRECT4 = 0x0006,
IMAGE_REL_SH3_DIRECT4_WORD = 0x0007,
IMAGE_REL_SH3_DIRECT4_LONG = 0x0008,
IMAGE_REL_SH3_PCREL8_WORD = 0x0009,
IMAGE_REL_SH3_PCREL8_LONG = 0x000A,
IMAGE_REL_SH3_PCREL12_WORD = 0x000B,
IMAGE_REL_SH3_STARTOF_SECTION = 0x000C,
IMAGE_REL_SH3_SIZEOF_SECTION = 0x000D,
IMAGE_REL_SH3_SECTION = 0x000E,
IMAGE_REL_SH3_SECREL = 0x000F,
IMAGE_REL_SH3_DIRECT32_NB = 0x0010,
IMAGE_REL_SH3_GPREL4_LONG = 0x0011,
IMAGE_REL_SH3_TOKEN = 0x0012,
IMAGE_REL_SHM_PCRELPT = 0x0013,
IMAGE_REL_SHM_REFLO = 0x0014,
IMAGE_REL_SHM_REFHALF = 0x0015,
IMAGE_REL_SHM_RELLO = 0x0016,
IMAGE_REL_SHM_RELHALF = 0x0017,
IMAGE_REL_SHM_PAIR = 0x0018,
IMAGE_REL_SH_NOMODE = 0x8000,
}
enum {
IMAGE_REL_ARM_ABSOLUTE = 0x0000,
IMAGE_REL_ARM_ADDR32 = 0x0001,
IMAGE_REL_ARM_ADDR32NB = 0x0002,
IMAGE_REL_ARM_BRANCH24 = 0x0003,
IMAGE_REL_ARM_BRANCH11 = 0x0004,
IMAGE_REL_ARM_TOKEN = 0x0005,
IMAGE_REL_ARM_GPREL12 = 0x0006,
IMAGE_REL_ARM_GPREL7 = 0x0007,
IMAGE_REL_ARM_BLX24 = 0x0008,
IMAGE_REL_ARM_BLX11 = 0x0009,
IMAGE_REL_ARM_SECTION = 0x000E,
IMAGE_REL_ARM_SECREL = 0x000F,
IMAGE_REL_AM_ABSOLUTE = 0x0000,
IMAGE_REL_AM_ADDR32 = 0x0001,
IMAGE_REL_AM_ADDR32NB = 0x0002,
IMAGE_REL_AM_CALL32 = 0x0003,
IMAGE_REL_AM_FUNCINFO = 0x0004,
IMAGE_REL_AM_REL32_1 = 0x0005,
IMAGE_REL_AM_REL32_2 = 0x0006,
IMAGE_REL_AM_SECREL = 0x0007,
IMAGE_REL_AM_SECTION = 0x0008,
IMAGE_REL_AM_TOKEN = 0x0009,
}
enum {
IMAGE_REL_AMD64_ABSOLUTE = 0x0000,
IMAGE_REL_AMD64_ADDR64 = 0x0001,
IMAGE_REL_AMD64_ADDR32 = 0x0002,
IMAGE_REL_AMD64_ADDR32NB = 0x0003,
IMAGE_REL_AMD64_REL32 = 0x0004,
IMAGE_REL_AMD64_REL32_1 = 0x0005,
IMAGE_REL_AMD64_REL32_2 = 0x0006,
IMAGE_REL_AMD64_REL32_3 = 0x0007,
IMAGE_REL_AMD64_REL32_4 = 0x0008,
IMAGE_REL_AMD64_REL32_5 = 0x0009,
IMAGE_REL_AMD64_SECTION = 0x000A,
IMAGE_REL_AMD64_SECREL = 0x000B,
IMAGE_REL_AMD64_SECREL7 = 0x000C,
IMAGE_REL_AMD64_TOKEN = 0x000D,
IMAGE_REL_AMD64_SREL32 = 0x000E,
IMAGE_REL_AMD64_PAIR = 0x000F,
IMAGE_REL_AMD64_SSPAN32 = 0x0010,
}
enum {
IMAGE_REL_IA64_ABSOLUTE = 0x0000,
IMAGE_REL_IA64_IMM14 = 0x0001,
IMAGE_REL_IA64_IMM22 = 0x0002,
IMAGE_REL_IA64_IMM64 = 0x0003,
IMAGE_REL_IA64_DIR32 = 0x0004,
IMAGE_REL_IA64_DIR64 = 0x0005,
IMAGE_REL_IA64_PCREL21B = 0x0006,
IMAGE_REL_IA64_PCREL21M = 0x0007,
IMAGE_REL_IA64_PCREL21F = 0x0008,
IMAGE_REL_IA64_GPREL22 = 0x0009,
IMAGE_REL_IA64_LTOFF22 = 0x000A,
IMAGE_REL_IA64_SECTION = 0x000B,
IMAGE_REL_IA64_SECREL22 = 0x000C,
IMAGE_REL_IA64_SECREL64I = 0x000D,
IMAGE_REL_IA64_SECREL32 = 0x000E,
IMAGE_REL_IA64_DIR32NB = 0x0010,
IMAGE_REL_IA64_SREL14 = 0x0011,
IMAGE_REL_IA64_SREL22 = 0x0012,
IMAGE_REL_IA64_SREL32 = 0x0013,
IMAGE_REL_IA64_UREL32 = 0x0014,
IMAGE_REL_IA64_PCREL60X = 0x0015,
IMAGE_REL_IA64_PCREL60B = 0x0016,
IMAGE_REL_IA64_PCREL60F = 0x0017,
IMAGE_REL_IA64_PCREL60I = 0x0018,
IMAGE_REL_IA64_PCREL60M = 0x0019,
IMAGE_REL_IA64_IMMGPREL64 = 0x001A,
IMAGE_REL_IA64_TOKEN = 0x001B,
IMAGE_REL_IA64_GPREL32 = 0x001C,
IMAGE_REL_IA64_ADDEND = 0x001F,
}
enum {
IMAGE_REL_CEF_ABSOLUTE = 0x0000,
IMAGE_REL_CEF_ADDR32 = 0x0001,
IMAGE_REL_CEF_ADDR64 = 0x0002,
IMAGE_REL_CEF_ADDR32NB = 0x0003,
IMAGE_REL_CEF_SECTION = 0x0004,
IMAGE_REL_CEF_SECREL = 0x0005,
IMAGE_REL_CEF_TOKEN = 0x0006,
}
enum {
IMAGE_REL_CEE_ABSOLUTE = 0x0000,
IMAGE_REL_CEE_ADDR32 = 0x0001,
IMAGE_REL_CEE_ADDR64 = 0x0002,
IMAGE_REL_CEE_ADDR32NB = 0x0003,
IMAGE_REL_CEE_SECTION = 0x0004,
IMAGE_REL_CEE_SECREL = 0x0005,
IMAGE_REL_CEE_TOKEN = 0x0006,
}
enum {
IMAGE_REL_M32R_ABSOLUTE = 0x0000,
IMAGE_REL_M32R_ADDR32 = 0x0001,
IMAGE_REL_M32R_ADDR32NB = 0x0002,
IMAGE_REL_M32R_ADDR24 = 0x0003,
IMAGE_REL_M32R_GPREL16 = 0x0004,
IMAGE_REL_M32R_PCREL24 = 0x0005,
IMAGE_REL_M32R_PCREL16 = 0x0006,
IMAGE_REL_M32R_PCREL8 = 0x0007,
IMAGE_REL_M32R_REFHALF = 0x0008,
IMAGE_REL_M32R_REFHI = 0x0009,
IMAGE_REL_M32R_REFLO = 0x000A,
IMAGE_REL_M32R_PAIR = 0x000B,
IMAGE_REL_M32R_SECTION = 0x000C,
IMAGE_REL_M32R_SECREL32 = 0x000D,
IMAGE_REL_M32R_TOKEN = 0x000E,
}
enum {
IMAGE_REL_EBC_ABSOLUTE = 0x0000,
IMAGE_REL_EBC_ADDR32NB = 0x0001,
IMAGE_REL_EBC_REL32 = 0x0002,
IMAGE_REL_EBC_SECTION = 0x0003,
IMAGE_REL_EBC_SECREL = 0x0004,
}
/*template EXT_IMM64(alias Value, Address, Size, InstPos, ValPos)
{
Value |= (cast(ULONGLONG)((*Address >> InstPos) & ((cast(ULONGLONG)1 << Size) - 1))) << ValPos;
}*/
/*template INS_IMM64(Value, Address, Size, InstPos, ValPos)
{
*cast(PDWORD)Address = (*cast(PDWORD)Address & ~(((1 << Size) - 1) << InstPos)) | (cast(DWORD)(((cast(ULONGLONG)Value >> ValPos) & ((cast(ULONGLONG)1 << Size) - 1))) << InstPos);
}*/
enum {
EMARCH_ENC_I17_IMM7B_INST_WORD_X = 3,
EMARCH_ENC_I17_IMM7B_SIZE_X = 7,
EMARCH_ENC_I17_IMM7B_INST_WORD_POS_X = 4,
EMARCH_ENC_I17_IMM7B_VAL_POS_X = 0,
EMARCH_ENC_I17_IMM9D_INST_WORD_X = 3,
EMARCH_ENC_I17_IMM9D_SIZE_X = 9,
EMARCH_ENC_I17_IMM9D_INST_WORD_POS_X = 18,
EMARCH_ENC_I17_IMM9D_VAL_POS_X = 7,
EMARCH_ENC_I17_IMM5C_INST_WORD_X = 3,
EMARCH_ENC_I17_IMM5C_SIZE_X = 5,
EMARCH_ENC_I17_IMM5C_INST_WORD_POS_X = 13,
EMARCH_ENC_I17_IMM5C_VAL_POS_X = 16,
EMARCH_ENC_I17_IC_INST_WORD_X = 3,
EMARCH_ENC_I17_IC_SIZE_X = 1,
EMARCH_ENC_I17_IC_INST_WORD_POS_X = 12,
EMARCH_ENC_I17_IC_VAL_POS_X = 21,
EMARCH_ENC_I17_IMM41a_INST_WORD_X = 1,
EMARCH_ENC_I17_IMM41a_SIZE_X = 10,
EMARCH_ENC_I17_IMM41a_INST_WORD_POS_X = 14,
EMARCH_ENC_I17_IMM41a_VAL_POS_X = 22,
EMARCH_ENC_I17_IMM41b_INST_WORD_X = 1,
EMARCH_ENC_I17_IMM41b_SIZE_X = 8,
EMARCH_ENC_I17_IMM41b_INST_WORD_POS_X = 24,
EMARCH_ENC_I17_IMM41b_VAL_POS_X = 32,
EMARCH_ENC_I17_IMM41c_INST_WORD_X = 2,
EMARCH_ENC_I17_IMM41c_SIZE_X = 23,
EMARCH_ENC_I17_IMM41c_INST_WORD_POS_X = 0,
EMARCH_ENC_I17_IMM41c_VAL_POS_X = 40,
EMARCH_ENC_I17_SIGN_INST_WORD_X = 3,
EMARCH_ENC_I17_SIGN_SIZE_X = 1,
EMARCH_ENC_I17_SIGN_INST_WORD_POS_X = 27,
EMARCH_ENC_I17_SIGN_VAL_POS_X = 63,
X3_OPCODE_INST_WORD_X = 3,
X3_OPCODE_SIZE_X = 4,
X3_OPCODE_INST_WORD_POS_X = 28,
X3_OPCODE_SIGN_VAL_POS_X = 0,
X3_I_INST_WORD_X = 3,
X3_I_SIZE_X = 1,
X3_I_INST_WORD_POS_X = 27,
X3_I_SIGN_VAL_POS_X = 59,
X3_D_WH_INST_WORD_X = 3,
X3_D_WH_SIZE_X = 3,
X3_D_WH_INST_WORD_POS_X = 24,
X3_D_WH_SIGN_VAL_POS_X = 0,
X3_IMM20_INST_WORD_X = 3,
X3_IMM20_SIZE_X = 20,
X3_IMM20_INST_WORD_POS_X = 4,
X3_IMM20_SIGN_VAL_POS_X = 0,
X3_IMM39_1_INST_WORD_X = 2,
X3_IMM39_1_SIZE_X = 23,
X3_IMM39_1_INST_WORD_POS_X = 0,
X3_IMM39_1_SIGN_VAL_POS_X = 36,
X3_IMM39_2_INST_WORD_X = 1,
X3_IMM39_2_SIZE_X = 16,
X3_IMM39_2_INST_WORD_POS_X = 16,
X3_IMM39_2_SIGN_VAL_POS_X = 20,
X3_P_INST_WORD_X = 3,
X3_P_SIZE_X = 4,
X3_P_INST_WORD_POS_X = 0,
X3_P_SIGN_VAL_POS_X = 0,
X3_TMPLT_INST_WORD_X = 0,
X3_TMPLT_SIZE_X = 4,
X3_TMPLT_INST_WORD_POS_X = 0,
X3_TMPLT_SIGN_VAL_POS_X = 0,
X3_BTYPE_QP_INST_WORD_X = 2,
X3_BTYPE_QP_SIZE_X = 9,
X3_BTYPE_QP_INST_WORD_POS_X = 23,
X3_BTYPE_QP_INST_VAL_POS_X = 0,
X3_EMPTY_INST_WORD_X = 1,
X3_EMPTY_SIZE_X = 2,
X3_EMPTY_INST_WORD_POS_X = 14,
X3_EMPTY_INST_VAL_POS_X = 0,
}
struct IMAGE_LINENUMBER {
union {
DWORD SymbolTableIndex;
DWORD VirtualAddress;
}
WORD Linenumber;
}
alias IMAGE_LINENUMBER* PIMAGE_LINENUMBER;
} // align(2)
struct IMAGE_BASE_RELOCATION {
DWORD VirtualAddress;
DWORD SizeOfBlock;
//WORD[1] TypeOffset;
}
alias IMAGE_BASE_RELOCATION* PIMAGE_BASE_RELOCATION;
enum {
IMAGE_REL_BASED_ABSOLUTE = 0,
IMAGE_REL_BASED_HIGH = 1,
IMAGE_REL_BASED_LOW = 2,
IMAGE_REL_BASED_HIGHLOW = 3,
IMAGE_REL_BASED_HIGHADJ = 4,
IMAGE_REL_BASED_MIPS_JMPADDR = 5,
IMAGE_REL_BASED_MIPS_JMPADDR16 = 9,
IMAGE_REL_BASED_IA64_IMM64 = 9,
IMAGE_REL_BASED_DIR64 = 10,
}
enum IMAGE_ARCHIVE_START_SIZE = 8;
const char* IMAGE_ARCHIVE_START = "!<arch>\n";
const char* IMAGE_ARCHIVE_END = "`\n";
const char* IMAGE_ARCHIVE_PAD = "\n";
const char* IMAGE_ARCHIVE_LINKER_MEMBER = "/ ";
const char* IMAGE_ARCHIVE_LONGNAMES_MEMBER = "// ";
struct IMAGE_ARCHIVE_MEMBER_HEADER {
BYTE[16] Name;
BYTE[12] Date;
BYTE[6] UserID;
BYTE[6] GroupID;
BYTE[8] Mode;
BYTE[10] Size;
BYTE[2] EndHeader;
}
alias IMAGE_ARCHIVE_MEMBER_HEADER* PIMAGE_ARCHIVE_MEMBER_HEADER;
enum IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR = 60;
struct IMAGE_EXPORT_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
DWORD Name;
DWORD Base;
DWORD NumberOfFunctions;
DWORD NumberOfNames;
DWORD AddressOfFunctions;
DWORD AddressOfNames;
DWORD AddressOfNameOrdinals;
}
alias IMAGE_EXPORT_DIRECTORY* PIMAGE_EXPORT_DIRECTORY;
struct IMAGE_IMPORT_BY_NAME {
WORD Hint;
BYTE[1] Name;
}
alias IMAGE_IMPORT_BY_NAME* PIMAGE_IMPORT_BY_NAME;
align(8)
struct IMAGE_THUNK_DATA64 {
union {
ULONGLONG ForwarderString;
ULONGLONG Function;
ULONGLONG Ordinal;
ULONGLONG AddressOfData;
}
}
alias IMAGE_THUNK_DATA64* PIMAGE_THUNK_DATA64;
struct IMAGE_THUNK_DATA32 {
union {
DWORD ForwarderString;
DWORD Function;
DWORD Ordinal;
DWORD AddressOfData;
}
}
alias IMAGE_THUNK_DATA32* PIMAGE_THUNK_DATA32;
enum {
IMAGE_ORDINAL_FLAG64 = 0x8000000000000000,
IMAGE_ORDINAL_FLAG32 = 0x80000000,
}
//#define IMAGE_ORDINAL64(Ordinal) (Ordinal & 0xffff)
//#define IMAGE_ORDINAL32(Ordinal) (Ordinal & 0xffff)
//#define IMAGE_SNAP_BY_ORDINAL64(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG64) != 0)
//#define IMAGE_SNAP_BY_ORDINAL32(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG32) != 0)
alias extern(Windows) VOID function(PVOID DllHandle, DWORD Reason, PVOID Reserved) PIMAGE_TLS_CALLBACK;
struct IMAGE_TLS_DIRECTORY64 {
ULONGLONG StartAddressOfRawData;
ULONGLONG EndAddressOfRawData;
ULONGLONG AddressOfIndex;
ULONGLONG AddressOfCallBacks;
DWORD SizeOfZeroFill;
DWORD Characteristics;
}
alias IMAGE_TLS_DIRECTORY64* PIMAGE_TLS_DIRECTORY64;
struct IMAGE_TLS_DIRECTORY32 {
DWORD StartAddressOfRawData;
DWORD EndAddressOfRawData;
DWORD AddressOfIndex;
DWORD AddressOfCallBacks;
DWORD SizeOfZeroFill;
DWORD Characteristics;
}
alias IMAGE_TLS_DIRECTORY32* PIMAGE_TLS_DIRECTORY32;
version(Win64){
alias IMAGE_ORDINAL_FLAG64 IMAGE_ORDINAL_FLAG;
//#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL64(Ordinal)
alias IMAGE_THUNK_DATA64 IMAGE_THUNK_DATA;
alias PIMAGE_THUNK_DATA64 PIMAGE_THUNK_DATA;
//#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL64(Ordinal)
alias IMAGE_TLS_DIRECTORY64 IMAGE_TLS_DIRECTORY;
alias PIMAGE_TLS_DIRECTORY64 PIMAGE_TLS_DIRECTORY;
}else{
alias IMAGE_ORDINAL_FLAG32 IMAGE_ORDINAL_FLAG;
//#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL32(Ordinal)
alias IMAGE_THUNK_DATA32 IMAGE_THUNK_DATA;
alias PIMAGE_THUNK_DATA32 PIMAGE_THUNK_DATA;
//#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL32(Ordinal)
alias IMAGE_TLS_DIRECTORY32 IMAGE_TLS_DIRECTORY;
alias PIMAGE_TLS_DIRECTORY32 PIMAGE_TLS_DIRECTORY;
}
struct IMAGE_IMPORT_DESCRIPTOR {
union {
DWORD Characteristics;
DWORD OriginalFirstThunk;
}
DWORD TimeDateStamp;
DWORD ForwarderChain;
DWORD Name;
DWORD FirstThunk;
}
alias IMAGE_IMPORT_DESCRIPTOR* PIMAGE_IMPORT_DESCRIPTOR;
struct IMAGE_BOUND_IMPORT_DESCRIPTOR {
DWORD TimeDateStamp;
WORD OffsetModuleName;
WORD NumberOfModuleForwarderRefs;
}
alias IMAGE_BOUND_IMPORT_DESCRIPTOR* PIMAGE_BOUND_IMPORT_DESCRIPTOR;
struct IMAGE_BOUND_FORWARDER_REF {
DWORD TimeDateStamp;
WORD OffsetModuleName;
WORD Reserved;
}
alias IMAGE_BOUND_FORWARDER_REF* PIMAGE_BOUND_FORWARDER_REF;
struct IMAGE_RESOURCE_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
WORD NumberOfNamedEntries;
WORD NumberOfIdEntries;
// IMAGE_RESOURCE_DIRECTORY_ENTRY[] DirectoryEntries;
}
alias IMAGE_RESOURCE_DIRECTORY* PIMAGE_RESOURCE_DIRECTORY;
enum {
IMAGE_RESOURCE_NAME_IS_STRING = 0x80000000,
IMAGE_RESOURCE_DATA_IS_DIRECTORY = 0x80000000,
}
struct IMAGE_RESOURCE_DIRECTORY_ENTRY {
union {
struct {
DWORD NameOffset31NameIsString1;
}
DWORD Name;
WORD Id;
}
union {
DWORD OffsetToData;
struct {
DWORD OffsetToDirectory31DataIsDirectory1;
}
}
}
alias IMAGE_RESOURCE_DIRECTORY_ENTRY* PIMAGE_RESOURCE_DIRECTORY_ENTRY;
struct IMAGE_RESOURCE_DIRECTORY_STRING {
WORD Length;
CHAR[1] NameString;
}
alias IMAGE_RESOURCE_DIRECTORY_STRING* PIMAGE_RESOURCE_DIRECTORY_STRING;
struct IMAGE_RESOURCE_DIR_STRING_U {
WORD Length;
WCHAR[1] NameString;
}
alias IMAGE_RESOURCE_DIR_STRING_U* PIMAGE_RESOURCE_DIR_STRING_U;
struct IMAGE_RESOURCE_DATA_ENTRY {
DWORD OffsetToData;
DWORD Size;
DWORD CodePage;
DWORD Reserved;
}
alias IMAGE_RESOURCE_DATA_ENTRY* PIMAGE_RESOURCE_DATA_ENTRY;
struct IMAGE_LOAD_CONFIG_DIRECTORY32 {
DWORD Size;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
DWORD GlobalFlagsClear;
DWORD GlobalFlagsSet;
DWORD CriticalSectionDefaultTimeout;
DWORD DeCommitFreeBlockThreshold;
DWORD DeCommitTotalFreeThreshold;
DWORD LockPrefixTable;
DWORD MaximumAllocationSize;
DWORD VirtualMemoryThreshold;
DWORD ProcessHeapFlags;
DWORD ProcessAffinityMask;
WORD CSDVersion;
WORD Reserved1;
DWORD EditList;
DWORD SecurityCookie;
DWORD SEHandlerTable;
DWORD SEHandlerCount;
}
alias IMAGE_LOAD_CONFIG_DIRECTORY32* PIMAGE_LOAD_CONFIG_DIRECTORY32;
struct IMAGE_LOAD_CONFIG_DIRECTORY64 {
DWORD Size;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
DWORD GlobalFlagsClear;
DWORD GlobalFlagsSet;
DWORD CriticalSectionDefaultTimeout;
ULONGLONG DeCommitFreeBlockThreshold;
ULONGLONG DeCommitTotalFreeThreshold;
ULONGLONG LockPrefixTable;
ULONGLONG MaximumAllocationSize;
ULONGLONG VirtualMemoryThreshold;
ULONGLONG ProcessAffinityMask;
DWORD ProcessHeapFlags;
WORD CSDVersion;
WORD Reserved1;
ULONGLONG EditList;
ULONGLONG SecurityCookie;
ULONGLONG SEHandlerTable;
ULONGLONG SEHandlerCount;
}
alias IMAGE_LOAD_CONFIG_DIRECTORY64* PIMAGE_LOAD_CONFIG_DIRECTORY64;
version(Win64){
alias IMAGE_LOAD_CONFIG_DIRECTORY64 IMAGE_LOAD_CONFIG_DIRECTORY;
alias PIMAGE_LOAD_CONFIG_DIRECTORY64 PIMAGE_LOAD_CONFIG_DIRECTORY;
}else{
alias IMAGE_LOAD_CONFIG_DIRECTORY32 IMAGE_LOAD_CONFIG_DIRECTORY;
alias PIMAGE_LOAD_CONFIG_DIRECTORY32 PIMAGE_LOAD_CONFIG_DIRECTORY;
}
struct IMAGE_CE_RUNTIME_FUNCTION_ENTRY {
DWORD FuncStart;
DWORD PrologLen8FuncLen22ThirtyTwoBit1ExceptionFlag1;
}
alias IMAGE_CE_RUNTIME_FUNCTION_ENTRY* PIMAGE_CE_RUNTIME_FUNCTION_ENTRY;
struct IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY {
ULONGLONG BeginAddress;
ULONGLONG EndAddress;
ULONGLONG ExceptionHandler;
ULONGLONG HandlerData;
ULONGLONG PrologEndAddress;
}
alias IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY* PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY;
struct IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY {
DWORD BeginAddress;
DWORD EndAddress;
DWORD ExceptionHandler;
DWORD HandlerData;
DWORD PrologEndAddress;
}
alias IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY* PIMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY;
struct IMAGE_IA64_RUNTIME_FUNCTION_ENTRY {
DWORD BeginAddress;
DWORD EndAddress;
DWORD UnwindInfoAddress;
}
alias IMAGE_IA64_RUNTIME_FUNCTION_ENTRY* PIMAGE_IA64_RUNTIME_FUNCTION_ENTRY;
version(none){ // _AXP64_
alias IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY IMAGE_AXP64_RUNTIME_FUNCTION_ENTRY;
alias PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY PIMAGE_AXP64_RUNTIME_FUNCTION_ENTRY;
alias IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY IMAGE_RUNTIME_FUNCTION_ENTRY;
alias PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY PIMAGE_RUNTIME_FUNCTION_ENTRY;
}else version(none){ // _ALPHA_
alias IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY IMAGE_RUNTIME_FUNCTION_ENTRY;
alias PIMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY PIMAGE_RUNTIME_FUNCTION_ENTRY;
}
struct IMAGE_DEBUG_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
DWORD Type;
DWORD SizeOfData;
DWORD AddressOfRawData;
DWORD PointerToRawData;
}
alias IMAGE_DEBUG_DIRECTORY* PIMAGE_DEBUG_DIRECTORY;
enum {
IMAGE_DEBUG_TYPE_UNKNOWN = 0,
IMAGE_DEBUG_TYPE_COFF = 1,
IMAGE_DEBUG_TYPE_CODEVIEW = 2,
IMAGE_DEBUG_TYPE_FPO = 3,
IMAGE_DEBUG_TYPE_MISC = 4,
IMAGE_DEBUG_TYPE_EXCEPTION = 5,
IMAGE_DEBUG_TYPE_FIXUP = 6,
IMAGE_DEBUG_TYPE_OMAP_TO_SRC = 7,
IMAGE_DEBUG_TYPE_OMAP_FROM_SRC = 8,
IMAGE_DEBUG_TYPE_BORLAND = 9,
IMAGE_DEBUG_TYPE_RESERVED10 = 10,
IMAGE_DEBUG_TYPE_CLSID = 11,
}
struct IMAGE_COFF_SYMBOLS_HEADER {
DWORD NumberOfSymbols;
DWORD LvaToFirstSymbol;
DWORD NumberOfLinenumbers;
DWORD LvaToFirstLinenumber;
DWORD RvaToFirstByteOfCode;
DWORD RvaToLastByteOfCode;
DWORD RvaToFirstByteOfData;
DWORD RvaToLastByteOfData;
}
alias IMAGE_COFF_SYMBOLS_HEADER* PIMAGE_COFF_SYMBOLS_HEADER;
enum {
FRAME_FPO = 0,
FRAME_TRAP = 1,
FRAME_TSS = 2,
FRAME_NONFPO = 3,
}
struct FPO_DATA {
DWORD ulOffStart;
DWORD cbProcSize;
DWORD cdwLocals;
WORD cdwParams;
WORD cbProlog8cbRegs3fHasSEH1fUseBP1reserved1cbFrame2;
}
alias FPO_DATA* PFPO_DATA;
enum SIZEOF_RFPO_DATA = 16;
enum IMAGE_DEBUG_MISC_EXENAME = 1;
struct IMAGE_DEBUG_MISC {
DWORD DataType;
DWORD Length;
BOOLEAN Unicode;
BYTE[3] Reserved;
BYTE[1] Data;
}
alias IMAGE_DEBUG_MISC* PIMAGE_DEBUG_MISC;
struct IMAGE_FUNCTION_ENTRY {
DWORD StartingAddress;
DWORD EndingAddress;
DWORD EndOfPrologue;
}
alias IMAGE_FUNCTION_ENTRY* PIMAGE_FUNCTION_ENTRY;
struct IMAGE_FUNCTION_ENTRY64 {
ULONGLONG StartingAddress;
ULONGLONG EndingAddress;
union {
ULONGLONG EndOfPrologue;
ULONGLONG UnwindInfoAddress;
}
}
alias IMAGE_FUNCTION_ENTRY64* PIMAGE_FUNCTION_ENTRY64;
struct IMAGE_SEPARATE_DEBUG_HEADER {
WORD Signature;
WORD Flags;
WORD Machine;
WORD Characteristics;
DWORD TimeDateStamp;
DWORD CheckSum;
DWORD ImageBase;
DWORD SizeOfImage;
DWORD NumberOfSections;
DWORD ExportedNamesSize;
DWORD DebugDirectorySize;
DWORD SectionAlignment;
DWORD[2] Reserved;
}
alias IMAGE_SEPARATE_DEBUG_HEADER* PIMAGE_SEPARATE_DEBUG_HEADER;
struct NON_PAGED_DEBUG_INFO {
WORD Signature;
WORD Flags;
DWORD Size;
WORD Machine;
WORD Characteristics;
DWORD TimeDateStamp;
DWORD CheckSum;
DWORD SizeOfImage;
ULONGLONG ImageBase;
//DebugDirectorySize
//IMAGE_DEBUG_DIRECTORY
}
alias NON_PAGED_DEBUG_INFO* PNON_PAGED_DEBUG_INFO;
enum {
IMAGE_SEPARATE_DEBUG_SIGNATURE = 0x4944,
NON_PAGED_DEBUG_SIGNATURE = 0x494E,
}
enum {
IMAGE_SEPARATE_DEBUG_FLAGS_MASK = 0x8000,
IMAGE_SEPARATE_DEBUG_MISMATCH = 0x8000,
}
struct IMAGE_ARCHITECTURE_HEADER {
uint AmaskValue1_7AmaskShift8_16;
DWORD FirstEntryRVA;
}
alias IMAGE_ARCHITECTURE_HEADER* PIMAGE_ARCHITECTURE_HEADER;
struct IMAGE_ARCHITECTURE_ENTRY {
DWORD FixupInstRVA;
DWORD NewInst;
}
alias IMAGE_ARCHITECTURE_ENTRY* PIMAGE_ARCHITECTURE_ENTRY;
} // align(4)
enum IMPORT_OBJECT_HDR_SIG2 = 0xffff;
struct IMPORT_OBJECT_HEADER {
WORD Sig1;
WORD Sig2;
WORD Version;
WORD Machine;
DWORD TimeDateStamp;
DWORD SizeOfData;
union {
WORD Ordinal;
WORD Hint;
}
WORD Type2NameType3Reserved11;
}
enum {
IMPORT_OBJECT_CODE = 0,
IMPORT_OBJECT_DATA = 1,
IMPORT_OBJECT_CONST = 2,
}
alias int IMPORT_OBJECT_TYPE;
enum {
IMPORT_OBJECT_ORDINAL = 0,
IMPORT_OBJECT_NAME = 1,
IMPORT_OBJECT_NAME_NO_PREFIX = 2,
IMPORT_OBJECT_NAME_UNDECORATE = 3,
}
alias int IMPORT_OBJECT_NAME_TYPE;
enum {
COMIMAGE_FLAGS_ILONLY = 0x00000001,
COMIMAGE_FLAGS_32BITREQUIRED = 0x00000002,
COMIMAGE_FLAGS_IL_LIBRARY = 0x00000004,
COMIMAGE_FLAGS_STRONGNAMESIGNED = 0x00000008,
COMIMAGE_FLAGS_NATIVE_ENTRYPOINT = 0x00000010,
COMIMAGE_FLAGS_TRACKDEBUGDATA = 0x00010000,
COR_VERSION_MAJOR_V2 = 2,
COR_VERSION_MAJOR = COR_VERSION_MAJOR_V2,
COR_VERSION_MINOR = 0,
COR_DELETED_NAME_LENGTH = 8,
COR_VTABLEGAP_NAME_LENGTH = 8,
NATIVE_TYPE_MAX_CB = 1,
COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE = 0xFF,
IMAGE_COR_MIH_METHODRVA = 0x01,
IMAGE_COR_MIH_EHRVA = 0x02,
IMAGE_COR_MIH_BASICBLOCK = 0x08,
COR_VTABLE_32BIT = 0x01,
COR_VTABLE_64BIT = 0x02,
COR_VTABLE_FROM_UNMANAGED = 0x04,
COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN = 0x08,
COR_VTABLE_CALL_MOST_DERIVED = 0x10,
IMAGE_COR_EATJ_THUNK_SIZE = 32,
MAX_CLASS_NAME = 1024,
MAX_PACKAGE_NAME = 1024,
}
alias uint ReplacesCorHdrNumericDefines;
struct IMAGE_COR20_HEADER {
DWORD cb;
WORD MajorRuntimeVersion;
WORD MinorRuntimeVersion;
IMAGE_DATA_DIRECTORY MetaData;
DWORD Flags;
union {
DWORD EntryPointToken;
DWORD EntryPointRVA;
}
IMAGE_DATA_DIRECTORY Resources;
IMAGE_DATA_DIRECTORY StrongNameSignature;
IMAGE_DATA_DIRECTORY CodeManagerTable;
IMAGE_DATA_DIRECTORY VTableFixups;
IMAGE_DATA_DIRECTORY ExportAddressTableJumps;
IMAGE_DATA_DIRECTORY ManagedNativeHeader;
}
alias IMAGE_COR20_HEADER* PIMAGE_COR20_HEADER;
version(Win64){
align(16)
struct SLIST_ENTRY {
PSLIST_ENTRY Next;
}
alias SLIST_ENTRY* PSLIST_ENTRY;
struct SLIST_ENTRY32 {
DWORD Next;
}
alias SLIST_ENTRY32* PSLIST_ENTRY32;
}else{
alias SINGLE_LIST_ENTRY SLIST_ENTRY;
alias PSINGLE_LIST_ENTRY PSLIST_ENTRY;
alias SLIST_ENTRY SLIST_ENTRY32;
alias SLIST_ENTRY32* PSLIST_ENTRY32;
}
version(Win64){
align(16)
union SLIST_HEADER {
struct {
ULONGLONG Alignment;
ULONGLONG Region;
}
}
alias SLIST_HEADER* PSLIST_HEADER;
union SLIST_HEADER32{
ULONGLONG Alignment;
struct {
SLIST_ENTRY32 Next;
WORD Depth;
WORD Sequence;
}
}
alias SLIST_HEADER32* PSLIST_HEADER32;
}else{
union SLIST_HEADER {
ULONGLONG Alignment;
struct {
SLIST_ENTRY Next;
WORD Depth;
WORD Sequence;
}
}
alias SLIST_HEADER* PSLIST_HEADER;
alias SLIST_HEADER SLIST_HEADER32;
alias SLIST_HEADER32* PSLIST_HEADER32;
}
export extern(Windows) VOID RtlInitializeSListHead(PSLIST_HEADER ListHead);
export extern(Windows) PSLIST_ENTRY RtlFirstEntrySList(const(SLIST_HEADER)* ListHead);
export extern(Windows) PSLIST_ENTRY RtlInterlockedPopEntrySList(PSLIST_HEADER ListHead);
export extern(Windows) PSLIST_ENTRY RtlInterlockedPushEntrySList(PSLIST_HEADER ListHead, PSLIST_ENTRY ListEntry);
export extern(Windows) PSLIST_ENTRY RtlInterlockedFlushSList(PSLIST_HEADER ListHead);
export extern(Windows) WORD RtlQueryDepthSList(PSLIST_HEADER ListHead);
version(none) // _IA64_
export extern(Windows) PSLIST_ENTRY32 RtlInterlockedPopEntrySList32(PSLIST_HEADER32 ListHead);
enum RTL_RUN_ONCE_INIT = 0;
enum {
RTL_RUN_ONCE_CHECK_ONLY = 0x00000001,
RTL_RUN_ONCE_ASYNC = 0x00000002,
RTL_RUN_ONCE_INIT_FAILED = 0x00000004,
}
enum RTL_RUN_ONCE_CTX_RESERVED_BITS = 2;
union RTL_RUN_ONCE {
PVOID Ptr;
}
alias RTL_RUN_ONCE* PRTL_RUN_ONCE;
alias extern(Windows) DWORD function(PRTL_RUN_ONCE RunOnce, PVOID Parameter, PVOID* Context) RTL_RUN_ONCE_INIT_FN;
alias RTL_RUN_ONCE_INIT_FN PRTL_RUN_ONCE_INIT_FN;
static if(NTDDI_VERSION >= NTDDI_LONGHORN){
export extern(Windows){
VOID RtlRunOnceInitialize(PRTL_RUN_ONCE RunOnce);
DWORD RtlRunOnceExecuteOnce(PRTL_RUN_ONCE RunOnce, PRTL_RUN_ONCE_INIT_FN InitFn, PVOID Parameter, PVOID* Context);
DWORD RtlRunOnceBeginInitialize(PRTL_RUN_ONCE RunOnce, DWORD Flags, PVOID* Context);
DWORD RtlRunOnceComplete(PRTL_RUN_ONCE RunOnce, DWORD Flags, PVOID Context);
}
}
enum {
HEAP_NO_SERIALIZE = 0x00000001,
HEAP_GROWABLE = 0x00000002,
HEAP_GENERATE_EXCEPTIONS = 0x00000004,
HEAP_ZERO_MEMORY = 0x00000008,
HEAP_REALLOC_IN_PLACE_ONLY = 0x00000010,
HEAP_TAIL_CHECKING_ENABLED = 0x00000020,
HEAP_FREE_CHECKING_ENABLED = 0x00000040,
HEAP_DISABLE_COALESCE_ON_FREE = 0x00000080,
HEAP_CREATE_ALIGN_16 = 0x00010000,
HEAP_CREATE_ENABLE_TRACING = 0x00020000,
HEAP_CREATE_ENABLE_EXECUTE = 0x00040000,
HEAP_MAXIMUM_TAG = 0x0FFF,
HEAP_PSEUDO_TAG_FLAG = 0x8000,
HEAP_TAG_SHIFT = 18,
}
pure nothrow
DWORD HEAP_MAKE_TAG_FLAGS(DWORD TagBase, DWORD Tag)
{
return cast(DWORD)(TagBase + (Tag << HEAP_TAG_SHIFT));
}
static if(NTDDI_VERSION > NTDDI_WINXP)
export extern(Windows) WORD RtlCaptureStackBackTrace(DWORD FramesToSkip, DWORD FramesToCapture, PVOID* BackTrace, PDWORD BackTraceHash);
export extern(Windows) VOID RtlCaptureContext(PCONTEXT ContextRecord);
enum {
IS_TEXT_UNICODE_ASCII16 = 0x0001,
IS_TEXT_UNICODE_REVERSE_ASCII16 = 0x0010,
IS_TEXT_UNICODE_STATISTICS = 0x0002,
IS_TEXT_UNICODE_REVERSE_STATISTICS = 0x0020,
IS_TEXT_UNICODE_CONTROLS = 0x0004,
IS_TEXT_UNICODE_REVERSE_CONTROLS = 0x0040,
IS_TEXT_UNICODE_SIGNATURE = 0x0008,
IS_TEXT_UNICODE_REVERSE_SIGNATURE = 0x0080,
IS_TEXT_UNICODE_ILLEGAL_CHARS = 0x0100,
IS_TEXT_UNICODE_ODD_LENGTH = 0x0200,
IS_TEXT_UNICODE_DBCS_LEADBYTE = 0x0400,
IS_TEXT_UNICODE_NULL_BYTES = 0x1000,
IS_TEXT_UNICODE_UNICODE_MASK = 0x000F,
IS_TEXT_UNICODE_REVERSE_MASK = 0x00F0,
IS_TEXT_UNICODE_NOT_UNICODE_MASK = 0x0F00,
IS_TEXT_UNICODE_NOT_ASCII_MASK = 0xF000,
}
enum {
COMPRESSION_FORMAT_NONE = 0x0000,
COMPRESSION_FORMAT_DEFAULT = 0x0001,
COMPRESSION_FORMAT_LZNT1 = 0x0002,
COMPRESSION_ENGINE_STANDARD = 0x0000,
COMPRESSION_ENGINE_MAXIMUM = 0x0100,
COMPRESSION_ENGINE_HIBER = 0x0200,
}
export extern(Windows) SIZE_T RtlCompareMemory(const(VOID)* Source1, const(VOID)* Source2, SIZE_T Length);
int RtlEqualMemory(const(void)* Destination, const(void)* Source, SIZE_T Length)
{
return !memcmp(Destination, Source, Length);
}
void RtlMoveMemory(PVOID Destination, const(void)* Source, SIZE_T Length)
{
memmove(Destination, Source, Length);
}
void RtlCopyMemory(PVOID Destination, const(void)* Source, SIZE_T Length)
{
memcpy(Destination, Source, Length);
}
void RtlFillMemory(PVOID Destination, SIZE_T Length, BYTE Fill)
{
memset(Destination, Fill, Length);
}
void RtlZeroMemory(PVOID Destination, SIZE_T Length)
{
memset(Destination, 0, Length);
}
PVOID RtlSecureZeroMemory(PVOID ptr, SIZE_T cnt)
{
byte* vptr = cast(byte*)ptr;
version(X86_64){
__stosb(cast(PBYTE)cast(DWORD64)vptr, 0, cnt);
}else{
while (cnt) {
*vptr = 0;
vptr++;
cnt--;
}
}
return ptr;
}
enum {
SEF_DACL_AUTO_INHERIT = 0x01,
SEF_SACL_AUTO_INHERIT = 0x02,
SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT = 0x04,
SEF_AVOID_PRIVILEGE_CHECK = 0x08,
SEF_AVOID_OWNER_CHECK = 0x10,
SEF_DEFAULT_OWNER_FROM_PARENT = 0x20,
SEF_DEFAULT_GROUP_FROM_PARENT = 0x40,
SEF_MACL_NO_WRITE_UP = 0x100,
SEF_MACL_NO_READ_UP = 0x200,
SEF_MACL_NO_EXECUTE_UP = 0x400,
SEF_AVOID_OWNER_RESTRICTION = 0x1000,
SEF_MACL_VALID_FLAGS = SEF_MACL_NO_WRITE_UP | SEF_MACL_NO_READ_UP | SEF_MACL_NO_EXECUTE_UP,
}
struct MESSAGE_RESOURCE_ENTRY {
WORD Length;
WORD Flags;
BYTE[1] Text;
}
alias MESSAGE_RESOURCE_ENTRY* PMESSAGE_RESOURCE_ENTRY;
enum MESSAGE_RESOURCE_UNICODE = 0x0001;
struct MESSAGE_RESOURCE_BLOCK {
DWORD LowId;
DWORD HighId;
DWORD OffsetToEntries;
}
alias MESSAGE_RESOURCE_BLOCK* PMESSAGE_RESOURCE_BLOCK;
struct MESSAGE_RESOURCE_DATA {
DWORD NumberOfBlocks;
MESSAGE_RESOURCE_BLOCK[1] Blocks;
}
alias MESSAGE_RESOURCE_DATA* PMESSAGE_RESOURCE_DATA;
export extern(Windows) PVOID RtlPcToFileHeader(PVOID PcValue, PVOID* BaseOfImage);
struct OSVERSIONINFOA {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR[ 128 ] szCSDVersion;
}
alias OSVERSIONINFOA* POSVERSIONINFOA;
alias OSVERSIONINFOA* LPOSVERSIONINFOA;
struct OSVERSIONINFOW {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR[128] szCSDVersion;
}
alias OSVERSIONINFOW* POSVERSIONINFOW;
alias OSVERSIONINFOW* LPOSVERSIONINFOW;
alias OSVERSIONINFOW RTL_OSVERSIONINFOW;
alias OSVERSIONINFOW* PRTL_OSVERSIONINFOW;
version(UNICODE){
alias OSVERSIONINFOW OSVERSIONINFO;
alias POSVERSIONINFOW POSVERSIONINFO;
alias LPOSVERSIONINFOW LPOSVERSIONINFO;
}else{
alias OSVERSIONINFOA OSVERSIONINFO;
alias POSVERSIONINFOA POSVERSIONINFO;
alias LPOSVERSIONINFOA LPOSVERSIONINFO;
}
struct OSVERSIONINFOEXA {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR[128] szCSDVersion;
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
}
alias OSVERSIONINFOEXA* POSVERSIONINFOEXA;
alias OSVERSIONINFOEXA* LPOSVERSIONINFOEXA;
struct OSVERSIONINFOEXW {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR[128] szCSDVersion;
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
}
alias OSVERSIONINFOEXW* POSVERSIONINFOEXW;
alias OSVERSIONINFOEXW* LPOSVERSIONINFOEXW;
alias OSVERSIONINFOEXW RTL_OSVERSIONINFOEXW;
alias OSVERSIONINFOEXW* PRTL_OSVERSIONINFOEXW;
version(UNICODE){
alias OSVERSIONINFOEXW OSVERSIONINFOEX;
alias POSVERSIONINFOEXW POSVERSIONINFOEX;
alias LPOSVERSIONINFOEXW LPOSVERSIONINFOEX;
}else{
alias OSVERSIONINFOEXA OSVERSIONINFOEX;
alias POSVERSIONINFOEXA POSVERSIONINFOEX;
alias LPOSVERSIONINFOEXA LPOSVERSIONINFOEX;
}
enum {
VER_EQUAL = 1,
VER_GREATER = 2,
VER_GREATER_EQUAL = 3,
VER_LESS = 4,
VER_LESS_EQUAL = 5,
VER_AND = 6,
VER_OR = 7,
VER_CONDITION_MASK = 7,
VER_NUM_BITS_PER_CONDITION_MASK = 3,
}
enum {
VER_MINORVERSION = 0x0000001,
VER_MAJORVERSION = 0x0000002,
VER_BUILDNUMBER = 0x0000004,
VER_PLATFORMID = 0x0000008,
VER_SERVICEPACKMINOR = 0x0000010,
VER_SERVICEPACKMAJOR = 0x0000020,
VER_SUITENAME = 0x0000040,
VER_PRODUCT_TYPE = 0x0000080,
}
enum {
VER_NT_WORKSTATION = 0x0000001,
VER_NT_DOMAIN_CONTROLLER = 0x0000002,
VER_NT_SERVER = 0x0000003,
}
enum {
VER_PLATFORM_WIN32s = 0,
VER_PLATFORM_WIN32_WINDOWS = 1,
VER_PLATFORM_WIN32_NT = 2,
}
/*template VER_SET_CONDITION(alias _m_, alias _t_, alias _c_)
{
_m_ = VerSetConditionMask(_m_, _t_, _c_);
}*/
export extern(Windows) ULONGLONG VerSetConditionMask(ULONGLONG ConditionMask, DWORD TypeMask, BYTE Condition);
static if(NTDDI_VERSION >= NTDDI_VISTA)
export extern(Windows) BOOLEAN RtlGetProductInfo(DWORD OSMajorVersion, DWORD OSMinorVersion, DWORD SpMajorVersion, DWORD SpMinorVersion, PDWORD ReturnedProductType);
enum RTL_UMS_VERSION = 0x0100;
enum {
UmsThreadInvalidInfoClass = 0,
UmsThreadUserContext,
UmsThreadPriority,
UmsThreadAffinity,
UmsThreadTeb,
UmsThreadIsSuspended,
UmsThreadIsTerminated,
UmsThreadMaxInfoClass
}
alias int RTL_UMS_THREAD_INFO_CLASS;
alias RTL_UMS_THREAD_INFO_CLASS* PRTL_UMS_THREAD_INFO_CLASS;
enum {
UmsSchedulerStartup = 0,
UmsSchedulerThreadBlocked,
UmsSchedulerThreadYield,
}
alias int RTL_UMS_SCHEDULER_REASON;
alias RTL_UMS_SCHEDULER_REASON* PRTL_UMS_SCHEDULER_REASON;
alias extern(Windows)
VOID function(RTL_UMS_SCHEDULER_REASON Reason, ULONG_PTR ActivationPayload, PVOID SchedulerParam) RTL_UMS_SCHEDULER_ENTRY_POINT;
alias RTL_UMS_SCHEDULER_ENTRY_POINT PRTL_UMS_SCHEDULER_ENTRY_POINT;
static if (NTDDI_VERSION >= NTDDI_WIN7){
export extern(Windows){
DWORD RtlCopyExtendedContext(PCONTEXT_EX Destination, DWORD ContextFlags, PCONTEXT_EX Source);
DWORD RtlInitializeExtendedContext(PVOID Context, DWORD ContextFlags, PCONTEXT_EX* ContextEx);
DWORD64 RtlGetEnabledExtendedFeatures(DWORD64 FeatureMask);
DWORD RtlGetExtendedContextLength(DWORD ContextFlags, PDWORD ContextLength);
DWORD64 RtlGetExtendedFeaturesMask(PCONTEXT_EX ContextEx);
PVOID RtlLocateExtendedFeature(PCONTEXT_EX ContextEx, DWORD FeatureId, PDWORD Length);
PCONTEXT RtlLocateLegacyContext(PCONTEXT_EX ContextEx, PDWORD Length);
VOID RtlSetExtendedFeaturesMask(PCONTEXT_EX ContextEx, DWORD64 FeatureMask);
}
}
struct RTL_CRITICAL_SECTION_DEBUG {
WORD Type;
WORD CreatorBackTraceIndex;
RTL_CRITICAL_SECTION* CriticalSection;
LIST_ENTRY ProcessLocksList;
DWORD EntryCount;
DWORD ContentionCount;
DWORD Flags;
WORD CreatorBackTraceIndexHigh;
WORD SpareWORD;
}
alias RTL_CRITICAL_SECTION_DEBUG* PRTL_CRITICAL_SECTION_DEBUG;
alias RTL_CRITICAL_SECTION_DEBUG RTL_RESOURCE_DEBUG;
alias RTL_CRITICAL_SECTION_DEBUG* PRTL_RESOURCE_DEBUG;
enum {
RTL_CRITSECT_TYPE = 0,
RTL_RESOURCE_TYPE = 1,
}
enum {
RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO = 0x01000000,
RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN = 0x02000000,
RTL_CRITICAL_SECTION_FLAG_STATIC_INIT = 0x04000000,
RTL_CRITICAL_SECTION_ALL_FLAG_BITS = 0xFF000000,
RTL_CRITICAL_SECTION_FLAG_RESERVED = RTL_CRITICAL_SECTION_ALL_FLAG_BITS & (~(RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO | RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN | RTL_CRITICAL_SECTION_FLAG_STATIC_INIT)),
RTL_CRITICAL_SECTION_DEBUG_FLAG_STATIC_INIT = 0x00000001,
}
align(8)
struct RTL_CRITICAL_SECTION {
PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
LONG LockCount;
LONG RecursionCount;
HANDLE OwningThread;
HANDLE LockSemaphore;
ULONG_PTR SpinCount;
}
alias RTL_CRITICAL_SECTION* PRTL_CRITICAL_SECTION;
struct RTL_SRWLOCK {
PVOID Ptr;
}
alias RTL_SRWLOCK* PRTL_SRWLOCK;
struct RTL_CONDITION_VARIABLE {
PVOID Ptr;
}
alias RTL_CONDITION_VARIABLE* PRTL_CONDITION_VARIABLE;
//const RTL_CONDITION_VARIABLE RTL_CONDITION_VARIABLE_INIT = {0};
//const RTL_CONDITION_VARIABLE_LOCKMODE_SHARED = 0x1;
alias extern(Windows) VOID function(ULONG_PTR Parameter) PAPCFUNC;
alias extern(Windows) LONG function(EXCEPTION_POINTERS* ExceptionInfo) PVECTORED_EXCEPTION_HANDLER;
enum {
HeapCompatibilityInformation,
HeapEnableTerminationOnCorruption
}
alias int HEAP_INFORMATION_CLASS;
enum {
WT_EXECUTEDEFAULT = 0x00000000,
WT_EXECUTEINIOTHREAD = 0x00000001,
WT_EXECUTEINUITHREAD = 0x00000002,
WT_EXECUTEINWAITTHREAD = 0x00000004,
WT_EXECUTEONLYONCE = 0x00000008,
WT_EXECUTEINTIMERTHREAD = 0x00000020,
WT_EXECUTELONGFUNCTION = 0x00000010,
WT_EXECUTEINPERSISTENTIOTHREAD = 0x00000040,
WT_EXECUTEINPERSISTENTTHREAD = 0x00000080,
WT_TRANSFER_IMPERSONATION = 0x00000100,
}
/*template WT_SET_MAX_THREADPOOL_THREADS(alias Flags, alias Limit)
{
Flags |= Limit << 16;
}*/
alias extern(Windows) VOID function(PVOID, BOOLEAN) WAITORTIMERCALLBACKFUNC;
alias extern(Windows) VOID function(PVOID) WORKERCALLBACKFUNC;
alias extern(Windows) VOID function(DWORD, PVOID, PVOID) APC_CALLBACK_FUNCTION;
alias extern(Windows) VOID function(PVOID lpFlsData) PFLS_CALLBACK_FUNCTION;
alias extern(Windows) BOOLEAN function(PVOID Addr, SIZE_T Range) PSECURE_MEMORY_CACHE_CALLBACK;
enum {
WT_EXECUTEINLONGTHREAD = 0x00000010,
WT_EXECUTEDELETEWAIT = 0x00000008,
}
enum {
ActivationContextBasicInformation = 1,
ActivationContextDetailedInformation = 2,
AssemblyDetailedInformationInActivationContext = 3,
FileInformationInAssemblyOfAssemblyInActivationContext = 4,
RunlevelInformationInActivationContext = 5,
CompatibilityInformationInActivationContext = 6,
ActivationContextManifestResourceName = 7,
MaxActivationContextInfoClass,
AssemblyDetailedInformationInActivationContxt = 3,
FileInformationInAssemblyOfAssemblyInActivationContxt = 4
}
alias int ACTIVATION_CONTEXT_INFO_CLASS;
alias ACTIVATION_CONTEXT_INFO_CLASS ACTIVATIONCONTEXTINFOCLASS;
struct ACTIVATION_CONTEXT_QUERY_INDEX {
DWORD ulAssemblyIndex;
DWORD ulFileIndexInAssembly;
}
alias ACTIVATION_CONTEXT_QUERY_INDEX* PACTIVATION_CONTEXT_QUERY_INDEX;
alias const(ACTIVATION_CONTEXT_QUERY_INDEX)* PCACTIVATION_CONTEXT_QUERY_INDEX;
enum {
ACTIVATION_CONTEXT_PATH_TYPE_NONE = 1,
ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE = 2,
ACTIVATION_CONTEXT_PATH_TYPE_URL = 3,
ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF = 4,
}
struct ASSEMBLY_FILE_DETAILED_INFORMATION {
DWORD ulFlags;
DWORD ulFilenameLength;
DWORD ulPathLength;
PCWSTR lpFileName;
PCWSTR lpFilePath;
}
alias ASSEMBLY_FILE_DETAILED_INFORMATION* PASSEMBLY_FILE_DETAILED_INFORMATION;
alias const(ASSEMBLY_FILE_DETAILED_INFORMATION)* PCASSEMBLY_FILE_DETAILED_INFORMATION;
alias ASSEMBLY_FILE_DETAILED_INFORMATION ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION;
alias PASSEMBLY_FILE_DETAILED_INFORMATION PASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION;
alias PCASSEMBLY_FILE_DETAILED_INFORMATION PCASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION;
struct ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION {
DWORD ulFlags;
DWORD ulEncodedAssemblyIdentityLength;
DWORD ulManifestPathType;
DWORD ulManifestPathLength;
LARGE_INTEGER liManifestLastWriteTime;
DWORD ulPolicyPathType;
DWORD ulPolicyPathLength;
LARGE_INTEGER liPolicyLastWriteTime;
DWORD ulMetadataSatelliteRosterIndex;
DWORD ulManifestVersionMajor;
DWORD ulManifestVersionMinor;
DWORD ulPolicyVersionMajor;
DWORD ulPolicyVersionMinor;
DWORD ulAssemblyDirectoryNameLength;
PCWSTR lpAssemblyEncodedAssemblyIdentity;
PCWSTR lpAssemblyManifestPath;
PCWSTR lpAssemblyPolicyPath;
PCWSTR lpAssemblyDirectoryName;
DWORD ulFileCount;
}
alias ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION* PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
alias const(ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION)* PCACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
enum {
ACTCTX_RUN_LEVEL_UNSPECIFIED = 0,
ACTCTX_RUN_LEVEL_AS_INVOKER,
ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE,
ACTCTX_RUN_LEVEL_REQUIRE_ADMIN,
ACTCTX_RUN_LEVEL_NUMBERS
}
alias int ACTCTX_REQUESTED_RUN_LEVEL;
struct ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION {
DWORD ulFlags;
ACTCTX_REQUESTED_RUN_LEVEL RunLevel;
DWORD UiAccess;
}
alias ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION* PACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION;
alias const(ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION)* PCACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION;
enum {
ACTCTX_COMPATIBILITY_ELEMENT_TYPE_UNKNOWN = 0,
ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS,
ACTCTX_COMPATIBILITY_ELEMENT_TYPE_MITIGATION
}
alias int ACTCTX_COMPATIBILITY_ELEMENT_TYPE;
struct COMPATIBILITY_CONTEXT_ELEMENT {
GUID Id;
ACTCTX_COMPATIBILITY_ELEMENT_TYPE Type;
}
alias COMPATIBILITY_CONTEXT_ELEMENT* PCOMPATIBILITY_CONTEXT_ELEMENT;
alias const(COMPATIBILITY_CONTEXT_ELEMENT)* PCCOMPATIBILITY_CONTEXT_ELEMENT;
struct ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION {
DWORD ElementCount;
COMPATIBILITY_CONTEXT_ELEMENT[1] Elements;
}
alias ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION* PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION;
alias const(ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION)* PCACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION;
enum MAX_SUPPORTED_OS_NUM = 4;
enum INVALID_OS_COUNT = 0xffff;
struct SUPPORTED_OS_INFO {
WORD OsCount;
WORD MitigationExist;
WORD[MAX_SUPPORTED_OS_NUM] OsList;
}
alias SUPPORTED_OS_INFO* PSUPPORTED_OS_INFO;
struct ACTIVATION_CONTEXT_DETAILED_INFORMATION {
DWORD dwFlags;
DWORD ulFormatVersion;
DWORD ulAssemblyCount;
DWORD ulRootManifestPathType;
DWORD ulRootManifestPathChars;
DWORD ulRootConfigurationPathType;
DWORD ulRootConfigurationPathChars;
DWORD ulAppDirPathType;
DWORD ulAppDirPathChars;
PCWSTR lpRootManifestPath;
PCWSTR lpRootConfigurationPath;
PCWSTR lpAppDirPath;
}
alias ACTIVATION_CONTEXT_DETAILED_INFORMATION* PACTIVATION_CONTEXT_DETAILED_INFORMATION;
alias const(ACTIVATION_CONTEXT_DETAILED_INFORMATION)* PCACTIVATION_CONTEXT_DETAILED_INFORMATION;
struct HARDWARE_COUNTER_DATA {
HARDWARE_COUNTER_TYPE Type;
DWORD Reserved;
DWORD64 Value;
}
alias HARDWARE_COUNTER_DATA* PHARDWARE_COUNTER_DATA;
enum PERFORMANCE_DATA_VERSION = 1;
struct PERFORMANCE_DATA {
WORD Size;
BYTE Version;
BYTE HwCountersCount;
DWORD ContextSwitchCount;
DWORD64 WaitReasonBitMap;
DWORD64 CycleTime;
DWORD RetryCount;
DWORD Reserved;
HARDWARE_COUNTER_DATA[MAX_HW_COUNTERS] HwCounters;
}
alias PERFORMANCE_DATA* PPERFORMANCE_DATA;
enum {
READ_THREAD_PROFILING_FLAG_DISPATCHING = 0x00000001,
READ_THREAD_PROFILING_FLAG_HARDWARE_COUNTERS = 0x00000002,
}
enum {
DLL_PROCESS_ATTACH = 1,
DLL_THREAD_ATTACH = 2,
DLL_THREAD_DETACH = 3,
DLL_PROCESS_DETACH = 0,
}
enum {
EVENTLOG_SEQUENTIAL_READ = 0x0001,
EVENTLOG_SEEK_READ = 0x0002,
EVENTLOG_FORWARDS_READ = 0x0004,
EVENTLOG_BACKWARDS_READ = 0x0008,
}
enum {
EVENTLOG_SUCCESS = 0x0000,
EVENTLOG_ERROR_TYPE = 0x0001,
EVENTLOG_WARNING_TYPE = 0x0002,
EVENTLOG_INFORMATION_TYPE = 0x0004,
EVENTLOG_AUDIT_SUCCESS = 0x0008,
EVENTLOG_AUDIT_FAILURE = 0x0010,
}
enum {
EVENTLOG_START_PAIRED_EVENT = 0x0001,
EVENTLOG_END_PAIRED_EVENT = 0x0002,
EVENTLOG_END_ALL_PAIRED_EVENTS = 0x0004,
EVENTLOG_PAIRED_EVENT_ACTIVE = 0x0008,
EVENTLOG_PAIRED_EVENT_INACTIVE = 0x0010,
}
struct EVENTLOGRECORD {
DWORD Length;
DWORD Reserved;
DWORD RecordNumber;
DWORD TimeGenerated;
DWORD TimeWritten;
DWORD EventID;
WORD EventType;
WORD NumStrings;
WORD EventCategory;
WORD ReservedFlags;
DWORD ClosingRecordNumber;
DWORD StringOffset;
DWORD UserSidLength;
DWORD UserSidOffset;
DWORD DataLength;
DWORD DataOffset;
// WCHAR[] SourceName;
// WCHAR[] Computername;
// SID UserSid;
// WCHAR[] Strings;
// BYTE[] Data;
// CHAR[] Pad;
// DWORD Length;
}
alias EVENTLOGRECORD* PEVENTLOGRECORD;
enum MAXLOGICALLOGNAMESIZE = 256;
version(all){ // _MSC_EXTENSIONS
struct EVENTSFORLOGFILE {
DWORD ulSize;
WCHAR[MAXLOGICALLOGNAMESIZE] szLogicalLogFile;
DWORD ulNumRecords;
EVENTLOGRECORD[1] pEventLogRecords;
}
struct PACKEDEVENTINFO {
DWORD ulSize;
DWORD ulNumEventsForLogFile;
DWORD[1] ulOffsets;
}
}else{
struct EVENTSFORLOGFILE {
}
struct PACKEDEVENTINFO {
}
}
alias EVENTSFORLOGFILE* PEVENTSFORLOGFILE;
alias PACKEDEVENTINFO* PPACKEDEVENTINFO;
enum {
KEY_QUERY_VALUE = 0x0001,
KEY_SET_VALUE = 0x0002,
KEY_CREATE_SUB_KEY = 0x0004,
KEY_ENUMERATE_SUB_KEYS = 0x0008,
KEY_NOTIFY = 0x0010,
KEY_CREATE_LINK = 0x0020,
KEY_WOW64_32KEY = 0x0200,
KEY_WOW64_64KEY = 0x0100,
KEY_WOW64_RES = 0x0300,
KEY_READ = (STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY) & (~SYNCHRONIZE),
KEY_WRITE = (STANDARD_RIGHTS_WRITE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY) & (~SYNCHRONIZE),
KEY_EXECUTE = (KEY_READ) & (~SYNCHRONIZE),
KEY_ALL_ACCESS = (STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | KEY_CREATE_LINK) & (~SYNCHRONIZE),
}
enum {
REG_OPTION_RESERVED = 0x00000000,
REG_OPTION_NON_VOLATILE = 0x00000000,
REG_OPTION_VOLATILE = 0x00000001,
REG_OPTION_CREATE_LINK = 0x00000002,
REG_OPTION_BACKUP_RESTORE = 0x00000004,
REG_OPTION_OPEN_LINK = 0x00000008,
REG_LEGAL_OPTION = REG_OPTION_RESERVED | REG_OPTION_NON_VOLATILE | REG_OPTION_VOLATILE | REG_OPTION_CREATE_LINK | REG_OPTION_BACKUP_RESTORE | REG_OPTION_OPEN_LINK,
REG_OPEN_LEGAL_OPTION = REG_OPTION_RESERVED | REG_OPTION_BACKUP_RESTORE | REG_OPTION_OPEN_LINK,
}
enum {
REG_CREATED_NEW_KEY = 0x00000001,
REG_OPENED_EXISTING_KEY = 0x00000002,
}
enum {
REG_STANDARD_FORMAT = 1,
REG_LATEST_FORMAT = 2,
REG_NO_COMPRESSION = 4,
}
enum {
REG_WHOLE_HIVE_VOLATILE = 0x00000001,
REG_REFRESH_HIVE = 0x00000002,
REG_NO_LAZY_FLUSH = 0x00000004,
REG_FORCE_RESTORE = 0x00000008,
REG_APP_HIVE = 0x00000010,
REG_PROCESS_PRIVATE = 0x00000020,
REG_START_JOURNAL = 0x00000040,
REG_HIVE_EXACT_FILE_GROWTH = 0x00000080,
REG_HIVE_NO_RM = 0x00000100,
REG_HIVE_SINGLE_LOG = 0x00000200,
REG_BOOT_HIVE = 0x00000400,
}
enum REG_FORCE_UNLOAD = 1;
enum {
REG_NOTIFY_CHANGE_NAME = 0x00000001,
REG_NOTIFY_CHANGE_ATTRIBUTES = 0x00000002,
REG_NOTIFY_CHANGE_LAST_SET = 0x00000004,
REG_NOTIFY_CHANGE_SECURITY = 0x00000008,
REG_LEGAL_CHANGE_FILTER = REG_NOTIFY_CHANGE_NAME | REG_NOTIFY_CHANGE_ATTRIBUTES | REG_NOTIFY_CHANGE_LAST_SET | REG_NOTIFY_CHANGE_SECURITY,
}
enum {
REG_NONE = 0,
REG_SZ = 1,
REG_EXPAND_SZ = 2,
REG_BINARY = 3,
REG_DWORD = 4,
REG_DWORD_LITTLE_ENDIAN = 4,
REG_DWORD_BIG_ENDIAN = 5,
REG_LINK = 6,
REG_MULTI_SZ = 7,
REG_RESOURCE_LIST = 8,
REG_FULL_RESOURCE_DESCRIPTOR = 9,
REG_RESOURCE_REQUIREMENTS_LIST = 10,
REG_QWORD = 11,
REG_QWORD_LITTLE_ENDIAN = 11,
}
enum {
SERVICE_KERNEL_DRIVER = 0x00000001,
SERVICE_FILE_SYSTEM_DRIVER = 0x00000002,
SERVICE_ADAPTER = 0x00000004,
SERVICE_RECOGNIZER_DRIVER = 0x00000008,
SERVICE_DRIVER = SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | SERVICE_RECOGNIZER_DRIVER,
SERVICE_WIN32_OWN_PROCESS = 0x00000010,
SERVICE_WIN32_SHARE_PROCESS = 0x00000020,
SERVICE_WIN32 = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS,
SERVICE_INTERACTIVE_PROCESS = 0x00000100,
SERVICE_TYPE_ALL = SERVICE_WIN32 | SERVICE_ADAPTER | SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS,
}
enum {
SERVICE_BOOT_START = 0x00000000,
SERVICE_SYSTEM_START = 0x00000001,
SERVICE_AUTO_START = 0x00000002,
SERVICE_DEMAND_START = 0x00000003,
SERVICE_DISABLED = 0x00000004,
}
enum {
SERVICE_ERROR_IGNORE = 0x00000000,
SERVICE_ERROR_NORMAL = 0x00000001,
SERVICE_ERROR_SEVERE = 0x00000002,
SERVICE_ERROR_CRITICAL = 0x00000003,
}
enum {
DriverType = SERVICE_KERNEL_DRIVER,
FileSystemType = SERVICE_FILE_SYSTEM_DRIVER,
Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS,
Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS,
AdapterType = SERVICE_ADAPTER,
RecognizerType = SERVICE_RECOGNIZER_DRIVER
}
alias int SERVICE_NODE_TYPE;
enum {
BootLoad = SERVICE_BOOT_START,
SystemLoad = SERVICE_SYSTEM_START,
AutoLoad = SERVICE_AUTO_START,
DemandLoad = SERVICE_DEMAND_START,
DisableLoad = SERVICE_DISABLED
}
alias int SERVICE_LOAD_TYPE;
enum {
IgnoreError = SERVICE_ERROR_IGNORE,
NormalError = SERVICE_ERROR_NORMAL,
SevereError = SERVICE_ERROR_SEVERE,
CriticalError = SERVICE_ERROR_CRITICAL
}
alias int SERVICE_ERROR_TYPE;
enum {
CM_SERVICE_NETWORK_BOOT_LOAD = 0x00000001,
CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD = 0x00000002,
CM_SERVICE_USB_DISK_BOOT_LOAD = 0x00000004,
CM_SERVICE_VALID_PROMOTION_MASK = CM_SERVICE_NETWORK_BOOT_LOAD | CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD | CM_SERVICE_USB_DISK_BOOT_LOAD,
}
enum {
TAPE_ERASE_SHORT = 0,
TAPE_ERASE_LONG = 1,
}
struct TAPE_ERASE {
DWORD Type;
BOOLEAN Immediate;
}
alias TAPE_ERASE* PTAPE_ERASE;
enum {
TAPE_LOAD = 0,
TAPE_UNLOAD = 1,
TAPE_TENSION = 2,
TAPE_LOCK = 3,
TAPE_UNLOCK = 4,
TAPE_FORMAT = 5,
}
struct TAPE_PREPARE {
DWORD Operation;
BOOLEAN Immediate;
}
alias TAPE_PREPARE* PTAPE_PREPARE;
enum {
TAPE_SETMARKS = 0,
TAPE_FILEMARKS = 1,
TAPE_SHORT_FILEMARKS = 2,
TAPE_LONG_FILEMARKS = 3,
}
struct TAPE_WRITE_MARKS {
DWORD Type;
DWORD Count;
BOOLEAN Immediate;
}
alias TAPE_WRITE_MARKS* PTAPE_WRITE_MARKS;
enum {
TAPE_ABSOLUTE_POSITION = 0,
TAPE_LOGICAL_POSITION = 1,
TAPE_PSEUDO_LOGICAL_POSITION = 2,
}
struct TAPE_GET_POSITION {
DWORD Type;
DWORD Partition;
LARGE_INTEGER Offset;
}
alias TAPE_GET_POSITION* PTAPE_GET_POSITION;
enum {
TAPE_REWIND = 0,
TAPE_ABSOLUTE_BLOCK = 1,
TAPE_LOGICAL_BLOCK = 2,
TAPE_PSEUDO_LOGICAL_BLOCK = 3,
TAPE_SPACE_END_OF_DATA = 4,
TAPE_SPACE_RELATIVE_BLOCKS = 5,
TAPE_SPACE_FILEMARKS = 6,
TAPE_SPACE_SEQUENTIAL_FMKS = 7,
TAPE_SPACE_SETMARKS = 8,
TAPE_SPACE_SEQUENTIAL_SMKS = 9,
}
struct TAPE_SET_POSITION {
DWORD Method;
DWORD Partition;
LARGE_INTEGER Offset;
BOOLEAN Immediate;
}
alias TAPE_SET_POSITION* PTAPE_SET_POSITION;
enum {
TAPE_DRIVE_FIXED = 0x00000001,
TAPE_DRIVE_SELECT = 0x00000002,
TAPE_DRIVE_INITIATOR = 0x00000004,
TAPE_DRIVE_ERASE_SHORT = 0x00000010,
TAPE_DRIVE_ERASE_LONG = 0x00000020,
TAPE_DRIVE_ERASE_BOP_ONLY = 0x00000040,
TAPE_DRIVE_ERASE_IMMEDIATE = 0x00000080,
TAPE_DRIVE_TAPE_CAPACITY = 0x00000100,
TAPE_DRIVE_TAPE_REMAINING = 0x00000200,
TAPE_DRIVE_FIXED_BLOCK = 0x00000400,
TAPE_DRIVE_VARIABLE_BLOCK = 0x00000800,
TAPE_DRIVE_WRITE_PROTECT = 0x00001000,
TAPE_DRIVE_EOT_WZ_SIZE = 0x00002000,
TAPE_DRIVE_ECC = 0x00010000,
TAPE_DRIVE_COMPRESSION = 0x00020000,
TAPE_DRIVE_PADDING = 0x00040000,
TAPE_DRIVE_REPORT_SMKS = 0x00080000,
TAPE_DRIVE_GET_ABSOLUTE_BLK = 0x00100000,
TAPE_DRIVE_GET_LOGICAL_BLK = 0x00200000,
TAPE_DRIVE_SET_EOT_WZ_SIZE = 0x00400000,
TAPE_DRIVE_EJECT_MEDIA = 0x01000000,
TAPE_DRIVE_CLEAN_REQUESTS = 0x02000000,
TAPE_DRIVE_SET_CMP_BOP_ONLY = 0x04000000,
TAPE_DRIVE_RESERVED_BIT = 0x80000000,
TAPE_DRIVE_LOAD_UNLOAD = 0x80000001,
TAPE_DRIVE_TENSION = 0x80000002,
TAPE_DRIVE_LOCK_UNLOCK = 0x80000004,
TAPE_DRIVE_REWIND_IMMEDIATE = 0x80000008,
TAPE_DRIVE_SET_BLOCK_SIZE = 0x80000010,
TAPE_DRIVE_LOAD_UNLD_IMMED = 0x80000020,
TAPE_DRIVE_TENSION_IMMED = 0x80000040,
TAPE_DRIVE_LOCK_UNLK_IMMED = 0x80000080,
TAPE_DRIVE_SET_ECC = 0x80000100,
TAPE_DRIVE_SET_COMPRESSION = 0x80000200,
TAPE_DRIVE_SET_PADDING = 0x80000400,
TAPE_DRIVE_SET_REPORT_SMKS = 0x80000800,
TAPE_DRIVE_ABSOLUTE_BLK = 0x80001000,
TAPE_DRIVE_ABS_BLK_IMMED = 0x80002000,
TAPE_DRIVE_LOGICAL_BLK = 0x80004000,
TAPE_DRIVE_LOG_BLK_IMMED = 0x80008000,
TAPE_DRIVE_END_OF_DATA = 0x80010000,
TAPE_DRIVE_RELATIVE_BLKS = 0x80020000,
TAPE_DRIVE_FILEMARKS = 0x80040000,
TAPE_DRIVE_SEQUENTIAL_FMKS = 0x80080000,
TAPE_DRIVE_SETMARKS = 0x80100000,
TAPE_DRIVE_SEQUENTIAL_SMKS = 0x80200000,
TAPE_DRIVE_REVERSE_POSITION = 0x80400000,
TAPE_DRIVE_SPACE_IMMEDIATE = 0x80800000,
TAPE_DRIVE_WRITE_SETMARKS = 0x81000000,
TAPE_DRIVE_WRITE_FILEMARKS = 0x82000000,
TAPE_DRIVE_WRITE_SHORT_FMKS = 0x84000000,
TAPE_DRIVE_WRITE_LONG_FMKS = 0x88000000,
TAPE_DRIVE_WRITE_MARK_IMMED = 0x90000000,
TAPE_DRIVE_FORMAT = 0xA0000000,
TAPE_DRIVE_FORMAT_IMMEDIATE = 0xC0000000,
TAPE_DRIVE_HIGH_FEATURES = 0x80000000,
}
struct TAPE_GET_DRIVE_PARAMETERS {
BOOLEAN ECC;
BOOLEAN Compression;
BOOLEAN DataPadding;
BOOLEAN ReportSetmarks;
DWORD DefaultBlockSize;
DWORD MaximumBlockSize;
DWORD MinimumBlockSize;
DWORD MaximumPartitionCount;
DWORD FeaturesLow;
DWORD FeaturesHigh;
DWORD EOTWarningZoneSize;
}
alias TAPE_GET_DRIVE_PARAMETERS* PTAPE_GET_DRIVE_PARAMETERS;
struct TAPE_SET_DRIVE_PARAMETERS {
BOOLEAN ECC;
BOOLEAN Compression;
BOOLEAN DataPadding;
BOOLEAN ReportSetmarks;
DWORD EOTWarningZoneSize;
}
alias TAPE_SET_DRIVE_PARAMETERS* PTAPE_SET_DRIVE_PARAMETERS;
struct TAPE_GET_MEDIA_PARAMETERS {
LARGE_INTEGER Capacity;
LARGE_INTEGER Remaining;
DWORD BlockSize;
DWORD PartitionCount;
BOOLEAN WriteProtected;
}
alias TAPE_GET_MEDIA_PARAMETERS* PTAPE_GET_MEDIA_PARAMETERS;
struct TAPE_SET_MEDIA_PARAMETERS {
DWORD BlockSize;
}
alias TAPE_SET_MEDIA_PARAMETERS* PTAPE_SET_MEDIA_PARAMETERS;
enum {
TAPE_FIXED_PARTITIONS = 0,
TAPE_SELECT_PARTITIONS = 1,
TAPE_INITIATOR_PARTITIONS = 2,
}
struct TAPE_CREATE_PARTITION {
DWORD Method;
DWORD Count;
DWORD Size;
}
alias TAPE_CREATE_PARTITION* PTAPE_CREATE_PARTITION;
enum {
TAPE_QUERY_DRIVE_PARAMETERS = 0,
TAPE_QUERY_MEDIA_CAPACITY = 1,
TAPE_CHECK_FOR_DRIVE_PROBLEM = 2,
TAPE_QUERY_IO_ERROR_DATA = 3,
TAPE_QUERY_DEVICE_ERROR_DATA = 4,
}
struct TAPE_WMI_OPERATIONS {
DWORD Method;
DWORD DataBufferSize;
PVOID DataBuffer;
}
alias TAPE_WMI_OPERATIONS* PTAPE_WMI_OPERATIONS;
enum {
TapeDriveProblemNone,
TapeDriveReadWriteWarning,
TapeDriveReadWriteError,
TapeDriveReadWarning,
TapeDriveWriteWarning,
TapeDriveReadError,
TapeDriveWriteError,
TapeDriveHardwareError,
TapeDriveUnsupportedMedia,
TapeDriveScsiConnectionError,
TapeDriveTimetoClean,
TapeDriveCleanDriveNow,
TapeDriveMediaLifeExpired,
TapeDriveSnappedTape
}
alias int TAPE_DRIVE_PROBLEM_TYPE;
extern(C){
enum {
TRANSACTIONMANAGER_QUERY_INFORMATION = 0x0001,
TRANSACTIONMANAGER_SET_INFORMATION = 0x0002,
TRANSACTIONMANAGER_RECOVER = 0x0004,
TRANSACTIONMANAGER_RENAME = 0x0008,
TRANSACTIONMANAGER_CREATE_RM = 0x0010,
TRANSACTIONMANAGER_BIND_TRANSACTION = 0x0020,
TRANSACTIONMANAGER_GENERIC_READ = STANDARD_RIGHTS_READ |TRANSACTIONMANAGER_QUERY_INFORMATION,
TRANSACTIONMANAGER_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | TRANSACTIONMANAGER_SET_INFORMATION | TRANSACTIONMANAGER_RECOVER |TRANSACTIONMANAGER_RENAME | TRANSACTIONMANAGER_CREATE_RM,
TRANSACTIONMANAGER_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE,
TRANSACTIONMANAGER_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | TRANSACTIONMANAGER_GENERIC_READ | TRANSACTIONMANAGER_GENERIC_WRITE | TRANSACTIONMANAGER_GENERIC_EXECUTE | TRANSACTIONMANAGER_BIND_TRANSACTION,
}
enum {
TRANSACTION_QUERY_INFORMATION = 0x0001,
TRANSACTION_SET_INFORMATION = 0x0002,
TRANSACTION_ENLIST = 0x0004,
TRANSACTION_COMMIT = 0x0008,
TRANSACTION_ROLLBACK = 0x0010,
TRANSACTION_PROPAGATE = 0x0020,
TRANSACTION_RIGHT_RESERVED1 = 0x0040,
TRANSACTION_GENERIC_READ = STANDARD_RIGHTS_READ | TRANSACTION_QUERY_INFORMATION | SYNCHRONIZE,
TRANSACTION_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | TRANSACTION_SET_INFORMATION | TRANSACTION_COMMIT | TRANSACTION_ENLIST | TRANSACTION_ROLLBACK | TRANSACTION_PROPAGATE | SYNCHRONIZE,
TRANSACTION_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | TRANSACTION_COMMIT | TRANSACTION_ROLLBACK | SYNCHRONIZE,
TRANSACTION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | TRANSACTION_GENERIC_READ | TRANSACTION_GENERIC_WRITE | TRANSACTION_GENERIC_EXECUTE,
TRANSACTION_RESOURCE_MANAGER_RIGHTS = TRANSACTION_GENERIC_READ | STANDARD_RIGHTS_WRITE | TRANSACTION_SET_INFORMATION | TRANSACTION_ENLIST | TRANSACTION_ROLLBACK | TRANSACTION_PROPAGATE | SYNCHRONIZE,
}
enum {
RESOURCEMANAGER_QUERY_INFORMATION = 0x0001,
RESOURCEMANAGER_SET_INFORMATION = 0x0002,
RESOURCEMANAGER_RECOVER = 0x0004,
RESOURCEMANAGER_ENLIST = 0x0008,
RESOURCEMANAGER_GET_NOTIFICATION = 0x0010,
RESOURCEMANAGER_REGISTER_PROTOCOL = 0x0020,
RESOURCEMANAGER_COMPLETE_PROPAGATION = 0x0040,
RESOURCEMANAGER_GENERIC_READ = STANDARD_RIGHTS_READ | RESOURCEMANAGER_QUERY_INFORMATION | SYNCHRONIZE,
RESOURCEMANAGER_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | RESOURCEMANAGER_SET_INFORMATION | RESOURCEMANAGER_RECOVER | RESOURCEMANAGER_ENLIST | RESOURCEMANAGER_GET_NOTIFICATION | RESOURCEMANAGER_REGISTER_PROTOCOL | RESOURCEMANAGER_COMPLETE_PROPAGATION | SYNCHRONIZE,
RESOURCEMANAGER_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | RESOURCEMANAGER_RECOVER | RESOURCEMANAGER_ENLIST | RESOURCEMANAGER_GET_NOTIFICATION | RESOURCEMANAGER_COMPLETE_PROPAGATION | SYNCHRONIZE,
RESOURCEMANAGER_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | RESOURCEMANAGER_GENERIC_READ | RESOURCEMANAGER_GENERIC_WRITE | RESOURCEMANAGER_GENERIC_EXECUTE,
}
enum {
ENLISTMENT_QUERY_INFORMATION = 0x0001,
ENLISTMENT_SET_INFORMATION = 0x0002,
ENLISTMENT_RECOVER = 0x0004,
ENLISTMENT_SUBORDINATE_RIGHTS = 0x0008,
ENLISTMENT_SUPERIOR_RIGHTS = 0x0010,
ENLISTMENT_GENERIC_READ = STANDARD_RIGHTS_READ | ENLISTMENT_QUERY_INFORMATION,
ENLISTMENT_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | ENLISTMENT_SET_INFORMATION | ENLISTMENT_RECOVER | ENLISTMENT_SUBORDINATE_RIGHTS | ENLISTMENT_SUPERIOR_RIGHTS,
ENLISTMENT_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | ENLISTMENT_RECOVER | ENLISTMENT_SUBORDINATE_RIGHTS | ENLISTMENT_SUPERIOR_RIGHTS,
ENLISTMENT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | ENLISTMENT_GENERIC_READ | ENLISTMENT_GENERIC_WRITE | ENLISTMENT_GENERIC_EXECUTE,
}
enum {
TransactionOutcomeUndetermined = 1,
TransactionOutcomeCommitted,
TransactionOutcomeAborted,
}
alias int TRANSACTION_OUTCOME;
enum {
TransactionStateNormal = 1,
TransactionStateIndoubt,
TransactionStateCommittedNotify,
}
alias int TRANSACTION_STATE;
struct TRANSACTION_BASIC_INFORMATION {
GUID TransactionId;
DWORD State;
DWORD Outcome;
}
alias TRANSACTION_BASIC_INFORMATION* PTRANSACTION_BASIC_INFORMATION;
struct TRANSACTIONMANAGER_BASIC_INFORMATION {
GUID TmIdentity;
LARGE_INTEGER VirtualClock;
}
alias TRANSACTIONMANAGER_BASIC_INFORMATION* PTRANSACTIONMANAGER_BASIC_INFORMATION;
struct TRANSACTIONMANAGER_LOG_INFORMATION {
GUID LogIdentity;
}
alias TRANSACTIONMANAGER_LOG_INFORMATION* PTRANSACTIONMANAGER_LOG_INFORMATION;
struct TRANSACTIONMANAGER_LOGPATH_INFORMATION {
DWORD LogPathLength;
WCHAR[1] LogPath;
}
alias TRANSACTIONMANAGER_LOGPATH_INFORMATION* PTRANSACTIONMANAGER_LOGPATH_INFORMATION;
struct TRANSACTIONMANAGER_RECOVERY_INFORMATION {
ULONGLONG LastRecoveredLsn;
}
alias TRANSACTIONMANAGER_RECOVERY_INFORMATION* PTRANSACTIONMANAGER_RECOVERY_INFORMATION;
struct TRANSACTIONMANAGER_OLDEST_INFORMATION {
GUID OldestTransactionGuid;
}
alias TRANSACTIONMANAGER_OLDEST_INFORMATION* PTRANSACTIONMANAGER_OLDEST_INFORMATION;
struct TRANSACTION_PROPERTIES_INFORMATION {
DWORD IsolationLevel;
DWORD IsolationFlags;
LARGE_INTEGER Timeout;
DWORD Outcome;
DWORD DescriptionLength;
WCHAR[1] Description;
}
alias TRANSACTION_PROPERTIES_INFORMATION* PTRANSACTION_PROPERTIES_INFORMATION;
struct TRANSACTION_BIND_INFORMATION {
HANDLE TmHandle;
}
alias TRANSACTION_BIND_INFORMATION* PTRANSACTION_BIND_INFORMATION;
struct TRANSACTION_ENLISTMENT_PAIR {
GUID EnlistmentId;
GUID ResourceManagerId;
}
alias TRANSACTION_ENLISTMENT_PAIR* PTRANSACTION_ENLISTMENT_PAIR;
struct TRANSACTION_ENLISTMENTS_INFORMATION {
DWORD NumberOfEnlistments;
TRANSACTION_ENLISTMENT_PAIR[1] EnlistmentPair;
}
alias TRANSACTION_ENLISTMENTS_INFORMATION* PTRANSACTION_ENLISTMENTS_INFORMATION;
struct TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION {
TRANSACTION_ENLISTMENT_PAIR SuperiorEnlistmentPair;
}
alias TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION* PTRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION;
struct RESOURCEMANAGER_BASIC_INFORMATION {
GUID ResourceManagerId;
DWORD DescriptionLength;
WCHAR[1] Description;
}
alias RESOURCEMANAGER_BASIC_INFORMATION* PRESOURCEMANAGER_BASIC_INFORMATION;
struct RESOURCEMANAGER_COMPLETION_INFORMATION {
HANDLE IoCompletionPortHandle;
ULONG_PTR CompletionKey;
}
alias RESOURCEMANAGER_COMPLETION_INFORMATION* PRESOURCEMANAGER_COMPLETION_INFORMATION;
enum {
TransactionBasicInformation,
TransactionPropertiesInformation,
TransactionEnlistmentInformation,
TransactionSuperiorEnlistmentInformation,
TransactionBindInformation,
TransactionDTCPrivateInformation,
}
alias int TRANSACTION_INFORMATION_CLASS;
enum {
TransactionManagerBasicInformation,
TransactionManagerLogInformation,
TransactionManagerLogPathInformation,
TransactionManagerRecoveryInformation = 4,
TransactionManagerOnlineProbeInformation = 3,
TransactionManagerOldestTransactionInformation = 5
}
alias int TRANSACTIONMANAGER_INFORMATION_CLASS;
enum {
ResourceManagerBasicInformation,
ResourceManagerCompletionInformation,
}
alias int RESOURCEMANAGER_INFORMATION_CLASS;
struct ENLISTMENT_BASIC_INFORMATION {
GUID EnlistmentId;
GUID TransactionId;
GUID ResourceManagerId;
}
alias ENLISTMENT_BASIC_INFORMATION* PENLISTMENT_BASIC_INFORMATION;
struct ENLISTMENT_CRM_INFORMATION {
GUID CrmTransactionManagerId;
GUID CrmResourceManagerId;
GUID CrmEnlistmentId;
}
alias ENLISTMENT_CRM_INFORMATION* PENLISTMENT_CRM_INFORMATION;
enum {
EnlistmentBasicInformation,
EnlistmentRecoveryInformation,
EnlistmentCrmInformation
}
alias int ENLISTMENT_INFORMATION_CLASS;
struct TRANSACTION_LIST_ENTRY {
UOW uow;
}
alias TRANSACTION_LIST_ENTRY* PTRANSACTION_LIST_ENTRY;
struct TRANSACTION_LIST_INFORMATION {
DWORD NumberOfTransactions;
TRANSACTION_LIST_ENTRY[1] TransactionInformation;
}
alias TRANSACTION_LIST_INFORMATION* PTRANSACTION_LIST_INFORMATION;
enum {
KTMOBJECT_TRANSACTION,
KTMOBJECT_TRANSACTION_MANAGER,
KTMOBJECT_RESOURCE_MANAGER,
KTMOBJECT_ENLISTMENT,
KTMOBJECT_INVALID
}
alias int KTMOBJECT_TYPE;
alias KTMOBJECT_TYPE* PKTMOBJECT_TYPE;
struct KTMOBJECT_CURSOR {
GUID LastQuery;
DWORD ObjectIdCount;
GUID[1] ObjectIds;
}
alias KTMOBJECT_CURSOR* PKTMOBJECT_CURSOR;
}
alias DWORD TP_VERSION;
alias TP_VERSION* PTP_VERSION;
struct TP_CALLBACK_INSTANCE {
}
alias TP_CALLBACK_INSTANCE* PTP_CALLBACK_INSTANCE;
alias extern(Windows) VOID function(PTP_CALLBACK_INSTANCE Instance, PVOID Context) PTP_SIMPLE_CALLBACK;
struct TP_POOL {
}
alias TP_POOL* PTP_POOL;
enum {
TP_CALLBACK_PRIORITY_HIGH,
TP_CALLBACK_PRIORITY_NORMAL,
TP_CALLBACK_PRIORITY_LOW,
TP_CALLBACK_PRIORITY_INVALID
}
alias int TP_CALLBACK_PRIORITY;
struct TP_POOL_STACK_INFORMATION {
SIZE_T StackReserve;
SIZE_T StackCommit;
}
alias TP_POOL_STACK_INFORMATION* PTP_POOL_STACK_INFORMATION;
struct TP_CLEANUP_GROUP {
}
alias TP_CLEANUP_GROUP* PTP_CLEANUP_GROUP;
alias extern(Windows) VOID function(PVOID ObjectContext, PVOID CleanupContext) PTP_CLEANUP_GROUP_CANCEL_CALLBACK;
//(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
struct TP_CALLBACK_ENVIRON_V3 {
TP_VERSION Version;
PTP_POOL Pool;
PTP_CLEANUP_GROUP CleanupGroup;
PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback;
PVOID RaceDll;
ACTIVATION_CONTEXT* ActivationContext;
PTP_SIMPLE_CALLBACK FinalizationCallback;
union {
DWORD Flags;
DWORD LongFunction1Persistent1Private30;
}
TP_CALLBACK_PRIORITY CallbackPriority;
DWORD Size;
}
alias TP_CALLBACK_ENVIRON_V3 TP_CALLBACK_ENVIRON;
alias TP_CALLBACK_ENVIRON_V3* PTP_CALLBACK_ENVIRON;
/*}else{
struct TP_CALLBACK_ENVIRON_V1 {
TP_VERSION Version;
PTP_POOL Pool;
PTP_CLEANUP_GROUP CleanupGroup;
PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback;
PVOID RaceDll;
ACTIVATION_CONTEXT* ActivationContext;
PTP_SIMPLE_CALLBACK FinalizationCallback;
union {
DWORD Flags;
DWORD LongFunction1Persistent1Private30;
}
}
alias TP_CALLBACK_ENVIRON_V1 TP_CALLBACK_ENVIRON;
alias TP_CALLBACK_ENVIRON_V1* PTP_CALLBACK_ENVIRON;
}*/
VOID TpInitializeCallbackEnviron(PTP_CALLBACK_ENVIRON CallbackEnviron)
{
static if(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
CallbackEnviron.Version = 3;
else
CallbackEnviron.Version = 1;
CallbackEnviron.Pool = null;
CallbackEnviron.CleanupGroup = null;
CallbackEnviron.CleanupGroupCancelCallback = null;
CallbackEnviron.RaceDll = null;
CallbackEnviron.ActivationContext = null;
CallbackEnviron.FinalizationCallback = null;
CallbackEnviron.Flags = 0;
static if(_WIN32_WINNT >= _WIN32_WINNT_WIN7){
CallbackEnviron.CallbackPriority = TP_CALLBACK_PRIORITY_NORMAL;
CallbackEnviron.Size = TP_CALLBACK_ENVIRON.sizeof;
}
}
VOID TpSetCallbackThreadpool(PTP_CALLBACK_ENVIRON CallbackEnviron, PTP_POOL Pool)
{
CallbackEnviron.Pool = Pool;
}
VOID TpSetCallbackCleanupGroup(PTP_CALLBACK_ENVIRON CallbackEnviron, PTP_CLEANUP_GROUP CleanupGroup, PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback)
{
CallbackEnviron.CleanupGroup = CleanupGroup;
CallbackEnviron.CleanupGroupCancelCallback = CleanupGroupCancelCallback;
}
VOID TpSetCallbackActivationContext(PTP_CALLBACK_ENVIRON CallbackEnviron, ACTIVATION_CONTEXT* ActivationContext)
{
CallbackEnviron.ActivationContext = ActivationContext;
}
VOID TpSetCallbackNoActivationContext(PTP_CALLBACK_ENVIRON CallbackEnviron)
{
CallbackEnviron.ActivationContext = cast(ACTIVATION_CONTEXT*)cast(LONG_PTR)-1;
}
VOID TpSetCallbackLongFunction(PTP_CALLBACK_ENVIRON CallbackEnviron)
{
//CallbackEnviron.LongFunction = 1;
CallbackEnviron.LongFunction1Persistent1Private30 |= 0x80000000;
}
VOID TpSetCallbackRaceWithDll(PTP_CALLBACK_ENVIRON CallbackEnviron, PVOID DllHandle)
{
CallbackEnviron.RaceDll = DllHandle;
}
VOID TpSetCallbackFinalizationCallback(PTP_CALLBACK_ENVIRON CallbackEnviron, PTP_SIMPLE_CALLBACK FinalizationCallback)
{
CallbackEnviron.FinalizationCallback = FinalizationCallback;
}
static if(_WIN32_WINNT >= _WIN32_WINNT_WIN7){
VOID TpSetCallbackPriority(PTP_CALLBACK_ENVIRON CallbackEnviron, TP_CALLBACK_PRIORITY Priority)
{
CallbackEnviron.CallbackPriority = Priority;
}
}
VOID TpSetCallbackPersistent(PTP_CALLBACK_ENVIRON CallbackEnviron)
{
//CallbackEnviron.Persistent = 1;
CallbackEnviron.LongFunction1Persistent1Private30 |= 0x40000000;
}
VOID TpDestroyCallbackEnviron(PTP_CALLBACK_ENVIRON CallbackEnviron)
{
}
struct TP_WORK {
}
alias TP_WORK* PTP_WORK;
alias extern(Windows) VOID function(PTP_CALLBACK_INSTANCE Instance, PVOID Context, PTP_WORK Work) PTP_WORK_CALLBACK;
struct TP_TIMER {
}
alias TP_TIMER* PTP_TIMER;
alias extern(Windows) VOID function(PTP_CALLBACK_INSTANCE Instance, PVOID Context, PTP_TIMER Timer) PTP_TIMER_CALLBACK;
alias DWORD TP_WAIT_RESULT;
struct TP_WAIT {
}
alias TP_WAIT* PTP_WAIT;
alias extern(Windows) VOID function(PTP_CALLBACK_INSTANCE Instance, PVOID Context, PTP_WAIT Wait, TP_WAIT_RESULT WaitResult) PTP_WAIT_CALLBACK;
struct TP_IO {
}
alias TP_IO* PTP_IO;
version(X86_64){
TEB* NtCurrentTeb()
{
return cast(TEB*)__readgsqword(NT_TIB.Self.offsetof);
}
PVOID GetCurrentFiber()
{
return cast(PVOID)__readgsqword(NT_TIB.FiberData.offsetof);
}
PVOID GetFiberData()
{
return *cast(PVOID*)GetCurrentFiber();
}
}else{
enum PcTeb = 0x18;
TEB* NtCurrentTeb()
{
return cast(TEB*)cast(ULONG_PTR)__readfsdword(PcTeb);
}
}
enum {
ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION = 1,
ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION = 2,
ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION = 3,
ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION = 4,
ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION = 5,
ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION = 6,
ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION = 7,
ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE = 8,
ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES = 9,
ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS = 10,
ACTIVATION_CONTEXT_SECTION_COMPATIBILITY_INFO = 11,
}
} // extern(C)
| D |
/Users/Fares/Documents/Projects/TransitApp/build/Pods.build/Debug-iphonesimulator/MaterialKit.build/Objects-normal/x86_64/MKCardView.o : /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKActivityIndicator.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKButton.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKCardView.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKCollectionViewCell.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKColor.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKEmbedDrawerControllerSegue.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKEmbedMainControllerSegue.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKImageView.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKLabel.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKLayer.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKNavigationBar.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKRefreshControl.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSideDrawerViewController.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSnackbar.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSwitch.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKTableViewCell.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKTextField.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Fares/Documents/Projects/TransitApp/Pods/Target\ Support\ Files/MaterialKit/MaterialKit-umbrella.h /Users/Fares/Documents/Projects/TransitApp/build/Pods.build/Debug-iphonesimulator/MaterialKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/Fares/Documents/Projects/TransitApp/build/Pods.build/Debug-iphonesimulator/MaterialKit.build/Objects-normal/x86_64/MKCardView~partial.swiftmodule : /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKActivityIndicator.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKButton.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKCardView.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKCollectionViewCell.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKColor.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKEmbedDrawerControllerSegue.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKEmbedMainControllerSegue.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKImageView.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKLabel.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKLayer.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKNavigationBar.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKRefreshControl.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSideDrawerViewController.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSnackbar.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSwitch.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKTableViewCell.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKTextField.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Fares/Documents/Projects/TransitApp/Pods/Target\ Support\ Files/MaterialKit/MaterialKit-umbrella.h /Users/Fares/Documents/Projects/TransitApp/build/Pods.build/Debug-iphonesimulator/MaterialKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/Fares/Documents/Projects/TransitApp/build/Pods.build/Debug-iphonesimulator/MaterialKit.build/Objects-normal/x86_64/MKCardView~partial.swiftdoc : /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKActivityIndicator.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKButton.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKCardView.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKCollectionViewCell.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKColor.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKEmbedDrawerControllerSegue.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKEmbedMainControllerSegue.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKImageView.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKLabel.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKLayer.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKNavigationBar.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKRefreshControl.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSideDrawerViewController.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSnackbar.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKSwitch.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKTableViewCell.swift /Users/Fares/Documents/Projects/TransitApp/Pods/MaterialKit/Source/MKTextField.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Fares/Documents/Projects/TransitApp/Pods/Target\ Support\ Files/MaterialKit/MaterialKit-umbrella.h /Users/Fares/Documents/Projects/TransitApp/build/Pods.build/Debug-iphonesimulator/MaterialKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
| D |
the serum or watery part of milk that is separated from the curd in making cheese
watery part of milk produced when raw milk sours and coagulates
| D |
/Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.build/ByteBuffer-aux.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/ByteBuffer-aux~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/ByteBuffer-aux~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 |
# FIXED
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.c
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/stdbool.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/stdint.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/_stdint40.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/sys/stdint.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/sys/cdefs.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/sys/_types.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/machine/_types.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/machine/_stdint.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/sys/_stdint.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/inc/hw_gpio.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/inc/hw_ints.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/inc/hw_memmap.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/inc/hw_types.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/inc/hw_sysctl.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/driverlib/gpio.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/driverlib/interrupt.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/driverlib/sysctl.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/driverlib/timer.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/driverlib/rom.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/driverlib/lcd.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/grlib/grlib.h
drivers/kentec320x240x16_ssd2119.obj: C:/ti/tivaware_c_series_2_1_4_178/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.h
C:/ti/tivaware_c_series_2_1_4_178/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.c:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/stdbool.h:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/stdint.h:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/_stdint40.h:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/sys/stdint.h:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/sys/cdefs.h:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/sys/_types.h:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/machine/_types.h:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/machine/_stdint.h:
C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS/include/sys/_stdint.h:
C:/ti/tivaware_c_series_2_1_4_178/inc/hw_gpio.h:
C:/ti/tivaware_c_series_2_1_4_178/inc/hw_ints.h:
C:/ti/tivaware_c_series_2_1_4_178/inc/hw_memmap.h:
C:/ti/tivaware_c_series_2_1_4_178/inc/hw_types.h:
C:/ti/tivaware_c_series_2_1_4_178/inc/hw_sysctl.h:
C:/ti/tivaware_c_series_2_1_4_178/driverlib/gpio.h:
C:/ti/tivaware_c_series_2_1_4_178/driverlib/interrupt.h:
C:/ti/tivaware_c_series_2_1_4_178/driverlib/sysctl.h:
C:/ti/tivaware_c_series_2_1_4_178/driverlib/timer.h:
C:/ti/tivaware_c_series_2_1_4_178/driverlib/rom.h:
C:/ti/tivaware_c_series_2_1_4_178/driverlib/lcd.h:
C:/ti/tivaware_c_series_2_1_4_178/grlib/grlib.h:
C:/ti/tivaware_c_series_2_1_4_178/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.h:
| D |
module printed.font.fontregistry;
import std.algorithm;
import std.file;
import std.array;
import std.uni;
import std.string: format;
import std.math: abs;
import standardpaths;
import printed.font.opentype;
/// FontRegistry register partial font information for all fonts
/// from the system directories, plus the ones added by the user.
/// Aggregates all fonts by family, a bit like a browser or Word does.
/// This allows to get one particular physical font with just a family
/// name, an approximate weight etc. Without such font-matching, it's
/// impractical and you need to give explicit ttf files manually.
class FontRegistry
{
/// Create a font registry, parsing every available fonts.
this()
{
// Extract all known fonts from system directories
foreach(fontFile; listAllFontFiles())
registerFontFile(fontFile);
}
/// Add a font file to parse.
/// Registers every font within that file.
/// Important: the file must outlive the `FontRegistry` itself.
void registerFontFile(string pathToTrueTypeFontFile)
{
ubyte[] fileContents = cast(ubyte[]) std.file.read(pathToTrueTypeFontFile);
try
{
auto fontFile = new OpenTypeFile(fileContents);
scope(exit) fontFile.destroy();
foreach(fontIndex; 0..fontFile.numberOfFonts)
{
auto font = new OpenTypeFont(fontFile, fontIndex);
scope(exit) font.destroy;
KnownFont kf;
kf.filePath = pathToTrueTypeFontFile;
kf.fontIndex = fontIndex;
kf.familyName = font.familyName;
kf.style = font.style;
kf.weight = font.weight;
_knownFonts ~= kf;
import std.stdio;
//writefln("Family name: %s", font.familyName);
//writefln("SubFamily name: %s", font.subFamilyName);
//writefln("Weight extracted: %s", font.weight);
//writefln("Style: %s\n", font.style());
}
}
catch(Exception e)
{
// For now we consider we shouldn't have unparseable fonts
}
}
/// Returns: a font which best follows the requested characteristics given.
OpenTypeFont findBestMatchingFont(string familyName,
OpenTypeFontWeight weight,
OpenTypeFontStyle style)
{
KnownFont* best = null;
float bestScore = float.infinity;
familyName = toLower(familyName);
foreach(ref kf; _knownFonts)
{
// FONT MATCHING HEURISTIC HERE
// unlike CSS we don't consider the "current char"
// the lower, the better
float score = 0;
if (familyName != toLower(kf.familyName))
score += 100000; // no matching family name
score += abs(weight - kf.weight); // weight difference
if (style != kf.style)
{
// not a big problem to choose oblique and italic interchangeably
if (style == OpenTypeFontStyle.oblique && kf.style == OpenTypeFontStyle.italic)
score += 1;
else if (style == OpenTypeFontStyle.italic && kf.style == OpenTypeFontStyle.oblique)
score += 1;
else
score += 10000;
}
if (score < bestScore)
{
best = &kf;
bestScore = score;
}
}
if (best is null)
throw new Exception(format("No matching font found for '%s'.", familyName));
return best.getParsedFont();
}
private:
// Describe a single font registered somewhere, with the information needed
// to parse it back.
// This is all what we keep before the font is requested,
// to avoid keeping unparsed fonts in memory.
struct KnownFont
{
string filePath; // path to the font file
int fontIndex; // index into that font file, which could contain multiple fonts
string familyName;
OpenTypeFontStyle style;
OpenTypeFontWeight weight;
OpenTypeFont instance;
OpenTypeFont getParsedFont() // opens and parses that font, lazily
{
if (instance is null)
{
ubyte[] fileContents = cast(ubyte[]) std.file.read(filePath);
auto file = new OpenTypeFile(fileContents); // TODO: cache those files too
instance = new OpenTypeFont(file, fontIndex);
}
return instance;
}
void releaseParsedFont()
{
instance = null;
}
}
/// A list of descriptor for all known fonts to the registry.
KnownFont[] _knownFonts;
/// Get a list of system font directories
static private string[] getFontDirectories()
{
return standardPaths(StandardPath.fonts);
}
/// Gives back a list of absolute pathes of .ttf files we know about
static string[] listAllFontFiles()
{
string[] listAllLocalFontFiles()
{
string[] fontAbsolutepathes;
foreach(fontDir; getFontDirectories() )
{
auto files = dirEntries(fontDir, SpanMode.shallow);
foreach(f; files)
if (hasFontExt(f.name))
fontAbsolutepathes ~= f.name;
}
return fontAbsolutepathes;
}
string[] listAllSystemFontFiles()
{
string[] fontAbsolutepathes;
foreach(fontDir; getFontDirectories() )
{
auto files = dirEntries(fontDir, SpanMode.shallow);
foreach(f; files)
if (hasFontExt(f.name))
fontAbsolutepathes ~= f.name;
}
return fontAbsolutepathes;
}
return listAllLocalFontFiles() ~ listAllSystemFontFiles();
}
}
unittest
{
auto registry = new FontRegistry();
foreach(FontRegistry.KnownFont font; registry._knownFonts)
{
font.getParsedFont().ascent(); // This will parse all fonts metrics on the system, thus validating CMAP parsing etc.
font.releaseParsedFont(); // else it takes so much memory one could crash
}
registry.destroy();
}
/// Returns: A global, lazily constructed font registry.
// TODO: synchronization
FontRegistry theFontRegistry()
{
__gshared FontRegistry globalFontRegistry;
if (globalFontRegistry is null)
globalFontRegistry = new FontRegistry();
return globalFontRegistry;
}
private:
static bool hasFontExt(string path)
{
if (path.length < 4)
return false;
string ext = path[$-4..$];
if (ext == ".ttf" || ext == ".ttc"
|| ext == ".otf" || ext == ".otc")
return true; // This is very likely a font
return false;
}
| 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_23_agm-3897723514.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_23_agm-3897723514.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| D |
// Copyright Ferdinand Majerech 2012.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
///System that handles player/script control of entities.
module component.controllersystem;
import std.algorithm;
import std.math;
import component.exceptions;
import containers.lazyarray;
import ice.player;
import math.vector2;
import time.gametime;
import util.resourcemanager;
import util.yaml;
import component.controllercomponent;
import component.dumbscriptcomponent;
import component.enginecomponent;
import component.entitysystem;
import component.playercomponent;
import component.physicscomponent;
import component.system;
///System that handles player/script control of entities.
class ControllerSystem : System
{
private:
///Entity system whose data we're processing.
EntitySystem entitySystem_;
///Game time subsystem.
const GameTime gameTime_;
///Reference to the resource manager handling YAML loading.
ResourceManager!YAMLNode yamlManager_;
///Loaded dumb scripts.
LazyArray!DumbScript dumbScripts_;
///DumbScript used when a DumbScript of an entity fails to load.
DumbScript placeholderDumbScript_;
public:
/**
* Construct a ControllerSystem working on entities from specified EntitySystem
* and using specified game time subsystem to determine time.
*/
this(EntitySystem entitySystem, const GameTime gameTime)
{
entitySystem_ = entitySystem;
gameTime_ = gameTime;
dumbScripts_.loaderDelegate(&loadDumbScript);
}
/// Provide a reference to the YAML resource manager.
///
/// Must be called at least once after construction.
///
/// Throws: SystemInitException on failure.
@property void yamlManager(ResourceManager!YAMLNode rhs)
{
yamlManager_ = rhs;
if(!loadDumbScript("placeholder/dumbscript.yaml", placeholderDumbScript_))
{
throw new SystemInitException("Failed to load placeholder dumbscript.");
}
}
/**
* Update the ControllerSystem, processing entities with ControllerComponents.
*
* Player controls the ControllerComponent, which in turn is used to
* control the EngineComponent of the entity.
*/
void update()
{
//Could be moved to a DumbScriptSystem.
//Allow dumb scripts to control their entities.
foreach(ref Entity e,
ref ControllerComponent control,
ref DumbScriptComponent scriptComponent;
entitySystem_)
{
DumbScript* script = scriptComponent.placeholder
? &placeholderDumbScript_
: dumbScripts_[scriptComponent.scriptIndex];
if(script is null)
{
import std.stdio;
writeln("WARNING: Could not load dumb scipt ",
scriptComponent.scriptIndex);
writeln("Falling back to a placeholder (idle) dumb script");
script = &placeholderDumbScript_;
scriptComponent.placeholder = true;
}
script.control(control, scriptComponent, gameTime_.timeStep);
}
//Could be moved to a PlayerControlSystem.
//Allow players to control their entities' ControllerComponents.
foreach(ref Entity e,
ref ControllerComponent control,
ref PlayerComponent playerComponent;
entitySystem_)
{
if(playerComponent.player is null) {continue;}
playerComponent.player.control(e.id, control);
}
//Set engines' acceleration directions based on controller data.
foreach(ref Entity e,
ref ControllerComponent control,
ref EngineComponent engine;
entitySystem_)
{
engine.accelerationDirection = control.movementDirection;
}
//Kill entities if specified by their controller.
foreach(ref Entity e, ref ControllerComponent control; entitySystem_)
{
if(control.die){e.kill();}
}
}
private:
/**
* Load a dumb script from specified source file.
*
* Params: sourceName = Name of the script source file in the game directory.
* output = Loaded script will be written here.
*
* Returns: true on success, false on failure.
*/
bool loadDumbScript(string sourceName, out DumbScript output)
{
import std.stdio;
string fail(){return "Failed to load dumb script " ~ sourceName ~ ": ";}
try
{
assert(yamlManager_ !is null,
"Trying to load a dumb script but YAML resource manager has not been set");
YAMLNode* yamlSource = yamlManager_.getResource(sourceName);
if(yamlSource is null)
{
writeln(fail() ~ "Couldn't load YAML file " ~ sourceName);
return false;
}
output = DumbScript(*yamlSource);
}
catch(YAMLException e){writeln(fail(), e.msg); return false;}
return true;
}
}
| D |
instance PAL_203_LOTHAR(NPC_DEFAULT)
{
name[0] = "Лотар";
guild = GIL_PAL;
id = 203;
voice = 1;
flags = NPC_FLAG_IMMORTAL;
npctype = NPCTYPE_MAIN;
b_setattributestochapter(self,5);
fight_tactic = FAI_HUMAN_MASTER;
EquipItem(self,itmw_1h_pal_sword);
b_createambientinv(self);
b_setnpcvisual(self,MALE,"Hum_Head_Psionic",FACE_P_NORMALBART_NEFARIUS,BODYTEX_P,itar_pal_h);
Mdl_SetModelFatness(self,1);
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
b_givenpctalents(self);
b_setfightskills(self,80);
daily_routine = rtn_prestart_203;
};
func void rtn_prestart_203()
{
ta_stand_guarding(8,0,23,0,"NW_CITY_MAINSTREET_01_B");
ta_stand_guarding(23,0,8,0,"NW_CITY_MAINSTREET_01_B");
};
func void rtn_start_203()
{
ta_stand_guarding(8,0,23,0,"NW_CITY_LOTHAR");
ta_stand_guarding(23,0,8,0,"NW_CITY_LOTHAR");
};
func void rtn_tot_203()
{
ta_sleep(8,0,23,0,"TOT");
ta_sleep(23,0,8,0,"TOT");
};
| D |
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/WebSockets.build/Serialization/WebSockets+Flags.swift.o : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Communication/WebSocket+Send.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/Frame.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Connection/WebSockets+Hash.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/Fragmentation.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/FrameSerializer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/FrameDeserializer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/WebSocket+Error.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Communication/WebSocket+ControlFrames.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/WebSockets+Flags.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/WebSocketFormatErrors.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Connection/Headers+WebSockets.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Request+WebSockets.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/WebSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Client/WebSocket+Client.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/WebSockets.build/WebSockets+Flags~partial.swiftmodule : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Communication/WebSocket+Send.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/Frame.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Connection/WebSockets+Hash.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/Fragmentation.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/FrameSerializer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/FrameDeserializer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/WebSocket+Error.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Communication/WebSocket+ControlFrames.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/WebSockets+Flags.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/WebSocketFormatErrors.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Connection/Headers+WebSockets.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Request+WebSockets.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/WebSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Client/WebSocket+Client.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/WebSockets.build/WebSockets+Flags~partial.swiftdoc : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Communication/WebSocket+Send.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/Frame.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Connection/WebSockets+Hash.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/Fragmentation.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/FrameSerializer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/FrameDeserializer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/WebSocket+Error.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Communication/WebSocket+ControlFrames.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Serialization/WebSockets+Flags.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/WebSocketFormatErrors.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Connection/Headers+WebSockets.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Request+WebSockets.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Model/WebSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/WebSockets/Client/WebSocket+Client.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes
| D |
func void B_Spawn_Skeleton_S1()
{
if(Skelett_Spawn == FALSE)
{
Wld_InsertNpc(Lesser_Skeleton,"OC_EBR_DARK_FLOOR");
Skelett_Spawn = TRUE;
};
};
| D |
/*******************************************************************************
copyright: Copyright (c) 2004 Kris Bell. все rights reserved
license: BSD стиль: $(LICENSE)
version: Initial release: May 2004
author: Kris
*******************************************************************************/
module util.log.AppendFile;
private import util.log.Log;
private import io.device.File;
private import io.stream.Buffered;
private import io.model;
/*******************************************************************************
Добавляет сообщения лога в файл. У базовой версии отсутствует поддержка
rollover, поэтому просто идёт постоянная добавь в файл. ДобВФайлы может
удовлетворить ваши замыслы.
*******************************************************************************/
class ДобВФайл : Файлер
{
private Маска маска_;
/***********************************************************************
Создаёт базовый FileAppender в файл, расположенный по заданному пути.
***********************************************************************/
this (ткст fp, Добавщик.Выкладка как = пусто);
/***********************************************************************
Вернуть fingerprint для данного класса
***********************************************************************/
final Маска маска ();
/***********************************************************************
Вернуть имя данного класса
***********************************************************************/
final ткст имя ();
/***********************************************************************
Добавить на вывод событие.
***********************************************************************/
final synchronized проц добавь (СобытиеЛога событие);
}
/*******************************************************************************
Класс-основа для добавщиков в файл.
*******************************************************************************/
class Файлер : Добавщик
{
package Бвыв буфер;
private ИПровод провод_;
/***********************************************************************
Вернуть провод.
***********************************************************************/
final ИПровод провод ();
/***********************************************************************
Закрыть файл, ассоциированный с этим Добавщиком.
***********************************************************************/
final synchronized проц закрой ();
/***********************************************************************
Установить провод.
***********************************************************************/
package final Бвыв конфигурируй (ИПровод провод);
}
| D |
//*********************************************************************
// Info EXIT
//*********************************************************************
INSTANCE DIA_NASZ_309_Straznik_EXIT (C_INFO)
{
npc = NASZ_309_Straznik;
nr = 999;
condition = DIA_NASZ_309_Straznik_EXIT_Condition;
information = DIA_NASZ_309_Straznik_EXIT_Info;
permanent = TRUE;
description = DIALOG_ENDE;
};
FUNC INT DIA_NASZ_309_Straznik_EXIT_Condition()
{
return TRUE;
};
FUNC VOID DIA_NASZ_309_Straznik_EXIT_Info()
{
AI_StopProcessInfos (self);
};
///////////////////////////////////////////////////////////////////////
// Info Obcy
///////////////////////////////////////////////////////////////////////
instance DIA_NASZ_309_Straznik_Obcy (C_INFO)
{
npc = NASZ_309_Straznik;
nr = 1;
condition = DIA_NASZ_309_Straznik_Obcy_Condition;
information = DIA_NASZ_309_Straznik_Obcy_Info;
important = TRUE;
permanent = TRUE;
};
func int DIA_NASZ_309_Straznik_Obcy_Condition ()
{
var c_item armor; armor = Npc_GetEquippedArmor (other);
if !((Hlp_IsItem (armor, ItNa_BAN_M)) || (Hlp_IsItem (armor, ItNa_BAN_H))) && (KAPITEL < 3)
{
return TRUE;
};
};
func void DIA_NASZ_309_Straznik_Obcy_Info ()
{
AI_Output (self, other, "DIA_NASZ_309_Straznik_Obcy_03_00"); //Intruz!
AI_Output (self, other, "DIA_NASZ_309_Straznik_Obcy_03_01"); //ALARM!
AI_StopProcessInfos (self);
self.flags = 2;
B_Attack (self, hero, AR_KILL, 1);
MakeBanditsAngry();
MakeBanditsAngry2();
};
func void Straznik309Say_Won() {
AI_Output (self, other,"Straznik309Say_Won_15_00"); //Won!
};
//*********************************************************************
// Info Hello
//*********************************************************************
var int Straznik309WonOneTime;
INSTANCE DIA_NASZ_309_Straznik_siema (C_INFO)
{
npc = NASZ_309_Straznik;
nr = 1;
condition = DIA_NASZ_309_Straznik_siema_Condition;
information = DIA_NASZ_309_Straznik_siema_Info;
permanent = TRUE;
important = TRUE;
};
FUNC INT DIA_NASZ_309_Straznik_siema_Condition()
{
if (! WCHODZENIE_SZEF)
{
return TRUE;
};
};
FUNC VOID DIA_NASZ_309_Straznik_siema_Info()
{
if (npc_hasitems (other, ItNa_ZezwolenieBandyci) >=1) {
Straznik309Say_Won();
AI_Output (other, self,"DIA_NASZ_309_Straznik_siema_55_01"); //Frut zezwolił mi na widzenie się z szefem. Mam na to papier.
AI_Output (self, other,"DIA_NASZ_309_Straznik_siema_55_02"); //Pokaż.
B_giveinvitems (other, self, ItNa_ZezwolenieBandyci, 1);
B_UseFakeScroll();
AI_Output (self, other,"DIA_NASZ_309_Straznik_siema_55_03"); //Dobra, możesz wejść. Tylko nie palnij czegoś głupiego. No, o ile chcesz jeszcze trochę pożyć.
B_LogEntry (TOPIC_Gestath_renegaci, "Teraz mogę porozmawiać z przywódcą bandytów.");
WCHODZENIE_SZEF=1;
}
else {
Straznik309Say_Won();
if (Straznik309WonOneTime == FALSE) {
AI_Output (other, self,"DIA_NASZ_309_Straznik_siema_55_04"); //Chcę rozmawiać z szefem.
AI_Output (self, other,"DIA_NASZ_309_Straznik_siema_55_05"); //Nie masz pozwolenia od Fruta, więc o tym zapomnij. A teraz zjeżdżaj!
Straznik309WonOneTime = TRUE;
};
AI_TurnAway (hero, self);
AI_GotoWP (hero, "OW_PATH_033_TO_CAVE3");
AI_StopProcessInfos (self);
};
};
//*********************************************************************
// Info Hello3
//*********************************************************************
INSTANCE DIA_NASZ_309_Straznik_siema3 (C_INFO)
{
npc = NASZ_309_Straznik;
nr = 2;
condition = DIA_NASZ_309_Straznik_siema3_Condition;
information = DIA_NASZ_309_Straznik_siema3_Info;
permanent = TRUE;
important = TRUE;
};
FUNC INT DIA_NASZ_309_Straznik_siema3_Condition()
{
if (Npc_IsInState (self, ZS_Talk)
&& (WCHODZENIE_SZEF == 1))
{
return TRUE;
};
};
FUNC VOID DIA_NASZ_309_Straznik_siema3_Info()
{
AI_Output (self, other,"DIA_NASZ_309_Straznik_siema3_15_00"); //Muszę być czujny.
AI_StopProcessInfos (self);
};
| D |
a siege and massacre at a mission in San Antonio in 1836
| D |
/++
$(H2 ASDF Package)
Publicly imports $(SUBMODULE _asdf), $(SUBMODULE jsonparser), and $(SUBMODULE serialization).
Copyright: Tamedia Digital, 2016
Authors: Ilia Ki
License: MIT
Macros:
SUBMODULE = $(LINK2 asdf_$1.html, _asdf.$1)
SUBREF = $(LINK2 asdf_$1.html#.$2, $(TT $2))$(NBSP)
T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
T4=$(TR $(TDNW $(LREF $1)) $(TD $2) $(TD $3) $(TD $4))
+/
module asdf;
public import asdf.asdf;
public import asdf.jsonparser;
public import asdf.serialization;
public import asdf.transform;
| D |
; Copyright (C) 2008 The Android Open Source Project
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
.source T_sput_boolean_18.java
.class public dot.junit.opcodes.sput_boolean.d.T_sput_boolean_18
.super java/lang/Object
.field public static st_i1 D
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public run()V
.limit regs 3
const v1, 1
sput-boolean v1, dot.junit.opcodes.sput_boolean.d.T_sput_boolean_18.st_i1 D
return-void
.end method
| D |
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;
immutable long MOD = 10^^9 + 7;
immutable long INF = 1L << 59;
void main() {
auto T = readln.chomp;
string S = "";
foreach_reverse (c; T) S ~= c;
auto N = S.length.to!int;
auto P = new long[](N+1);
P[0] = 1;
foreach (i; 0..N) P[i+1] = P[i] * 26 % MOD;
long ans = P[N];
auto sa = suffixArray(S);
int start = 1;
foreach (i; 1..N+1) {
if (i == 1 || sa.lcp[i-1] < N - sa.sa[start]) {
ans -= P[sa.sa[i]];
ans %= MOD;
start = i;
}
}
ans = (ans + MOD) % MOD;
ans.writeln;
}
struct SA(T) {
T[] s; /// base string
int[] sa; /// suffix array
int[] rsa; /// reverse sa, rsa[sa[i]] == i
int[] lcp; /// lcp
this(in T[] s) {
size_t n = s.length;
this.s = s.dup;
sa = new int[](n+1);
rsa = new int[](n+1);
lcp = new int[](n);
}
}
int[] sais(T)(in T[] _s, int B = 200) {
import std.conv, std.algorithm, std.range;
int n = _s.length.to!int;
int[] sa = new int[](n+1);
if (n == 0) return sa;
auto s = _s.map!"a+1".array ~ T(0); B++; // add 0 to last
// ls
bool[] ls = new bool[](n+1);
ls[n] = true;
foreach_reverse (i; 0..n) {
ls[i] = (s[i] == s[i+1]) ? ls[i+1] : (s[i] < s[i+1]);
}
// sum(l[0], s[0], l[1], s[1], ...)
int[] sumL = new int[](B+1), sumS = new int[](B+1);
s.each!((i, c) => !ls[i] ? sumS[c]++ : sumL[c+1]++);
foreach (i; 0..B) {
sumL[i+1] += sumS[i];
sumS[i+1] += sumL[i+1];
}
void induce(in int[] lms) {
sa[] = -1;
auto buf0 = sumS.dup;
foreach (d; lms) {
sa[buf0[s[d]]++] = d;
}
auto buf1 = sumL.dup;
foreach (v; sa) {
if (v >= 1 && !ls[v-1]) {
sa[buf1[s[v-1]]++] = v-1;
}
}
auto buf2 = sumL.dup;
foreach_reverse (v; sa) {
if (v >= 1 && ls[v-1]) {
sa[--buf2[s[v-1]+1]] = v-1;
}
}
}
int[] lms = iota(1, n+1).filter!(i => !ls[i-1] && ls[i]).array;
int[] lmsMap = new int[](n+1);
lmsMap[] = -1; lms.each!((i, v) => lmsMap[v] = i.to!int);
induce(lms);
if (lms.length >= 2) {
int m = lms.length.to!int - 1;
// sort lms
auto lms2 = sa.filter!(v => lmsMap[v] != -1).array;
int recN = 1;
int[] recS = new int[](m);
recS[lmsMap[lms2[1]]] = 1;
foreach (i; 2..m+1) {
int l = lms2[i-1], r = lms2[i];
int nl = lms[lmsMap[l]+1], nr = lms[lmsMap[r]+1];
if (cmp(s[l..nl+1], s[r..nr+1])) recN++;
recS[lmsMap[lms2[i]]] = recN;
}
//re induce
induce(lms.indexed(sais!int(recS, recN)).array);
}
return sa;
}
/// return SA!T. each character must be inside [T(0), T(B)).
SA!T suffixArray(T)(in T[] _s, int B = 200) {
import std.conv, std.algorithm;
int n = _s.length.to!int;
auto saInfo = SA!T(_s);
if (n == 0) return saInfo;
with (saInfo) {
sa = sais(_s, B);
//rsa
sa.each!((i, v) => rsa[v] = i.to!int);
//lcp
int h = 0;
foreach (i; 0..n) {
int j = sa[rsa[i]-1];
if (h > 0) h--;
for (; j+h < n && i+h < n; h++) {
if (s[j+h] != s[i+h]) break;
}
lcp[rsa[i]-1] = h;
}
}
return saInfo;
}
| D |
/Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/GraphRequestProtocol.o : /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFURL.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTask.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/Bolts.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
/Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/GraphRequestProtocol~partial.swiftmodule : /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFURL.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTask.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/Bolts.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
/Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/GraphRequestProtocol~partial.swiftdoc : /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/william/Projects/studySocial/studySocial/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFURL.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTask.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/Common/Bolts.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/william/Projects/studySocial/studySocial/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/william/Projects/studySocial/studySocial/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
| D |
module bullet2.BulletDynamics;
public import bullet2.BulletDynamics.ConstraintSolver;
public import bullet2.BulletDynamics.Dynamics;
| D |
/Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/Build/Intermediates/SpaceShooter.build/Debug-iphonesimulator/SpaceShooter.build/Objects-normal/x86_64/Bullet.o : /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/ShipView.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/SettingVC.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/ViewController.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/MeteorView.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameOver.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/AppDelegate.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameMenuVC.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Power.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameManager.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Blalajljdad.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Bullet.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/LoadGameVC.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /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/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/Build/Intermediates/SpaceShooter.build/Debug-iphonesimulator/SpaceShooter.build/Objects-normal/x86_64/Bullet~partial.swiftmodule : /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/ShipView.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/SettingVC.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/ViewController.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/MeteorView.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameOver.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/AppDelegate.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameMenuVC.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Power.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameManager.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Blalajljdad.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Bullet.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/LoadGameVC.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /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/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/Build/Intermediates/SpaceShooter.build/Debug-iphonesimulator/SpaceShooter.build/Objects-normal/x86_64/Bullet~partial.swiftdoc : /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/ShipView.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/SettingVC.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/ViewController.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/MeteorView.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameOver.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/AppDelegate.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameMenuVC.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Power.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/GameManager.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Blalajljdad.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/Bullet.swift /Users/dangcan/Documents/demoSwift/Space-Shooter-2.0-master/SpaceShooter/LoadGameVC.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /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 |
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.format;
import std.concurrency;
struct Monkey
{
int m;
int[] items;
string[] op;
int div;
int tm, fm;
int inspect = 0;
}
int perform_op(int old, string[] op)
{
int l = op[0] == "old" ? old : op[0].to!int;
int r = op[2] == "old" ? old : op[2].to!int;
if (op[1] == "+")
return l + r;
else if (op[1] == "*")
return l * r;
assert(0);
}
void main(string[] args)
{
Monkey[] monkeys;
while(!stdin.eof)
{
Monkey monkey;
stdin.readf!"Monkey %d:\n"(monkey.m);
string s;
stdin.readf(" Starting items: %s\n", s);
auto spec = singleSpec("%(%s, %)");
monkey.items = s.unformatValue!(int[])(spec);
string sop;
stdin.readf(" Operation: new = %s\n", sop);
monkey.op = sop.split;
stdin.readf(" Test: divisible by %d\n", monkey.div);
stdin.readf(" If true: throw to monkey %d\n", monkey.tm);
stdin.readf(" If false: throw to monkey %d\n", monkey.fm);
stdin.readln;
monkeys ~= monkey;
}
debug writeln(" Monkeys: ");
debug monkeys.each!(m => m.writeln);
debug writeln;
foreach (round; 0..20)
{
foreach (ref monkey; monkeys)
{
debug writeln(" Monkey inspector: ", monkey);
foreach (item; monkey.items)
{
monkey.inspect++;
int w = perform_op(item, monkey.op);
w /= 3;
if (w % monkey.div == 0)
monkeys[monkey.tm].items ~= w;
else
monkeys[monkey.fm].items ~= w;
monkey.items = monkey.items[1..$];
debug monkeys.each!(m => m.writeln);
debug writeln;
}
}
}
auto inspects = monkeys.map!(x => x.inspect).array.sort;
writeln(inspects[$-1] * inspects[$-2]);
}
| D |
a formal expression by a meeting
the ability of a microscope or telescope to measure the angular separation of images that are close together
the trait of being resolute
finding a solution to a problem
something settled or resolved
analysis into clear-cut components
(computer science) the number of pixels per square inch on a computer-generated display
the subsidence of swelling or other signs of inflammation (especially in a lung)
(music) a dissonant chord is followed by a consonant chord
a statement that solves a problem or explains how to solve the problem
a decision to do something or to behave in a certain manner
| D |
the act of sowing (of seeds in the ground or, figuratively, of germs in the body or ideas in the mind, etc.)
the introduction of semen into the genital tract of a female
| D |
/**
* The core.internal.atomic module comtains the low-level atomic features available in hardware.
* This module may be a routing layer for compiler intrinsics.
*
* Copyright: Copyright Manu Evans 2019.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Sean Kelly, Alex Rønne Petersen, Manu Evans
* Source: $(DRUNTIMESRC core/internal/_atomic.d)
*/
module core.internal.atomic;
import core.atomic : MemoryOrder;
version (LDC)
{
import core.atomic : has128BitCAS;
import ldc.intrinsics;
pragma(inline, true):
inout(T) atomicLoad(MemoryOrder order = MemoryOrder.seq, T)(inout(T)* src) pure nothrow @nogc @trusted
{
alias A = _AtomicType!T;
version (WebAssembly) {
return *src;
} else {
A result = llvm_atomic_load!A(cast(shared A*) src, _ordering!(order));
return *cast(inout(T)*) &result;
}
}
void atomicStore(MemoryOrder order = MemoryOrder.seq, T)(T* dest, T value) pure nothrow @nogc @trusted
{
alias A = _AtomicType!T;
version (WebAssembly) {
*dest = value;
} else
llvm_atomic_store!A(*cast(A*) &value, cast(shared A*) dest, _ordering!(order));
}
T atomicExchange(MemoryOrder order = MemoryOrder.seq, bool result = true, T)(T* dest, T value) pure nothrow @nogc @trusted
{
alias A = _AtomicType!T;
version (WebAssembly) {
auto old = *dest;
*dest = value;
return old;
} else {
A result = llvm_atomic_rmw_xchg!A(cast(shared A*) dest, *cast(A*) &value, _ordering!(order));
return *cast(T*) &result;
}
}
bool atomicCompareExchange(bool weak = false, MemoryOrder succ = MemoryOrder.seq, MemoryOrder fail = MemoryOrder.seq, T)(T* dest, T* compare, T value) pure nothrow @nogc @trusted
{
alias A = _AtomicType!T;
version (WebAssembly) {
// TODO: WebAssembly has no atomic ops yet
import core.stdc.string : memcmp;
if (memcmp(cast(void*)dest, cast(void*)compare, T.sizeof) == 0) {
*dest = value;
return true;
}
*compare = *dest;
return false;
} else {
auto result = llvm_atomic_cmp_xchg!A(cast(shared A*) dest, *cast(A*) compare, *cast(A*) &value,
_ordering!(succ), _ordering!(fail), weak);
*compare = *cast(T*) &result.previousValue;
return result.exchanged;
}
}
bool atomicCompareExchangeWeak(MemoryOrder succ = MemoryOrder.seq, MemoryOrder fail = MemoryOrder.seq, T)(T* dest, T* compare, T value) pure nothrow @nogc @trusted
{
return atomicCompareExchange!(true, succ, fail, T)(dest, compare, value);
}
bool atomicCompareExchangeStrong(MemoryOrder succ = MemoryOrder.seq, MemoryOrder fail = MemoryOrder.seq, T)(T* dest, T* compare, T value) pure nothrow @nogc @trusted
{
return atomicCompareExchange!(false, succ, fail, T)(dest, compare, value);
}
bool atomicCompareExchangeNoResult(bool weak = false, MemoryOrder succ = MemoryOrder.seq, MemoryOrder fail = MemoryOrder.seq, T)(T* dest, const T compare, T value) pure nothrow @nogc @trusted
{
alias A = _AtomicType!T;
version (WebAssembly) {
// TODO: WebAssembly has no atomic ops yet
import core.stdc.string : memcmp;
if (memcmp(cast(void*)dest, cast(void*)&compare, T.sizeof) == 0) {
*dest = value;
return true;
}
return false;
} else {
auto result = llvm_atomic_cmp_xchg!A(cast(shared A*) dest, *cast(A*) &compare, *cast(A*) &value,
_ordering!(succ), _ordering!(fail), weak);
return result.exchanged;
}
}
bool atomicCompareExchangeStrongNoResult(MemoryOrder succ = MemoryOrder.seq, MemoryOrder fail = MemoryOrder.seq, T)(T* dest, const T compare, T value) pure nothrow @nogc @trusted
{
return atomicCompareExchangeNoResult!(false, succ, fail, T)(dest, compare, value);
}
void atomicFence(MemoryOrder order = MemoryOrder.seq)() pure nothrow @nogc @trusted
{
version (WebAssembly) {} else
llvm_memory_fence(_ordering!(order));
}
void pause() pure nothrow @nogc @trusted
{
// LDC: TODO?
}
template _ordering(MemoryOrder ms)
{
static if (ms == MemoryOrder.acq)
enum _ordering = AtomicOrdering.Acquire;
else static if (ms == MemoryOrder.rel)
enum _ordering = AtomicOrdering.Release;
else static if (ms == MemoryOrder.acq_rel)
enum _ordering = AtomicOrdering.AcquireRelease;
else static if (ms == MemoryOrder.seq)
enum _ordering = AtomicOrdering.SequentiallyConsistent;
else static if (ms == MemoryOrder.raw)
{
// Note that C/C++ 'relaxed' is not the same as NoAtomic/Unordered,
// but Monotonic.
enum _ordering = AtomicOrdering.Monotonic;
}
else
static assert(0);
}
private template _AtomicType(T)
{
static if (T.sizeof == ubyte.sizeof)
alias _AtomicType = ubyte;
else static if (T.sizeof == ushort.sizeof)
alias _AtomicType = ushort;
else static if (T.sizeof == uint.sizeof)
alias _AtomicType = uint;
else static if (T.sizeof == ulong.sizeof)
alias _AtomicType = ulong;
else static if (T.sizeof == 2*ulong.sizeof && has128BitCAS)
{
struct UCent
{
ulong value1;
ulong value2;
}
alias _AtomicType = UCent;
}
else
static assert(is(_AtomicType!T),
"Cannot atomically load/store type of size " ~ T.sizeof.stringof);
}
}
else: // !LDC
private
{
enum : int
{
AX, BX, CX, DX, DI, SI, R8, R9
}
immutable string[4][8] registerNames = [
[ "AL", "AX", "EAX", "RAX" ],
[ "BL", "BX", "EBX", "RBX" ],
[ "CL", "CX", "ECX", "RCX" ],
[ "DL", "DX", "EDX", "RDX" ],
[ "DIL", "DI", "EDI", "RDI" ],
[ "SIL", "SI", "ESI", "RSI" ],
[ "R8B", "R8W", "R8D", "R8" ],
[ "R9B", "R9W", "R9D", "R9" ],
];
template RegIndex(T)
{
static if (T.sizeof == 1)
enum RegIndex = 0;
else static if (T.sizeof == 2)
enum RegIndex = 1;
else static if (T.sizeof == 4)
enum RegIndex = 2;
else static if (T.sizeof == 8)
enum RegIndex = 3;
else
static assert(false, "Invalid type");
}
enum SizedReg(int reg, T = size_t) = registerNames[reg][RegIndex!T];
}
inout(T) atomicLoad(MemoryOrder order = MemoryOrder.seq, T)(inout(T)* src) pure nothrow @nogc @trusted
if (CanCAS!T)
{
static assert(order != MemoryOrder.rel, "invalid MemoryOrder for atomicLoad()");
static if (T.sizeof == size_t.sizeof * 2)
{
version (D_InlineAsm_X86)
{
asm pure nothrow @nogc @trusted
{
push EDI;
push EBX;
mov EBX, 0;
mov ECX, 0;
mov EAX, 0;
mov EDX, 0;
mov EDI, src;
lock; cmpxchg8b [EDI];
pop EBX;
pop EDI;
}
}
else version (D_InlineAsm_X86_64)
{
version (Windows)
{
static if (RegisterReturn!T)
{
enum SrcPtr = SizedReg!CX;
enum RetPtr = null;
}
else
{
enum SrcPtr = SizedReg!DX;
enum RetPtr = SizedReg!CX;
}
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
naked;
push RBX;
mov R8, %0;
?1 mov R9, %1;
mov RBX, 0;
mov RCX, 0;
mov RAX, 0;
mov RDX, 0;
lock; cmpxchg16b [R8];
?1 mov [R9], RAX;
?1 mov 8[R9], RDX;
pop RBX;
ret;
}
}, SrcPtr, RetPtr));
}
else
{
asm pure nothrow @nogc @trusted
{
naked;
push RBX;
mov RBX, 0;
mov RCX, 0;
mov RAX, 0;
mov RDX, 0;
lock; cmpxchg16b [RDI];
pop RBX;
ret;
}
}
}
}
else static if (needsLoadBarrier!order)
{
version (D_InlineAsm_X86)
{
enum SrcReg = SizedReg!CX;
enum ZeroReg = SizedReg!(DX, T);
enum ResReg = SizedReg!(AX, T);
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
mov %1, 0;
mov %2, 0;
mov %0, src;
lock; cmpxchg [%0], %1;
}
}, SrcReg, ZeroReg, ResReg));
}
else version (D_InlineAsm_X86_64)
{
version (Windows)
enum SrcReg = SizedReg!CX;
else
enum SrcReg = SizedReg!DI;
enum ZeroReg = SizedReg!(DX, T);
enum ResReg = SizedReg!(AX, T);
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
naked;
mov %1, 0;
mov %2, 0;
lock; cmpxchg [%0], %1;
ret;
}
}, SrcReg, ZeroReg, ResReg));
}
}
else
return *src;
}
void atomicStore(MemoryOrder order = MemoryOrder.seq, T)(T* dest, T value) pure nothrow @nogc @trusted
if (CanCAS!T)
{
static assert(order != MemoryOrder.acq, "Invalid MemoryOrder for atomicStore()");
static if (T.sizeof == size_t.sizeof * 2)
{
version (D_InlineAsm_X86)
{
asm pure nothrow @nogc @trusted
{
push EDI;
push EBX;
lea EDI, value;
mov EBX, [EDI];
mov ECX, 4[EDI];
mov EDI, dest;
mov EAX, [EDI];
mov EDX, 4[EDI];
L1: lock; cmpxchg8b [EDI];
jne L1;
pop EBX;
pop EDI;
}
}
else version (D_InlineAsm_X86_64)
{
version (Windows)
{
asm pure nothrow @nogc @trusted
{
naked;
push RBX;
mov R8, RDX;
mov RAX, [RDX];
mov RDX, 8[RDX];
mov RBX, [RCX];
mov RCX, 8[RCX];
L1: lock; cmpxchg16b [R8];
jne L1;
pop RBX;
ret;
}
}
else
{
asm pure nothrow @nogc @trusted
{
naked;
push RBX;
mov RBX, RDI;
mov RCX, RSI;
mov RDI, RDX;
mov RAX, [RDX];
mov RDX, 8[RDX];
L1: lock; cmpxchg16b [RDI];
jne L1;
pop RBX;
ret;
}
}
}
}
else static if (needsStoreBarrier!order)
atomicExchange!(order, false)(dest, value);
else
*dest = value;
}
T atomicFetchAdd(MemoryOrder order = MemoryOrder.seq, bool result = true, T)(T* dest, T value) pure nothrow @nogc @trusted
if (is(T : ulong))
{
version (D_InlineAsm_X86)
{
static assert(T.sizeof <= 4, "64bit atomicFetchAdd not supported on 32bit target." );
enum DestReg = SizedReg!DX;
enum ValReg = SizedReg!(AX, T);
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
mov %1, value;
mov %0, dest;
lock; xadd[%0], %1;
}
}, DestReg, ValReg));
}
else version (D_InlineAsm_X86_64)
{
version (Windows)
{
enum DestReg = SizedReg!DX;
enum ValReg = SizedReg!(CX, T);
}
else
{
enum DestReg = SizedReg!SI;
enum ValReg = SizedReg!(DI, T);
}
enum ResReg = result ? SizedReg!(AX, T) : null;
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
naked;
lock; xadd[%0], %1;
?2 mov %2, %1;
ret;
}
}, DestReg, ValReg, ResReg));
}
else
static assert (false, "Unsupported architecture.");
}
T atomicFetchSub(MemoryOrder order = MemoryOrder.seq, bool result = true, T)(T* dest, T value) pure nothrow @nogc @trusted
if (is(T : ulong))
{
return atomicFetchAdd(dest, cast(T)-cast(IntOrLong!T)value);
}
T atomicExchange(MemoryOrder order = MemoryOrder.seq, bool result = true, T)(T* dest, T value) pure nothrow @nogc @trusted
if (is(T : ulong) || is(T == class) || is(T == interface) || is(T U : U*))
{
version (D_InlineAsm_X86)
{
static assert(T.sizeof <= 4, "64bit atomicExchange not supported on 32bit target." );
enum DestReg = SizedReg!CX;
enum ValReg = SizedReg!(AX, T);
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
mov %1, value;
mov %0, dest;
xchg [%0], %1;
}
}, DestReg, ValReg));
}
else version (D_InlineAsm_X86_64)
{
version (Windows)
{
enum DestReg = SizedReg!DX;
enum ValReg = SizedReg!(CX, T);
}
else
{
enum DestReg = SizedReg!SI;
enum ValReg = SizedReg!(DI, T);
}
enum ResReg = result ? SizedReg!(AX, T) : null;
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
naked;
xchg [%0], %1;
?2 mov %2, %1;
ret;
}
}, DestReg, ValReg, ResReg));
}
else
static assert (false, "Unsupported architecture.");
}
alias atomicCompareExchangeWeak = atomicCompareExchangeStrong;
bool atomicCompareExchangeStrong(MemoryOrder succ = MemoryOrder.seq, MemoryOrder fail = MemoryOrder.seq, T)(T* dest, T* compare, T value) pure nothrow @nogc @trusted
if (CanCAS!T)
{
version (D_InlineAsm_X86)
{
static if (T.sizeof <= 4)
{
enum DestAddr = SizedReg!CX;
enum CmpAddr = SizedReg!DI;
enum Val = SizedReg!(DX, T);
enum Cmp = SizedReg!(AX, T);
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
push %1;
mov %2, value;
mov %1, compare;
mov %3, [%1];
mov %0, dest;
lock; cmpxchg [%0], %2;
mov [%1], %3;
setz AL;
pop %1;
}
}, DestAddr, CmpAddr, Val, Cmp));
}
else static if (T.sizeof == 8)
{
asm pure nothrow @nogc @trusted
{
push EDI;
push EBX;
lea EDI, value;
mov EBX, [EDI];
mov ECX, 4[EDI];
mov EDI, compare;
mov EAX, [EDI];
mov EDX, 4[EDI];
mov EDI, dest;
lock; cmpxchg8b [EDI];
mov EDI, compare;
mov [EDI], EAX;
mov 4[EDI], EDX;
setz AL;
pop EBX;
pop EDI;
}
}
else
static assert(T.sizeof <= 8, "128bit atomicCompareExchangeStrong not supported on 32bit target." );
}
else version (D_InlineAsm_X86_64)
{
static if (T.sizeof <= 8)
{
version (Windows)
{
enum DestAddr = SizedReg!R8;
enum CmpAddr = SizedReg!DX;
enum Val = SizedReg!(CX, T);
}
else
{
enum DestAddr = SizedReg!DX;
enum CmpAddr = SizedReg!SI;
enum Val = SizedReg!(DI, T);
}
enum Res = SizedReg!(AX, T);
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
naked;
mov %3, [%1];
lock; cmpxchg [%0], %2;
jne compare_fail;
mov AL, 1;
ret;
compare_fail:
mov [%1], %3;
xor AL, AL;
ret;
}
}, DestAddr, CmpAddr, Val, Res));
}
else
{
version (Windows)
{
asm pure nothrow @nogc @trusted
{
naked;
push RBX;
mov R9, RDX;
mov RAX, [RDX];
mov RDX, 8[RDX];
mov RBX, [RCX];
mov RCX, 8[RCX];
lock; cmpxchg16b [R8];
pop RBX;
jne compare_fail;
mov AL, 1;
ret;
compare_fail:
mov [R9], RAX;
mov 8[R9], RDX;
xor AL, AL;
ret;
}
}
else
{
asm pure nothrow @nogc @trusted
{
naked;
push RBX;
mov R8, RCX;
mov R9, RDX;
mov RAX, [RDX];
mov RDX, 8[RDX];
mov RBX, RDI;
mov RCX, RSI;
lock; cmpxchg16b [R8];
pop RBX;
jne compare_fail;
mov AL, 1;
ret;
compare_fail:
mov [R9], RAX;
mov 8[R9], RDX;
xor AL, AL;
ret;
}
}
}
}
else
static assert (false, "Unsupported architecture.");
}
bool atomicCompareExchangeStrongNoResult(MemoryOrder succ = MemoryOrder.seq, MemoryOrder fail = MemoryOrder.seq, T)(T* dest, const T compare, T value) pure nothrow @nogc @trusted
if (CanCAS!T)
{
version (D_InlineAsm_X86)
{
static if (T.sizeof <= 4)
{
enum DestAddr = SizedReg!CX;
enum Cmp = SizedReg!(AX, T);
enum Val = SizedReg!(DX, T);
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
mov %2, value;
mov %1, compare;
mov %0, dest;
lock; cmpxchg [%0], %2;
setz AL;
}
}, DestAddr, Cmp, Val));
}
else static if (T.sizeof == 8)
{
asm pure nothrow @nogc @trusted
{
push EDI;
push EBX;
lea EDI, value;
mov EBX, [EDI];
mov ECX, 4[EDI];
lea EDI, compare;
mov EAX, [EDI];
mov EDX, 4[EDI];
mov EDI, dest;
lock; cmpxchg8b [EDI];
setz AL;
pop EBX;
pop EDI;
}
}
else
static assert(T.sizeof <= 8, "128bit atomicCompareExchangeStrong not supported on 32bit target." );
}
else version (D_InlineAsm_X86_64)
{
static if (T.sizeof <= 8)
{
version (Windows)
{
enum DestAddr = SizedReg!R8;
enum Cmp = SizedReg!(DX, T);
enum Val = SizedReg!(CX, T);
}
else
{
enum DestAddr = SizedReg!DX;
enum Cmp = SizedReg!(SI, T);
enum Val = SizedReg!(DI, T);
}
enum AXReg = SizedReg!(AX, T);
mixin (simpleFormat(q{
asm pure nothrow @nogc @trusted
{
naked;
mov %3, %1;
lock; cmpxchg [%0], %2;
setz AL;
ret;
}
}, DestAddr, Cmp, Val, AXReg));
}
else
{
version (Windows)
{
asm pure nothrow @nogc @trusted
{
naked;
push RBX;
mov RAX, [RDX];
mov RDX, 8[RDX];
mov RBX, [RCX];
mov RCX, 8[RCX];
lock; cmpxchg16b [R8];
setz AL;
pop RBX;
ret;
}
}
else
{
asm pure nothrow @nogc @trusted
{
naked;
push RBX;
mov RAX, RDX;
mov RDX, RCX;
mov RBX, RDI;
mov RCX, RSI;
lock; cmpxchg16b [R8];
setz AL;
pop RBX;
ret;
}
}
}
}
else
static assert (false, "Unsupported architecture.");
}
void atomicFence(MemoryOrder order = MemoryOrder.seq)() pure nothrow @nogc @trusted
{
// TODO: `mfence` should only be required for seq_cst operations, but this depends on
// the compiler's backend knowledge to not reorder code inappropriately,
// so we'll apply it conservatively.
static if (order != MemoryOrder.raw)
{
version (D_InlineAsm_X86)
{
import core.cpuid;
// TODO: review this implementation; it seems way overly complicated
asm pure nothrow @nogc @trusted
{
naked;
call sse2;
test AL, AL;
jne Lcpuid;
// Fast path: We have SSE2, so just use mfence.
mfence;
jmp Lend;
Lcpuid:
// Slow path: We use cpuid to serialize. This is
// significantly slower than mfence, but is the
// only serialization facility we have available
// on older non-SSE2 chips.
push EBX;
mov EAX, 0;
cpuid;
pop EBX;
Lend:
ret;
}
}
else version (D_InlineAsm_X86_64)
{
asm pure nothrow @nogc @trusted
{
naked;
mfence;
ret;
}
}
else
static assert (false, "Unsupported architecture.");
}
}
void pause() pure nothrow @nogc @trusted
{
version (D_InlineAsm_X86)
{
asm pure nothrow @nogc @trusted
{
naked;
rep; nop;
ret;
}
}
else version (D_InlineAsm_X86_64)
{
asm pure nothrow @nogc @trusted
{
naked;
// pause; // TODO: DMD should add this opcode to its inline asm
rep; nop;
ret;
}
}
else
{
// ARM should `yield`
// other architectures? otherwise some sort of nop...
}
}
private:
version (Windows)
{
enum RegisterReturn(T) = is(T : U[], U) || is(T : R delegate(A), R, A...);
}
enum CanCAS(T) = is(T : ulong) ||
is(T == class) ||
is(T == interface) ||
is(T : U*, U) ||
is(T : U[], U) ||
is(T : R delegate(A), R, A...) ||
(is(T == struct) && __traits(isPOD, T) &&
T.sizeof <= size_t.sizeof*2 && // no more than 2 words
(T.sizeof & (T.sizeof - 1)) == 0 // is power of 2
);
template IntOrLong(T)
{
static if (T.sizeof > 4)
alias IntOrLong = long;
else
alias IntOrLong = int;
}
// NOTE: x86 loads implicitly have acquire semantics so a memory
// barrier is only necessary on releases.
template needsLoadBarrier( MemoryOrder ms )
{
enum bool needsLoadBarrier = ms == MemoryOrder.seq;
}
// NOTE: x86 stores implicitly have release semantics so a memory
// barrier is only necessary on acquires.
template needsStoreBarrier( MemoryOrder ms )
{
enum bool needsStoreBarrier = ms == MemoryOrder.seq;
}
// this is a helper to build asm blocks
string simpleFormat(string format, string[] args...)
{
string result;
outer: while (format.length)
{
foreach (i; 0 .. format.length)
{
if (format[i] == '%' || format[i] == '?')
{
bool isQ = format[i] == '?';
result ~= format[0 .. i++];
assert (i < format.length, "Invalid format string");
if (format[i] == '%' || format[i] == '?')
{
assert(!isQ, "Invalid format string");
result ~= format[i++];
}
else
{
int index = 0;
assert (format[i] >= '0' && format[i] <= '9', "Invalid format string");
while (i < format.length && format[i] >= '0' && format[i] <= '9')
index = index * 10 + (ubyte(format[i++]) - ubyte('0'));
if (!isQ)
result ~= args[index];
else if (!args[index])
{
size_t j = i;
for (; j < format.length;)
{
if (format[j++] == '\n')
break;
}
i = j;
}
}
format = format[i .. $];
continue outer;
}
}
result ~= format;
break;
}
return result;
}
| D |
import std.stdio;
import std.conv;
import std.algorithm : group;
import std.algorithm.iteration : sum, splitter, map, each, filter;
import std.string : split;
import std.array;
unittest{
int[string] example_input_1 = ["1122": 3,
"1111": 4,
"1234": 0,
"91212129": 9];
foreach (example_string, expected_output; example_input_1)
{
auto example_ints = example_string.splitter("").map!(to!int).array;
assert(sum_adjacent_pairs(example_ints) == expected_output);
}
int[string] example_input_2 = ["1212": 6,
"1221": 0,
"123425": 4,
"123123": 12,
"12131415": 4];
foreach (example_string, expected_output; example_input_2)
{
auto example_ints = example_string.splitter("").map!(to!int).array;
assert(sum_halfway_pairs(example_ints) == expected_output);
}
}
auto sum_adjacent_pairs(int[] input_ints)
{
input_ints ~= input_ints[0];
int[] to_sum;
auto pairs = input_ints.group.filter!("a[1] > 1");
foreach (p; pairs)
{
for (int n = 1; n < p[1]; n++)
{
to_sum ~= p[0];
}
}
return sum(to_sum);
}
auto sum_halfway_pairs(int[] input_ints)
{
int[] to_sum;
foreach (i, input_int; input_ints)
{
auto lookahead = (i + input_ints.length/2) % input_ints.length;
if (input_int == input_ints[lookahead])
{
to_sum ~= input_int;
}
}
return sum(to_sum);
}
void main(string[] argv)
{
foreach (input_string; argv[1..$])
{
//write(input_string, ": ");
auto input_ints = input_string.splitter("").map!(to!int).array;
auto first_sum = sum_adjacent_pairs(input_ints);
write(first_sum, " ");
auto second_sum = sum_halfway_pairs(input_ints);
writeln(second_sum, " ");
}
}
| D |
/* calibrateASL.d
**
** created by jig 7/6/06
*/
#include "rexHdr.h"
#include "paradigm_rec.h"
#include "toys.h"
#include "lcode.h"
/* PRIVATE data structures */
/* GLOBAL VARIABLES */
static _PRrecord gl_rec = NULL; /* KA-HU-NA */
/* for now, allocate these here... */
MENU umenus[30];
RTVAR rtvars[15];
USER_FUNC ufuncs[15];
/* ROUTINES */
/*
**** INITIALIZATION routines
*/
/* ROUTINE: autoinit
**
** Initialize gl_rec. This will automatically
** set up the menus, etc.
*/
void autoinit(void)
{
gl_rec = pr_initV(0, 0,
umenus, NULL, rtvars, NULL, ufuncs, "asl", 1, NULL);
}
/* ROUTINE: rinitf
**
** initialize at first pass or at r s from keyboard
*/
void rinitf(void)
{
static int first_time = 1;
/* This stuff needs to be done only once, but also
** needs to be done after the clock has started
** (so do NOT put it up in autoinit).
*/
if(first_time) {
/* do this once */
first_time = 0;
#define WIND0 0
#define EYEH_SIG 0
#define EYEV_SIG 1
/* initialize interface (window) parameters */
wd_src_check(WIND0, WD_SIGNAL, EYEH_SIG, WD_SIGNAL, EYEV_SIG);
wd_src_pos (WIND0, WD_DIRPOS, 0, WD_DIRPOS, 0);
wd_cntrl (WIND0, WD_ON);
/* init the screen */
pr_setup();
}
}
/* THE STATE SET
*/
%%
id 666
restart rinitf
main_set {
status ON
begin first:
to prewait
/*
** First wait time, which can be used to add
** a delay after reset states (e.g., fixation break)
*/
prewait:
do timer_set1(0,100,600,200,0,0)
to loop on +MET % timer_check1
/*
** Start the loop!
** Note that the real workhorse here is pr_next_trial,
** called in go. It calls the task-specific
** "get trial" and "set trial" methods,
** and drops STARTCD and LISTDONECD, as
** appropriate.
**
*/
loop:
time 1000
to pause on +PSTOP & softswitch
to go
pause:
do ec_send_code(PAUSECD)
to go on -PSTOP & softswitch
go:
to showfp on MET % pr_start_trial
to loop
/* Show fixation point
*/
showfp:
do dx_toggle1(FPONCD, 1, 0, 1000, -1, -1);
to calstart on DX_MSG % dx_check
/* check for button press */
calstart:
time 5000
to calacc on 0 % dio_check_joybut
to ncerr
calacc:
do ec_send_code(ACCEPTCAL)
to pref
/* no choice */
ncerr:
do pr_score_trial(-2, 0, 0, 0, 0, 1)
to finish
/* pref -- reward! */
pref:
do pr_score_trial(1, 2, 0, 0, 0, 1)
to finish on 0 % pr_give_reward
finish:
pr_finish_trial()
to loop
abort list:
finish
}
| D |
module model;
import glutil : GLTexture2D;
abstract class Model {
abstract render(Matrix2x2 matrix);
}
class Sprite : Model {
this(GLTexture2D tex) {
diffuse = tex;
}
override render(Matrix2x2 matrix) {
}
private:
GLTexture2D diffuse;
}
| D |
/*
TEST_OUTPUT:
---
fail_compilation/fail10528.d(19): Error: undefined identifier `a`
fail_compilation/fail10528.d(20): Error: undefined identifier `a` in module `a10528`, did you mean variable `a`?
fail_compilation/fail10528.d(22): Error: undefined identifier `b`
fail_compilation/fail10528.d(23): Error: undefined identifier `b` in module `a10528`, did you mean enum member `b`?
fail_compilation/fail10528.d(25): Error: no property `c` for type `S`, did you mean `a10528.S.c`?
fail_compilation/fail10528.d(26): Error: no property `c` for type `S`, did you mean `a10528.S.c`?
fail_compilation/fail10528.d(28): Error: no property `d` for type `a10528.C`, did you mean `a10528.C.d`?
fail_compilation/fail10528.d(29): Error: no property `d` for type `a10528.C`, did you mean `a10528.C.d`?
---
*/
import imports.a10528;
void main()
{
auto a1 = a;
auto a2 = imports.a10528.a;
auto b1 = b;
auto b2 = imports.a10528.b;
auto c1 = S.c;
with (S) auto c2 = c;
auto d1 = C.d;
with (C) auto d2 = d;
}
| D |
/*
* expressionunit.d
*
* This module parses expressions.
*
*/
module parsing.d.versionunit;
import parsing.parseunit;
import parsing.token;
import parsing.d.tokens;
import parsing.d.nodes;
import parsing.d.assignexprunit;
import parsing.d.declarationunit;
import io.console;
import djehuty;
class VersionUnit : ParseUnit {
override bool tokenFound(Token current) {
if (this.state == 4) {
// We are looking for declarations
if (current.type == DToken.RightCurly) {
// Done.
return false;
}
else {
lexer.push(current);
auto tree = expand!(DeclarationUnit)();
}
return true;
}
// Else, we are looking for the condition
switch (current.type) {
// We could be declaring a version
// version = Release; etc
case DToken.Assign:
if (this.state == 1) {
// Error: Already started to use an identifier
// TODO:
}
else if (this.state == 2) {
// Error: Already named an identifier.
// TODO:
}
else if (this.state == 3) {
// Error: Found right paren.
// TODO:
}
// We need to find the identifier or integer to enable.
this.state = 5;
break;
// Look for a left paren first. It must exist.
case DToken.LeftParen:
if (this.state == 1) {
// Error: Too many left parentheses.
// TODO:
}
else if (this.state == 2) {
// Error: Found an identifier.
// TODO: Probably mistook left for right parenthesis.
}
else if (this.state == 3) {
// Error: We already found a right paren... Expected colon or brace
// TODO:
}
this.state = 1;
break;
// For version assignment, we are looking for a semicolon to end it.
case DToken.Semicolon:
if (this.state == 5) {
// Error: No identifier given.
// TODO:
}
else if (this.state == 0) {
// Error: Need '=' first.
// TODO:
}
else if (this.state == 1) {
// Error: Have left paren.
// TODO:
}
else if (this.state == 2) {
// Error: Have Identifier for normal foo.
// TODO:
}
else if (this.state == 3) {
// Error: Have right paren.
// TODO:
}
// else this.state == 6
// Done.
return false;
// Looking for some literal or identifier to use as the version
case DToken.Identifier:
case DToken.IntegerLiteral:
if (this.state == 5) {
// We are assigning a version
cur_string = current.value.toString();
Console.putln("Version enabled: ", current.value);
this.state = 6;
}
else if (this.state == 6) {
// Error: Too many identifiers in a row on a version assign.
// TODO:
}
else if (this.state == 0) {
// Error: No left parenthesis.
// TODO: Probably forgot it!
}
else if (this.state == 2) {
// Error: Too many identifiers in a row!
// TODO: Probably put a space or something in.
}
else if (this.state == 3) {
// Error: Found right parenthesis.
// TODO: Probably forgot a curly brace.
}
else {
Console.putln("Version: ", current.value);
cur_string = current.value.toString();
this.state = 2;
}
break;
case DToken.RightParen:
if (this.state == 0) {
// Error: Do not have a left paren.
// TODO: Probably forgot a left parenthesis.
}
else if (this.state == 3) {
// Error: Too many right parens
// TODO:
}
// Now we can look for a : or a curly brace for a declaration block
this.state = 3;
break;
// For declaring the rest of the file under this conditional block
// static if (foo):
case DToken.Colon:
if (this.state == 0) {
// Error: Do not have a condition!
// TODO:
}
else if (this.state == 1) {
// Error: Do not have an identifier.
// TODO:
}
else if (this.state == 2) {
// Error: Do not have a right paren.
// TODO:
}
else if (this.state == 4) {
// Error: After a left curly brace. We are within the block.
// TODO:
}
// Done.
return false;
// For specifying a declaration block for this condition
case DToken.LeftCurly:
if (this.state == 0) {
// Error: Do not have a condition!
// TODO:
}
else if (this.state == 1) {
// Error: Do not have an identifier.
// TODO:
}
else if (this.state == 2) {
// Error: Do not have a right paren.
// TODO:
}
// Now we look for declarations.
this.state = 4;
break;
// Errors for any unknown tokens.
default:
// TODO:
break;
}
return true;
}
protected:
string cur_string = "";
static const string _common_error_msg = "";
static const string[] _common_error_usages = null;
}
| D |
instance DIA_Addon_BL_BDT_1_EXIT(C_Info)
{
nr = 999;
condition = DIA_Addon_BL_BDT_1_EXIT_Condition;
information = DIA_Addon_BL_BDT_1_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Addon_BL_BDT_1_EXIT_Condition()
{
return TRUE;
};
func void DIA_Addon_BL_BDT_1_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Addon_BL_BDT_1_Chef(C_Info)
{
nr = 2;
condition = DIA_Addon_BL_BDT_1_Chef_Condition;
information = DIA_Addon_BL_BDT_1_Chef_Info;
permanent = TRUE;
description = "Кто здесь главный?";
};
func int DIA_Addon_BL_BDT_1_Chef_Condition()
{
return TRUE;
};
func void DIA_Addon_BL_BDT_1_Chef_Info()
{
AI_Output(other,self,"DIA_Addon_BL_BDT_1_Chef_15_00"); //Кто здесь главный?
if(RavenIsDead == TRUE)
{
if(Npc_IsDead(Thorus))
{
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Chef_01_01"); //Так много командиров приходит и уходит... Через некоторое время ты теряешь их из виду...
}
else
{
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Chef_01_02"); //Я думаю, Торус сейчас за главного...
};
}
else
{
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Chef_01_03"); //Ворон сейчас наш командир. Он привел нас сюда и построил лагерь.
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Chef_01_04"); //Он контролирует шахту, без него все давным-давно поубивали бы друг друга за золото.
};
};
instance DIA_Addon_BL_BDT_1_Lager(C_Info)
{
nr = 3;
condition = DIA_Addon_BL_BDT_1_Lager_Condition;
information = DIA_Addon_BL_BDT_1_Lager_Info;
permanent = FALSE;
description = "Что вы знаете про лагерь?";
};
func int DIA_Addon_BL_BDT_1_Lager_Condition()
{
if((Sklaven_Flucht == FALSE) || !Npc_IsDead(Raven))
{
return TRUE;
};
};
func void DIA_Addon_BL_BDT_1_Lager_Info()
{
AI_Output(other,self,"DIA_Addon_BL_BDT_1_Lager_15_00"); //Что вы знаете про лагерь?
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Lager_01_01"); //После того как стало известно о золотой шахте, эти бродяги, должно быть, все перегрызлись.
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Lager_01_02"); //Ворон убил худших из них, а остальных вышвырнул из шахты.
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Lager_01_03"); //С тех пор никто не допускается в верхнюю часть. Он даже притащил заключенных, чтобы работать в шахте.
if(SC_KnowsRavensGoldmine == FALSE)
{
B_LogEntry(TOPIC_Addon_RavenKDW,LogText_Addon_RavensGoldmine);
Log_AddEntry(TOPIC_Addon_Sklaven,LogText_Addon_RavensGoldmine);
B_LogEntry(TOPIC_Addon_ScoutBandits,Log_Text_Addon_ScoutBandits);
};
SC_KnowsRavensGoldmine = TRUE;
};
instance DIA_Addon_BL_BDT_1_Lager2(C_Info)
{
nr = 3;
condition = DIA_Addon_BL_BDT_1_Lager2_Condition;
information = DIA_Addon_BL_BDT_1_Lager2_Info;
permanent = TRUE;
description = "Что вы знаете про лагерь?";
};
func int DIA_Addon_BL_BDT_1_Lager2_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_BL_BDT_1_Lager))
{
return TRUE;
};
};
func void DIA_Addon_BL_BDT_1_Lager2_Info()
{
AI_Output(other,self,"DIA_Addon_BL_BDT_1_Lager2_15_00"); //Что вы знаете про лагерь?
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Lager2_01_01"); //Если ты на кого-нибудь нападешь, они ВСЕ набросятся на тебя.
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Lager2_01_02"); //Если у тебя нет хорошего повода разобраться с кем-то, конечно. Тогда никто не будет вмешиваться.
};
instance DIA_Addon_BL_BDT_1_News(C_Info)
{
nr = 4;
condition = DIA_Addon_BL_BDT_1_News_Condition;
information = DIA_Addon_BL_BDT_1_News_Info;
permanent = TRUE;
description = "Какие новости?";
};
func int DIA_Addon_BL_BDT_1_News_Condition()
{
return TRUE;
};
func void DIA_Addon_BL_BDT_1_News_Info()
{
AI_Output(other,self,"DIA_Addon_BL_BDT_1_News_15_00"); //Какие новости?
if(RavenIsDead == TRUE)
{
AI_Output(self,other,"DIA_Addon_BL_BDT_1_News_01_01"); //Ворон мертв. Что же нам теперь делать?
};
AI_Output(self,other,"DIA_Addon_BL_BDT_1_News_01_02"); //Пираты не захотят везти нас на материк, потому что им так и не заплатили за несколько последних перевозок.
AI_Output(self,other,"DIA_Addon_BL_BDT_1_News_01_03"); //Нам следует зарезать одного или двух, тогда остальным придется взять нас.
};
instance DIA_Addon_BL_BDT_1_Sklaven(C_Info)
{
nr = 5;
condition = DIA_Addon_BL_BDT_1_Sklaven_Condition;
information = DIA_Addon_BL_BDT_1_Sklaven_Info;
permanent = TRUE;
description = "Что вы знаете про заключенных?";
};
func int DIA_Addon_BL_BDT_1_Sklaven_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_BL_BDT_1_Lager) && ((Sklaven_Flucht == FALSE) || (RavenIsDead == FALSE)))
{
return TRUE;
};
};
func void DIA_Addon_BL_BDT_1_Sklaven_Info()
{
AI_Output(other,self,"DIA_Addon_BL_BDT_1_Sklaven_15_00"); //Что вы знаете про заключенных?
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Sklaven_01_01"); //Ворон хочет что-то выкопать. Сначала это делали разбойники, но слишком многие погибли.
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Sklaven_01_02"); //Поэтому он и привел заключенных - если они откинут копыта, ничего страшного.
if(BDT_1_Ausbuddeln == FALSE)
{
AI_Output(other,self,"DIA_Addon_BL_BDT_1_Sklaven_15_03"); //А что хочет выкопать Ворон?
AI_Output(self,other,"DIA_Addon_BL_BDT_1_Sklaven_01_04"); //Без понятия, но явно дело не только в золоте.
BDT_1_Ausbuddeln = TRUE;
};
};
func void B_AssignAmbientInfos_Addon_BL_BDT_1(var C_Npc slf)
{
DIA_Addon_BL_BDT_1_EXIT.npc = Hlp_GetInstanceID(slf);
DIA_Addon_BL_BDT_1_Chef.npc = Hlp_GetInstanceID(slf);
DIA_Addon_BL_BDT_1_Lager.npc = Hlp_GetInstanceID(slf);
DIA_Addon_BL_BDT_1_News.npc = Hlp_GetInstanceID(slf);
DIA_Addon_BL_BDT_1_Sklaven.npc = Hlp_GetInstanceID(slf);
DIA_Addon_BL_BDT_1_Lager2.npc = Hlp_GetInstanceID(slf);
};
| D |
/**
Gets the element at index n of a range
*/
module ddash.range.nth;
///
@("module example")
unittest {
import ddash.utils.optional: some, none;
import ddash.range: frontOr;
assert([1, 2].nth(1).frontOr(1) == 2);
assert((int[]).init.nth(1).frontOr(9) == 9);
assert([1, 2].nth(1) == some(2));
assert((int[]).init.nth(1) == none);
assert([1, 2, 3].nth!(Yes.wrap)(10) == some(2));
}
import ddash.common;
/**
Gets the element at index n of array if found, else `none`.
Params:
wrap = If `Yes.wrap`, then we wrap around the edge, else not
range = an input range
n = which element to return
Returns
The value at the nth index of range or defaultValue i not found
Since:
0.0.1
*/
auto nth(
from.std.typecons.Flag!"wrap" wrap = from.std.typecons.No.wrap,
Range,
)(
Range range,
size_t n,
)
if (from.std.range.isInputRange!Range)
{
import std.range: empty, walkLength, isRandomAccessRange, ElementType;
import std.typecons: Yes;
import ddash.utils.optional: no, some;
alias T = ElementType!Range;
if (range.empty) {
return no!T;
}
auto length = range.walkLength;
static if (isRandomAccessRange!Range) {
alias get = a => range[a];
} else {
import std.range: dropExactly;
alias get = a => range
.dropExactly(a)
.front;
}
static if (wrap == Yes.wrap) {
return some!T(get(n % length));
} else {
if (n >= length) {
return no!T;
}
return some!T(get(n));
}
}
@("nth works with filter and optional ranges")
unittest {
import std.algorithm: filter;
import ddash.utils.optional: some, none;
assert([1, 2].nth(1) == some(2));
assert([1, 2].filter!"true".nth(1) == some(2));
assert((int[]).init.nth(1) == none);
assert([1, 2].nth!(No.wrap)(2) == none);
assert([1, 2].nth!(Yes.wrap)(2) == some(1));
}
@("compiles with array of const")
unittest {
const(string)[] args = [];
static assert(__traits(compiles, { args.nth(0); }));
}
/**
Returns `optional` front of range
Since:
- 0.0.1
*/
alias first = from.ddash.range.maybeFront;
///
@("first example")
unittest {
import ddash.utils.optional: some, none;
assert([1, 2].first == some(1));
assert((int[]).init.first == none);
}
/**
Returns `optional` end of range
Since:
- 0.0.1
*/
alias last = from.ddash.range.maybeBack;
///
@("last returns optional")
unittest {
import ddash.utils.optional: some, none;
assert([1, 2].last == some(2));
assert((int[]).init.last == none);
}
| D |
import std.stdio;
import std.algorithm;
import std.array;
import parser;
import expression;
struct Trace {
enum Value {
F, T, X
}
struct ChangeEvent {
ulong offset;
Value new_value;
}
private ChangeEvent[] events;
this(ChangeEvent[] events) {
this.events = events.dup;
}
this(Value[] values) {
events ~= ChangeEvent(0, values[0]);
Value last_val = values[0];
foreach (offset, val; values) {
if (val != last_val) {
events ~= ChangeEvent(offset, val);
}
last_val = val;
}
}
this(string trace) {
Value[dchar] vals = ['x': Value.X, '0': Value.F, '1': Value.T];
this(trace.map!(a => vals[a]).array);
}
}
interface IChecker {
public bool match(ref const(Trace) trace);
}
class CombChecker(alias op) : IChecker {
IChecker[] checkers;
public bool match(ref const(Trace) trace) {
bool conclusion = true;
foreach (checker; checkers) {
conclusion = mixin(q{conclusion} ~ op ~ q{checker});
}
return conclusion;
}
}
class DelayChecker : IChecker {
public bool match(ref const(Trace) trace) {
return false;
}
}
void main()
{
auto e = parseExpression("0 || 1 && 1");
writeln(e);
auto t = e.create_expression_tree();
writeln(t);
t.walk(0);
writeln(t.value());
// auto tree = parseSVA("a ##1 a @@ b || c");
// writeln(tree);
// auto t2 = create_tree(tree);
// writeln(t2);
// auto t = Trace("00001010x");
// writeln(t);
}
| D |
module dinu.content.output;
import
std.file,
std.datetime,
std.stream,
std.parallelism,
std.process,
std.conv,
std.regex,
std.string,
std.stdio,
ws.context,
dinu.dinu,
dinu.util,
dinu.xclient,
dinu.content.content,
dinu.content.executables,
dinu.content.files,
dinu.command,
dinu.draw;
__gshared:
private {
CommandHistory[int] running;
int[int] results;
}
class OutputLoader: ChoiceLoader {
override void run(){
auto log = options.configPath ~ ".log";
while(!log.exists && active && runProgram)
core.thread.Thread.sleep(10.msecs);
auto file = new BufferedFile(log);
file.seekEnd(0);
size_t idx = 10000;
task(&loadBackwards, idx-1000).executeInNewThread;
while(active && runProgram){
if(!file.eof){
auto line = cast(string)file.readLine;
if(!line.length)
continue;
matchLine(line, idx++);
}else
core.thread.Thread.sleep(5.msecs);
}
}
void loadBackwards(size_t idx){
auto p = pipeProcess(["tac", options.configPath ~ ".log"], Redirect.stdout);
foreach(line; p.stdout.byLine){
matchLine(to!string(line), idx--);
if(idx<10000-2000)
core.thread.Thread.sleep(4.msecs);
if(idx==0 || !runProgram)
break;
}
}
void matchLine(string line, size_t idx){
try{
foreach(match; line.matchAll(`([0-9]+) (\S+)(?: (.*))?`)){
auto pid = to!int(match.captures[1]);
if(match.captures[2] == "exec"){
auto cmd = match.captures[3].bangSplit;
auto history = new CommandHistory(idx, pid, to!Type(cmd[0]), cmd[1].dup, cmd[2].dup);
running[pid] = history;
if(pid in results){
history.result = results[pid];
}else if(!exists("/proc/%s".format(pid))){
history.result = 0;
}
add(history);
}
if((match.captures[2] == "stdout" || match.captures[2] == "stderr") && match.captures[3].length){
add(new CommandOutput(pid, match.captures[3], idx, match.captures[2]=="stderr"));
}else if(match.captures[2] == "exit"){
if(pid in running)
running[pid].result = to!int(match.captures[3]);
else
results[pid] = to!int(match.captures[3]);
}
}
}catch(Exception e){
writeln(e);
}
}
}
class CommandOutput: Command {
size_t idx;
string command;
int pid;
this(int pid, string output, size_t idx, bool err){
super(output);
type = Type.output;
this.pid = pid;
this.idx = idx;
if(err)
color = options.colorError;
else
color = options.colorOutput;
}
override size_t score(){
return idx*1000;
}
override int draw(DrawingContext dc, int[2] pos, bool selected){
if(!command.length && pid in running)
command = running[pid].text;
dc.text(pos, command, options.colorHint, 1.8);
return super.draw(dc, pos, selected);
}
override void run(){}
}
class CommandHistory: Command {
size_t idx;
long result = long.max;
Type originalType;
Command command;
this(size_t idx, int pid, Type originalType, string serialized, string parameter){
this.idx = idx;
this.parameter = parameter;
type = Type.history;
switch(originalType){
case Type.script:
command = new CommandExec(serialized);
break;
case Type.desktop:
command = new CommandDesktop(serialized);
break;
case Type.file:
command = new CommandFile(serialized);
break;
case Type.directory:
command = new CommandDir(serialized);
break;
case Type.special:
command = new CommandSpecial(serialized);
break;
default:
command = new CommandExec(serialized);
break;
}
this.name = command.text;
}
override string filterText(){
return super.filterText() ~ parameter;
}
override size_t score(){
return idx*1000;
}
override int draw(DrawingContext dc, int[2] pos, bool selected){
auto origX = pos.x;
if(result != long.max){
if(result)
dc.rect([pos.x-0.4.em,pos.y], [0.1.em, 1.em], options.colorError);
}else
dc.rect([pos.x-0.4.em,pos.y], [0.1.em, 1.em], options.colorHint);
pos.x += command.draw(dc, pos, selected);
if(parameter.length)
pos.x += dc.text(pos, parameter, options.colorOutput);
return pos.x-origX;
}
override void run(){
auto paramOrig = command.parameter;
command.parameter ~= parameter;
command.run;
command.parameter = paramOrig;
}
}
| D |
func void b_story_leftfm()
{
var C_NPC gorn;
var C_NPC urshak;
gorn = Hlp_GetNpc(pc_fighter);
Npc_ExchangeRoutine(gorn,"WaitFM");
gorn.aivar[AIV_PARTYMEMBER] = FALSE;
Wld_InsertNpc(firewaran,"OW_PATH_SCAVENGER15_SPAWN01");
Wld_InsertNpc(firewaran,"SPAWN_OW_WARAN_DEMON_01");
Wld_InsertNpc(firewaran,"OW_COAST_SHIPWRECK_WARAN");
Wld_InsertNpc(swampshark,"PATH_AROUND_PSI16");
Wld_InsertNpc(swampshark,"PATH_AROUND_PSI17");
Wld_InsertNpc(swampshark,"PATH_AROUND_PSI18");
Wld_InsertNpc(shadowbeast,"OW_PATH_260");
Wld_InsertNpc(shadowbeast,"OW_PATH_033_TO_CAVE5");
Wld_InsertNpc(shadowbeast,"SPAWN_OW_SHADOWBEAST2_PSIWOOD_02");
Wld_InsertNpc(troll,"OW_RUIN_TROLL");
Wld_InsertNpc(troll,"LOCATION_12_12");
Wld_InsertNpc(troll,"OW_PATH_2_08");
urshak = Hlp_GetNpc(orc_2200_shaman);
Npc_ExchangeRoutine(urshak,"LeftFM");
ENTEREDFREEMINE = TRUE;
};
| D |
/**
* Compiler runtime function symbols
*
* Compiler implementation of the
* $(LINK2 https://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1994-1998 by Symantec
* Copyright (C) 2000-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: https://github.com/dlang/dmd/blob/master/src/dmd/backend/_rtlsym.d
* Documentation: https://dlang.org/phobos/dmd_backend_rtlsym.html
*/
module dmd.backend.rtlsym;
import dmd.backend.cc : Symbol;
enum RTLSYM
{
THROW,
THROWC,
THROWDWARF,
MONITOR_HANDLER,
MONITOR_PROLOG,
MONITOR_EPILOG,
DCOVER,
DCOVER2,
DASSERT,
DASSERTP,
DASSERT_MSG,
DUNITTEST,
DUNITTESTP,
DUNITTEST_MSG,
DARRAY,
DARRAYP,
DARRAY_SLICEP,
DARRAY_INDEXP,
DINVARIANT,
MEMCPY,
MEMSET8,
MEMSET16,
MEMSET32,
MEMSET64,
MEMSET128,
MEMSET128ii,
MEMSET80,
MEMSET160,
MEMSETFLOAT,
MEMSETDOUBLE,
MEMSETSIMD,
MEMSETN,
MODULO,
MONITORENTER,
MONITOREXIT,
CRITICALENTER,
CRITICALEXIT,
SWITCH_STRING, // unused
SWITCH_USTRING, // unused
SWITCH_DSTRING, // unused
DSWITCHERR,
DHIDDENFUNC,
NEWCLASS,
NEWTHROW,
NEWARRAYT,
NEWARRAYIT,
NEWITEMT,
NEWITEMIT,
NEWARRAYMTX,
NEWARRAYMITX,
ARRAYLITERALTX,
ASSOCARRAYLITERALTX,
CALLFINALIZER,
CALLINTERFACEFINALIZER,
DELCLASS,
DELINTERFACE,
DELSTRUCT,
ALLOCMEMORY,
DELARRAYT,
DELMEMORY,
INTERFACE,
DYNAMIC_CAST,
INTERFACE_CAST,
FATEXIT,
ARRAYCATT,
ARRAYCATNTX,
ARRAYAPPENDT,
ARRAYAPPENDCTX,
ARRAYAPPENDCD,
ARRAYAPPENDWD,
ARRAYSETLENGTHT,
ARRAYSETLENGTHIT,
ARRAYCOPY,
ARRAYASSIGN,
ARRAYASSIGN_R,
ARRAYASSIGN_L,
ARRAYCTOR,
ARRAYSETASSIGN,
ARRAYSETCTOR,
ARRAYCAST, // unused
ARRAYEQ, // unused
ARRAYEQ2,
ARRAYCMP, // unused
ARRAYCMP2, // unused
ARRAYCMPCHAR, // unused
OBJ_EQ, // unused
OBJ_CMP, // unused
EXCEPT_HANDLER2,
EXCEPT_HANDLER3,
CPP_HANDLER,
D_HANDLER,
D_LOCAL_UNWIND2,
LOCAL_UNWIND2,
UNWIND_RESUME,
PERSONALITY,
BEGIN_CATCH,
CXA_BEGIN_CATCH,
CXA_END_CATCH,
TLS_INDEX,
TLS_ARRAY,
AHSHIFT,
HDIFFN,
HDIFFF,
INTONLY,
EXCEPT_LIST,
SETJMP3,
LONGJMP,
ALLOCA,
CPP_LONGJMP,
PTRCHK,
CHKSTK,
TRACE_PRO_N,
TRACE_PRO_F,
TRACE_EPI_N,
TRACE_EPI_F,
TRACE_CPRO,
TRACE_CEPI,
TRACENEWCLASS,
TRACENEWARRAYT,
TRACENEWARRAYIT,
TRACENEWARRAYMTX,
TRACENEWARRAYMITX,
TRACENEWITEMT,
TRACENEWITEMIT,
TRACECALLFINALIZER,
TRACECALLINTERFACEFINALIZER,
TRACEDELCLASS,
TRACEDELINTERFACE,
TRACEDELSTRUCT,
TRACEDELARRAYT,
TRACEDELMEMORY,
TRACEARRAYLITERALTX,
TRACEASSOCARRAYLITERALTX,
TRACEARRAYCATT,
TRACEARRAYCATNTX,
TRACEARRAYAPPENDT,
TRACEARRAYAPPENDCTX,
TRACEARRAYAPPENDCD,
TRACEARRAYAPPENDWD,
TRACEARRAYSETLENGTHT,
TRACEARRAYSETLENGTHIT,
TRACEALLOCMEMORY,
C_ASSERT,
C__ASSERT,
C__ASSERT_FAIL,
C__ASSERT_RTN,
CXA_ATEXIT
}
extern (C++):
nothrow:
@safe:
Symbol *getRtlsym(RTLSYM i);
Symbol *getRtlsymPersonality();
| D |
instance Mil_317_Ruga(Npc_Default)
{
name[0] = "Руга";
guild = GIL_MIL;
id = 317;
voice = 11;
flags = 0;
npcType = npctype_main;
aivar[AIV_MM_RestEnd] = TRUE;
B_SetAttributesToChapter(self,2);
fight_tactic = FAI_NAILED;
EquipItem(self,ItMw_1h_Mil_Sword);
EquipItem(self,ItRw_Mil_Crossbow);
CreateInvItems(self,ItRw_Bolt,10);
B_CreateAmbientInv(self);
CreateInvItems(self,ItKe_City_Tower_03,1);
B_SetNpcVisual(self,MALE,"Hum_Head_Thief",Face_N_NormalBart03,BodyTex_N,ITAR_Mil_L);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,30);
daily_routine = Rtn_Start_317;
};
func void Rtn_Start_317()
{
TA_Stand_Guarding(7,0,13,0,"KASERNE");
TA_Stand_Drinking(13,0,16,0,"NW_CITY_HABOUR_TAVERN01_STAND_01");
TA_Stand_Guarding(16,0,20,0,"KASERNE");
TA_Sit_Chair(20,0,22,0,"NW_CITY_HABOUR_KASERN_15_B");
TA_Sleep(22,0,7,0,"NW_CITY_BARRACK01_BED_08");
};
| D |
module godot.bitmapfont;
import std.meta : AliasSeq, staticIndexOf;
import std.traits : Unqual;
import godot.d.meta;
import godot.core;
import godot.c;
import godot.d.bind;
import godot.object;
import godot.classdb;
import godot.font;
import godot.texture;
@GodotBaseClass struct BitmapFont
{
static immutable string _GODOT_internal_name = "BitmapFont";
public:
union { godot_object _godot_object; Font base; }
alias base this;
alias BaseClasses = AliasSeq!(typeof(base), typeof(base).BaseClasses);
bool opEquals(in BitmapFont other) const { return _godot_object.ptr is other._godot_object.ptr; }
BitmapFont opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
mixin baseCasts;
static BitmapFont _new()
{
static godot_class_constructor constructor;
if(constructor is null) constructor = godot_get_class_constructor("BitmapFont");
if(constructor is null) return typeof(this).init;
return cast(BitmapFont)(constructor());
}
package(godot) static GodotMethod!(GodotError, String) _GODOT_create_from_fnt;
package(godot) alias _GODOT_methodBindInfo(string name : "create_from_fnt") = _GODOT_create_from_fnt;
GodotError create_from_fnt(StringArg0)(in StringArg0 path)
{
_GODOT_create_from_fnt.bind("BitmapFont", "create_from_fnt");
return ptrcall!(GodotError)(_GODOT_create_from_fnt, _godot_object, path);
}
package(godot) static GodotMethod!(void, float) _GODOT_set_height;
package(godot) alias _GODOT_methodBindInfo(string name : "set_height") = _GODOT_set_height;
void set_height(in float px)
{
_GODOT_set_height.bind("BitmapFont", "set_height");
ptrcall!(void)(_GODOT_set_height, _godot_object, px);
}
package(godot) static GodotMethod!(void, float) _GODOT_set_ascent;
package(godot) alias _GODOT_methodBindInfo(string name : "set_ascent") = _GODOT_set_ascent;
void set_ascent(in float px)
{
_GODOT_set_ascent.bind("BitmapFont", "set_ascent");
ptrcall!(void)(_GODOT_set_ascent, _godot_object, px);
}
package(godot) static GodotMethod!(void, int, int, int) _GODOT_add_kerning_pair;
package(godot) alias _GODOT_methodBindInfo(string name : "add_kerning_pair") = _GODOT_add_kerning_pair;
void add_kerning_pair(in int char_a, in int char_b, in int kerning)
{
_GODOT_add_kerning_pair.bind("BitmapFont", "add_kerning_pair");
ptrcall!(void)(_GODOT_add_kerning_pair, _godot_object, char_a, char_b, kerning);
}
package(godot) static GodotMethod!(int, int, int) _GODOT_get_kerning_pair;
package(godot) alias _GODOT_methodBindInfo(string name : "get_kerning_pair") = _GODOT_get_kerning_pair;
int get_kerning_pair(in int char_a, in int char_b) const
{
_GODOT_get_kerning_pair.bind("BitmapFont", "get_kerning_pair");
return ptrcall!(int)(_GODOT_get_kerning_pair, _godot_object, char_a, char_b);
}
package(godot) static GodotMethod!(void, Texture) _GODOT_add_texture;
package(godot) alias _GODOT_methodBindInfo(string name : "add_texture") = _GODOT_add_texture;
void add_texture(in Texture texture)
{
_GODOT_add_texture.bind("BitmapFont", "add_texture");
ptrcall!(void)(_GODOT_add_texture, _godot_object, texture);
}
package(godot) static GodotMethod!(void, int, int, Rect2, Vector2, float) _GODOT_add_char;
package(godot) alias _GODOT_methodBindInfo(string name : "add_char") = _GODOT_add_char;
void add_char(in int character, in int texture, in Rect2 rect, in Vector2 _align = Vector2(0, 0), in float advance = -1)
{
_GODOT_add_char.bind("BitmapFont", "add_char");
ptrcall!(void)(_GODOT_add_char, _godot_object, character, texture, rect, _align, advance);
}
package(godot) static GodotMethod!(int) _GODOT_get_texture_count;
package(godot) alias _GODOT_methodBindInfo(string name : "get_texture_count") = _GODOT_get_texture_count;
int get_texture_count() const
{
_GODOT_get_texture_count.bind("BitmapFont", "get_texture_count");
return ptrcall!(int)(_GODOT_get_texture_count, _godot_object);
}
package(godot) static GodotMethod!(Texture, int) _GODOT_get_texture;
package(godot) alias _GODOT_methodBindInfo(string name : "get_texture") = _GODOT_get_texture;
Texture get_texture(in int idx) const
{
_GODOT_get_texture.bind("BitmapFont", "get_texture");
return ptrcall!(Texture)(_GODOT_get_texture, _godot_object, idx);
}
package(godot) static GodotMethod!(Vector2, int, int) _GODOT_get_char_size;
package(godot) alias _GODOT_methodBindInfo(string name : "get_char_size") = _GODOT_get_char_size;
Vector2 get_char_size(in int _char, in int next = 0) const
{
_GODOT_get_char_size.bind("BitmapFont", "get_char_size");
return ptrcall!(Vector2)(_GODOT_get_char_size, _godot_object, _char, next);
}
package(godot) static GodotMethod!(void, bool) _GODOT_set_distance_field_hint;
package(godot) alias _GODOT_methodBindInfo(string name : "set_distance_field_hint") = _GODOT_set_distance_field_hint;
void set_distance_field_hint(in bool enable)
{
_GODOT_set_distance_field_hint.bind("BitmapFont", "set_distance_field_hint");
ptrcall!(void)(_GODOT_set_distance_field_hint, _godot_object, enable);
}
package(godot) static GodotMethod!(void) _GODOT_clear;
package(godot) alias _GODOT_methodBindInfo(string name : "clear") = _GODOT_clear;
void clear()
{
_GODOT_clear.bind("BitmapFont", "clear");
ptrcall!(void)(_GODOT_clear, _godot_object);
}
package(godot) static GodotMethod!(void, PoolIntArray) _GODOT__set_chars;
package(godot) alias _GODOT_methodBindInfo(string name : "_set_chars") = _GODOT__set_chars;
void _set_chars(in PoolIntArray arg0)
{
Array _GODOT_args = Array.empty_array;
_GODOT_args.append(arg0);
String _GODOT_method_name = String("_set_chars");
this.callv(_GODOT_method_name, _GODOT_args);
}
package(godot) static GodotMethod!(PoolIntArray) _GODOT__get_chars;
package(godot) alias _GODOT_methodBindInfo(string name : "_get_chars") = _GODOT__get_chars;
PoolIntArray _get_chars() const
{
Array _GODOT_args = Array.empty_array;
String _GODOT_method_name = String("_get_chars");
return this.callv(_GODOT_method_name, _GODOT_args).as!(PoolIntArray);
}
package(godot) static GodotMethod!(void, PoolIntArray) _GODOT__set_kernings;
package(godot) alias _GODOT_methodBindInfo(string name : "_set_kernings") = _GODOT__set_kernings;
void _set_kernings(in PoolIntArray arg0)
{
Array _GODOT_args = Array.empty_array;
_GODOT_args.append(arg0);
String _GODOT_method_name = String("_set_kernings");
this.callv(_GODOT_method_name, _GODOT_args);
}
package(godot) static GodotMethod!(PoolIntArray) _GODOT__get_kernings;
package(godot) alias _GODOT_methodBindInfo(string name : "_get_kernings") = _GODOT__get_kernings;
PoolIntArray _get_kernings() const
{
Array _GODOT_args = Array.empty_array;
String _GODOT_method_name = String("_get_kernings");
return this.callv(_GODOT_method_name, _GODOT_args).as!(PoolIntArray);
}
package(godot) static GodotMethod!(void, Array) _GODOT__set_textures;
package(godot) alias _GODOT_methodBindInfo(string name : "_set_textures") = _GODOT__set_textures;
void _set_textures(in Array arg0)
{
Array _GODOT_args = Array.empty_array;
_GODOT_args.append(arg0);
String _GODOT_method_name = String("_set_textures");
this.callv(_GODOT_method_name, _GODOT_args);
}
package(godot) static GodotMethod!(Array) _GODOT__get_textures;
package(godot) alias _GODOT_methodBindInfo(string name : "_get_textures") = _GODOT__get_textures;
Array _get_textures() const
{
Array _GODOT_args = Array.empty_array;
String _GODOT_method_name = String("_get_textures");
return this.callv(_GODOT_method_name, _GODOT_args).as!(Array);
}
package(godot) static GodotMethod!(void, BitmapFont) _GODOT_set_fallback;
package(godot) alias _GODOT_methodBindInfo(string name : "set_fallback") = _GODOT_set_fallback;
void set_fallback(in BitmapFont fallback)
{
_GODOT_set_fallback.bind("BitmapFont", "set_fallback");
ptrcall!(void)(_GODOT_set_fallback, _godot_object, fallback);
}
package(godot) static GodotMethod!(BitmapFont) _GODOT_get_fallback;
package(godot) alias _GODOT_methodBindInfo(string name : "get_fallback") = _GODOT_get_fallback;
BitmapFont get_fallback() const
{
_GODOT_get_fallback.bind("BitmapFont", "get_fallback");
return ptrcall!(BitmapFont)(_GODOT_get_fallback, _godot_object);
}
}
| D |
# FIXED
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/Common/Minimal/recmutex.c
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/FreeRTOS.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include/stddef.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include/stdint.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/FreeRTOSConfig.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/driverlib.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/adc14.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/ccs_base/arm/include/msp.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/ccs_base/arm/include/msp432p401r.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/ccs_base/arm/include/msp_compatibility.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/ccs_base/arm/include/CMSIS/cmsis_ccs.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/ccs_base/arm/include/msp432p401r_classic.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/ccs_base/arm/include/CMSIS/core_cm4.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/ccs_base/arm/include/CMSIS/cmsis_compiler.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/ccs_base/arm/include/system_msp432p401r.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include/stdbool.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/aes256.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/comp_e.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/cpu.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/crc32.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/cs.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/dma.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/eusci.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/flash.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/fpu.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/gpio.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/i2c.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/interrupt.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/mpu.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/pcm.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/pmap.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/pss.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/ref_a.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/reset.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/rom.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/rom_map.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/rtc_c.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/spi.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/sysctl.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/systick.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/timer32.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/timer_a.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/uart.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/wdt_a.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/projdefs.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/portable.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/deprecated_definitions.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/portable/CCS/ARM_CM4F/portmacro.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/mpu_wrappers.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/task.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/list.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/semphr.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/queue.h
Full_Demo/Standard_Demo_Tasks/recmutex.obj: C:/FreeRTOSv10.1.1/FreeRTOS/Demo/Common/include/recmutex.h
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/Common/Minimal/recmutex.c:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/FreeRTOS.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include/stddef.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include/stdint.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/FreeRTOSConfig.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/driverlib.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/adc14.h:
C:/ti/ccsv7/ccs_base/arm/include/msp.h:
C:/ti/ccsv7/ccs_base/arm/include/msp432p401r.h:
C:/ti/ccsv7/ccs_base/arm/include/msp_compatibility.h:
C:/ti/ccsv7/ccs_base/arm/include/CMSIS/cmsis_ccs.h:
C:/ti/ccsv7/ccs_base/arm/include/msp432p401r_classic.h:
C:/ti/ccsv7/ccs_base/arm/include/CMSIS/core_cm4.h:
C:/ti/ccsv7/ccs_base/arm/include/CMSIS/cmsis_compiler.h:
C:/ti/ccsv7/ccs_base/arm/include/system_msp432p401r.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include/stdbool.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/aes256.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/comp_e.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/cpu.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/crc32.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/cs.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/dma.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/eusci.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/flash.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/fpu.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/gpio.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/i2c.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/interrupt.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/mpu.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/pcm.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/pmap.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/pss.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/ref_a.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/reset.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/rom.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/rom_map.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/rtc_c.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/spi.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/sysctl.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/systick.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/timer32.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/timer_a.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/uart.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/wdt_a.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/projdefs.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/portable.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/deprecated_definitions.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/portable/CCS/ARM_CM4F/portmacro.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/mpu_wrappers.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/task.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/list.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/semphr.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Source/include/queue.h:
C:/FreeRTOSv10.1.1/FreeRTOS/Demo/Common/include/recmutex.h:
| D |
module reggae.rules.c_and_cpp;
import reggae.build;
import reggae.path: buildPath;
import reggae.rules.common;
import reggae.types;
import std.range;
import std.traits;
import std.stdio;
import std.file;
@safe:
Target unityBuild(ExeName exeName,
alias sourcesFunc,
Flags flags = Flags(),
IncludePaths includes = IncludePaths(),
alias dependenciesFunc = emptyTargets,
alias implicitsFunc = emptyTargets)() @trusted {
import reggae.config: options;
const srcFiles = sourcesToFileNames!(sourcesFunc);
immutable dirName = buildPath(options.workingDir, objDirOf(Target(exeName.value)));
dirName.exists || mkdirRecurse(dirName);
immutable fileName = buildPath(dirName, "unity.cpp");
auto unityFile = File(fileName, "w");
unityFile.writeln(unityFileContents(options.projectPath, srcFiles));
return unityTarget(exeName, options.projectPath, srcFiles, flags, includes,
dependenciesFunc(), implicitsFunc());
}
/**
Returns the contents of the unity build file for these source files.
The source files have to all be in the same language and the only
supported languages are C and C++
*/
string unityFileContents(in string projectPath, in string[] files) pure {
import std.array;
import std.algorithm;
import std.path: dirSeparator;
if(files.empty)
throw new Exception("Cannot perform a unity build with no files");
const languages = files.map!getLanguage.array;
if(!languages.all!(a => a == Language.C) && !languages.all!(a => a == Language.Cplusplus))
throw new Exception("Unity build can only be done if all files are C or C++");
return files.map!(a => `#include "` ~ buildPath(projectPath, a).replace(dirSeparator, "/") ~ `"`).join("\n");
}
/**
Returns the unity build target for these parameters.
*/
Target unityTarget(ExeName exeName,
string projectPath,
string[] srcFiles,
Flags flags = Flags(),
IncludePaths includes = IncludePaths(),
alias dependenciesFunc = emptyTargets,
alias implicitsFunc = emptyTargets,
)() {
return unityTarget(exeName, projectPath, srcFiles, flags, includes, dependenciesFunc());
}
Target unityTarget(R1, R2)(in ExeName exeName,
in string projectPath,
in string[] srcFiles,
in Flags flags = Flags(),
in IncludePaths includes = IncludePaths(),
R1 dependencies = emptyTargets(),
R2 implicits = emptyTargets(),
)
pure if(isInputRange!R1 && is(ElementType!R1 == Target) && isInputRange!R2 && is(ElementType!R2 == Target)) {
import std.algorithm;
auto justFileName = srcFiles.map!getLanguage.front == Language.C ? "unity.c" : "unity.cpp";
auto unityFileName = buildPath(gBuilddir, objDirOf(Target(exeName.value)), justFileName);
auto unityFileTarget = Target.phony(unityFileName, "", [], srcFiles.map!(a => Target(a)).array);
auto incompleteTarget = Target(
exeName.value,
"", // filled in below by compileTarget
unityFileTarget ~ dependencies.array,
);
return compileTarget(
incompleteTarget,
unityFileName,
flags.value,
includes.value,
[],
projectPath,
No.justCompile,
);
}
private Target[] emptyTargets() {
return [];
}
| D |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.