code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
instance PAL_25000_GAROND(Npc_Default)
{
name[0] = "Лорд Гаронд";
guild = GIL_PAL;
id = 25000;
voice = 10;
flags = 0;
npcType = npctype_main;
aivar[93] = TRUE;
B_SetAttributesToChapter(self,6);
fight_tactic = FAI_HUMAN_MASTER;
EquipItem(self,ItMw_2H_Blessed_02);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_FatBald",Face_N_Raven,BodyTex_N,ITAR_PAL_H_V2_NPC);
Mdl_SetModelFatness(self,1);
Mdl_ApplyOverlayMds(self,"Humans_Arrogance.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,100);
daily_routine = rtn_start_25000;
};
func void rtn_start_25000()
{
TA_Stand_Guarding(8,0,21,0,"PLFT_GAROND");
TA_Stand_Guarding(21,0,8,0,"PLFT_GAROND");
};
func void rtn_tot_25000()
{
TA_Stand_Guarding(8,0,23,0,"TOT");
TA_Stand_Guarding(23,0,8,0,"TOT");
};
|
D
|
module graphics.activity.MenuActivity;
import d2d;
import graphics;
import logic;
/**
* The main menu activity
*/
class MenuActivity : Activity {
Texture drawTexture; ///The temporary draw texture
GameActivity newActivity; ///The game activity to use to make the game
/**
* Initializes the menu
*/
this(Display container) {
super(container);
this.generateDrawTexture();
}
private void generateDrawTexture() {
Surface background = loadImage("res/Interface/background.png");
Font font = new Font("res/Font/Courier.ttf", 55);
Font font2 = new Font("res/Font/Courier.ttf", 16);
Font font3 = new Font("res/Font/Courier.ttf", 21);
background.blit(loadImage("res/Interface/informationpanel.png"), null, this.container.window.size.x / 2 - 205, 50);
background.blit(font.renderTextSolid("World at War", Color(75, 75, 75)), null, this.container.window.size.x / 2 - 200, 90);
background.blit(loadImage("res/Interface/base.png"), null, this.container.window.size.x / 2 - 57, 230);
background.blit(font2.renderTextSolid("Random Map", Color(30, 30, 30)), null, this.container.window.size.x / 2 - 50, 250);
background.blit(loadImage("res/Interface/base.png"), null, this.container.window.size.x / 2 - 57, 350);
background.blit(font3.renderTextSolid("Scenario", Color(30, 30, 30)), null, this.container.window.size.x / 2 - 50, 370);
this.drawTexture = new Texture(background, this.container.renderer);
}
/**
* Draws the menu to the screen
*/
override void draw() {
this.container.renderer.copy(this.drawTexture, 0, 0);
if(this.newActivity !is null) {
this.container.activity = this.newActivity;
this.newActivity.startGame();
}
}
/**
* If the user clicks a button, create a game activity and start the game
*/
override void handleEvent(SDL_Event event) {
if(event.type == SDL_MOUSEBUTTONDOWN) {
if(this.container.mouse.location.x > this.container.window.size.x / 2 - 57
&& this.container.mouse.location.x < this.container.window.size.x / 2 + 57) {
if(this.container.mouse.location.y > 230 && this.container.mouse.location.y < 290) {
this.newActivity = new GameActivity(this.container, new World(6, 30, 40));
} else if(this.container.mouse.location.y > 350 && this.container.mouse.location.y < 410) {
this.newActivity = new GameActivity(this.container, new World("res/Scenario/eastasia.json"));
}
}
}
if(event.type == SDL_WINDOWEVENT) {
if(event.window.event == SDL_WINDOWEVENT_RESIZED) {
this.generateDrawTexture();
}
}
}
}
|
D
|
/**********************************************************
**
** LOGRAMM
** Interpreter
**
** (c) 2009-2014, Dr.Kameleon
**
**********************************************************
** src/backend/html.d
**********************************************************/
module backend.html;
//================================================
// Imports
//================================================
import std.array;
import std.conv;
import std.json;
import std.stdio;
import std.string;
import value;
//================================================
// Class
//================================================
class LGM_Html
{
static Value parse(Value[] v)
{
string str = v[0].content.s;
string buffer = "";
string ret = "";
bool codeMode = false;
string slice;
string[] lines;
bool toOut = false;
for (ulong i=0; i<str.length; i++)
{
buffer ~= str[i];
slice = str[i..$];
if ((std.algorithm.startsWith(slice,"<%")) && !codeMode)
{
if (std.algorithm.startsWith(slice,"<%=")) toOut = true;
else toOut = false;
lines = buffer[0..$-1].splitter("\n").array();
foreach (string line; lines)
{
if (line!="")
ret ~= "out '" ~ line.replace("'","\\'") ~ "';\n";
}
buffer = "";
codeMode = true;
i+= 1 + toOut;
}
else if ((std.algorithm.startsWith(slice,"%>")==1) && codeMode)
{
lines = buffer[0..$-1].splitter("\n").array();
foreach (string line; lines)
{
if (!toOut)
ret ~= line.strip() ~ "\n";
else
ret ~= "out " ~ line.strip() ~ ";\n";
}
buffer = "";
codeMode = false;
i+=1;
}
}
buffer ~= str[str.length-1];
lines = buffer[0..$-1].splitter("\n").array();
foreach (string line; lines)
{
if (line!="")
ret ~= "out '" ~ line ~ "';\n";
}
return new Value(ret);
}
}
|
D
|
import std.stdio;
import std.typecons;
import std.conv;
import std.socket;
import core.thread;
import core.sync.semaphore;
import network;
import transactions;
import cc;
import extObject;
import updateList;
import observer;
class UC_Message : Message {
private int id;
private int clock;
private Operation op;
this(int clock, int id, Operation op) {
this.id = id;
this.clock = clock;
this.op = op;
}
override void on_receive() {
UC.getInstance().getImplementation().receiveMessage(clock, id, op);
}
}
/*************************************************
Implementation of the Criterion Update Consistency
*************************************************/
class UC_Implementation : ConsistencyCriterionImplementation {
private int id; //local clock
private int clock; //local clock
private Update_list!Operation updates; //list of updates in the lexico order
private Semaphore s; // protects from concurrent acytions : reception/operation
this() {
Network.registerType!UC_Message;
id = Network.getInstance().getID();
clock = 0;
updates = new Update_list!Operation();
s = new Semaphore(1);
}
ExtObject executeOperation(Operation op) {
incr_clock();
ExtObject o;
UC_Message m = new UC_Message(get_clock(), id, op);
//if(not pure query)
s.wait();
updates.push(clock, id, op);
o = executeList();
//if(not pure update)
s.notify();
//if(not pure query)
Network.getInstance().broadcast(m);
return o;
}
public int get_clock(){
return clock;
}
private void set_clock(int i){
clock = i;
}
private void incr_clock(){
clock = clock + 1;
}
void receiveMessage(int clock, int id, Operation op) {
int time = UC.getInstance().getImplementation().get_clock();
set_clock((time < clock ? clock : time)); //new clock = max (local clock, received clock);
s.wait();
updates.push(clock, id, op);
s.notify();
}
public ExtObject executeList() {
ExtObject o;
foreach (InternalObject o; UC.getInstance().getAllObjects()) {
UC_Object uco = cast(UC_Object)(o);
uco.initialize();
}
auto updates_copy = updates.copy();
//we apply all the updates seen by the process until now
while (!updates_copy.isEmpty()){
auto operation = updates_copy.pull()[2];//pull give the earliest (i,j,f) still in updates
o = operation.execute();
}
return o;
}
interface UC_Object {
void initialize();
}
override static public class SharedObject(T) : ConsistencyCriterionImplementation.SharedObject!T, UC_Object {
T t;
public void initialize() {
t = new T();
}
override public ExtObject executeMethod(Functor!T f) {
ExtObject o = f.execute(t);
return o;
}
}
}
class UC : ConsistencyCriterionBase!UC_Implementation {};
|
D
|
import std.algorithm, std.conv, std.range, std.stdio, std.string;
import std.bitmanip;
version(unittest) {} else
void main()
{
auto n = readln.chomp.to!size_t;
auto ai = readln.split.to!(int[]);
auto q = readln.chomp.to!size_t;
auto mi = readln.split.to!(int[]);
auto ri = new bool[](q);
foreach (i; 0..1 << n) {
auto s = ai.indexed(i.bitsSet).sum;
foreach (j, m; mi)
if (s == m) ri[j] = true;
}
foreach (r; ri)
writeln(r ? "yes" : "no");
}
|
D
|
/**
* just publically imports all the other modules
*/
module opencl.c.opencl;
public import
opencl.c.cl,
opencl.c.cl_gl,
opencl.c.cl_gl_ext,
opencl.c.cl_ext;
|
D
|
block consisting of a thick piece of something
|
D
|
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_2_BeT-4664236897.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_2_BeT-4664236897.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
/****************************************************************************
* Copyright (c) 1998-2004,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/****************************************************************************
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
/* $Id: form.h,v 0.21 2009/11/07 19:31:11 tom Exp $ */
module deimos.ncurses.form;
import core.stdc.stdarg;
public import deimos.ncurses.ncurses;
public import deimos.ncurses.eti;
extern(C) @nogc
{
alias void* FIELD_CELL;
alias int Form_Options;
alias int Field_Options;
/**********
* _PAGE *
**********/
struct _PAGE
{
short pmin; /* index of first field on page */
short pmax; /* index of last field on page */
short smin; /* index of top leftmost field on page */
short smax; /* index of bottom rightmost field on page */
}
/**********
* FIELD *
**********/
struct FIELD
{
ushort status; /* flags */
short rows; /* size in rows */
short cols; /* size in cols */
short frow; /* first row */
short fcol; /* first col */
int drows; /* dynamic rows */
int dcols; /* dynamic cols */
int maxgrow; /* maximum field growth */
int nrow; /* off-screen rows */
short nbuf; /* additional buffers */
short just; /* justification */
short page; /* page on form */
short index; /* into form -> field */
int pad; /* pad character */
chtype fore; /* foreground attribute */
chtype back; /* background attribute */
Field_Options opts; /* options */
FIELD* snext; /* sorted order pointer */
FIELD* sprev; /* sorted order pointer */
FIELD* link; /* linked field chain */
FORM* form; /* containing form */
FORM* type; /* field type */
void* arg; /* argument for type */
FIELD_CELL* buf; /* field buffers */
void* usrptr; /* user pointer */
/*
* The wide-character configuration requires extra information. Because
* there are existing applications that manipulate the members of FIELD
* directly, we cannot make the struct opaque. Offsets of members up to
* this point are the same in the narrow- and wide-character configuration.
* But note that the type of buf depends on the configuration, and is made
* opaque for that reason.
*/
}
/*********
* FORM *
*********/
struct FORM
{
ushort status; /* flags */
short rows; /* size in rows */
short cols; /* size in cols */
int currow; /* current row in field window */
int curcol; /* current col in field window */
int toprow; /* in scrollable field window */
int begincol; /* in horiz. scrollable field */
short maxfield; /* number of fields */
short maxpage; /* number of pages */
short curpage; /* index into page */
Form_Options opts; /* options */
WINDOW* win; /* window */
WINDOW* sub; /* subwindow */
WINDOW* w; /* window for current field */
FIELD** field; /* field [maxfield] */
FIELD* current; /* current field */
_PAGE* page; /* page [maxpage] */
void* usrptr; /* user pointer */
//TODO check...
void function(FORM* form) forminit;
void function(FORM* form) formterm;
void function(FORM* form) fieldinit;
void function(FORM* form) fieldterm;
}
/**************
* FIELDTYPE *
**************/
struct FIELDTYPE
{
ushort status; /* flags */
long reference; /* reference count */
FIELDTYPE* left; /* ptr to operand for | */
FIELDTYPE* right; /* ptr to operand for | */
void* function(va_list*) makearg; /* make fieldtype arg */
void* function(const void*) copyarg; /* copy fieldtype arg */
void function(void*) freearg; /* free fieldtype arg */
bool function(FIELD*, const void*) fcheck; /* field validation */
bool function(int, const void*) ccheck; /* character validation */
bool function(FIELD*, const void*) next; /* enumerate next value */
bool function(FIELD*, const void*) prev; /* enumerate prev value */
}
/***************************
* miscellaneous #defines *
***************************/
immutable enum
{
/* field justification */
NO_JUSTIFICATION = 0,
JUSTIFY_LEFT = 1,
JUSTIFY_CENTER = 2,
JUSTIFY_RIGHT = 3
}
immutable enum :OPTIONS
{
/* field options */
O_VISIBLE = 0x0001,
O_ACTIVE = 0x0002,
O_PUBLIC = 0x0004,
O_EDIT = 0x0008,
O_WRAP = 0x0010,
O_BLANK = 0x0020,
O_AUTOSKIP = 0x0040,
O_NULLOK = 0x0080,
O_PASSOK = 0x0100,
O_STATIC = 0x0200,
/* form options */
O_NL_OVERLOAD = 0x0001,
O_BS_OVERLOAD = 0x0002
}
immutable enum
{
/* form driver commands */
REQ_NEXT_PAGE = (KEY_MAX + 1), /* move to next page */
REQ_PREV_PAGE = (KEY_MAX + 2), /* move to previous page */
REQ_FIRST_PAGE = (KEY_MAX + 3), /* move to first page */
REQ_LAST_PAGE = (KEY_MAX + 4), /* move to last page */
REQ_NEXT_FIELD = (KEY_MAX + 5), /* move to next field */
REQ_PREV_FIELD = (KEY_MAX + 6), /* move to previous field */
REQ_FIRST_FIELD = (KEY_MAX + 7), /* move to first field */
REQ_LAST_FIELD = (KEY_MAX + 8), /* move to last field */
REQ_SNEXT_FIELD = (KEY_MAX + 9), /* move to sorted next field */
REQ_SPREV_FIELD = (KEY_MAX + 10), /* move to sorted prev field */
REQ_SFIRST_FIELD = (KEY_MAX + 11), /* move to sorted first field */
REQ_SLAST_FIELD = (KEY_MAX + 12), /* move to sorted last field */
REQ_LEFT_FIELD = (KEY_MAX + 13), /* move to left to field */
REQ_RIGHT_FIELD = (KEY_MAX + 14), /* move to right to field */
REQ_UP_FIELD = (KEY_MAX + 15), /* move to up to field */
REQ_DOWN_FIELD = (KEY_MAX + 16), /* move to down to field */
REQ_NEXT_CHAR = (KEY_MAX + 17), /* move to next char in field */
REQ_PREV_CHAR = (KEY_MAX + 18), /* move to prev char in field */
REQ_NEXT_LINE = (KEY_MAX + 19), /* move to next line in field */
REQ_PREV_LINE = (KEY_MAX + 20), /* move to prev line in field */
REQ_NEXT_WORD = (KEY_MAX + 21), /* move to next word in field */
REQ_PREV_WORD = (KEY_MAX + 22), /* move to prev word in field */
REQ_BEG_FIELD = (KEY_MAX + 23), /* move to first char in field */
REQ_END_FIELD = (KEY_MAX + 24), /* move after last char in fld */
REQ_BEG_LINE = (KEY_MAX + 25), /* move to beginning of line */
REQ_END_LINE = (KEY_MAX + 26), /* move after last char in line */
REQ_LEFT_CHAR = (KEY_MAX + 27), /* move left in field */
REQ_RIGHT_CHAR = (KEY_MAX + 28), /* move right in field */
REQ_UP_CHAR = (KEY_MAX + 29), /* move up in field */
REQ_DOWN_CHAR = (KEY_MAX + 30), /* move down in field */
REQ_NEW_LINE = (KEY_MAX + 31), /* insert/overlay new line */
REQ_INS_CHAR = (KEY_MAX + 32), /* insert blank char at cursor */
REQ_INS_LINE = (KEY_MAX + 33), /* insert blank line at cursor */
REQ_DEL_CHAR = (KEY_MAX + 34), /* delete char at cursor */
REQ_DEL_PREV = (KEY_MAX + 35), /* delete char before cursor */
REQ_DEL_LINE = (KEY_MAX + 36), /* delete line at cursor */
REQ_DEL_WORD = (KEY_MAX + 37), /* delete word at cursor */
REQ_CLR_EOL = (KEY_MAX + 38), /* clear to end of line */
REQ_CLR_EOF = (KEY_MAX + 39), /* clear to end of field */
REQ_CLR_FIELD = (KEY_MAX + 40), /* clear entire field */
REQ_OVL_MODE = (KEY_MAX + 41), /* begin overlay mode */
REQ_INS_MODE = (KEY_MAX + 42), /* begin insert mode */
REQ_SCR_FLINE = (KEY_MAX + 43), /* scroll field forward a line */
REQ_SCR_BLINE = (KEY_MAX + 44), /* scroll field backward a line */
REQ_SCR_FPAGE = (KEY_MAX + 45), /* scroll field forward a page */
REQ_SCR_BPAGE = (KEY_MAX + 46), /* scroll field backward a page */
REQ_SCR_FHPAGE = (KEY_MAX + 47), /* scroll field forward half page */
REQ_SCR_BHPAGE = (KEY_MAX + 48), /* scroll field backward half page */
REQ_SCR_FCHAR = (KEY_MAX + 49), /* horizontal scroll char */
REQ_SCR_BCHAR = (KEY_MAX + 50), /* horizontal scroll char */
REQ_SCR_HFLINE = (KEY_MAX + 51), /* horizontal scroll line */
REQ_SCR_HBLINE = (KEY_MAX + 52), /* horizontal scroll line */
REQ_SCR_HFHALF = (KEY_MAX + 53), /* horizontal scroll half line */
REQ_SCR_HBHALF = (KEY_MAX + 54), /* horizontal scroll half line */
REQ_VALIDATION = (KEY_MAX + 55), /* validate field */
REQ_NEXT_CHOICE = (KEY_MAX + 56), /* display next field choice */
REQ_PREV_CHOICE = (KEY_MAX + 57), /* display prev field choice */
MIN_FORM_COMMAND = (KEY_MAX + 1), /* used by form_driver */
MAX_FORM_COMMAND = (KEY_MAX + 57) /* used by form_driver */
}
immutable MAX_COMMAND = (KEY_MAX + 128);
/*************************
* standard field types *
*************************/
FIELDTYPE* TYPE_ALNUM;
FIELDTYPE* TYPE_ALPHA;
FIELDTYPE* TYPE_ENUM;
FIELDTYPE* TYPE_INTEGER;
FIELDTYPE* TYPE_NUMERIC;
FIELDTYPE* TYPE_REGEXP;
/************************************
* built-in additional field types *
* They are not defined in SVr4 *
************************************/
FIELDTYPE* TYPE_IPV4; /* Internet IP Version 4 address */
/***********************
* FIELDTYPE routines *
***********************/
FIELDTYPE* new_fieldtype(
bool function(FIELD*, void*) field_check,
bool function(int, void*) char_check);
FIELDTYPE* link_fieldtype(FIELDTYPE* type1, FIELDTYPE* type2);
int free_fieldtype(FIELDTYPE* fieldtype);
int set_fieldtype_arg(
FIELDTYPE* fieldtype,
void* function(va_list*) make_arg,
void* function(void*) copy_arg,
void function(void*) free_arg);
int set_fieldtype_choice(
FIELDTYPE* fieldtype,
bool function(FIELD*, void*) next_choice,
bool function(FIELD*, void*) prev_choice);
/*******************
* FIELD routines *
*******************/
FIELD* new_field(int height, int width, int toprow, int leftcol, int offscreen, int nbuffers);
FIELD* dup_field(FIELD* field, int toprow, int leftcol);
FIELD* link_field(FIELD* field, int toprow, int leftcol);
int free_field(FIELD* field);
int field_info(const FIELD* field, int* rows, int* cols, int* frow, int* fcol, int* nrow, int* nbuf);
int dynamic_field_info(const FIELD* field, int* rows, int* cols, int* max);
int set_max_field(FIELD* field, int max);
int move_field(FIELD* field, int frow, int fcol);
int set_field_type(FIELD* field, FIELDTYPE* type, ...);
int set_new_page(FIELD* field, bool new_page_flag);
int set_field_just(FIELD* field, int justification);
int field_just(const FIELD* field);
int set_field_fore(FIELD* field, chtype attr);
int set_field_back(FIELD* field, chtype attr);
int set_field_pad(FIELD* field, int pad);
int field_pad(const FIELD* field);
int set_field_buffer(FIELD* field, int buf, immutable(char*) value);
int set_field_status(FIELD* field, bool status);
int set_field_userptr(FIELD* field, void* userptr);
int set_field_opts(FIELD* field, Field_Options opts);
int field_opts_on(FIELD* field, Field_Options opts);
int field_opts_off(FIELD* field, Field_Options opts);
chtype field_fore(const FIELD* field);
chtype field_back(const FIELD* field);
bool new_page(const FIELD* field);
bool field_status(const FIELD* field);
void* field_arg(const FIELD* field);
void* field_userptr(const FIELD* field);
FIELDTYPE* field_type(const FIELD* field);
char* field_buffer(const FIELD* field, int buffer);
Field_Options field_opts(const FIELD* field);
/******************
* FORM routines *
******************/
FORM* new_form(FIELD** fields);
FIELD** form_fields(const FORM* form);
FIELD* current_field(const FORM* form);
WINDOW* form_win(const FORM* form);
WINDOW* form_sub(const FORM* form);
FORM* form_init(const FORM* form);
FORM* form_term(const FORM* form);
FORM* field_init(const FORM* form);
FORM* field_term(const FORM* form);
int free_form(FORM* form);
int set_form_fields(FORM* form, FIELD** fields);
int field_count(const FORM* form);
int set_form_win(FORM* form, WINDOW* win);
int set_form_sub(FORM* form, WINDOW* sub);
int set_current_field(FORM* form, FIELD* field);
int field_index(const FIELD* field);
int set_form_page(FORM* form, int n);
int form_page(const FORM* form);
int scale_form(const FORM* form, int* rows, int* columns);
int set_form_init(FORM* form, FORM* func);
int set_form_term(FORM* form, FORM* func);
int set_field_init(FORM* form, FORM* func);
int set_field_term(FORM* form, FORM* func);
int post_form(FORM* form);
int unpost_form(FORM* form);
int pos_form_cursor(FORM* form);
int form_driver(FORM* form, int c);
int set_form_userptr(FORM* form, void* userptr);
int set_form_opts(FORM* form, Form_Options opts);
int form_opts_on(FORM* form, Form_Options opts);
int form_opts_off(FORM* form, Form_Options opts);
int form_request_by_name(immutable char* name);
char* form_request_name(int request);
void* form_userptr(const FORM* form);
Form_Options form_opts(const FORM* form);
bool data_ahead(const FORM* form);
bool data_behind(const FORM* form);
}//end extern (C)
|
D
|
module gtkD.glib.AsyncQueue;
public import gtkD.gtkc.glibtypes;
private import gtkD.gtkc.glib;
private import gtkD.glib.ConstructionException;
private import gtkD.glib.TimeVal;
/**
* Description
* Often you need to communicate between different threads. In general
* it's safer not to do this by shared memory, but by explicit message
* passing. These messages only make sense asynchronously for
* multi-threaded applications though, as a synchronous operation could as
* well be done in the same thread.
* Asynchronous queues are an exception from most other GLib data
* structures, as they can be used simultaneously from multiple threads
* without explicit locking and they bring their own builtin reference
* counting. This is because the nature of an asynchronous queue is that
* it will always be used by at least 2 concurrent threads.
* For using an asynchronous queue you first have to create one with
* g_async_queue_new(). A newly-created queue will get the reference
* count 1. Whenever another thread is creating a new reference of (that
* is, pointer to) the queue, it has to increase the reference count
* (using g_async_queue_ref()). Also, before removing this reference, the
* reference count has to be decreased (using
* g_async_queue_unref()). After that the queue might no longer exist so
* you must not access it after that point.
* A thread, which wants to send a message to that queue simply calls
* g_async_queue_push() to push the message to the queue.
* A thread, which is expecting messages from an asynchronous queue
* simply calls g_async_queue_pop() for that queue. If no message is
* available in the queue at that point, the thread is now put to sleep
* until a message arrives. The message will be removed from the queue
* and returned. The functions g_async_queue_try_pop() and
* g_async_queue_timed_pop() can be used to only check for the presence
* of messages or to only wait a certain time for messages respectively.
* For almost every function there exist two variants, one that locks the
* queue and one that doesn't. That way you can hold the queue lock
* (acquire it with g_async_queue_lock() and release it with
* g_async_queue_unlock()) over multiple queue accessing
* instructions. This can be necessary to ensure the integrity of the
* queue, but should only be used when really necessary, as it can make
* your life harder if used unwisely. Normally you should only use the
* locking function variants (those without the suffix _unlocked)
*/
public class AsyncQueue
{
/** the main Gtk struct */
protected GAsyncQueue* gAsyncQueue;
public GAsyncQueue* getAsyncQueueStruct();
/** the main Gtk struct as a void* */
protected void* getStruct();
/**
* Sets our main struct and passes it to the parent class
*/
public this (GAsyncQueue* gAsyncQueue);
/**
*/
/**
* Creates a new asynchronous queue with the initial reference count of 1.
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this ();
/**
* Creates a new asynchronous queue with an initial reference count of 1 and
* sets up a destroy notify function that is used to free any remaining
* queue items when the queue is destroyed after the final unref.
* Since 2.16
* Params:
* itemFreeFunc = function to free queue elements
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this (GDestroyNotify itemFreeFunc);
/**
* Increases the reference count of the asynchronous queue by 1. You
* do not need to hold the lock to call this function.
* Returns: the queue that was passed in (since 2.6)
*/
public AsyncQueue doref();
/**
* Decreases the reference count of the asynchronous queue by 1. If
* the reference count went to 0, the queue will be destroyed and the
* memory allocated will be freed. So you are not allowed to use the
* queue afterwards, as it might have disappeared. You do not need to
* hold the lock to call this function.
*/
public void unref();
/**
* Pushes the data into the queue. data must not be NULL.
* Params:
* data = data to push into the queue.
*/
public void push(void* data);
/**
* Inserts data into queue using func to determine the new
* position.
* This function requires that the queue is sorted before pushing on
* new elements.
* This function will lock queue before it sorts the queue and unlock
* it when it is finished.
* For an example of func see g_async_queue_sort().
* Since 2.10
* Params:
* data = the data to push into the queue
* func = the GCompareDataFunc is used to sort queue. This function
* is passed two elements of the queue. The function should return
* 0 if they are equal, a negative value if the first element
* should be higher in the queue or a positive value if the first
* element should be lower in the queue than the second element.
* userData = user data passed to func.
*/
public void pushSorted(void* data, GCompareDataFunc func, void* userData);
/**
* Pops data from the queue. This function blocks until data become
* available.
* Returns: data from the queue.
*/
public void* pop();
/**
* Tries to pop data from the queue. If no data is available, NULL is
* returned.
* Returns: data from the queue or NULL, when no data isavailable immediately.
*/
public void* tryPop();
/**
* Pops data from the queue. If no data is received before end_time,
* NULL is returned.
* To easily calculate end_time a combination of g_get_current_time()
* and g_time_val_add() can be used.
* Params:
* endTime = a GTimeVal, determining the final time.
* Returns: data from the queue or NULL, when no data isreceived before end_time.
*/
public void* timedPop(TimeVal endTime);
/**
* Returns the length of the queue, negative values mean waiting
* threads, positive values mean available entries in the
* queue. Actually this function returns the number of data items in
* the queue minus the number of waiting threads. Thus a return value
* of 0 could mean 'n' entries in the queue and 'n' thread waiting.
* That can happen due to locking of the queue or due to
* scheduling.
* Returns: the length of the queue.
*/
public int length();
/**
* Sorts queue using func.
* This function will lock queue before it sorts the queue and unlock
* it when it is finished.
* If you were sorting a list of priority numbers to make sure the
* Since 2.10
* Params:
* func = the GCompareDataFunc is used to sort queue. This
* function is passed two elements of the queue. The function
* should return 0 if they are equal, a negative value if the
* first element should be higher in the queue or a positive
* value if the first element should be lower in the queue than
* the second element.
* userData = user data passed to func
*/
public void sort(GCompareDataFunc func, void* userData);
/**
* Acquires the queue's lock. After that you can only call the
* g_async_queue_*_unlocked() function variants on that
* queue. Otherwise it will deadlock.
*/
public void lock();
/**
* Releases the queue's lock.
*/
public void unlock();
/**
* Warning
* g_async_queue_ref_unlocked is deprecated and should not be used in newly-written code.
* Increases the reference count of the asynchronous queue by 1.
* Deprecated: Since 2.8, reference counting is done atomically
* so g_async_queue_ref() can be used regardless of the queue's
* lock.
*/
public void refUnlocked();
/**
* Warning
* g_async_queue_unref_and_unlock is deprecated and should not be used in newly-written code.
* Decreases the reference count of the asynchronous queue by 1 and
* releases the lock. This function must be called while holding the
* queue's lock. If the reference count went to 0, the queue will be
* destroyed and the memory allocated will be freed.
* Deprecated: Since 2.8, reference counting is done atomically
* so g_async_queue_unref() can be used regardless of the queue's
* lock.
*/
public void unrefAndUnlock();
/**
* Pushes the data into the queue. data must not be NULL. This
* function must be called while holding the queue's lock.
* Params:
* data = data to push into the queue.
*/
public void pushUnlocked(void* data);
/**
* Inserts data into queue using func to determine the new
* position.
* This function requires that the queue is sorted before pushing on
* new elements.
* This function is called while holding the queue's lock.
* For an example of func see g_async_queue_sort().
* Since 2.10
* Params:
* data = the data to push into the queue
* func = the GCompareDataFunc is used to sort queue. This function
* is passed two elements of the queue. The function should return
* 0 if they are equal, a negative value if the first element
* should be higher in the queue or a positive value if the first
* element should be lower in the queue than the second element.
* userData = user data passed to func.
*/
public void pushSortedUnlocked(void* data, GCompareDataFunc func, void* userData);
/**
* Pops data from the queue. This function blocks until data become
* available. This function must be called while holding the queue's
* lock.
* Returns: data from the queue.
*/
public void* popUnlocked();
/**
* Tries to pop data from the queue. If no data is available, NULL is
* returned. This function must be called while holding the queue's
* lock.
* Returns: data from the queue or NULL, when no data isavailable immediately.
*/
public void* tryPopUnlocked();
/**
* Pops data from the queue. If no data is received before end_time,
* NULL is returned. This function must be called while holding the
* queue's lock.
* To easily calculate end_time a combination of g_get_current_time()
* and g_time_val_add() can be used.
* Params:
* endTime = a GTimeVal, determining the final time.
* Returns: data from the queue or NULL, when no data isreceived before end_time.
*/
public void* timedPopUnlocked(TimeVal endTime);
/**
* Returns the length of the queue, negative values mean waiting
* threads, positive values mean available entries in the
* queue. Actually this function returns the number of data items in
* the queue minus the number of waiting threads. Thus a return value
* of 0 could mean 'n' entries in the queue and 'n' thread waiting.
* That can happen due to locking of the queue or due to
* scheduling. This function must be called while holding the queue's
* lock.
* Returns: the length of the queue.
*/
public int lengthUnlocked();
/**
* Sorts queue using func.
* This function is called while holding the queue's lock.
* Since 2.10
* Params:
* func = the GCompareDataFunc is used to sort queue. This
* function is passed two elements of the queue. The function
* should return 0 if they are equal, a negative value if the
* first element should be higher in the queue or a positive
* value if the first element should be lower in the queue than
* the second element.
* userData = user data passed to func
*/
public void sortUnlocked(GCompareDataFunc func, void* userData);
}
|
D
|
// https://issues.dlang.org/show_bug.cgi?id=21515
// EXTRA_CPP_SOURCES: test21515.cpp
// DISABLED: win32 win64
// ABI layout of native complex
struct _Complex(T) { T re; T im; }
// Special enum definitions.
version (Posix)
{
align(float.alignof) enum __c_complex_float : _Complex!float;
align(double.alignof) enum __c_complex_double : _Complex!double;
align(real.alignof) enum __c_complex_real : _Complex!real;
}
else
{
align(float.sizeof * 2) enum __c_complex_float : _Complex!float;
align(double.sizeof * 2) enum __c_complex_double : _Complex!double;
align(real.alignof) enum __c_complex_real : _Complex!real;
}
alias complex_float = __c_complex_float;
alias complex_double = __c_complex_double;
alias complex_real = __c_complex_real;
extern(C) complex_float ccomplexf();
extern(C) complex_double ccomplex();
extern(C) complex_real ccomplexl();
extern(C) void ccomplexf2(complex_float c);
extern(C) void ccomplex2(complex_double c);
extern(C) void ccomplexl2(complex_real c);
extern(C++) complex_float cpcomplexf();
extern(C++) complex_double cpcomplex();
extern(C++) complex_real cpcomplexl();
extern(C++) void cpcomplexf(complex_float c);
extern(C++) void cpcomplex(complex_double c);
extern(C++) void cpcomplexl(complex_real c);
struct wrap_complexf { complex_float c; alias c this; };
struct wrap_complex { complex_double c; alias c this; };
struct wrap_complexl { complex_real c; alias c this; };
extern(C++) wrap_complexf wcomplexf();
extern(C++) wrap_complex wcomplex();
extern(C++) wrap_complexl wcomplexl();
extern(C++) void wcomplexf(wrap_complexf c);
extern(C++) void wcomplex(wrap_complex c);
extern(C++) void wcomplexl(wrap_complexl c);
struct soft_complexf { float re; float im; };
struct soft_complex { double re; double im; };
struct soft_complexl { real re; real im; };
extern(C++) soft_complexf scomplexf();
extern(C++) soft_complex scomplex();
extern(C++) soft_complexl scomplexl();
extern(C++) void scomplexf(soft_complexf c);
extern(C++) void scomplex(soft_complex c);
extern(C++) void scomplexl(soft_complexl c);
int main()
{
auto a1 = ccomplexf();
auto b1 = ccomplex();
auto c1 = ccomplexl();
assert(a1.re == 2 && a1.im == 1);
assert(b1.re == 2 && b1.im == 1);
assert(c1.re == 2 && c1.im == 1);
ccomplexf2(a1);
ccomplex2(b1);
ccomplexl2(c1);
auto a2 = cpcomplexf();
auto b2 = cpcomplex();
auto c2 = cpcomplexl();
assert(a2.re == 2 && a2.im == 1);
assert(b2.re == 2 && b2.im == 1);
assert(c2.re == 2 && c2.im == 1);
cpcomplexf(a2);
cpcomplex(b2);
cpcomplexl(c2);
auto a3 = wcomplexf();
auto b3 = wcomplex();
auto c3 = wcomplexl();
assert(a3.re == 2 && a3.im == 1);
assert(b3.re == 2 && b3.im == 1);
assert(c3.re == 2 && c3.im == 1);
wcomplexf(a3);
wcomplex(b3);
wcomplexl(c3);
auto a4 = scomplexf();
auto b4 = scomplex();
auto c4 = scomplexl();
assert(a4.re == 2 && a4.im == 1);
assert(b4.re == 2 && b4.im == 1);
assert(c4.re == 2 && c4.im == 1);
scomplexf(a4);
scomplex(b4);
scomplexl(c4);
return 0;
}
|
D
|
/**
LDC compiler support.
Copyright: © 2013-2013 rejectedsoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module dub.compilers.ldc;
import dub.compilers.compiler;
import dub.compilers.utils;
import dub.internal.utils;
import dub.internal.vibecompat.core.log;
import dub.internal.vibecompat.inet.path;
import dub.recipe.packagerecipe : ToolchainRequirements;
import std.algorithm;
import std.array;
import std.conv;
import std.exception;
import std.file;
import std.process;
import std.typecons;
class LDCCompiler : Compiler {
private static immutable s_options = [
tuple(BuildOption.debugMode, ["-d-debug"]),
tuple(BuildOption.releaseMode, ["-release"]),
//tuple(BuildOption.coverage, ["-?"]),
tuple(BuildOption.debugInfo, ["-g"]),
tuple(BuildOption.debugInfoC, ["-gc"]),
//tuple(BuildOption.alwaysStackFrame, ["-?"]),
//tuple(BuildOption.stackStomping, ["-?"]),
tuple(BuildOption.inline, ["-enable-inlining", "-Hkeep-all-bodies"]),
tuple(BuildOption.noBoundsCheck, ["-boundscheck=off"]),
tuple(BuildOption.optimize, ["-O3"]),
//tuple(BuildOption.profile, ["-?"]),
tuple(BuildOption.unittests, ["-unittest"]),
tuple(BuildOption.verbose, ["-v"]),
tuple(BuildOption.ignoreUnknownPragmas, ["-ignore"]),
tuple(BuildOption.syntaxOnly, ["-o-"]),
tuple(BuildOption.warnings, ["-wi"]),
tuple(BuildOption.warningsAsErrors, ["-w"]),
tuple(BuildOption.ignoreDeprecations, ["-d"]),
tuple(BuildOption.deprecationWarnings, ["-dw"]),
tuple(BuildOption.deprecationErrors, ["-de"]),
tuple(BuildOption.property, ["-property"]),
//tuple(BuildOption.profileGC, ["-?"]),
tuple(BuildOption.betterC, ["-betterC"]),
tuple(BuildOption._docs, ["-Dd=docs"]),
tuple(BuildOption._ddox, ["-Xf=docs.json", "-Dd=__dummy_docs"]),
];
@property string name() const { return "ldc"; }
enum ldcVersionRe = `^version\s+v?(\d+\.\d+\.\d+[A-Za-z0-9.+-]*)`;
unittest {
import std.regex : matchFirst, regex;
auto probe = `
binary /usr/bin/ldc2
version 1.11.0 (DMD v2.081.2, LLVM 6.0.1)
config /etc/ldc2.conf (x86_64-pc-linux-gnu)
`;
auto re = regex(ldcVersionRe, "m");
auto c = matchFirst(probe, re);
assert(c && c.length > 1 && c[1] == "1.11.0");
}
string determineVersion(string compiler_binary, string verboseOutput)
{
import std.regex : matchFirst, regex;
auto ver = matchFirst(verboseOutput, regex(ldcVersionRe, "m"));
return ver && ver.length > 1 ? ver[1] : null;
}
BuildPlatform determinePlatform(ref BuildSettings settings, string compiler_binary, string arch_override)
{
string[] arch_flags;
switch (arch_override) {
default: throw new Exception("Unsupported architecture: "~arch_override);
case "": break;
case "x86": arch_flags = ["-march=x86"]; break;
case "x86_64": arch_flags = ["-march=x86-64"]; break;
}
settings.addDFlags(arch_flags);
return probePlatform(
compiler_binary,
arch_flags ~ ["-c", "-o-", "-v"],
arch_override
);
}
void prepareBuildSettings(ref BuildSettings settings, BuildSetting fields = BuildSetting.all) const
{
enforceBuildRequirements(settings);
if (!(fields & BuildSetting.options)) {
foreach (t; s_options)
if (settings.options & t[0])
settings.addDFlags(t[1]);
}
// since LDC always outputs multiple object files, avoid conflicts by default
settings.addDFlags("-oq", "-od=.dub/obj");
if (!(fields & BuildSetting.versions)) {
settings.addDFlags(settings.versions.map!(s => "-d-version="~s)().array());
settings.versions = null;
}
if (!(fields & BuildSetting.debugVersions)) {
settings.addDFlags(settings.debugVersions.map!(s => "-d-debug="~s)().array());
settings.debugVersions = null;
}
if (!(fields & BuildSetting.importPaths)) {
settings.addDFlags(settings.importPaths.map!(s => "-I"~s)().array());
settings.importPaths = null;
}
if (!(fields & BuildSetting.stringImportPaths)) {
settings.addDFlags(settings.stringImportPaths.map!(s => "-J"~s)().array());
settings.stringImportPaths = null;
}
if (!(fields & BuildSetting.sourceFiles)) {
settings.addDFlags(settings.sourceFiles);
settings.sourceFiles = null;
}
if (!(fields & BuildSetting.libs)) {
resolveLibs(settings);
settings.addLFlags(settings.libs.map!(l => "-l"~l)().array());
}
if (!(fields & BuildSetting.lflags)) {
settings.addDFlags(lflagsToDFlags(settings.lflags));
settings.lflags = null;
}
if (settings.options & BuildOption.pic)
settings.addDFlags("-relocation-model=pic");
assert(fields & BuildSetting.dflags);
assert(fields & BuildSetting.copyFiles);
}
void extractBuildOptions(ref BuildSettings settings) const
{
Appender!(string[]) newflags;
next_flag: foreach (f; settings.dflags) {
foreach (t; s_options)
if (t[1].canFind(f)) {
settings.options |= t[0];
continue next_flag;
}
if (f.startsWith("-d-version=")) settings.addVersions(f[11 .. $]);
else if (f.startsWith("-d-debug=")) settings.addDebugVersions(f[9 .. $]);
else newflags ~= f;
}
settings.dflags = newflags.data;
}
string getTargetFileName(in BuildSettings settings, in BuildPlatform platform)
const {
assert(settings.targetName.length > 0, "No target name set.");
final switch (settings.targetType) {
case TargetType.autodetect: assert(false, "Configurations must have a concrete target type.");
case TargetType.none: return null;
case TargetType.sourceLibrary: return null;
case TargetType.executable:
if (platform.platform.canFind("windows"))
return settings.targetName ~ ".exe";
else return settings.targetName;
case TargetType.library:
case TargetType.staticLibrary:
if (generatesCOFF(platform)) return settings.targetName ~ ".lib";
else return "lib" ~ settings.targetName ~ ".a";
case TargetType.dynamicLibrary:
if (platform.platform.canFind("windows"))
return settings.targetName ~ ".dll";
else if (platform.platform.canFind("osx"))
return "lib" ~ settings.targetName ~ ".dylib";
else return "lib" ~ settings.targetName ~ ".so";
case TargetType.object:
if (platform.platform.canFind("windows"))
return settings.targetName ~ ".obj";
else return settings.targetName ~ ".o";
}
}
void setTarget(ref BuildSettings settings, in BuildPlatform platform, string tpath = null) const
{
final switch (settings.targetType) {
case TargetType.autodetect: assert(false, "Invalid target type: autodetect");
case TargetType.none: assert(false, "Invalid target type: none");
case TargetType.sourceLibrary: assert(false, "Invalid target type: sourceLibrary");
case TargetType.executable: break;
case TargetType.library:
case TargetType.staticLibrary:
settings.addDFlags("-lib");
break;
case TargetType.dynamicLibrary:
settings.addDFlags("-shared");
break;
case TargetType.object:
settings.addDFlags("-c");
break;
}
if (tpath is null)
tpath = (NativePath(settings.targetPath) ~ getTargetFileName(settings, platform)).toNativeString();
settings.addDFlags("-of"~tpath);
}
void invoke(in BuildSettings settings, in BuildPlatform platform, void delegate(int, string) output_callback)
{
auto res_file = getTempFile("dub-build", ".rsp");
const(string)[] args = settings.dflags;
if (platform.frontendVersion >= 2066) args ~= "-vcolumns";
std.file.write(res_file.toNativeString(), escapeArgs(args).join("\n"));
logDiagnostic("%s %s", platform.compilerBinary, escapeArgs(args).join(" "));
invokeTool([platform.compilerBinary, "@"~res_file.toNativeString()], output_callback);
}
void invokeLinker(in BuildSettings settings, in BuildPlatform platform, string[] objects, void delegate(int, string) output_callback)
{
assert(false, "Separate linking not implemented for LDC");
}
string[] lflagsToDFlags(in string[] lflags) const
{
return map!(f => "-L"~f)(lflags.filter!(f => f != "")()).array();
}
private auto escapeArgs(in string[] args)
{
return args.map!(s => s.canFind(' ') ? "\""~s~"\"" : s);
}
private static bool generatesCOFF(in BuildPlatform platform)
{
import std.string : splitLines, strip;
import std.uni : toLower;
static bool[string] compiler_coff_map;
if (auto pret = platform.compilerBinary in compiler_coff_map)
return *pret;
auto result = executeShell(escapeShellCommand([platform.compilerBinary, "-version"]));
enforce (result.status == 0, "Failed to determine linker used by LDC. \""
~platform.compilerBinary~" -version\" failed with exit code "
~result.status.to!string()~".");
bool ret = result.output
.splitLines
.find!(l => l.strip.toLower.startsWith("default target:"))
.front
.canFind("msvc");
compiler_coff_map[platform.compilerBinary] = ret;
return ret;
}
}
|
D
|
/**
Copyright: Copyright (c) 2017 Andrey Penechko.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Andrey Penechko.
*/
module voxelman.container.chunkedrange;
struct ChunkedRange(T)
{
T[] front;
bool empty() { return front.length == 0; }
size_t joinedLength() { return front.length + itemsLeft; }
void popFront() { popFrontHandler(front, itemsLeft, data0, data1); }
size_t itemsLeft;
void* data0;
void* data1;
void function(ref T[], ref size_t, ref void*, ref void*) popFrontHandler;
auto byItem() { return ByItem!T(this); }
void copyInto(T[] sink)
{
assert(sink.length >= joinedLength);
foreach(chunk; this)
{
sink[0..chunk.length] = chunk;
sink = sink[chunk.length..$];
}
}
}
struct ByItem(T)
{
private ChunkedRange!T range;
bool empty() { return range.empty; }
size_t length() { return range.joinedLength; }
alias opDollar = length;
T front() { return range.front[0]; }
void popFront() {
range.front = range.front[1..$];
if (range.front.length == 0) range.popFront;
}
void copyInto(T[] sink) { range.copyInto(sink); }
}
|
D
|
// Compiler implementation of the D programming language
// Copyright (c) 1999-2015 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
module ddmd.dtemplate;
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import ddmd.aggregate;
import ddmd.aliasthis;
import ddmd.arraytypes;
import ddmd.attrib;
import ddmd.backend;
import ddmd.dcast;
import ddmd.dclass;
import ddmd.declaration;
import ddmd.dmangle;
import ddmd.dmodule;
import ddmd.doc;
import ddmd.dscope;
import ddmd.dsymbol;
import ddmd.errors;
import ddmd.expression;
import ddmd.func;
import ddmd.globals;
import ddmd.hdrgen;
import ddmd.id;
import ddmd.identifier;
import ddmd.init;
import ddmd.mtype;
import ddmd.opover;
import ddmd.root.aav;
import ddmd.root.array;
import ddmd.root.outbuffer;
import ddmd.root.rootobject;
import ddmd.tokens;
import ddmd.visitor;
private enum LOG = false;
enum IDX_NOTFOUND = 0x12345678;
/********************************************
* These functions substitute for dynamic_cast. dynamic_cast does not work
* on earlier versions of gcc.
*/
extern (C++) Expression isExpression(RootObject o)
{
//return dynamic_cast<Expression *>(o);
if (!o || o.dyncast() != DYNCAST_EXPRESSION)
return null;
return cast(Expression)o;
}
extern (C++) Dsymbol isDsymbol(RootObject o)
{
//return dynamic_cast<Dsymbol *>(o);
if (!o || o.dyncast() != DYNCAST_DSYMBOL)
return null;
return cast(Dsymbol)o;
}
extern (C++) Type isType(RootObject o)
{
//return dynamic_cast<Type *>(o);
if (!o || o.dyncast() != DYNCAST_TYPE)
return null;
return cast(Type)o;
}
extern (C++) Tuple isTuple(RootObject o)
{
//return dynamic_cast<Tuple *>(o);
if (!o || o.dyncast() != DYNCAST_TUPLE)
return null;
return cast(Tuple)o;
}
extern (C++) Parameter isParameter(RootObject o)
{
//return dynamic_cast<Parameter *>(o);
if (!o || o.dyncast() != DYNCAST_PARAMETER)
return null;
return cast(Parameter)o;
}
/**************************************
* Is this Object an error?
*/
extern (C++) bool isError(RootObject o)
{
Type t = isType(o);
if (t)
return (t.ty == Terror);
Expression e = isExpression(o);
if (e)
return (e.op == TOKerror || !e.type || e.type.ty == Terror);
Tuple v = isTuple(o);
if (v)
return arrayObjectIsError(&v.objects);
Dsymbol s = isDsymbol(o);
assert(s);
if (s.errors)
return true;
return s.parent ? isError(s.parent) : false;
}
/**************************************
* Are any of the Objects an error?
*/
extern (C++) bool arrayObjectIsError(Objects* args)
{
for (size_t i = 0; i < args.dim; i++)
{
RootObject o = (*args)[i];
if (isError(o))
return true;
}
return false;
}
/***********************
* Try to get arg as a type.
*/
extern (C++) Type getType(RootObject o)
{
Type t = isType(o);
if (!t)
{
Expression e = isExpression(o);
if (e)
t = e.type;
}
return t;
}
extern (C++) Dsymbol getDsymbol(RootObject oarg)
{
//printf("getDsymbol()\n");
//printf("e %p s %p t %p v %p\n", isExpression(oarg), isDsymbol(oarg), isType(oarg), isTuple(oarg));
Dsymbol sa;
Expression ea = isExpression(oarg);
if (ea)
{
// Try to convert Expression to symbol
if (ea.op == TOKvar)
sa = (cast(VarExp)ea).var;
else if (ea.op == TOKfunction)
{
if ((cast(FuncExp)ea).td)
sa = (cast(FuncExp)ea).td;
else
sa = (cast(FuncExp)ea).fd;
}
else
sa = null;
}
else
{
// Try to convert Type to symbol
Type ta = isType(oarg);
if (ta)
sa = ta.toDsymbol(null);
else
sa = isDsymbol(oarg); // if already a symbol
}
return sa;
}
extern (C++) Expression getValue(ref Dsymbol s)
{
Expression e = null;
if (s)
{
VarDeclaration v = s.isVarDeclaration();
if (v && v.storage_class & STCmanifest)
{
e = v.getConstInitializer();
}
}
return e;
}
/***********************
* Try to get value from manifest constant
*/
extern (C++) Expression getValue(Expression e)
{
if (e && e.op == TOKvar)
{
VarDeclaration v = (cast(VarExp)e).var.isVarDeclaration();
if (v && v.storage_class & STCmanifest)
{
e = v.getConstInitializer();
}
}
return e;
}
/******************************
* If o1 matches o2, return true.
* Else, return false.
*/
extern (C++) bool match(RootObject o1, RootObject o2)
{
Type t1 = isType(o1);
Type t2 = isType(o2);
Dsymbol s1 = isDsymbol(o1);
Dsymbol s2 = isDsymbol(o2);
Expression e1 = s1 ? getValue(s1) : getValue(isExpression(o1));
Expression e2 = s2 ? getValue(s2) : getValue(isExpression(o2));
Tuple u1 = isTuple(o1);
Tuple u2 = isTuple(o2);
//printf("\t match t1 %p t2 %p, e1 %p e2 %p, s1 %p s2 %p, u1 %p u2 %p\n", t1,t2,e1,e2,s1,s2,u1,u2);
/* A proper implementation of the various equals() overrides
* should make it possible to just do o1->equals(o2), but
* we'll do that another day.
*/
/* Manifest constants should be compared by their values,
* at least in template arguments.
*/
if (t1)
{
//printf("t1 = %s\n", t1->toChars());
//printf("t2 = %s\n", t2->toChars());
if (!t2)
goto Lnomatch;
if (!t1.equals(t2))
goto Lnomatch;
}
else if (e1)
{
if (!e2)
goto Lnomatch;
version (none)
{
printf("match %d\n", e1.equals(e2));
printf("\te1 = %p %s %s %s\n", e1, e1.type.toChars(), Token.toChars(e1.op), e1.toChars());
printf("\te2 = %p %s %s %s\n", e2, e2.type.toChars(), Token.toChars(e2.op), e2.toChars());
}
if (!e1.equals(e2))
goto Lnomatch;
}
else if (s1)
{
if (s2)
{
if (!s1.equals(s2))
goto Lnomatch;
if (s1.parent != s2.parent && !s1.isFuncDeclaration() && !s2.isFuncDeclaration())
{
goto Lnomatch;
}
}
else
goto Lnomatch;
}
else if (u1)
{
if (!u2)
goto Lnomatch;
if (!arrayObjectMatch(&u1.objects, &u2.objects))
goto Lnomatch;
}
//printf("match\n");
return true; // match
Lnomatch:
//printf("nomatch\n");
return false; // nomatch;
}
/************************************
* Match an array of them.
*/
extern (C++) int arrayObjectMatch(Objects* oa1, Objects* oa2)
{
if (oa1 == oa2)
return 1;
if (oa1.dim != oa2.dim)
return 0;
for (size_t j = 0; j < oa1.dim; j++)
{
RootObject o1 = (*oa1)[j];
RootObject o2 = (*oa2)[j];
if (!match(o1, o2))
{
return 0;
}
}
return 1;
}
/************************************
* Return hash of Objects.
*/
extern (C++) hash_t arrayObjectHash(Objects* oa1)
{
hash_t hash = 0;
for (size_t j = 0; j < oa1.dim; j++)
{
/* Must follow the logic of match()
*/
RootObject o1 = (*oa1)[j];
if (Type t1 = isType(o1))
hash += cast(size_t)t1.deco;
else
{
Dsymbol s1 = isDsymbol(o1);
Expression e1 = s1 ? getValue(s1) : getValue(isExpression(o1));
if (e1)
{
if (e1.op == TOKint64)
{
IntegerExp ne = cast(IntegerExp)e1;
hash += cast(size_t)ne.getInteger();
}
}
else if (s1)
{
FuncAliasDeclaration fa1 = s1.isFuncAliasDeclaration();
if (fa1)
s1 = fa1.toAliasFunc();
hash += cast(size_t)cast(void*)s1.getIdent() + cast(size_t)cast(void*)s1.parent;
}
else if (Tuple u1 = isTuple(o1))
hash += arrayObjectHash(&u1.objects);
}
}
return hash;
}
extern (C++) RootObject objectSyntaxCopy(RootObject o)
{
if (!o)
return null;
if (Type t = isType(o))
return t.syntaxCopy();
if (Expression e = isExpression(o))
return e.syntaxCopy();
return o;
}
extern (C++) final class Tuple : RootObject
{
public:
Objects objects;
// kludge for template.isType()
int dyncast()
{
return DYNCAST_TUPLE;
}
char* toChars()
{
return objects.toChars();
}
}
struct TemplatePrevious
{
TemplatePrevious* prev;
Scope* sc;
Objects* dedargs;
}
extern (C++) final class TemplateDeclaration : ScopeDsymbol
{
public:
TemplateParameters* parameters; // array of TemplateParameter's
TemplateParameters* origParameters; // originals for Ddoc
Expression constraint;
// Hash table to look up TemplateInstance's of this TemplateDeclaration
Array!(TemplateInstances*) buckets;
size_t numinstances; // number of instances in the hash table
TemplateDeclaration overnext; // next overloaded TemplateDeclaration
TemplateDeclaration overroot; // first in overnext list
FuncDeclaration funcroot; // first function in unified overload list
Dsymbol onemember; // if !=NULL then one member of this template
bool literal; // this template declaration is a literal
bool ismixin; // template declaration is only to be used as a mixin
bool isstatic; // this is static template declaration
Prot protection;
TemplatePrevious* previous; // threaded list of previous instantiation attempts on stack
/* ======================== TemplateDeclaration ============================= */
extern (D) this(Loc loc, Identifier id, TemplateParameters* parameters, Expression constraint, Dsymbols* decldefs, bool ismixin = false, bool literal = false)
{
super(id);
static if (LOG)
{
printf("TemplateDeclaration(this = %p, id = '%s')\n", this, id.toChars());
}
version (none)
{
if (parameters)
for (int i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
//printf("\tparameter[%d] = %p\n", i, tp);
TemplateTypeParameter ttp = tp.isTemplateTypeParameter();
if (ttp)
{
printf("\tparameter[%d] = %s : %s\n", i, tp.ident.toChars(), ttp.specType ? ttp.specType.toChars() : "");
}
}
}
this.loc = loc;
this.parameters = parameters;
this.origParameters = parameters;
this.constraint = constraint;
this.members = decldefs;
this.overnext = null;
this.overroot = null;
this.funcroot = null;
this.onemember = null;
this.literal = literal;
this.ismixin = ismixin;
this.isstatic = true;
this.previous = null;
this.protection = Prot(PROTundefined);
this.numinstances = 0;
// Compute in advance for Ddoc's use
// Bugzilla 11153: ident could be NULL if parsing fails.
if (members && ident)
{
Dsymbol s;
if (Dsymbol.oneMembers(members, &s, ident) && s)
{
onemember = s;
s.parent = this;
}
}
}
Dsymbol syntaxCopy(Dsymbol)
{
//printf("TemplateDeclaration::syntaxCopy()\n");
TemplateParameters* p = null;
if (parameters)
{
p = new TemplateParameters();
p.setDim(parameters.dim);
for (size_t i = 0; i < p.dim; i++)
(*p)[i] = (*parameters)[i].syntaxCopy();
}
return new TemplateDeclaration(loc, ident, p, constraint ? constraint.syntaxCopy() : null, Dsymbol.arraySyntaxCopy(members), ismixin, literal);
}
void semantic(Scope* sc)
{
static if (LOG)
{
printf("TemplateDeclaration::semantic(this = %p, id = '%s')\n", this, ident.toChars());
printf("sc->stc = %llx\n", sc.stc);
printf("sc->module = %s\n", sc._module.toChars());
}
if (semanticRun != PASSinit)
return; // semantic() already run
semanticRun = PASSsemantic;
// Remember templates defined in module object that we need to know about
if (sc._module && sc._module.ident == Id.object)
{
if (ident == Id.RTInfo)
Type.rtinfo = this;
}
/* Remember Scope for later instantiations, but make
* a copy since attributes can change.
*/
if (!this._scope)
{
this._scope = sc.copy();
this._scope.setNoFree();
}
// Set up scope for parameters
auto paramsym = new ScopeDsymbol();
paramsym.parent = sc.parent;
Scope* paramscope = sc.push(paramsym);
paramscope.stc = 0;
if (!parent)
parent = sc.parent;
isstatic = toParent().isModule() || (_scope.stc & STCstatic);
protection = sc.protection;
if (global.params.doDocComments)
{
origParameters = new TemplateParameters();
origParameters.setDim(parameters.dim);
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
(*origParameters)[i] = tp.syntaxCopy();
}
}
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
if (!tp.declareParameter(paramscope))
{
error(tp.loc, "parameter '%s' multiply defined", tp.ident.toChars());
errors = true;
}
if (!tp.semantic(paramscope, parameters))
{
errors = true;
}
if (i + 1 != parameters.dim && tp.isTemplateTupleParameter())
{
error("template tuple parameter must be last one");
errors = true;
}
}
/* Calculate TemplateParameter::dependent
*/
TemplateParameters tparams;
tparams.setDim(1);
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
tparams[0] = tp;
for (size_t j = 0; j < parameters.dim; j++)
{
// Skip cases like: X(T : T)
if (i == j)
continue;
if (TemplateTypeParameter ttp = (*parameters)[j].isTemplateTypeParameter())
{
if (reliesOnTident(ttp.specType, &tparams))
tp.dependent = true;
}
else if (TemplateAliasParameter tap = (*parameters)[j].isTemplateAliasParameter())
{
if (reliesOnTident(tap.specType, &tparams) || reliesOnTident(isType(tap.specAlias), &tparams))
{
tp.dependent = true;
}
}
}
}
paramscope.pop();
// Compute again
onemember = null;
if (members)
{
Dsymbol s;
if (Dsymbol.oneMembers(members, &s, ident) && s)
{
onemember = s;
s.parent = this;
}
}
/* BUG: should check:
* o no virtual functions or non-static data members of classes
*/
}
/**********************************
* Overload existing TemplateDeclaration 'this' with the new one 's'.
* Return true if successful; i.e. no conflict.
*/
bool overloadInsert(Dsymbol s)
{
static if (LOG)
{
printf("TemplateDeclaration::overloadInsert('%s')\n", s.toChars());
}
FuncDeclaration fd = s.isFuncDeclaration();
if (fd)
{
if (funcroot)
return funcroot.overloadInsert(fd);
funcroot = fd;
return funcroot.overloadInsert(this);
}
TemplateDeclaration td = s.isTemplateDeclaration();
if (!td)
return false;
TemplateDeclaration pthis = this;
TemplateDeclaration* ptd;
for (ptd = &pthis; *ptd; ptd = &(*ptd).overnext)
{
}
td.overroot = this;
*ptd = td;
static if (LOG)
{
printf("\ttrue: no conflict\n");
}
return true;
}
bool hasStaticCtorOrDtor()
{
return false; // don't scan uninstantiated templates
}
const(char)* kind()
{
return (onemember && onemember.isAggregateDeclaration()) ? onemember.kind() : cast(char*)"template";
}
char* toChars()
{
if (literal)
return Dsymbol.toChars();
OutBuffer buf;
HdrGenState hgs;
buf.writestring(ident.toChars());
buf.writeByte('(');
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
if (i)
buf.writestring(", ");
.toCBuffer(tp, &buf, &hgs);
}
buf.writeByte(')');
if (onemember)
{
FuncDeclaration fd = onemember.isFuncDeclaration();
if (fd && fd.type)
{
TypeFunction tf = cast(TypeFunction)fd.type;
buf.writestring(parametersTypeToChars(tf.parameters, tf.varargs));
}
}
if (constraint)
{
buf.writestring(" if (");
.toCBuffer(constraint, &buf, &hgs);
buf.writeByte(')');
}
return buf.extractString();
}
Prot prot()
{
return protection;
}
/****************************
* Check to see if constraint is satisfied.
*/
bool evaluateConstraint(TemplateInstance ti, Scope* sc, Scope* paramscope, Objects* dedargs, FuncDeclaration fd)
{
/* Detect recursive attempts to instantiate this template declaration,
* Bugzilla 4072
* void foo(T)(T x) if (is(typeof(foo(x)))) { }
* static assert(!is(typeof(foo(7))));
* Recursive attempts are regarded as a constraint failure.
*/
/* There's a chicken-and-egg problem here. We don't know yet if this template
* instantiation will be a local one (enclosing is set), and we won't know until
* after selecting the correct template. Thus, function we're nesting inside
* is not on the sc scope chain, and this can cause errors in FuncDeclaration::getLevel().
* Workaround the problem by setting a flag to relax the checking on frame errors.
*/
for (TemplatePrevious* p = previous; p; p = p.prev)
{
if (arrayObjectMatch(p.dedargs, dedargs))
{
//printf("recursive, no match p->sc=%p %p %s\n", p->sc, this, this->toChars());
/* It must be a subscope of p->sc, other scope chains are not recursive
* instantiations.
*/
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (scx == p.sc)
return false;
}
}
/* BUG: should also check for ref param differences
*/
}
TemplatePrevious pr;
pr.prev = previous;
pr.sc = paramscope;
pr.dedargs = dedargs;
previous = ≺ // add this to threaded list
uint nerrors = global.errors;
Scope* scx = paramscope.push(ti);
scx.parent = ti;
scx.tinst = null;
scx.minst = null;
assert(!ti.symtab);
if (fd)
{
/* Declare all the function parameters as variables and add them to the scope
* Making parameters is similar to FuncDeclaration::semantic3
*/
TypeFunction tf = cast(TypeFunction)fd.type;
assert(tf.ty == Tfunction);
scx.parent = fd;
Parameters* fparameters = tf.parameters;
int fvarargs = tf.varargs;
size_t nfparams = Parameter.dim(fparameters);
for (size_t i = 0; i < nfparams; i++)
{
Parameter fparam = Parameter.getNth(fparameters, i);
fparam.storageClass &= (STCin | STCout | STCref | STClazy | STCfinal | STC_TYPECTOR | STCnodtor);
fparam.storageClass |= STCparameter;
if (fvarargs == 2 && i + 1 == nfparams)
fparam.storageClass |= STCvariadic;
}
for (size_t i = 0; i < fparameters.dim; i++)
{
Parameter fparam = (*fparameters)[i];
if (!fparam.ident)
continue;
// don't add it, if it has no name
auto v = new VarDeclaration(loc, fparam.type, fparam.ident, null);
v.storage_class = fparam.storageClass;
v.semantic(scx);
if (!ti.symtab)
ti.symtab = new DsymbolTable();
if (!scx.insert(v))
error("parameter %s.%s is already defined", toChars(), v.toChars());
else
v.parent = fd;
}
if (isstatic)
fd.storage_class |= STCstatic;
fd.vthis = fd.declareThis(scx, fd.isThis());
}
Expression e = constraint.syntaxCopy();
scx = scx.startCTFE();
scx.flags |= SCOPEcondition | SCOPEconstraint;
assert(ti.inst is null);
ti.inst = ti; // temporary instantiation to enable genIdent()
//printf("\tscx->parent = %s %s\n", scx->parent->kind(), scx->parent->toPrettyChars());
e = e.semantic(scx);
e = resolveProperties(scx, e);
ti.inst = null;
ti.symtab = null;
scx = scx.endCTFE();
scx = scx.pop();
previous = pr.prev; // unlink from threaded list
if (nerrors != global.errors) // if any errors from evaluating the constraint, no match
return false;
if (e.op == TOKerror)
return false;
e = e.ctfeInterpret();
if (e.isBool(true))
{
}
else if (e.isBool(false))
return false;
else
{
e.error("constraint %s is not constant or does not evaluate to a bool", e.toChars());
}
return true;
}
/***************************************
* Given that ti is an instance of this TemplateDeclaration,
* deduce the types of the parameters to this, and store
* those deduced types in dedtypes[].
* Input:
* flag 1: don't do semantic() because of dummy types
* 2: don't change types in matchArg()
* Output:
* dedtypes deduced arguments
* Return match level.
*/
MATCH matchWithInstance(Scope* sc, TemplateInstance ti, Objects* dedtypes, Expressions* fargs, int flag)
{
enum LOGM = 0;
static if (LOGM)
{
printf("\n+TemplateDeclaration::matchWithInstance(this = %s, ti = %s, flag = %d)\n", toChars(), ti.toChars(), flag);
}
version (none)
{
printf("dedtypes->dim = %d, parameters->dim = %d\n", dedtypes.dim, parameters.dim);
if (ti.tiargs.dim)
printf("ti->tiargs->dim = %d, [0] = %p\n", ti.tiargs.dim, (*ti.tiargs)[0]);
}
MATCH m;
size_t dedtypes_dim = dedtypes.dim;
dedtypes.zero();
if (errors)
return MATCHnomatch;
size_t parameters_dim = parameters.dim;
int variadic = isVariadic() !is null;
// If more arguments than parameters, no match
if (ti.tiargs.dim > parameters_dim && !variadic)
{
static if (LOGM)
{
printf(" no match: more arguments than parameters\n");
}
return MATCHnomatch;
}
assert(dedtypes_dim == parameters_dim);
assert(dedtypes_dim >= ti.tiargs.dim || variadic);
assert(_scope);
// Set up scope for template parameters
auto paramsym = new ScopeDsymbol();
paramsym.parent = _scope.parent;
Scope* paramscope = _scope.push(paramsym);
paramscope.tinst = ti;
paramscope.minst = sc.minst;
paramscope.callsc = sc;
paramscope.stc = 0;
// Attempt type deduction
m = MATCHexact;
for (size_t i = 0; i < dedtypes_dim; i++)
{
MATCH m2;
TemplateParameter tp = (*parameters)[i];
Declaration sparam;
//printf("\targument [%d]\n", i);
static if (LOGM)
{
//printf("\targument [%d] is %s\n", i, oarg ? oarg->toChars() : "null");
TemplateTypeParameter ttp = tp.isTemplateTypeParameter();
if (ttp)
printf("\tparameter[%d] is %s : %s\n", i, tp.ident.toChars(), ttp.specType ? ttp.specType.toChars() : "");
}
m2 = tp.matchArg(ti.loc, paramscope, ti.tiargs, i, parameters, dedtypes, &sparam);
//printf("\tm2 = %d\n", m2);
if (m2 == MATCHnomatch)
{
version (none)
{
printf("\tmatchArg() for parameter %i failed\n", i);
}
goto Lnomatch;
}
if (m2 < m)
m = m2;
if (!flag)
sparam.semantic(paramscope);
if (!paramscope.insert(sparam)) // TODO: This check can make more early
goto Lnomatch;
// in TemplateDeclaration::semantic, and
// then we don't need to make sparam if flags == 0
}
if (!flag)
{
/* Any parameter left without a type gets the type of
* its corresponding arg
*/
for (size_t i = 0; i < dedtypes_dim; i++)
{
if (!(*dedtypes)[i])
{
assert(i < ti.tiargs.dim);
(*dedtypes)[i] = cast(Type)(*ti.tiargs)[i];
}
}
}
if (m > MATCHnomatch && constraint && !flag)
{
if (ti.hasNestedArgs(ti.tiargs, this.isstatic)) // TODO: should gag error
ti.parent = ti.enclosing;
else
ti.parent = this.parent;
// Similar to doHeaderInstantiation
FuncDeclaration fd = onemember ? onemember.isFuncDeclaration() : null;
if (fd)
{
assert(fd.type.ty == Tfunction);
TypeFunction tf = cast(TypeFunction)fd.type.syntaxCopy();
fd = new FuncDeclaration(fd.loc, fd.endloc, fd.ident, fd.storage_class, tf);
fd.parent = ti;
fd.inferRetType = true;
// Shouldn't run semantic on default arguments and return type.
for (size_t i = 0; i < tf.parameters.dim; i++)
(*tf.parameters)[i].defaultArg = null;
tf.next = null;
// Resolve parameter types and 'auto ref's.
tf.fargs = fargs;
uint olderrors = global.startGagging();
fd.type = tf.semantic(loc, paramscope);
if (global.endGagging(olderrors))
{
assert(fd.type.ty != Tfunction);
goto Lnomatch;
}
assert(fd.type.ty == Tfunction);
fd.originalType = fd.type; // for mangling
}
// TODO: dedtypes => ti->tiargs ?
if (!evaluateConstraint(ti, sc, paramscope, dedtypes, fd))
goto Lnomatch;
}
static if (LOGM)
{
// Print out the results
printf("--------------------------\n");
printf("template %s\n", toChars());
printf("instance %s\n", ti.toChars());
if (m > MATCHnomatch)
{
for (size_t i = 0; i < dedtypes_dim; i++)
{
TemplateParameter tp = (*parameters)[i];
RootObject oarg;
printf(" [%d]", i);
if (i < ti.tiargs.dim)
oarg = (*ti.tiargs)[i];
else
oarg = null;
tp.print(oarg, (*dedtypes)[i]);
}
}
else
goto Lnomatch;
}
static if (LOGM)
{
printf(" match = %d\n", m);
}
goto Lret;
Lnomatch:
static if (LOGM)
{
printf(" no match\n");
}
m = MATCHnomatch;
Lret:
paramscope.pop();
static if (LOGM)
{
printf("-TemplateDeclaration::matchWithInstance(this = %p, ti = %p) = %d\n", this, ti, m);
}
return m;
}
/********************************************
* Determine partial specialization order of 'this' vs td2.
* Returns:
* match this is at least as specialized as td2
* 0 td2 is more specialized than this
*/
MATCH leastAsSpecialized(Scope* sc, TemplateDeclaration td2, Expressions* fargs)
{
enum LOG_LEASTAS = 0;
static if (LOG_LEASTAS)
{
printf("%s.leastAsSpecialized(%s)\n", toChars(), td2.toChars());
}
/* This works by taking the template parameters to this template
* declaration and feeding them to td2 as if it were a template
* instance.
* If it works, then this template is at least as specialized
* as td2.
*/
scope TemplateInstance ti = new TemplateInstance(Loc(), ident); // create dummy template instance
// Set type arguments to dummy template instance to be types
// generated from the parameters to this template declaration
ti.tiargs = new Objects();
ti.tiargs.reserve(parameters.dim);
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
if (tp.dependent)
break;
RootObject p = cast(RootObject)tp.dummyArg();
if (!p)
break;
ti.tiargs.push(p);
}
// Temporary Array to hold deduced types
Objects dedtypes;
dedtypes.setDim(td2.parameters.dim);
// Attempt a type deduction
MATCH m = td2.matchWithInstance(sc, ti, &dedtypes, fargs, 1);
if (m > MATCHnomatch)
{
/* A non-variadic template is more specialized than a
* variadic one.
*/
TemplateTupleParameter tp = isVariadic();
if (tp && !tp.dependent && !td2.isVariadic())
goto L1;
static if (LOG_LEASTAS)
{
printf(" matches %d, so is least as specialized\n", m);
}
return m;
}
L1:
static if (LOG_LEASTAS)
{
printf(" doesn't match, so is not as specialized\n");
}
return MATCHnomatch;
}
/*************************************************
* Match function arguments against a specific template function.
* Input:
* ti
* sc instantiation scope
* fd
* tthis 'this' argument if !NULL
* fargs arguments to function
* Output:
* fd Partially instantiated function declaration
* ti->tdtypes Expression/Type deduced template arguments
* Returns:
* match level
* bit 0-3 Match template parameters by inferred template arguments
* bit 4-7 Match template parameters by initial template arguments
*/
MATCH deduceFunctionTemplateMatch(TemplateInstance ti, Scope* sc, ref FuncDeclaration fd, Type tthis, Expressions* fargs)
{
size_t nfparams;
size_t nfargs;
size_t ntargs; // array size of tiargs
size_t fptupindex = IDX_NOTFOUND;
MATCH match = MATCHexact;
MATCH matchTiargs = MATCHexact;
Parameters* fparameters; // function parameter list
int fvarargs; // function varargs
uint wildmatch = 0;
size_t inferStart = 0;
Loc instLoc = ti.loc;
Objects* tiargs = ti.tiargs;
auto dedargs = new Objects();
Objects* dedtypes = &ti.tdtypes; // for T:T*, the dedargs is the T*, dedtypes is the T
version (none)
{
printf("\nTemplateDeclaration::deduceFunctionTemplateMatch() %s\n", toChars());
for (size_t i = 0; i < (fargs ? fargs.dim : 0); i++)
{
Expression e = (*fargs)[i];
printf("\tfarg[%d] is %s, type is %s\n", i, e.toChars(), e.type.toChars());
}
printf("fd = %s\n", fd.toChars());
printf("fd->type = %s\n", fd.type.toChars());
if (tthis)
printf("tthis = %s\n", tthis.toChars());
}
assert(_scope);
dedargs.setDim(parameters.dim);
dedargs.zero();
dedtypes.setDim(parameters.dim);
dedtypes.zero();
if (errors || fd.errors)
return MATCHnomatch;
// Set up scope for parameters
auto paramsym = new ScopeDsymbol();
paramsym.parent = _scope.parent; // should use hasnestedArgs and enclosing?
Scope* paramscope = _scope.push(paramsym);
paramscope.tinst = ti;
paramscope.minst = sc.minst;
paramscope.callsc = sc;
paramscope.stc = 0;
TemplateTupleParameter tp = isVariadic();
Tuple declaredTuple = null;
version (none)
{
for (size_t i = 0; i < dedargs.dim; i++)
{
printf("\tdedarg[%d] = ", i);
RootObject oarg = (*dedargs)[i];
if (oarg)
printf("%s", oarg.toChars());
printf("\n");
}
}
ntargs = 0;
if (tiargs)
{
// Set initial template arguments
ntargs = tiargs.dim;
size_t n = parameters.dim;
if (tp)
n--;
if (ntargs > n)
{
if (!tp)
goto Lnomatch;
/* The extra initial template arguments
* now form the tuple argument.
*/
auto t = new Tuple();
assert(parameters.dim);
(*dedargs)[parameters.dim - 1] = t;
t.objects.setDim(ntargs - n);
for (size_t i = 0; i < t.objects.dim; i++)
{
t.objects[i] = (*tiargs)[n + i];
}
declareParameter(paramscope, tp, t);
declaredTuple = t;
}
else
n = ntargs;
memcpy(dedargs.tdata(), tiargs.tdata(), n * (*dedargs.tdata()).sizeof);
for (size_t i = 0; i < n; i++)
{
assert(i < parameters.dim);
Declaration sparam = null;
MATCH m = (*parameters)[i].matchArg(instLoc, paramscope, dedargs, i, parameters, dedtypes, &sparam);
//printf("\tdeduceType m = %d\n", m);
if (m <= MATCHnomatch)
goto Lnomatch;
if (m < matchTiargs)
matchTiargs = m;
sparam.semantic(paramscope);
if (!paramscope.insert(sparam))
goto Lnomatch;
}
if (n < parameters.dim && !declaredTuple)
{
inferStart = n;
}
else
inferStart = parameters.dim;
//printf("tiargs matchTiargs = %d\n", matchTiargs);
}
version (none)
{
for (size_t i = 0; i < dedargs.dim; i++)
{
printf("\tdedarg[%d] = ", i);
RootObject oarg = (*dedargs)[i];
if (oarg)
printf("%s", oarg.toChars());
printf("\n");
}
}
fparameters = fd.getParameters(&fvarargs);
nfparams = Parameter.dim(fparameters); // number of function parameters
nfargs = fargs ? fargs.dim : 0; // number of function arguments
/* Check for match of function arguments with variadic template
* parameter, such as:
*
* void foo(T, A...)(T t, A a);
* void main() { foo(1,2,3); }
*/
if (tp) // if variadic
{
// TemplateTupleParameter always makes most lesser matching.
matchTiargs = MATCHconvert;
if (nfparams == 0 && nfargs != 0) // if no function parameters
{
if (!declaredTuple)
{
auto t = new Tuple();
//printf("t = %p\n", t);
(*dedargs)[parameters.dim - 1] = t;
declareParameter(paramscope, tp, t);
declaredTuple = t;
}
}
else
{
/* Figure out which of the function parameters matches
* the tuple template parameter. Do this by matching
* type identifiers.
* Set the index of this function parameter to fptupindex.
*/
for (fptupindex = 0; fptupindex < nfparams; fptupindex++)
{
Parameter fparam = (*fparameters)[fptupindex];
if (fparam.type.ty != Tident)
continue;
TypeIdentifier tid = cast(TypeIdentifier)fparam.type;
if (!tp.ident.equals(tid.ident) || tid.idents.dim)
continue;
if (fvarargs) // variadic function doesn't
goto Lnomatch;
// go with variadic template
goto L1;
}
fptupindex = IDX_NOTFOUND;
L1:
}
}
if (toParent().isModule() || (_scope.stc & STCstatic))
tthis = null;
if (tthis)
{
bool hasttp = false;
// Match 'tthis' to any TemplateThisParameter's
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateThisParameter ttp = (*parameters)[i].isTemplateThisParameter();
if (ttp)
{
hasttp = true;
Type t = new TypeIdentifier(Loc(), ttp.ident);
MATCH m = deduceType(tthis, paramscope, t, parameters, dedtypes);
if (m <= MATCHnomatch)
goto Lnomatch;
if (m < match)
match = m; // pick worst match
}
}
// Match attributes of tthis against attributes of fd
if (fd.type && !fd.isCtorDeclaration())
{
StorageClass stc = _scope.stc | fd.storage_class2;
// Propagate parent storage class (see bug 5504)
Dsymbol p = parent;
while (p.isTemplateDeclaration() || p.isTemplateInstance())
p = p.parent;
AggregateDeclaration ad = p.isAggregateDeclaration();
if (ad)
stc |= ad.storage_class;
ubyte mod = fd.type.mod;
if (stc & STCimmutable)
mod = MODimmutable;
else
{
if (stc & (STCshared | STCsynchronized))
mod |= MODshared;
if (stc & STCconst)
mod |= MODconst;
if (stc & STCwild)
mod |= MODwild;
}
ubyte thismod = tthis.mod;
if (hasttp)
mod = MODmerge(thismod, mod);
MATCH m = MODmethodConv(thismod, mod);
if (m <= MATCHnomatch)
goto Lnomatch;
if (m < match)
match = m;
}
}
// Loop through the function parameters
{
//printf("%s\n\tnfargs = %d, nfparams = %d, tuple_dim = %d\n", toChars(), nfargs, nfparams, declaredTuple ? declaredTuple->objects.dim : 0);
//printf("\ttp = %p, fptupindex = %d, found = %d, declaredTuple = %s\n", tp, fptupindex, fptupindex != IDX_NOTFOUND, declaredTuple ? declaredTuple->toChars() : NULL);
size_t argi = 0;
size_t nfargs2 = nfargs; // nfargs + supplied defaultArgs
for (size_t parami = 0; parami < nfparams; parami++)
{
Parameter fparam = Parameter.getNth(fparameters, parami);
// Apply function parameter storage classes to parameter types
Type prmtype = fparam.type.addStorageClass(fparam.storageClass);
Expression farg;
/* See function parameters which wound up
* as part of a template tuple parameter.
*/
if (fptupindex != IDX_NOTFOUND && parami == fptupindex)
{
assert(prmtype.ty == Tident);
TypeIdentifier tid = cast(TypeIdentifier)prmtype;
if (!declaredTuple)
{
/* The types of the function arguments
* now form the tuple argument.
*/
declaredTuple = new Tuple();
(*dedargs)[parameters.dim - 1] = declaredTuple;
/* Count function parameters following a tuple parameter.
* void foo(U, T...)(int y, T, U, int) {} // rem == 2 (U, int)
*/
size_t rem = 0;
for (size_t j = parami + 1; j < nfparams; j++)
{
Parameter p = Parameter.getNth(fparameters, j);
if (!reliesOnTident(p.type, parameters, inferStart))
{
Type pt = p.type.syntaxCopy().semantic(fd.loc, paramscope);
rem += pt.ty == Ttuple ? (cast(TypeTuple)pt).arguments.dim : 1;
}
else
{
++rem;
}
}
if (nfargs2 - argi < rem)
goto Lnomatch;
declaredTuple.objects.setDim(nfargs2 - argi - rem);
for (size_t i = 0; i < declaredTuple.objects.dim; i++)
{
farg = (*fargs)[argi + i];
// Check invalid arguments to detect errors early.
if (farg.op == TOKerror || farg.type.ty == Terror)
goto Lnomatch;
if (!(fparam.storageClass & STClazy) && farg.type.ty == Tvoid)
goto Lnomatch;
Type tt;
MATCH m;
if (ubyte wm = deduceWildHelper(farg.type, &tt, tid))
{
wildmatch |= wm;
m = MATCHconst;
}
else
{
m = deduceTypeHelper(farg.type, &tt, tid);
}
if (m <= MATCHnomatch)
goto Lnomatch;
if (m < match)
match = m;
/* Remove top const for dynamic array types and pointer types
*/
if ((tt.ty == Tarray || tt.ty == Tpointer) && !tt.isMutable() && (!(fparam.storageClass & STCref) || (fparam.storageClass & STCauto) && !farg.isLvalue()))
{
tt = tt.mutableOf();
}
declaredTuple.objects[i] = tt;
}
declareParameter(paramscope, tp, declaredTuple);
}
else
{
// Bugzilla 6810: If declared tuple is not a type tuple,
// it cannot be function parameter types.
for (size_t i = 0; i < declaredTuple.objects.dim; i++)
{
if (!isType(declaredTuple.objects[i]))
goto Lnomatch;
}
}
assert(declaredTuple);
argi += declaredTuple.objects.dim;
continue;
}
// If parameter type doesn't depend on inferred template parameters,
// semantic it to get actual type.
if (!reliesOnTident(prmtype, parameters, inferStart))
{
// should copy prmtype to avoid affecting semantic result
prmtype = prmtype.syntaxCopy().semantic(fd.loc, paramscope);
if (prmtype.ty == Ttuple)
{
TypeTuple tt = cast(TypeTuple)prmtype;
size_t tt_dim = tt.arguments.dim;
for (size_t j = 0; j < tt_dim; j++, ++argi)
{
Parameter p = (*tt.arguments)[j];
if (j == tt_dim - 1 && fvarargs == 2 && parami + 1 == nfparams && argi < nfargs)
{
prmtype = p.type;
goto Lvarargs;
}
if (argi >= nfargs)
{
if (p.defaultArg)
continue;
goto Lnomatch;
}
farg = (*fargs)[argi];
if (!farg.implicitConvTo(p.type))
goto Lnomatch;
}
continue;
}
}
if (argi >= nfargs) // if not enough arguments
{
if (!fparam.defaultArg)
goto Lvarargs;
/* Bugzilla 2803: Before the starting of type deduction from the function
* default arguments, set the already deduced parameters into paramscope.
* It's necessary to avoid breaking existing acceptable code. Cases:
*
* 1. Already deduced template parameters can appear in fparam->defaultArg:
* auto foo(A, B)(A a, B b = A.stringof);
* foo(1);
* // at fparam == 'B b = A.string', A is equivalent with the deduced type 'int'
*
* 2. If prmtype depends on default-specified template parameter, the
* default type should be preferred.
* auto foo(N = size_t, R)(R r, N start = 0)
* foo([1,2,3]);
* // at fparam `N start = 0`, N should be 'size_t' before
* // the deduction result from fparam->defaultArg.
*/
if (argi == nfargs)
{
for (size_t i = 0; i < dedtypes.dim; i++)
{
Type at = isType((*dedtypes)[i]);
if (at && at.ty == Tnone)
{
TypeDeduced xt = cast(TypeDeduced)at;
(*dedtypes)[i] = xt.tded; // 'unbox'
}
}
for (size_t i = ntargs; i < dedargs.dim; i++)
{
TemplateParameter tparam = (*parameters)[i];
RootObject oarg = (*dedargs)[i];
RootObject oded = (*dedtypes)[i];
if (!oarg)
{
if (oded)
{
if (tparam.specialization() || !tparam.isTemplateTypeParameter())
{
/* The specialization can work as long as afterwards
* the oded == oarg
*/
(*dedargs)[i] = oded;
MATCH m2 = tparam.matchArg(loc, paramscope, dedargs, i, parameters, dedtypes, null);
//printf("m2 = %d\n", m2);
if (m2 <= MATCHnomatch)
goto Lnomatch;
if (m2 < matchTiargs)
matchTiargs = m2; // pick worst match
if (!(*dedtypes)[i].equals(oded))
error("specialization not allowed for deduced parameter %s", tparam.ident.toChars());
}
else
{
if (MATCHconvert < matchTiargs)
matchTiargs = MATCHconvert;
}
(*dedargs)[i] = declareParameter(paramscope, tparam, oded);
}
else
{
oded = tparam.defaultArg(loc, paramscope);
if (oded)
(*dedargs)[i] = declareParameter(paramscope, tparam, oded);
}
}
}
}
nfargs2 = argi + 1;
/* If prmtype does not depend on any template parameters:
*
* auto foo(T)(T v, double x = 0);
* foo("str");
* // at fparam == 'double x = 0'
*
* or, if all template parameters in the prmtype are already deduced:
*
* auto foo(R)(R range, ElementType!R sum = 0);
* foo([1,2,3]);
* // at fparam == 'ElementType!R sum = 0'
*
* Deducing prmtype from fparam->defaultArg is not necessary.
*/
if (prmtype.deco || prmtype.syntaxCopy().trySemantic(loc, paramscope))
{
++argi;
continue;
}
// Deduce prmtype from the defaultArg.
farg = fparam.defaultArg.syntaxCopy();
farg = farg.semantic(paramscope);
farg = resolveProperties(paramscope, farg);
}
else
{
farg = (*fargs)[argi];
}
{
// Check invalid arguments to detect errors early.
if (farg.op == TOKerror || farg.type.ty == Terror)
goto Lnomatch;
Lretry:
version (none)
{
printf("\tfarg->type = %s\n", farg.type.toChars());
printf("\tfparam->type = %s\n", prmtype.toChars());
}
Type argtype = farg.type;
if (!(fparam.storageClass & STClazy) && argtype.ty == Tvoid && farg.op != TOKfunction)
goto Lnomatch;
// Bugzilla 12876: optimize arugument to allow CT-known length matching
farg = farg.optimize(WANTvalue, (fparam.storageClass & (STCref | STCout)) != 0);
//printf("farg = %s %s\n", farg->type->toChars(), farg->toChars());
RootObject oarg = farg;
if ((fparam.storageClass & STCref) && (!(fparam.storageClass & STCauto) || farg.isLvalue()))
{
/* Allow expressions that have CT-known boundaries and type [] to match with [dim]
*/
Type taai;
if (argtype.ty == Tarray && (prmtype.ty == Tsarray || prmtype.ty == Taarray && (taai = (cast(TypeAArray)prmtype).index).ty == Tident && (cast(TypeIdentifier)taai).idents.dim == 0))
{
if (farg.op == TOKstring)
{
StringExp se = cast(StringExp)farg;
argtype = se.type.nextOf().sarrayOf(se.len);
}
else if (farg.op == TOKarrayliteral)
{
ArrayLiteralExp ae = cast(ArrayLiteralExp)farg;
argtype = ae.type.nextOf().sarrayOf(ae.elements.dim);
}
else if (farg.op == TOKslice)
{
SliceExp se = cast(SliceExp)farg;
if (Type tsa = toStaticArrayType(se))
argtype = tsa;
}
}
oarg = argtype;
}
else if ((fparam.storageClass & STCout) == 0 && (argtype.ty == Tarray || argtype.ty == Tpointer) && templateParameterLookup(prmtype, parameters) != IDX_NOTFOUND && (cast(TypeIdentifier)prmtype).idents.dim == 0)
{
/* The farg passing to the prmtype always make a copy. Therefore,
* we can shrink the set of the deduced type arguments for prmtype
* by adjusting top-qualifier of the argtype.
*
* prmtype argtype ta
* T <- const(E)[] const(E)[]
* T <- const(E[]) const(E)[]
* qualifier(T) <- const(E)[] const(E[])
* qualifier(T) <- const(E[]) const(E[])
*/
Type ta = argtype.castMod(prmtype.mod ? argtype.nextOf().mod : 0);
if (ta != argtype)
{
Expression ea = farg.copy();
ea.type = ta;
oarg = ea;
}
}
if (fvarargs == 2 && parami + 1 == nfparams && argi + 1 < nfargs)
goto Lvarargs;
uint wm = 0;
MATCH m = deduceType(oarg, paramscope, prmtype, parameters, dedtypes, &wm, inferStart);
//printf("\tL%d deduceType m = %d, wm = x%x, wildmatch = x%x\n", __LINE__, m, wm, wildmatch);
wildmatch |= wm;
/* If no match, see if the argument can be matched by using
* implicit conversions.
*/
if (m == MATCHnomatch && prmtype.deco)
m = farg.implicitConvTo(prmtype);
if (m == MATCHnomatch)
{
AggregateDeclaration ad = isAggregate(farg.type);
if (ad && ad.aliasthis)
{
/* If a semantic error occurs while doing alias this,
* eg purity(bug 7295), just regard it as not a match.
*/
uint olderrors = global.startGagging();
Expression e = resolveAliasThis(sc, farg);
if (!global.endGagging(olderrors))
{
farg = e;
goto Lretry;
}
}
}
if (m > MATCHnomatch && (fparam.storageClass & (STCref | STCauto)) == STCref)
{
if (!farg.isLvalue())
{
if ((farg.op == TOKstring || farg.op == TOKslice) && (prmtype.ty == Tsarray || prmtype.ty == Taarray))
{
// Allow conversion from T[lwr .. upr] to ref T[upr-lwr]
}
else
goto Lnomatch;
}
}
if (m > MATCHnomatch && (fparam.storageClass & STCout))
{
if (!farg.isLvalue())
goto Lnomatch;
if (!farg.type.isMutable()) // Bugzilla 11916
goto Lnomatch;
}
if (m == MATCHnomatch && (fparam.storageClass & STClazy) && prmtype.ty == Tvoid && farg.type.ty != Tvoid)
m = MATCHconvert;
if (m != MATCHnomatch)
{
if (m < match)
match = m; // pick worst match
argi++;
continue;
}
}
Lvarargs:
/* The following code for variadic arguments closely
* matches TypeFunction::callMatch()
*/
if (!(fvarargs == 2 && parami + 1 == nfparams))
goto Lnomatch;
/* Check for match with function parameter T...
*/
Type tb = prmtype.toBasetype();
switch (tb.ty)
{
// 6764 fix - TypeAArray may be TypeSArray have not yet run semantic().
case Tsarray:
case Taarray:
{
// Perhaps we can do better with this, see TypeFunction::callMatch()
if (tb.ty == Tsarray)
{
TypeSArray tsa = cast(TypeSArray)tb;
dinteger_t sz = tsa.dim.toInteger();
if (sz != nfargs - argi)
goto Lnomatch;
}
else if (tb.ty == Taarray)
{
TypeAArray taa = cast(TypeAArray)tb;
Expression dim = new IntegerExp(instLoc, nfargs - argi, Type.tsize_t);
size_t i = templateParameterLookup(taa.index, parameters);
if (i == IDX_NOTFOUND)
{
Expression e;
Type t;
Dsymbol s;
taa.index.resolve(instLoc, sc, &e, &t, &s);
if (!e)
goto Lnomatch;
e = e.ctfeInterpret();
e = e.implicitCastTo(sc, Type.tsize_t);
e = e.optimize(WANTvalue);
if (!dim.equals(e))
goto Lnomatch;
}
else
{
// This code matches code in TypeInstance::deduceType()
TemplateParameter tprm = (*parameters)[i];
TemplateValueParameter tvp = tprm.isTemplateValueParameter();
if (!tvp)
goto Lnomatch;
Expression e = cast(Expression)(*dedtypes)[i];
if (e)
{
if (!dim.equals(e))
goto Lnomatch;
}
else
{
Type vt = tvp.valType.semantic(Loc(), sc);
MATCH m = cast(MATCH)dim.implicitConvTo(vt);
if (m <= MATCHnomatch)
goto Lnomatch;
(*dedtypes)[i] = dim;
}
}
}
/* fall through */
}
case Tarray:
{
TypeArray ta = cast(TypeArray)tb;
Type tret = fparam.isLazyArray();
for (; argi < nfargs; argi++)
{
Expression arg = (*fargs)[argi];
assert(arg);
MATCH m;
/* If lazy array of delegates,
* convert arg(s) to delegate(s)
*/
if (tret)
{
if (ta.next.equals(arg.type))
{
m = MATCHexact;
}
else
{
m = arg.implicitConvTo(tret);
if (m == MATCHnomatch)
{
if (tret.toBasetype().ty == Tvoid)
m = MATCHconvert;
}
}
}
else
{
uint wm = 0;
m = deduceType(arg, paramscope, ta.next, parameters, dedtypes, &wm, inferStart);
wildmatch |= wm;
}
if (m == MATCHnomatch)
goto Lnomatch;
if (m < match)
match = m;
}
goto Lmatch;
}
case Tclass:
case Tident:
goto Lmatch;
default:
goto Lnomatch;
}
++argi;
}
//printf("-> argi = %d, nfargs = %d, nfargs2 = %d\n", argi, nfargs, nfargs2);
if (argi != nfargs2 && !fvarargs)
goto Lnomatch;
}
Lmatch:
for (size_t i = 0; i < dedtypes.dim; i++)
{
Type at = isType((*dedtypes)[i]);
if (at)
{
if (at.ty == Tnone)
{
TypeDeduced xt = cast(TypeDeduced)at;
at = xt.tded; // 'unbox'
}
(*dedtypes)[i] = at.merge2();
}
}
for (size_t i = ntargs; i < dedargs.dim; i++)
{
TemplateParameter tparam = (*parameters)[i];
//printf("tparam[%d] = %s\n", i, tparam->ident->toChars());
/* For T:T*, the dedargs is the T*, dedtypes is the T
* But for function templates, we really need them to match
*/
RootObject oarg = (*dedargs)[i];
RootObject oded = (*dedtypes)[i];
//printf("1dedargs[%d] = %p, dedtypes[%d] = %p\n", i, oarg, i, oded);
//if (oarg) printf("oarg: %s\n", oarg->toChars());
//if (oded) printf("oded: %s\n", oded->toChars());
if (!oarg)
{
if (oded)
{
if (tparam.specialization() || !tparam.isTemplateTypeParameter())
{
/* The specialization can work as long as afterwards
* the oded == oarg
*/
(*dedargs)[i] = oded;
MATCH m2 = tparam.matchArg(instLoc, paramscope, dedargs, i, parameters, dedtypes, null);
//printf("m2 = %d\n", m2);
if (m2 <= MATCHnomatch)
goto Lnomatch;
if (m2 < matchTiargs)
matchTiargs = m2; // pick worst match
if (!(*dedtypes)[i].equals(oded))
error("specialization not allowed for deduced parameter %s", tparam.ident.toChars());
}
else
{
if (MATCHconvert < matchTiargs)
matchTiargs = MATCHconvert;
}
}
else
{
oded = tparam.defaultArg(instLoc, paramscope);
if (!oded)
{
// if tuple parameter and
// tuple parameter was not in function parameter list and
// we're one or more arguments short (i.e. no tuple argument)
if (tparam == tp && fptupindex == IDX_NOTFOUND && ntargs <= dedargs.dim - 1)
{
// make tuple argument an empty tuple
oded = cast(RootObject)new Tuple();
}
else
goto Lnomatch;
}
if (isError(oded))
goto Lerror;
ntargs++;
/* At the template parameter T, the picked default template argument
* X!int should be matched to T in order to deduce dependent
* template parameter A.
* auto foo(T : X!A = X!int, A...)() { ... }
* foo(); // T <-- X!int, A <-- (int)
*/
if (tparam.specialization())
{
(*dedargs)[i] = oded;
MATCH m2 = tparam.matchArg(instLoc, paramscope, dedargs, i, parameters, dedtypes, null);
//printf("m2 = %d\n", m2);
if (m2 <= MATCHnomatch)
goto Lnomatch;
if (m2 < matchTiargs)
matchTiargs = m2; // pick worst match
if (!(*dedtypes)[i].equals(oded))
error("specialization not allowed for deduced parameter %s", tparam.ident.toChars());
}
}
oded = declareParameter(paramscope, tparam, oded);
/* Bugzilla 7469: Normalize ti->tiargs for the correct mangling of template instance.
*/
Tuple va = isTuple(oded);
if (va && va.objects.dim)
{
dedargs.setDim(parameters.dim - 1 + va.objects.dim);
for (size_t j = 0; j < va.objects.dim; j++)
(*dedargs)[i + j] = va.objects[j];
i = dedargs.dim - 1;
}
else
(*dedargs)[i] = oded;
}
}
// Partially instantiate function for constraint and fd->leastAsSpecialized()
{
assert(paramsym);
Scope* sc2 = _scope;
sc2 = sc2.push(paramsym);
sc2 = sc2.push(ti);
sc2.parent = ti;
sc2.tinst = ti;
sc2.minst = sc.minst;
fd = doHeaderInstantiation(ti, sc2, fd, tthis, fargs);
sc2 = sc2.pop();
sc2 = sc2.pop();
if (!fd)
goto Lnomatch;
}
ti.tiargs = dedargs; // update to the normalized template arguments.
if (constraint)
{
if (!evaluateConstraint(ti, sc, paramscope, dedargs, fd))
goto Lnomatch;
}
version (none)
{
for (size_t i = 0; i < dedargs.dim; i++)
{
RootObject o = (*dedargs)[i];
printf("\tdedargs[%d] = %d, %s\n", i, o.dyncast(), o.toChars());
}
}
paramscope.pop();
//printf("\tmatch %d\n", match);
return cast(MATCH)(match | (matchTiargs << 4));
Lnomatch:
paramscope.pop();
//printf("\tnomatch\n");
return MATCHnomatch;
Lerror:
// todo: for the future improvement
paramscope.pop();
//printf("\terror\n");
return MATCHnomatch;
}
/**************************************************
* Declare template parameter tp with value o, and install it in the scope sc.
*/
RootObject declareParameter(Scope* sc, TemplateParameter tp, RootObject o)
{
//printf("TemplateDeclaration::declareParameter('%s', o = %p)\n", tp->ident->toChars(), o);
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
Tuple va = isTuple(o);
Declaration d;
VarDeclaration v = null;
if (ea && ea.op == TOKtype)
ta = ea.type;
else if (ea && ea.op == TOKimport)
sa = (cast(ScopeExp)ea).sds;
else if (ea && (ea.op == TOKthis || ea.op == TOKsuper))
sa = (cast(ThisExp)ea).var;
else if (ea && ea.op == TOKfunction)
{
if ((cast(FuncExp)ea).td)
sa = (cast(FuncExp)ea).td;
else
sa = (cast(FuncExp)ea).fd;
}
if (ta)
{
//printf("type %s\n", ta->toChars());
d = new AliasDeclaration(Loc(), tp.ident, ta);
}
else if (sa)
{
//printf("Alias %s %s;\n", sa->ident->toChars(), tp->ident->toChars());
d = new AliasDeclaration(Loc(), tp.ident, sa);
}
else if (ea)
{
// tdtypes.data[i] always matches ea here
Initializer _init = new ExpInitializer(loc, ea);
TemplateValueParameter tvp = tp.isTemplateValueParameter();
Type t = tvp ? tvp.valType : null;
v = new VarDeclaration(loc, t, tp.ident, _init);
v.storage_class = STCmanifest | STCtemplateparameter;
d = v;
}
else if (va)
{
//printf("\ttuple\n");
d = new TupleDeclaration(loc, tp.ident, &va.objects);
}
else
{
debug
{
o.print();
}
assert(0);
}
d.storage_class |= STCtemplateparameter;
if (ta)
{
Type t = ta;
// consistent with Type::checkDeprecated()
while (t.ty != Tenum)
{
if (!t.nextOf())
break;
t = (cast(TypeNext)t).next;
}
if (Dsymbol s = t.toDsymbol(null))
{
if (s.isDeprecated())
d.storage_class |= STCdeprecated;
}
}
else if (sa)
{
if (sa.isDeprecated())
d.storage_class |= STCdeprecated;
}
if (!sc.insert(d))
error("declaration %s is already defined", tp.ident.toChars());
d.semantic(sc);
/* So the caller's o gets updated with the result of semantic() being run on o
*/
if (v)
o = v._init.toExpression();
return o;
}
/*************************************************
* Limited function template instantiation for using fd->leastAsSpecialized()
*/
FuncDeclaration doHeaderInstantiation(TemplateInstance ti, Scope* sc2, FuncDeclaration fd, Type tthis, Expressions* fargs)
{
assert(fd);
version (none)
{
printf("doHeaderInstantiation this = %s\n", toChars());
}
// function body and contracts are not need
if (fd.isCtorDeclaration())
fd = new CtorDeclaration(fd.loc, fd.endloc, fd.storage_class, fd.type.syntaxCopy());
else
fd = new FuncDeclaration(fd.loc, fd.endloc, fd.ident, fd.storage_class, fd.type.syntaxCopy());
fd.parent = ti;
assert(fd.type.ty == Tfunction);
TypeFunction tf = cast(TypeFunction)fd.type;
tf.fargs = fargs;
if (tthis)
{
// Match 'tthis' to any TemplateThisParameter's
bool hasttp = false;
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
TemplateThisParameter ttp = tp.isTemplateThisParameter();
if (ttp)
hasttp = true;
}
if (hasttp)
{
tf = cast(TypeFunction)tf.addSTC(ModToStc(tthis.mod));
assert(!tf.deco);
}
}
Scope* scx = sc2.push();
// Shouldn't run semantic on default arguments and return type.
for (size_t i = 0; i < tf.parameters.dim; i++)
(*tf.parameters)[i].defaultArg = null;
if (fd.isCtorDeclaration())
{
// For constructors, emitting return type is necessary for
// isolateReturn() in functionResolve.
scx.flags |= SCOPEctor;
Dsymbol parent = toParent2();
Type tret;
AggregateDeclaration ad = parent.isAggregateDeclaration();
if (!ad || parent.isUnionDeclaration())
{
tret = Type.tvoid;
}
else
{
tret = ad.handleType();
assert(tret);
tret = tret.addStorageClass(fd.storage_class | scx.stc);
tret = tret.addMod(tf.mod);
}
tf.next = tret;
if (ad && ad.isStructDeclaration())
tf.isref = 1;
//printf("tf = %s\n", tf->toChars());
}
else
tf.next = null;
fd.type = tf;
fd.type = fd.type.addSTC(scx.stc);
fd.type = fd.type.semantic(fd.loc, scx);
scx = scx.pop();
if (fd.type.ty != Tfunction)
return null;
fd.originalType = fd.type; // for mangling
//printf("\t[%s] fd->type = %s, mod = %x, ", loc.toChars(), fd->type->toChars(), fd->type->mod);
//printf("fd->needThis() = %d\n", fd->needThis());
return fd;
}
/****************************************************
* Given a new instance tithis of this TemplateDeclaration,
* see if there already exists an instance.
* If so, return that existing instance.
*/
TemplateInstance findExistingInstance(TemplateInstance tithis, Expressions* fargs)
{
tithis.fargs = fargs;
hash_t hash = tithis.hashCode();
if (!buckets.dim)
{
buckets.setDim(7);
buckets.zero();
}
size_t bi = hash % buckets.dim;
TemplateInstances* instances = buckets[bi];
if (instances)
{
for (size_t i = 0; i < instances.dim; i++)
{
TemplateInstance ti = (*instances)[i];
static if (LOG)
{
printf("\t%s: checking for match with instance %d (%p): '%s'\n", tithis.toChars(), i, ti, ti.toChars());
}
if (hash == ti.hash && tithis.compare(ti) == 0)
{
//printf("hash = %p yes %d n = %d\n", hash, instances->dim, numinstances);
return ti;
}
}
}
//printf("hash = %p no\n", hash);
return null; // didn't find a match
}
/********************************************
* Add instance ti to TemplateDeclaration's table of instances.
* Return a handle we can use to later remove it if it fails instantiation.
*/
TemplateInstance addInstance(TemplateInstance ti)
{
/* See if we need to rehash
*/
if (numinstances > buckets.dim * 4)
{
// rehash
//printf("rehash\n");
size_t newdim = buckets.dim * 2 + 1;
TemplateInstances** newp = cast(TemplateInstances**).calloc(newdim, (TemplateInstances*).sizeof);
assert(newp);
for (size_t bi = 0; bi < buckets.dim; ++bi)
{
TemplateInstances* instances = buckets[bi];
if (instances)
{
for (size_t i = 0; i < instances.dim; i++)
{
TemplateInstance ti1 = (*instances)[i];
size_t newbi = ti1.hash % newdim;
TemplateInstances* newinstances = newp[newbi];
if (!newinstances)
newp[newbi] = newinstances = new TemplateInstances();
newinstances.push(ti1);
}
}
}
buckets.setDim(newdim);
memcpy(buckets.tdata(), newp, newdim * TemplateInstance.sizeof);
.free(newp);
}
// Insert ti into hash table
size_t bi = ti.hash % buckets.dim;
TemplateInstances* instances = buckets[bi];
if (!instances)
buckets[bi] = instances = new TemplateInstances();
instances.push(ti);
++numinstances;
return ti;
}
/*******************************************
* Remove TemplateInstance from table of instances.
* Input:
* handle returned by addInstance()
*/
void removeInstance(TemplateInstance handle)
{
size_t bi = handle.hash % buckets.dim;
TemplateInstances* instances = buckets[bi];
for (size_t i = 0; i < instances.dim; i++)
{
TemplateInstance ti = (*instances)[i];
if (handle == ti)
{
instances.remove(i);
break;
}
}
--numinstances;
}
TemplateDeclaration isTemplateDeclaration()
{
return this;
}
TemplateTupleParameter isVariadic()
{
return .isVariadic(parameters);
}
/***********************************
* We can overload templates.
*/
bool isOverloadable()
{
return true;
}
void accept(Visitor v)
{
v.visit(this);
}
}
extern (C++) final class TypeDeduced : Type
{
public:
Type tded;
Expressions argexps; // corresponding expressions
Types tparams; // tparams[i]->mod
extern (D) this(Type tt, Expression e, Type tparam)
{
super(Tnone);
tded = tt;
argexps.push(e);
tparams.push(tparam);
}
void update(Expression e, Type tparam)
{
argexps.push(e);
tparams.push(tparam);
}
void update(Type tt, Expression e, Type tparam)
{
tded = tt;
argexps.push(e);
tparams.push(tparam);
}
MATCH matchAll(Type tt)
{
MATCH match = MATCHexact;
for (size_t j = 0; j < argexps.dim; j++)
{
Expression e = argexps[j];
assert(e);
if (e == emptyArrayElement)
continue;
Type t = tt.addMod(tparams[j].mod).substWildTo(MODconst);
MATCH m = e.implicitConvTo(t);
if (match > m)
match = m;
if (match <= MATCHnomatch)
break;
}
return match;
}
}
/**************************************
* Determine if TemplateDeclaration is variadic.
*/
extern (C++) TemplateTupleParameter isVariadic(TemplateParameters* parameters)
{
size_t dim = parameters.dim;
TemplateTupleParameter tp = null;
if (dim)
tp = (*parameters)[dim - 1].isTemplateTupleParameter();
return tp;
}
/*************************************************
* Given function arguments, figure out which template function
* to expand, and return matching result.
* Input:
* m matching result
* dstart the root of overloaded function templates
* loc instantiation location
* sc instantiation scope
* tiargs initial list of template arguments
* tthis if !NULL, the 'this' pointer argument
* fargs arguments to function
*/
extern (C++) void functionResolve(Match* m, Dsymbol dstart, Loc loc, Scope* sc, Objects* tiargs, Type tthis, Expressions* fargs)
{
version (none)
{
printf("functionResolve() dstart = %s\n", dstart.toChars());
printf(" tiargs:\n");
if (tiargs)
{
for (size_t i = 0; i < tiargs.dim; i++)
{
RootObject arg = (*tiargs)[i];
printf("\t%s\n", arg.toChars());
}
}
printf(" fargs:\n");
for (size_t i = 0; i < (fargs ? fargs.dim : 0); i++)
{
Expression arg = (*fargs)[i];
printf("\t%s %s\n", arg.type.toChars(), arg.toChars());
//printf("\tty = %d\n", arg->type->ty);
}
//printf("stc = %llx\n", dstart->scope->stc);
//printf("match:t/f = %d/%d\n", ta_last, m->last);
}
struct ParamDeduce
{
// context
Loc loc;
Scope* sc;
Type tthis;
Objects* tiargs;
Expressions* fargs;
// result
Match* m;
int property; // 0: unintialized
// 1: seen @property
// 2: not @property
size_t ov_index;
TemplateDeclaration td_best;
TemplateInstance ti_best;
MATCH ta_last;
Type tthis_best;
extern (C++) static int fp(void* param, Dsymbol s)
{
if (!s.errors)
{
if (FuncDeclaration fd = s.isFuncDeclaration())
return (cast(ParamDeduce*)param).fp(fd);
if (TemplateDeclaration td = s.isTemplateDeclaration())
return (cast(ParamDeduce*)param).fp(td);
}
return 0;
}
extern (C++) int fp(FuncDeclaration fd)
{
// skip duplicates
if (fd == m.lastf)
return 0;
// explicitly specified tiargs never match to non template function
if (tiargs && tiargs.dim > 0)
return 0;
if (fd.semanticRun == PASSinit && fd._scope)
{
Ungag ungag = fd.ungagSpeculative();
fd.semantic(fd._scope);
}
if (fd.semanticRun == PASSinit)
{
.error(loc, "forward reference to template %s", fd.toChars());
return 1;
}
//printf("fd = %s %s, fargs = %s\n", fd->toChars(), fd->type->toChars(), fargs->toChars());
m.anyf = fd;
TypeFunction tf = cast(TypeFunction)fd.type;
int prop = tf.isproperty ? 1 : 2;
if (property == 0)
property = prop;
else if (property != prop)
error(fd.loc, "cannot overload both property and non-property functions");
/* For constructors, qualifier check will be opposite direction.
* Qualified constructor always makes qualified object, then will be checked
* that it is implicitly convertible to tthis.
*/
Type tthis_fd = fd.needThis() ? tthis : null;
if (tthis_fd && fd.isCtorDeclaration())
{
//printf("%s tf->mod = x%x tthis_fd->mod = x%x %d\n", tf->toChars(),
// tf->mod, tthis_fd->mod, fd->isolateReturn());
if (MODimplicitConv(tf.mod, tthis_fd.mod) || tf.isWild() && tf.isShared() == tthis_fd.isShared() || fd.isolateReturn())
{
/* && tf->isShared() == tthis_fd->isShared()*/
// Uniquely constructed object can ignore shared qualifier.
// TODO: Is this appropriate?
tthis_fd = null;
}
else
return 0; // MATCHnomatch
}
MATCH mfa = tf.callMatch(tthis_fd, fargs);
//printf("test1: mfa = %d\n", mfa);
if (mfa > MATCHnomatch)
{
if (mfa > m.last)
goto LfIsBetter;
if (mfa < m.last)
goto LlastIsBetter;
/* See if one of the matches overrides the other.
*/
assert(m.lastf);
if (m.lastf.overrides(fd))
goto LlastIsBetter;
if (fd.overrides(m.lastf))
goto LfIsBetter;
/* Try to disambiguate using template-style partial ordering rules.
* In essence, if f() and g() are ambiguous, if f() can call g(),
* but g() cannot call f(), then pick f().
* This is because f() is "more specialized."
*/
{
MATCH c1 = fd.leastAsSpecialized(m.lastf);
MATCH c2 = m.lastf.leastAsSpecialized(fd);
//printf("c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2)
goto LfIsBetter;
if (c1 < c2)
goto LlastIsBetter;
}
/* If the two functions are the same function, like:
* int foo(int);
* int foo(int x) { ... }
* then pick the one with the body.
*/
if (tf.equals(m.lastf.type) && fd.storage_class == m.lastf.storage_class && fd.parent == m.lastf.parent && fd.protection == m.lastf.protection && fd.linkage == m.lastf.linkage)
{
if (fd.fbody && !m.lastf.fbody)
goto LfIsBetter;
if (!fd.fbody && m.lastf.fbody)
goto LlastIsBetter;
}
m.nextf = fd;
m.count++;
return 0;
LlastIsBetter:
return 0;
LfIsBetter:
td_best = null;
ti_best = null;
ta_last = MATCHexact;
m.last = mfa;
m.lastf = fd;
tthis_best = tthis_fd;
ov_index = 0;
m.count = 1;
return 0;
}
return 0;
}
extern (C++) int fp(TemplateDeclaration td)
{
// skip duplicates
if (td == td_best)
return 0;
if (!sc)
sc = td._scope; // workaround for Type::aliasthisOf
if (td.semanticRun == PASSinit && td._scope)
{
// Try to fix forward reference. Ungag errors while doing so.
Ungag ungag = td.ungagSpeculative();
td.semantic(td._scope);
}
if (td.semanticRun == PASSinit)
{
.error(loc, "forward reference to template %s", td.toChars());
Lerror:
m.lastf = null;
m.count = 0;
m.last = MATCHnomatch;
return 1;
}
//printf("td = %s\n", td->toChars());
FuncDeclaration f;
f = td.onemember ? td.onemember.isFuncDeclaration() : null;
if (!f)
{
if (!tiargs)
tiargs = new Objects();
auto ti = new TemplateInstance(loc, td, tiargs);
Objects dedtypes;
dedtypes.setDim(td.parameters.dim);
assert(td.semanticRun != PASSinit);
MATCH mta = td.matchWithInstance(sc, ti, &dedtypes, fargs, 0);
//printf("matchWithInstance = %d\n", mta);
if (mta <= MATCHnomatch || mta < ta_last) // no match or less match
return 0;
ti.semantic(sc, fargs);
if (!ti.inst) // if template failed to expand
return 0;
Dsymbol s = ti.inst.toAlias();
FuncDeclaration fd;
if (TemplateDeclaration tdx = s.isTemplateDeclaration())
{
Objects dedtypesX; // empty tiargs
// Bugzilla 11553: Check for recursive instantiation of tdx.
for (TemplatePrevious* p = tdx.previous; p; p = p.prev)
{
if (arrayObjectMatch(p.dedargs, &dedtypesX))
{
//printf("recursive, no match p->sc=%p %p %s\n", p->sc, this, this->toChars());
/* It must be a subscope of p->sc, other scope chains are not recursive
* instantiations.
*/
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (scx == p.sc)
{
error(loc, "recursive template expansion while looking for %s.%s", ti.toChars(), tdx.toChars());
goto Lerror;
}
}
}
/* BUG: should also check for ref param differences
*/
}
TemplatePrevious pr;
pr.prev = tdx.previous;
pr.sc = sc;
pr.dedargs = &dedtypesX;
tdx.previous = ≺ // add this to threaded list
fd = resolveFuncCall(loc, sc, s, null, tthis, fargs, 1);
tdx.previous = pr.prev; // unlink from threaded list
}
else if (s.isFuncDeclaration())
{
fd = resolveFuncCall(loc, sc, s, null, tthis, fargs, 1);
}
else
goto Lerror;
if (!fd)
return 0;
if (fd.type.ty != Tfunction)
goto Lerror;
Type tthis_fd = fd.needThis() && !fd.isCtorDeclaration() ? tthis : null;
TypeFunction tf = cast(TypeFunction)fd.type;
MATCH mfa = tf.callMatch(tthis_fd, fargs);
if (mfa < m.last)
return 0;
if (mta < ta_last)
goto Ltd_best2;
if (mta > ta_last)
goto Ltd2;
if (mfa < m.last)
goto Ltd_best2;
if (mfa > m.last)
goto Ltd2;
Lambig2:
// td_best and td are ambiguous
//printf("Lambig2\n");
m.nextf = fd;
m.count++;
return 0;
Ltd_best2:
return 0;
Ltd2:
// td is the new best match
assert(td._scope);
td_best = td;
ti_best = null;
property = 0; // (backward compatibility)
ta_last = mta;
m.last = mfa;
m.lastf = fd;
tthis_best = tthis_fd;
ov_index = 0;
m.nextf = null;
m.count = 1;
return 0;
}
//printf("td = %s\n", td->toChars());
for (size_t ovi = 0; f; f = f.overnext0, ovi++)
{
if (f.type.ty != Tfunction || f.errors)
goto Lerror;
/* This is a 'dummy' instance to evaluate constraint properly.
*/
auto ti = new TemplateInstance(loc, td, tiargs);
ti.parent = td.parent; // Maybe calculating valid 'enclosing' is unnecessary.
FuncDeclaration fd = f;
int x = td.deduceFunctionTemplateMatch(ti, sc, fd, tthis, fargs);
MATCH mta = cast(MATCH)(x >> 4);
MATCH mfa = cast(MATCH)(x & 0xF);
//printf("match:t/f = %d/%d\n", mta, mfa);
if (!fd || mfa == MATCHnomatch)
continue;
Type tthis_fd = fd.needThis() ? tthis : null;
if (fd.isCtorDeclaration())
{
// Constructor call requires additional check.
TypeFunction tf = cast(TypeFunction)fd.type;
if (tthis_fd)
{
assert(tf.next);
if (MODimplicitConv(tf.mod, tthis_fd.mod) || tf.isWild() && tf.isShared() == tthis_fd.isShared() || fd.isolateReturn())
{
tthis_fd = null;
}
else
continue;
// MATCHnomatch
}
}
if (mta < ta_last)
goto Ltd_best;
if (mta > ta_last)
goto Ltd;
if (mfa < m.last)
goto Ltd_best;
if (mfa > m.last)
goto Ltd;
if (td_best)
{
// Disambiguate by picking the most specialized TemplateDeclaration
MATCH c1 = td.leastAsSpecialized(sc, td_best, fargs);
MATCH c2 = td_best.leastAsSpecialized(sc, td, fargs);
//printf("1: c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2)
goto Ltd;
if (c1 < c2)
goto Ltd_best;
}
assert(fd && m.lastf);
{
// Disambiguate by tf->callMatch
TypeFunction tf1 = cast(TypeFunction)fd.type;
assert(tf1.ty == Tfunction);
TypeFunction tf2 = cast(TypeFunction)m.lastf.type;
assert(tf2.ty == Tfunction);
MATCH c1 = tf1.callMatch(tthis_fd, fargs);
MATCH c2 = tf2.callMatch(tthis_best, fargs);
//printf("2: c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2)
goto Ltd;
if (c1 < c2)
goto Ltd_best;
}
{
// Disambiguate by picking the most specialized FunctionDeclaration
MATCH c1 = fd.leastAsSpecialized(m.lastf);
MATCH c2 = m.lastf.leastAsSpecialized(fd);
//printf("3: c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2)
goto Ltd;
if (c1 < c2)
goto Ltd_best;
}
m.nextf = fd;
m.count++;
continue;
Ltd_best:
// td_best is the best match so far
//printf("Ltd_best\n");
continue;
Ltd:
// td is the new best match
//printf("Ltd\n");
assert(td._scope);
td_best = td;
ti_best = ti;
property = 0; // (backward compatibility)
ta_last = mta;
m.last = mfa;
m.lastf = fd;
tthis_best = tthis_fd;
ov_index = ovi;
m.nextf = null;
m.count = 1;
continue;
}
return 0;
}
}
ParamDeduce p;
// context
p.loc = loc;
p.sc = sc;
p.tthis = tthis;
p.tiargs = tiargs;
p.fargs = fargs;
// result
p.m = m;
p.property = 0;
p.ov_index = 0;
p.td_best = null;
p.ti_best = null;
p.ta_last = m.last != MATCHnomatch ? MATCHexact : MATCHnomatch;
p.tthis_best = null;
TemplateDeclaration td = dstart.isTemplateDeclaration();
if (td && td.funcroot)
dstart = td.funcroot;
overloadApply(dstart, &p, &ParamDeduce.fp);
//printf("td_best = %p, m->lastf = %p\n", p.td_best, m->lastf);
if (p.td_best && p.ti_best && m.count == 1)
{
// Matches to template function
assert(p.td_best.onemember && p.td_best.onemember.isFuncDeclaration());
/* The best match is td_best with arguments tdargs.
* Now instantiate the template.
*/
assert(p.td_best._scope);
if (!sc)
sc = p.td_best._scope; // workaround for Type::aliasthisOf
auto ti = new TemplateInstance(loc, p.td_best, p.ti_best.tiargs);
ti.semantic(sc, fargs);
m.lastf = ti.toAlias().isFuncDeclaration();
if (!m.lastf)
goto Lnomatch;
if (ti.errors)
{
Lerror:
m.count = 1;
assert(m.lastf);
m.last = MATCHnomatch;
return;
}
// look forward instantiated overload function
// Dsymbol::oneMembers is alredy called in TemplateInstance::semantic.
// it has filled overnext0d
while (p.ov_index--)
{
m.lastf = m.lastf.overnext0;
assert(m.lastf);
}
p.tthis_best = m.lastf.needThis() && !m.lastf.isCtorDeclaration() ? tthis : null;
TypeFunction tf = cast(TypeFunction)m.lastf.type;
if (tf.ty == Terror)
goto Lerror;
assert(tf.ty == Tfunction);
if (!tf.callMatch(p.tthis_best, fargs))
goto Lnomatch;
if (FuncLiteralDeclaration fld = m.lastf.isFuncLiteralDeclaration())
{
if ((sc.flags & SCOPEconstraint) || sc.intypeof)
{
// Inside template constraint, or inside typeof,
// nested reference check doesn't work correctly.
}
else if (fld.tok == TOKreserved)
{
// change to non-nested
fld.tok = TOKfunction;
fld.vthis = null;
}
}
/* As Bugzilla 3682 shows, a template instance can be matched while instantiating
* that same template. Thus, the function type can be incomplete. Complete it.
*
* Bugzilla 9208: For auto function, completion should be deferred to the end of
* its semantic3. Should not complete it in here.
*/
if (tf.next && !m.lastf.inferRetType)
{
m.lastf.type = tf.semantic(loc, sc);
}
}
else if (m.lastf)
{
// Matches to non template function,
// or found matches were ambiguous.
assert(m.count >= 1);
}
else
{
Lnomatch:
m.count = 0;
m.lastf = null;
m.last = MATCHnomatch;
}
}
/* ======================== Type ============================================ */
/****
* Given an identifier, figure out which TemplateParameter it is.
* Return IDX_NOTFOUND if not found.
*/
extern (C++) size_t templateIdentifierLookup(Identifier id, TemplateParameters* parameters)
{
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
if (tp.ident.equals(id))
return i;
}
return IDX_NOTFOUND;
}
extern (C++) size_t templateParameterLookup(Type tparam, TemplateParameters* parameters)
{
if (tparam.ty == Tident)
{
TypeIdentifier tident = cast(TypeIdentifier)tparam;
//printf("\ttident = '%s'\n", tident->toChars());
return templateIdentifierLookup(tident.ident, parameters);
}
return IDX_NOTFOUND;
}
extern (C++) ubyte deduceWildHelper(Type t, Type* at, Type tparam)
{
if ((tparam.mod & MODwild) == 0)
return 0;
*at = null;
auto X(T, U)(T U, U T)
{
return (U << 4) | T;
}
switch (X(tparam.mod, t.mod))
{
case X(MODwild, 0):
case X(MODwild, MODconst):
case X(MODwild, MODshared):
case X(MODwild, MODshared | MODconst):
case X(MODwild, MODimmutable):
case X(MODwildconst, 0):
case X(MODwildconst, MODconst):
case X(MODwildconst, MODshared):
case X(MODwildconst, MODshared | MODconst):
case X(MODwildconst, MODimmutable):
case X(MODshared | MODwild, MODshared):
case X(MODshared | MODwild, MODshared | MODconst):
case X(MODshared | MODwild, MODimmutable):
case X(MODshared | MODwildconst, MODshared):
case X(MODshared | MODwildconst, MODshared | MODconst):
case X(MODshared | MODwildconst, MODimmutable):
{
ubyte wm = (t.mod & ~MODshared);
if (wm == 0)
wm = MODmutable;
ubyte m = (t.mod & (MODconst | MODimmutable)) | (tparam.mod & t.mod & MODshared);
*at = t.unqualify(m);
return wm;
}
case X(MODwild, MODwild):
case X(MODwild, MODwildconst):
case X(MODwild, MODshared | MODwild):
case X(MODwild, MODshared | MODwildconst):
case X(MODwildconst, MODwild):
case X(MODwildconst, MODwildconst):
case X(MODwildconst, MODshared | MODwild):
case X(MODwildconst, MODshared | MODwildconst):
case X(MODshared | MODwild, MODshared | MODwild):
case X(MODshared | MODwild, MODshared | MODwildconst):
case X(MODshared | MODwildconst, MODshared | MODwild):
case X(MODshared | MODwildconst, MODshared | MODwildconst):
{
*at = t.unqualify(tparam.mod & t.mod);
return MODwild;
}
default:
return 0;
}
}
extern (C++) MATCH deduceTypeHelper(Type t, Type* at, Type tparam)
{
// 9*9 == 81 cases
auto X(T, U)(T U, U T)
{
return (U << 4) | T;
}
switch (X(tparam.mod, t.mod))
{
case X(0, 0):
case X(0, MODconst):
case X(0, MODwild):
case X(0, MODwildconst):
case X(0, MODshared):
case X(0, MODshared | MODconst):
case X(0, MODshared | MODwild):
case X(0, MODshared | MODwildconst):
case X(0, MODimmutable):
// foo(U) T => T
// foo(U) const(T) => const(T)
// foo(U) inout(T) => inout(T)
// foo(U) inout(const(T)) => inout(const(T))
// foo(U) shared(T) => shared(T)
// foo(U) shared(const(T)) => shared(const(T))
// foo(U) shared(inout(T)) => shared(inout(T))
// foo(U) shared(inout(const(T))) => shared(inout(const(T)))
// foo(U) immutable(T) => immutable(T)
{
*at = t;
return MATCHexact;
}
case X(MODconst, MODconst):
case X(MODwild, MODwild):
case X(MODwildconst, MODwildconst):
case X(MODshared, MODshared):
case X(MODshared | MODconst, MODshared | MODconst):
case X(MODshared | MODwild, MODshared | MODwild):
case X(MODshared | MODwildconst, MODshared | MODwildconst):
case X(MODimmutable, MODimmutable):
// foo(const(U)) const(T) => T
// foo(inout(U)) inout(T) => T
// foo(inout(const(U))) inout(const(T)) => T
// foo(shared(U)) shared(T) => T
// foo(shared(const(U))) shared(const(T)) => T
// foo(shared(inout(U))) shared(inout(T)) => T
// foo(shared(inout(const(U)))) shared(inout(const(T))) => T
// foo(immutable(U)) immutable(T) => T
{
*at = t.mutableOf().unSharedOf();
return MATCHexact;
}
case X(MODconst, 0):
case X(MODconst, MODwild):
case X(MODconst, MODwildconst):
case X(MODconst, MODshared | MODconst):
case X(MODconst, MODshared | MODwild):
case X(MODconst, MODshared | MODwildconst):
case X(MODconst, MODimmutable):
case X(MODwild, MODshared | MODwild):
case X(MODwildconst, MODshared | MODwildconst):
case X(MODshared | MODconst, MODimmutable):
// foo(const(U)) T => T
// foo(const(U)) inout(T) => T
// foo(const(U)) inout(const(T)) => T
// foo(const(U)) shared(const(T)) => shared(T)
// foo(const(U)) shared(inout(T)) => shared(T)
// foo(const(U)) shared(inout(const(T))) => shared(T)
// foo(const(U)) immutable(T) => T
// foo(inout(U)) shared(inout(T)) => shared(T)
// foo(inout(const(U))) shared(inout(const(T))) => shared(T)
// foo(shared(const(U))) immutable(T) => T
{
*at = t.mutableOf();
return MATCHconst;
}
case X(MODconst, MODshared):
// foo(const(U)) shared(T) => shared(T)
{
*at = t;
return MATCHconst;
}
case X(MODshared, MODshared | MODconst):
case X(MODshared, MODshared | MODwild):
case X(MODshared, MODshared | MODwildconst):
case X(MODshared | MODconst, MODshared):
// foo(shared(U)) shared(const(T)) => const(T)
// foo(shared(U)) shared(inout(T)) => inout(T)
// foo(shared(U)) shared(inout(const(T))) => inout(const(T))
// foo(shared(const(U))) shared(T) => T
{
*at = t.unSharedOf();
return MATCHconst;
}
case X(MODwildconst, MODimmutable):
case X(MODshared | MODconst, MODshared | MODwildconst):
case X(MODshared | MODwildconst, MODimmutable):
case X(MODshared | MODwildconst, MODshared | MODwild):
// foo(inout(const(U))) immutable(T) => T
// foo(shared(const(U))) shared(inout(const(T))) => T
// foo(shared(inout(const(U)))) immutable(T) => T
// foo(shared(inout(const(U)))) shared(inout(T)) => T
{
*at = t.unSharedOf().mutableOf();
return MATCHconst;
}
case X(MODshared | MODconst, MODshared | MODwild):
// foo(shared(const(U))) shared(inout(T)) => T
{
*at = t.unSharedOf().mutableOf();
return MATCHconst;
}
case X(MODwild, 0):
case X(MODwild, MODconst):
case X(MODwild, MODwildconst):
case X(MODwild, MODimmutable):
case X(MODwild, MODshared):
case X(MODwild, MODshared | MODconst):
case X(MODwild, MODshared | MODwildconst):
case X(MODwildconst, 0):
case X(MODwildconst, MODconst):
case X(MODwildconst, MODwild):
case X(MODwildconst, MODshared):
case X(MODwildconst, MODshared | MODconst):
case X(MODwildconst, MODshared | MODwild):
case X(MODshared, 0):
case X(MODshared, MODconst):
case X(MODshared, MODwild):
case X(MODshared, MODwildconst):
case X(MODshared, MODimmutable):
case X(MODshared | MODconst, 0):
case X(MODshared | MODconst, MODconst):
case X(MODshared | MODconst, MODwild):
case X(MODshared | MODconst, MODwildconst):
case X(MODshared | MODwild, 0):
case X(MODshared | MODwild, MODconst):
case X(MODshared | MODwild, MODwild):
case X(MODshared | MODwild, MODwildconst):
case X(MODshared | MODwild, MODimmutable):
case X(MODshared | MODwild, MODshared):
case X(MODshared | MODwild, MODshared | MODconst):
case X(MODshared | MODwild, MODshared | MODwildconst):
case X(MODshared | MODwildconst, 0):
case X(MODshared | MODwildconst, MODconst):
case X(MODshared | MODwildconst, MODwild):
case X(MODshared | MODwildconst, MODwildconst):
case X(MODshared | MODwildconst, MODshared):
case X(MODshared | MODwildconst, MODshared | MODconst):
case X(MODimmutable, 0):
case X(MODimmutable, MODconst):
case X(MODimmutable, MODwild):
case X(MODimmutable, MODwildconst):
case X(MODimmutable, MODshared):
case X(MODimmutable, MODshared | MODconst):
case X(MODimmutable, MODshared | MODwild):
case X(MODimmutable, MODshared | MODwildconst):
// foo(inout(U)) T => nomatch
// foo(inout(U)) const(T) => nomatch
// foo(inout(U)) inout(const(T)) => nomatch
// foo(inout(U)) immutable(T) => nomatch
// foo(inout(U)) shared(T) => nomatch
// foo(inout(U)) shared(const(T)) => nomatch
// foo(inout(U)) shared(inout(const(T))) => nomatch
// foo(inout(const(U))) T => nomatch
// foo(inout(const(U))) const(T) => nomatch
// foo(inout(const(U))) inout(T) => nomatch
// foo(inout(const(U))) shared(T) => nomatch
// foo(inout(const(U))) shared(const(T)) => nomatch
// foo(inout(const(U))) shared(inout(T)) => nomatch
// foo(shared(U)) T => nomatch
// foo(shared(U)) const(T) => nomatch
// foo(shared(U)) inout(T) => nomatch
// foo(shared(U)) inout(const(T)) => nomatch
// foo(shared(U)) immutable(T) => nomatch
// foo(shared(const(U))) T => nomatch
// foo(shared(const(U))) const(T) => nomatch
// foo(shared(const(U))) inout(T) => nomatch
// foo(shared(const(U))) inout(const(T)) => nomatch
// foo(shared(inout(U))) T => nomatch
// foo(shared(inout(U))) const(T) => nomatch
// foo(shared(inout(U))) inout(T) => nomatch
// foo(shared(inout(U))) inout(const(T)) => nomatch
// foo(shared(inout(U))) immutable(T) => nomatch
// foo(shared(inout(U))) shared(T) => nomatch
// foo(shared(inout(U))) shared(const(T)) => nomatch
// foo(shared(inout(U))) shared(inout(const(T))) => nomatch
// foo(shared(inout(const(U)))) T => nomatch
// foo(shared(inout(const(U)))) const(T) => nomatch
// foo(shared(inout(const(U)))) inout(T) => nomatch
// foo(shared(inout(const(U)))) inout(const(T)) => nomatch
// foo(shared(inout(const(U)))) shared(T) => nomatch
// foo(shared(inout(const(U)))) shared(const(T)) => nomatch
// foo(immutable(U)) T => nomatch
// foo(immutable(U)) const(T) => nomatch
// foo(immutable(U)) inout(T) => nomatch
// foo(immutable(U)) inout(const(T)) => nomatch
// foo(immutable(U)) shared(T) => nomatch
// foo(immutable(U)) shared(const(T)) => nomatch
// foo(immutable(U)) shared(inout(T)) => nomatch
// foo(immutable(U)) shared(inout(const(T))) => nomatch
return MATCHnomatch;
default:
assert(0);
return MATCHnomatch; // silence compiler warning about missing return
}
}
extern (C++) __gshared Expression emptyArrayElement = null;
/* These form the heart of template argument deduction.
* Given 'this' being the type argument to the template instance,
* it is matched against the template declaration parameter specialization
* 'tparam' to determine the type to be used for the parameter.
* Example:
* template Foo(T:T*) // template declaration
* Foo!(int*) // template instantiation
* Input:
* this = int*
* tparam = T*
* parameters = [ T:T* ] // Array of TemplateParameter's
* Output:
* dedtypes = [ int ] // Array of Expression/Type's
*/
extern (C++) MATCH deduceType(RootObject o, Scope* sc, Type tparam, TemplateParameters* parameters, Objects* dedtypes, uint* wm = null, size_t inferStart = 0)
{
extern (C++) final class DeduceType : Visitor
{
alias visit = super.visit;
public:
Scope* sc;
Type tparam;
TemplateParameters* parameters;
Objects* dedtypes;
uint* wm;
size_t inferStart;
MATCH result;
extern (D) this(Scope* sc, Type tparam, TemplateParameters* parameters, Objects* dedtypes, uint* wm, size_t inferStart)
{
this.sc = sc;
this.tparam = tparam;
this.parameters = parameters;
this.dedtypes = dedtypes;
this.wm = wm;
this.inferStart = inferStart;
result = MATCHnomatch;
}
void visit(Type t)
{
version (none)
{
printf("Type::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
if (!tparam)
goto Lnomatch;
if (t == tparam)
goto Lexact;
if (tparam.ty == Tident)
{
// Determine which parameter tparam is
size_t i = templateParameterLookup(tparam, parameters);
if (i == IDX_NOTFOUND)
{
if (!sc)
goto Lnomatch;
/* Need a loc to go with the semantic routine.
*/
Loc loc;
if (parameters.dim)
{
TemplateParameter tp = (*parameters)[0];
loc = tp.loc;
}
/* BUG: what if tparam is a template instance, that
* has as an argument another Tident?
*/
tparam = tparam.semantic(loc, sc);
assert(tparam.ty != Tident);
result = deduceType(t, sc, tparam, parameters, dedtypes, wm);
return;
}
TemplateParameter tp = (*parameters)[i];
TypeIdentifier tident = cast(TypeIdentifier)tparam;
if (tident.idents.dim > 0)
{
//printf("matching %s to %s\n", tparam->toChars(), t->toChars());
Dsymbol s = t.toDsymbol(sc);
for (size_t j = tident.idents.dim; j-- > 0;)
{
RootObject id = tident.idents[j];
if (id.dyncast() == DYNCAST_IDENTIFIER)
{
if (!s || !s.parent)
goto Lnomatch;
Dsymbol s2 = s.parent.search(Loc(), cast(Identifier)id);
if (!s2)
goto Lnomatch;
s2 = s2.toAlias();
//printf("[%d] s = %s %s, s2 = %s %s\n", j, s->kind(), s->toChars(), s2->kind(), s2->toChars());
if (s != s2)
{
if (Type tx = s2.getType())
{
if (s != tx.toDsymbol(sc))
goto Lnomatch;
}
else
goto Lnomatch;
}
s = s.parent;
}
else
goto Lnomatch;
}
//printf("[e] s = %s\n", s?s->toChars():"(null)");
if (tp.isTemplateTypeParameter())
{
Type tt = s.getType();
if (!tt)
goto Lnomatch;
Type at = cast(Type)(*dedtypes)[i];
if (at && at.ty == Tnone)
at = (cast(TypeDeduced)at).tded;
if (!at || tt.equals(at))
{
(*dedtypes)[i] = tt;
goto Lexact;
}
}
if (tp.isTemplateAliasParameter())
{
Dsymbol s2 = cast(Dsymbol)(*dedtypes)[i];
if (!s2 || s == s2)
{
(*dedtypes)[i] = s;
goto Lexact;
}
}
goto Lnomatch;
}
// Found the corresponding parameter tp
if (!tp.isTemplateTypeParameter())
goto Lnomatch;
Type at = cast(Type)(*dedtypes)[i];
Type tt;
if (ubyte wx = wm ? deduceWildHelper(t, &tt, tparam) : 0)
{
// type vs (none)
if (!at)
{
(*dedtypes)[i] = tt;
*wm |= wx;
result = MATCHconst;
return;
}
// type vs expressions
if (at.ty == Tnone)
{
TypeDeduced xt = cast(TypeDeduced)at;
result = xt.matchAll(tt);
if (result > MATCHnomatch)
{
(*dedtypes)[i] = tt;
if (result > MATCHconst)
result = MATCHconst; // limit level for inout matches
}
return;
}
// type vs type
if (tt.equals(at))
{
(*dedtypes)[i] = tt; // Prefer current type match
goto Lconst;
}
if (tt.implicitConvTo(at.constOf()))
{
(*dedtypes)[i] = at.constOf().mutableOf();
*wm |= MODconst;
goto Lconst;
}
if (at.implicitConvTo(tt.constOf()))
{
(*dedtypes)[i] = tt.constOf().mutableOf();
*wm |= MODconst;
goto Lconst;
}
goto Lnomatch;
}
else if (MATCH m = deduceTypeHelper(t, &tt, tparam))
{
// type vs (none)
if (!at)
{
(*dedtypes)[i] = tt;
result = m;
return;
}
// type vs expressions
if (at.ty == Tnone)
{
TypeDeduced xt = cast(TypeDeduced)at;
result = xt.matchAll(tt);
if (result > MATCHnomatch)
{
(*dedtypes)[i] = tt;
}
return;
}
// type vs type
if (tt.equals(at))
{
goto Lexact;
}
if (tt.ty == Tclass && at.ty == Tclass)
{
result = tt.implicitConvTo(at);
return;
}
if (tt.ty == Tsarray && at.ty == Tarray && tt.nextOf().implicitConvTo(at.nextOf()) >= MATCHconst)
{
goto Lexact;
}
}
goto Lnomatch;
}
if (tparam.ty == Ttypeof)
{
/* Need a loc to go with the semantic routine.
*/
Loc loc;
if (parameters.dim)
{
TemplateParameter tp = (*parameters)[0];
loc = tp.loc;
}
tparam = tparam.semantic(loc, sc);
}
if (t.ty != tparam.ty)
{
if (Dsymbol sym = t.toDsymbol(sc))
{
if (sym.isforwardRef() && !tparam.deco)
goto Lnomatch;
}
MATCH m = t.implicitConvTo(tparam);
if (m == MATCHnomatch)
{
if (t.ty == Tclass)
{
TypeClass tc = cast(TypeClass)t;
if (tc.sym.aliasthis && !(tc.att & RECtracingDT))
{
tc.att = cast(AliasThisRec)(tc.att | RECtracingDT);
m = deduceType(t.aliasthisOf(), sc, tparam, parameters, dedtypes, wm);
tc.att = cast(AliasThisRec)(tc.att & ~RECtracingDT);
}
}
else if (t.ty == Tstruct)
{
TypeStruct ts = cast(TypeStruct)t;
if (ts.sym.aliasthis && !(ts.att & RECtracingDT))
{
ts.att = cast(AliasThisRec)(ts.att | RECtracingDT);
m = deduceType(t.aliasthisOf(), sc, tparam, parameters, dedtypes, wm);
ts.att = cast(AliasThisRec)(ts.att & ~RECtracingDT);
}
}
}
result = m;
return;
}
if (t.nextOf())
{
if (tparam.deco && !tparam.hasWild())
{
result = t.implicitConvTo(tparam);
return;
}
Type tpn = tparam.nextOf();
if (wm && t.ty == Taarray && tparam.isWild())
{
// Bugzilla 12403: In IFTI, stop inout matching on transitive part of AA types.
tpn = tpn.substWildTo(MODmutable);
}
result = deduceType(t.nextOf(), sc, tpn, parameters, dedtypes, wm);
return;
}
Lexact:
result = MATCHexact;
return;
Lnomatch:
result = MATCHnomatch;
return;
Lconst:
result = MATCHconst;
}
void visit(TypeVector t)
{
version (none)
{
printf("TypeVector::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
if (tparam.ty == Tvector)
{
TypeVector tp = cast(TypeVector)tparam;
result = deduceType(t.basetype, sc, tp.basetype, parameters, dedtypes, wm);
return;
}
visit(cast(Type)t);
}
void visit(TypeDArray t)
{
version (none)
{
printf("TypeDArray::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
visit(cast(Type)t);
}
void visit(TypeSArray t)
{
version (none)
{
printf("TypeSArray::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
// Extra check that array dimensions must match
if (tparam)
{
if (tparam.ty == Tarray)
{
MATCH m = deduceType(t.next, sc, tparam.nextOf(), parameters, dedtypes, wm);
result = (m >= MATCHconst) ? MATCHconvert : MATCHnomatch;
return;
}
TemplateParameter tp = null;
Expression edim = null;
size_t i;
if (tparam.ty == Tsarray)
{
TypeSArray tsa = cast(TypeSArray)tparam;
if (tsa.dim.op == TOKvar && (cast(VarExp)tsa.dim).var.storage_class & STCtemplateparameter)
{
Identifier id = (cast(VarExp)tsa.dim).var.ident;
i = templateIdentifierLookup(id, parameters);
assert(i != IDX_NOTFOUND);
tp = (*parameters)[i];
}
else
edim = tsa.dim;
}
else if (tparam.ty == Taarray)
{
TypeAArray taa = cast(TypeAArray)tparam;
i = templateParameterLookup(taa.index, parameters);
if (i != IDX_NOTFOUND)
tp = (*parameters)[i];
else
{
Expression e;
Type tx;
Dsymbol s;
taa.index.resolve(Loc(), sc, &e, &tx, &s);
edim = s ? getValue(s) : getValue(e);
}
}
if (tp && tp.matchArg(sc, t.dim, i, parameters, dedtypes, null) || edim && edim.toInteger() == t.dim.toInteger())
{
result = deduceType(t.next, sc, tparam.nextOf(), parameters, dedtypes, wm);
return;
}
}
visit(cast(Type)t);
return;
result = MATCHnomatch;
}
void visit(TypeAArray t)
{
version (none)
{
printf("TypeAArray::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
// Extra check that index type must match
if (tparam && tparam.ty == Taarray)
{
TypeAArray tp = cast(TypeAArray)tparam;
if (!deduceType(t.index, sc, tp.index, parameters, dedtypes))
{
result = MATCHnomatch;
return;
}
}
visit(cast(Type)t);
}
void visit(TypeFunction t)
{
//printf("TypeFunction::deduceType()\n");
//printf("\tthis = %d, ", t->ty); t->print();
//printf("\ttparam = %d, ", tparam->ty); tparam->print();
// Extra check that function characteristics must match
if (tparam && tparam.ty == Tfunction)
{
TypeFunction tp = cast(TypeFunction)tparam;
if (t.varargs != tp.varargs || t.linkage != tp.linkage)
{
result = MATCHnomatch;
return;
}
size_t nfargs = Parameter.dim(t.parameters);
size_t nfparams = Parameter.dim(tp.parameters);
// bug 2579 fix: Apply function parameter storage classes to parameter types
for (size_t i = 0; i < nfparams; i++)
{
Parameter fparam = Parameter.getNth(tp.parameters, i);
fparam.type = fparam.type.addStorageClass(fparam.storageClass);
fparam.storageClass &= ~(STC_TYPECTOR | STCin);
}
//printf("\t-> this = %d, ", t->ty); t->print();
//printf("\t-> tparam = %d, ", tparam->ty); tparam->print();
/* See if tuple match
*/
if (nfparams > 0 && nfargs >= nfparams - 1)
{
/* See if 'A' of the template parameter matches 'A'
* of the type of the last function parameter.
*/
Parameter fparam = Parameter.getNth(tp.parameters, nfparams - 1);
assert(fparam);
assert(fparam.type);
if (fparam.type.ty != Tident)
goto L1;
TypeIdentifier tid = cast(TypeIdentifier)fparam.type;
if (tid.idents.dim)
goto L1;
/* Look through parameters to find tuple matching tid->ident
*/
size_t tupi = 0;
for (; 1; tupi++)
{
if (tupi == parameters.dim)
goto L1;
TemplateParameter tx = (*parameters)[tupi];
TemplateTupleParameter tup = tx.isTemplateTupleParameter();
if (tup && tup.ident.equals(tid.ident))
break;
}
/* The types of the function arguments [nfparams - 1 .. nfargs]
* now form the tuple argument.
*/
size_t tuple_dim = nfargs - (nfparams - 1);
/* See if existing tuple, and whether it matches or not
*/
RootObject o = (*dedtypes)[tupi];
if (o)
{
// Existing deduced argument must be a tuple, and must match
Tuple tup = isTuple(o);
if (!tup || tup.objects.dim != tuple_dim)
{
result = MATCHnomatch;
return;
}
for (size_t i = 0; i < tuple_dim; i++)
{
Parameter arg = Parameter.getNth(t.parameters, nfparams - 1 + i);
if (!arg.type.equals(tup.objects[i]))
{
result = MATCHnomatch;
return;
}
}
}
else
{
// Create new tuple
auto tup = new Tuple();
tup.objects.setDim(tuple_dim);
for (size_t i = 0; i < tuple_dim; i++)
{
Parameter arg = Parameter.getNth(t.parameters, nfparams - 1 + i);
tup.objects[i] = arg.type;
}
(*dedtypes)[tupi] = tup;
}
nfparams--; // don't consider the last parameter for type deduction
goto L2;
}
L1:
if (nfargs != nfparams)
{
result = MATCHnomatch;
return;
}
L2:
for (size_t i = 0; i < nfparams; i++)
{
Parameter a = Parameter.getNth(t.parameters, i);
Parameter ap = Parameter.getNth(tp.parameters, i);
if (a.storageClass != ap.storageClass || !deduceType(a.type, sc, ap.type, parameters, dedtypes))
{
result = MATCHnomatch;
return;
}
}
}
visit(cast(Type)t);
}
void visit(TypeIdentifier t)
{
// Extra check
if (tparam && tparam.ty == Tident)
{
TypeIdentifier tp = cast(TypeIdentifier)tparam;
for (size_t i = 0; i < t.idents.dim; i++)
{
RootObject id1 = t.idents[i];
RootObject id2 = tp.idents[i];
if (!id1.equals(id2))
{
result = MATCHnomatch;
return;
}
}
}
visit(cast(Type)t);
}
void visit(TypeInstance t)
{
version (none)
{
printf("TypeInstance::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
// Extra check
if (tparam && tparam.ty == Tinstance && t.tempinst.tempdecl)
{
TemplateDeclaration tempdecl = t.tempinst.tempdecl.isTemplateDeclaration();
assert(tempdecl);
TypeInstance tp = cast(TypeInstance)tparam;
//printf("tempinst->tempdecl = %p\n", tempdecl);
//printf("tp->tempinst->tempdecl = %p\n", tp->tempinst->tempdecl);
if (!tp.tempinst.tempdecl)
{
//printf("tp->tempinst->name = '%s'\n", tp->tempinst->name->toChars());
/* Handle case of:
* template Foo(T : sa!(T), alias sa)
*/
size_t i = templateIdentifierLookup(tp.tempinst.name, parameters);
if (i == IDX_NOTFOUND)
{
/* Didn't find it as a parameter identifier. Try looking
* it up and seeing if is an alias. See Bugzilla 1454
*/
auto tid = new TypeIdentifier(tp.loc, tp.tempinst.name);
Type tx;
Expression e;
Dsymbol s;
tid.resolve(tp.loc, sc, &e, &tx, &s);
if (tx)
{
s = tx.toDsymbol(sc);
if (TemplateInstance ti = s ? s.parent.isTemplateInstance() : null)
{
// Bugzilla 14290: Try to match with ti->tempecl,
// only when ti is an enclosing instance.
Dsymbol p = sc.parent;
while (p && p != ti)
p = p.parent;
if (p)
s = ti.tempdecl;
}
}
if (s)
{
s = s.toAlias();
TemplateDeclaration td = s.isTemplateDeclaration();
if (td)
{
if (td.overroot)
td = td.overroot;
for (; td; td = td.overnext)
{
if (td == tempdecl)
goto L2;
}
}
}
goto Lnomatch;
}
TemplateParameter tpx = (*parameters)[i];
if (!tpx.matchArg(sc, tempdecl, i, parameters, dedtypes, null))
goto Lnomatch;
}
else if (tempdecl != tp.tempinst.tempdecl)
goto Lnomatch;
L2:
for (size_t i = 0; 1; i++)
{
//printf("\ttest: tempinst->tiargs[%d]\n", i);
RootObject o1 = null;
if (i < t.tempinst.tiargs.dim)
o1 = (*t.tempinst.tiargs)[i];
else if (i < t.tempinst.tdtypes.dim && i < tp.tempinst.tiargs.dim)
{
// Pick up default arg
o1 = t.tempinst.tdtypes[i];
}
else if (i >= tp.tempinst.tiargs.dim)
break;
if (i >= tp.tempinst.tiargs.dim)
{
size_t dim = tempdecl.parameters.dim - (tempdecl.isVariadic() ? 1 : 0);
while (i < dim && ((*tempdecl.parameters)[i].dependent || (*tempdecl.parameters)[i].hasDefaultArg()))
{
i++;
}
if (i >= dim)
break;
// match if all remained parameters are dependent
goto Lnomatch;
}
RootObject o2 = (*tp.tempinst.tiargs)[i];
Type t2 = isType(o2);
size_t j;
if (t2 && t2.ty == Tident && i == tp.tempinst.tiargs.dim - 1 && (j = templateParameterLookup(t2, parameters), j != IDX_NOTFOUND) && j == parameters.dim - 1 && (*parameters)[j].isTemplateTupleParameter())
{
/* Given:
* struct A(B...) {}
* alias A!(int, float) X;
* static if (is(X Y == A!(Z), Z...)) {}
* deduce that Z is a tuple(int, float)
*/
/* Create tuple from remaining args
*/
auto vt = new Tuple();
size_t vtdim = (tempdecl.isVariadic() ? t.tempinst.tiargs.dim : t.tempinst.tdtypes.dim) - i;
vt.objects.setDim(vtdim);
for (size_t k = 0; k < vtdim; k++)
{
RootObject o;
if (k < t.tempinst.tiargs.dim)
o = (*t.tempinst.tiargs)[i + k];
else // Pick up default arg
o = t.tempinst.tdtypes[i + k];
vt.objects[k] = o;
}
Tuple v = cast(Tuple)(*dedtypes)[j];
if (v)
{
if (!match(v, vt))
goto Lnomatch;
}
else
(*dedtypes)[j] = vt;
break;
}
else if (!o1)
break;
Type t1 = isType(o1);
Dsymbol s1 = isDsymbol(o1);
Dsymbol s2 = isDsymbol(o2);
Expression e1 = s1 ? getValue(s1) : getValue(isExpression(o1));
Expression e2 = isExpression(o2);
version (none)
{
Tuple v1 = isTuple(o1);
Tuple v2 = isTuple(o2);
if (t1)
printf("t1 = %s\n", t1.toChars());
if (t2)
printf("t2 = %s\n", t2.toChars());
if (e1)
printf("e1 = %s\n", e1.toChars());
if (e2)
printf("e2 = %s\n", e2.toChars());
if (s1)
printf("s1 = %s\n", s1.toChars());
if (s2)
printf("s2 = %s\n", s2.toChars());
if (v1)
printf("v1 = %s\n", v1.toChars());
if (v2)
printf("v2 = %s\n", v2.toChars());
}
if (t1 && t2)
{
if (!deduceType(t1, sc, t2, parameters, dedtypes))
goto Lnomatch;
}
else if (e1 && e2)
{
Le:
e1 = e1.ctfeInterpret();
/* If it is one of the template parameters for this template,
* we should not attempt to interpret it. It already has a value.
*/
if (e2.op == TOKvar && ((cast(VarExp)e2).var.storage_class & STCtemplateparameter))
{
/*
* (T:Number!(e2), int e2)
*/
j = templateIdentifierLookup((cast(VarExp)e2).var.ident, parameters);
if (j != IDX_NOTFOUND)
goto L1;
// The template parameter was not from this template
// (it may be from a parent template, for example)
}
e2 = e2.semantic(sc); // Bugzilla 13417
e2 = e2.ctfeInterpret();
//printf("e1 = %s, type = %s %d\n", e1->toChars(), e1->type->toChars(), e1->type->ty);
//printf("e2 = %s, type = %s %d\n", e2->toChars(), e2->type->toChars(), e2->type->ty);
if (!e1.equals(e2))
{
if (!e2.implicitConvTo(e1.type))
goto Lnomatch;
e2 = e2.implicitCastTo(sc, e1.type);
e2 = e2.ctfeInterpret();
if (!e1.equals(e2))
goto Lnomatch;
}
}
else if (e1 && t2 && t2.ty == Tident)
{
j = templateParameterLookup(t2, parameters);
L1:
if (j == IDX_NOTFOUND)
{
t2.resolve((cast(TypeIdentifier)t2).loc, sc, &e2, &t2, &s2);
if (e2)
goto Le;
goto Lnomatch;
}
if (!(*parameters)[j].matchArg(sc, e1, j, parameters, dedtypes, null))
goto Lnomatch;
}
else if (s1 && s2)
{
Ls:
if (!s1.equals(s2))
goto Lnomatch;
}
else if (s1 && t2 && t2.ty == Tident)
{
j = templateParameterLookup(t2, parameters);
if (j == IDX_NOTFOUND)
{
t2.resolve((cast(TypeIdentifier)t2).loc, sc, &e2, &t2, &s2);
if (s2)
goto Ls;
goto Lnomatch;
}
if (!(*parameters)[j].matchArg(sc, s1, j, parameters, dedtypes, null))
goto Lnomatch;
}
else
goto Lnomatch;
}
}
visit(cast(Type)t);
return;
Lnomatch:
//printf("no match\n");
result = MATCHnomatch;
}
void visit(TypeStruct t)
{
version (none)
{
printf("TypeStruct::deduceType()\n");
printf("\tthis->parent = %s, ", t.sym.parent.toChars());
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
/* If this struct is a template struct, and we're matching
* it against a template instance, convert the struct type
* to a template instance, too, and try again.
*/
TemplateInstance ti = t.sym.parent.isTemplateInstance();
if (tparam && tparam.ty == Tinstance)
{
if (ti && ti.toAlias() == t.sym)
{
auto tx = new TypeInstance(Loc(), ti);
result = deduceType(tx, sc, tparam, parameters, dedtypes, wm);
return;
}
/* Match things like:
* S!(T).foo
*/
TypeInstance tpi = cast(TypeInstance)tparam;
if (tpi.idents.dim)
{
RootObject id = tpi.idents[tpi.idents.dim - 1];
if (id.dyncast() == DYNCAST_IDENTIFIER && t.sym.ident.equals(cast(Identifier)id))
{
Type tparent = t.sym.parent.getType();
if (tparent)
{
/* Slice off the .foo in S!(T).foo
*/
tpi.idents.dim--;
result = deduceType(tparent, sc, tpi, parameters, dedtypes, wm);
tpi.idents.dim++;
return;
}
}
}
}
// Extra check
if (tparam && tparam.ty == Tstruct)
{
TypeStruct tp = cast(TypeStruct)tparam;
//printf("\t%d\n", (MATCH) t->implicitConvTo(tp));
if (wm && t.deduceWild(tparam, false))
{
result = MATCHconst;
return;
}
result = t.implicitConvTo(tp);
return;
}
visit(cast(Type)t);
}
void visit(TypeEnum t)
{
// Extra check
if (tparam && tparam.ty == Tenum)
{
TypeEnum tp = cast(TypeEnum)tparam;
if (t.sym == tp.sym)
visit(cast(Type)t);
else
result = MATCHnomatch;
return;
}
Type tb = t.toBasetype();
if (tb.ty == tparam.ty || tb.ty == Tsarray && tparam.ty == Taarray)
{
result = deduceType(tb, sc, tparam, parameters, dedtypes, wm);
return;
}
visit(cast(Type)t);
}
/* Helper for TypeClass::deduceType().
* Classes can match with implicit conversion to a base class or interface.
* This is complicated, because there may be more than one base class which
* matches. In such cases, one or more parameters remain ambiguous.
* For example,
*
* interface I(X, Y) {}
* class C : I(uint, double), I(char, double) {}
* C x;
* foo(T, U)( I!(T, U) x)
*
* deduces that U is double, but T remains ambiguous (could be char or uint).
*
* Given a baseclass b, and initial deduced types 'dedtypes', this function
* tries to match tparam with b, and also tries all base interfaces of b.
* If a match occurs, numBaseClassMatches is incremented, and the new deduced
* types are ANDed with the current 'best' estimate for dedtypes.
*/
static void deduceBaseClassParameters(BaseClass* b, Scope* sc, Type tparam, TemplateParameters* parameters, Objects* dedtypes, Objects* best, ref int numBaseClassMatches)
{
TemplateInstance parti = b.sym ? b.sym.parent.isTemplateInstance() : null;
if (parti)
{
// Make a temporary copy of dedtypes so we don't destroy it
auto tmpdedtypes = new Objects();
tmpdedtypes.setDim(dedtypes.dim);
memcpy(tmpdedtypes.tdata(), dedtypes.tdata(), dedtypes.dim * (void*).sizeof);
auto t = new TypeInstance(Loc(), parti);
MATCH m = deduceType(t, sc, tparam, parameters, tmpdedtypes);
if (m > MATCHnomatch)
{
// If this is the first ever match, it becomes our best estimate
if (numBaseClassMatches == 0)
memcpy(best.tdata(), tmpdedtypes.tdata(), tmpdedtypes.dim * (void*).sizeof);
else
for (size_t k = 0; k < tmpdedtypes.dim; ++k)
{
// If we've found more than one possible type for a parameter,
// mark it as unknown.
if ((*tmpdedtypes)[k] != (*best)[k])
(*best)[k] = (*dedtypes)[k];
}
++numBaseClassMatches;
}
}
// Now recursively test the inherited interfaces
for (size_t j = 0; j < b.baseInterfaces_dim; ++j)
{
deduceBaseClassParameters(&b.baseInterfaces[j], sc, tparam, parameters, dedtypes, best, numBaseClassMatches);
}
}
void visit(TypeClass t)
{
//printf("TypeClass::deduceType(this = %s)\n", t->toChars());
/* If this class is a template class, and we're matching
* it against a template instance, convert the class type
* to a template instance, too, and try again.
*/
TemplateInstance ti = t.sym.parent.isTemplateInstance();
if (tparam && tparam.ty == Tinstance)
{
if (ti && ti.toAlias() == t.sym)
{
auto tx = new TypeInstance(Loc(), ti);
MATCH m = deduceType(tx, sc, tparam, parameters, dedtypes, wm);
// Even if the match fails, there is still a chance it could match
// a base class.
if (m != MATCHnomatch)
{
result = m;
return;
}
}
/* Match things like:
* S!(T).foo
*/
TypeInstance tpi = cast(TypeInstance)tparam;
if (tpi.idents.dim)
{
RootObject id = tpi.idents[tpi.idents.dim - 1];
if (id.dyncast() == DYNCAST_IDENTIFIER && t.sym.ident.equals(cast(Identifier)id))
{
Type tparent = t.sym.parent.getType();
if (tparent)
{
/* Slice off the .foo in S!(T).foo
*/
tpi.idents.dim--;
result = deduceType(tparent, sc, tpi, parameters, dedtypes, wm);
tpi.idents.dim++;
return;
}
}
}
// If it matches exactly or via implicit conversion, we're done
visit(cast(Type)t);
if (result != MATCHnomatch)
return;
/* There is still a chance to match via implicit conversion to
* a base class or interface. Because there could be more than one such
* match, we need to check them all.
*/
int numBaseClassMatches = 0; // Have we found an interface match?
// Our best guess at dedtypes
auto best = new Objects();
best.setDim(dedtypes.dim);
ClassDeclaration s = t.sym;
while (s && s.baseclasses.dim > 0)
{
// Test the base class
deduceBaseClassParameters((*s.baseclasses)[0], sc, tparam, parameters, dedtypes, best, numBaseClassMatches);
// Test the interfaces inherited by the base class
for (size_t i = 0; i < s.interfaces_dim; ++i)
{
BaseClass* b = s.interfaces[i];
deduceBaseClassParameters(b, sc, tparam, parameters, dedtypes, best, numBaseClassMatches);
}
s = (*s.baseclasses)[0].sym;
}
if (numBaseClassMatches == 0)
{
result = MATCHnomatch;
return;
}
// If we got at least one match, copy the known types into dedtypes
memcpy(dedtypes.tdata(), best.tdata(), best.dim * (void*).sizeof);
result = MATCHconvert;
return;
}
// Extra check
if (tparam && tparam.ty == Tclass)
{
TypeClass tp = cast(TypeClass)tparam;
//printf("\t%d\n", (MATCH) t->implicitConvTo(tp));
if (wm && t.deduceWild(tparam, false))
{
result = MATCHconst;
return;
}
result = t.implicitConvTo(tp);
return;
}
visit(cast(Type)t);
}
void visit(Expression e)
{
//printf("Expression::deduceType(e = %s)\n", e->toChars());
size_t i = templateParameterLookup(tparam, parameters);
if (i == IDX_NOTFOUND || (cast(TypeIdentifier)tparam).idents.dim > 0)
{
if (e == emptyArrayElement && tparam.ty == Tarray)
{
Type tn = (cast(TypeNext)tparam).next;
result = deduceType(emptyArrayElement, sc, tn, parameters, dedtypes, wm);
return;
}
e.type.accept(this);
return;
}
TemplateTypeParameter tp = (*parameters)[i].isTemplateTypeParameter();
if (!tp)
return; // nomatch
if (e == emptyArrayElement)
{
if ((*dedtypes)[i])
{
result = MATCHexact;
return;
}
if (tp.defaultType)
{
tp.defaultType.accept(this);
return;
}
}
Type at = cast(Type)(*dedtypes)[i];
Type tt;
if (ubyte wx = deduceWildHelper(e.type, &tt, tparam))
{
*wm |= wx;
result = MATCHconst;
}
else if (MATCH m = deduceTypeHelper(e.type, &tt, tparam))
{
result = m;
}
else
return; // nomatch
// expression vs (none)
if (!at)
{
(*dedtypes)[i] = new TypeDeduced(tt, e, tparam);
return;
}
TypeDeduced xt = null;
if (at.ty == Tnone)
{
xt = cast(TypeDeduced)at;
at = xt.tded;
}
// From previous matched expressions to current deduced type
MATCH match1 = xt ? xt.matchAll(tt) : MATCHnomatch;
// From current expresssion to previous deduced type
Type pt = at.addMod(tparam.mod);
if (*wm)
pt = pt.substWildTo(*wm);
MATCH match2 = e.implicitConvTo(pt);
if (match1 > MATCHnomatch && match2 > MATCHnomatch)
{
if (at.implicitConvTo(tt) <= MATCHnomatch)
match1 = MATCHnomatch; // Prefer at
else if (tt.implicitConvTo(at) <= MATCHnomatch)
match2 = MATCHnomatch; // Prefer tt
else if (tt.isTypeBasic() && tt.ty == at.ty && tt.mod != at.mod)
{
if (!tt.isMutable() && !at.isMutable())
tt = tt.mutableOf().addMod(MODmerge(tt.mod, at.mod));
else if (tt.isMutable())
{
if (at.mod == 0) // Prefer unshared
match1 = MATCHnomatch;
else
match2 = MATCHnomatch;
}
else if (at.isMutable())
{
if (tt.mod == 0) // Prefer unshared
match2 = MATCHnomatch;
else
match1 = MATCHnomatch;
}
//printf("tt = %s, at = %s\n", tt->toChars(), at->toChars());
}
else
{
match1 = MATCHnomatch;
match2 = MATCHnomatch;
}
}
if (match1 > MATCHnomatch)
{
// Prefer current match: tt
if (xt)
xt.update(tt, e, tparam);
else
(*dedtypes)[i] = tt;
result = match1;
return;
}
if (match2 > MATCHnomatch)
{
// Prefer previous match: (*dedtypes)[i]
if (xt)
xt.update(e, tparam);
result = match2;
return;
}
/* Deduce common type
*/
if (Type t = rawTypeMerge(at, tt))
{
if (xt)
xt.update(t, e, tparam);
else
(*dedtypes)[i] = t;
pt = tt.addMod(tparam.mod);
if (*wm)
pt = pt.substWildTo(*wm);
result = e.implicitConvTo(pt);
return;
}
result = MATCHnomatch;
}
MATCH deduceEmptyArrayElement()
{
if (!emptyArrayElement)
{
emptyArrayElement = new IdentifierExp(Loc(), Id.p); // dummy
emptyArrayElement.type = Type.tvoid;
}
assert(tparam.ty == Tarray);
Type tn = (cast(TypeNext)tparam).next;
return deduceType(emptyArrayElement, sc, tn, parameters, dedtypes, wm);
}
void visit(NullExp e)
{
if (tparam.ty == Tarray && e.type.ty == Tnull)
{
// tparam:T[] <- e:null (void[])
result = deduceEmptyArrayElement();
return;
}
visit(cast(Expression)e);
}
void visit(StringExp e)
{
Type taai;
if (e.type.ty == Tarray && (tparam.ty == Tsarray || tparam.ty == Taarray && (taai = (cast(TypeAArray)tparam).index).ty == Tident && (cast(TypeIdentifier)taai).idents.dim == 0))
{
// Consider compile-time known boundaries
e.type.nextOf().sarrayOf(e.len).accept(this);
return;
}
visit(cast(Expression)e);
}
void visit(ArrayLiteralExp e)
{
if ((!e.elements || !e.elements.dim) && e.type.toBasetype().nextOf().ty == Tvoid && tparam.ty == Tarray)
{
// tparam:T[] <- e:[] (void[])
result = deduceEmptyArrayElement();
return;
}
if (tparam.ty == Tarray && e.elements && e.elements.dim)
{
Type tn = (cast(TypeDArray)tparam).next;
result = MATCHexact;
for (size_t i = 0; i < e.elements.dim; i++)
{
MATCH m = deduceType((*e.elements)[i], sc, tn, parameters, dedtypes, wm);
if (m < result)
result = m;
if (result <= MATCHnomatch)
break;
}
return;
}
Type taai;
if (e.type.ty == Tarray && (tparam.ty == Tsarray || tparam.ty == Taarray && (taai = (cast(TypeAArray)tparam).index).ty == Tident && (cast(TypeIdentifier)taai).idents.dim == 0))
{
// Consider compile-time known boundaries
e.type.nextOf().sarrayOf(e.elements.dim).accept(this);
return;
}
visit(cast(Expression)e);
}
void visit(AssocArrayLiteralExp e)
{
if (tparam.ty == Taarray && e.keys && e.keys.dim)
{
TypeAArray taa = cast(TypeAArray)tparam;
result = MATCHexact;
for (size_t i = 0; i < e.keys.dim; i++)
{
MATCH m1 = deduceType((*e.keys)[i], sc, taa.index, parameters, dedtypes, wm);
if (m1 < result)
result = m1;
if (result <= MATCHnomatch)
break;
MATCH m2 = deduceType((*e.values)[i], sc, taa.next, parameters, dedtypes, wm);
if (m2 < result)
result = m2;
if (result <= MATCHnomatch)
break;
}
return;
}
visit(cast(Expression)e);
}
void visit(FuncExp e)
{
//printf("e->type = %s, tparam = %s\n", e->type->toChars(), tparam->toChars());
if (e.td)
{
Type to = tparam;
if (!to.nextOf() || to.nextOf().ty != Tfunction)
return;
TypeFunction tof = cast(TypeFunction)to.nextOf();
// Parameter types inference from 'tof'
assert(e.td._scope);
TypeFunction tf = cast(TypeFunction)e.fd.type;
//printf("\ttof = %s\n", tof->toChars());
//printf("\ttf = %s\n", tf->toChars());
size_t dim = Parameter.dim(tf.parameters);
if (Parameter.dim(tof.parameters) != dim || tof.varargs != tf.varargs)
return;
auto tiargs = new Objects();
tiargs.reserve(e.td.parameters.dim);
for (size_t i = 0; i < e.td.parameters.dim; i++)
{
TemplateParameter tp = (*e.td.parameters)[i];
size_t u = 0;
for (; u < dim; u++)
{
Parameter p = Parameter.getNth(tf.parameters, u);
if (p.type.ty == Tident && (cast(TypeIdentifier)p.type).ident == tp.ident)
{
break;
}
}
assert(u < dim);
Parameter pto = Parameter.getNth(tof.parameters, u);
if (!pto)
break;
Type t = pto.type.syntaxCopy(); // Bugzilla 11774
if (reliesOnTident(t, parameters, inferStart))
return;
t = t.semantic(e.loc, sc);
if (t.ty == Terror)
return;
tiargs.push(t);
}
// Set target of return type inference
if (!tf.next && tof.next)
e.fd.treq = tparam;
auto ti = new TemplateInstance(e.loc, e.td, tiargs);
Expression ex = (new ScopeExp(e.loc, ti)).semantic(e.td._scope);
// Reset inference target for the later re-semantic
e.fd.treq = null;
if (ex.op == TOKerror)
return;
if (ex.op != TOKfunction)
return;
visit(ex.type);
return;
}
Type t = e.type;
if (t.ty == Tdelegate && tparam.ty == Tpointer)
return;
// Allow conversion from implicit function pointer to delegate
if (e.tok == TOKreserved && t.ty == Tpointer && tparam.ty == Tdelegate)
{
TypeFunction tf = cast(TypeFunction)t.nextOf();
t = (new TypeDelegate(tf)).merge();
}
//printf("tparam = %s <= e->type = %s, t = %s\n", tparam->toChars(), e->type->toChars(), t->toChars());
visit(t);
}
void visit(SliceExp e)
{
Type taai;
if (e.type.ty == Tarray && (tparam.ty == Tsarray || tparam.ty == Taarray && (taai = (cast(TypeAArray)tparam).index).ty == Tident && (cast(TypeIdentifier)taai).idents.dim == 0))
{
// Consider compile-time known boundaries
if (Type tsa = toStaticArrayType(e))
{
tsa.accept(this);
return;
}
}
visit(cast(Expression)e);
}
void visit(CommaExp e)
{
(cast(CommaExp)e).e2.accept(this);
}
}
scope DeduceType v = new DeduceType(sc, tparam, parameters, dedtypes, wm, inferStart);
if (Type t = isType(o))
t.accept(v);
else
{
assert(isExpression(o) && wm);
(cast(Expression)o).accept(v);
}
return v.result;
}
/*******************************
* Input:
* t Tested type, if NULL, returns NULL.
* tparams Optional template parameters.
* == NULL:
* If one of the subtypes of this type is a TypeIdentifier,
* i.e. it's an unresolved type, return that type.
* != NULL:
* Only when the TypeIdentifier is one of template parameters,
* return that type.
*/
extern (C++) Type reliesOnTident(Type t, TemplateParameters* tparams = null, size_t iStart = 0)
{
extern (C++) final class ReliesOnTident : Visitor
{
alias visit = super.visit;
public:
TemplateParameters* tparams;
size_t iStart;
Type result;
extern (D) this(TemplateParameters* tparams, size_t iStart)
{
this.tparams = tparams;
this.iStart = iStart;
result = null;
}
void visit(Type t)
{
}
void visit(TypeNext t)
{
t.next.accept(this);
}
void visit(TypeVector t)
{
t.basetype.accept(this);
}
void visit(TypeAArray t)
{
visit(cast(TypeNext)t);
if (!result)
t.index.accept(this);
}
void visit(TypeFunction t)
{
size_t dim = Parameter.dim(t.parameters);
for (size_t i = 0; i < dim; i++)
{
Parameter fparam = Parameter.getNth(t.parameters, i);
fparam.type.accept(this);
if (result)
return;
}
if (t.next)
t.next.accept(this);
}
void visit(TypeIdentifier t)
{
if (!tparams)
{
result = t;
return;
}
for (size_t i = iStart; i < tparams.dim; i++)
{
TemplateParameter tp = (*tparams)[i];
if (tp.ident.equals(t.ident))
{
result = t;
return;
}
}
}
void visit(TypeInstance t)
{
if (!tparams)
return;
for (size_t i = iStart; i < tparams.dim; i++)
{
TemplateParameter tp = (*tparams)[i];
if (t.tempinst.name == tp.ident)
{
result = t;
return;
}
}
if (!t.tempinst.tiargs)
return;
for (size_t i = 0; i < t.tempinst.tiargs.dim; i++)
{
Type ta = isType((*t.tempinst.tiargs)[i]);
if (ta)
{
ta.accept(this);
if (result)
return;
}
}
}
void visit(TypeTuple t)
{
if (t.arguments)
{
for (size_t i = 0; i < t.arguments.dim; i++)
{
Parameter arg = (*t.arguments)[i];
arg.type.accept(this);
if (result)
return;
}
}
}
}
if (!t)
return null;
scope ReliesOnTident v = new ReliesOnTident(tparams, iStart);
t.accept(v);
return v.result;
}
/* For type-parameter:
* template Foo(ident) // specType is set to NULL
* template Foo(ident : specType)
* For value-parameter:
* template Foo(valType ident) // specValue is set to NULL
* template Foo(valType ident : specValue)
* For alias-parameter:
* template Foo(alias ident)
* For this-parameter:
* template Foo(this ident)
*/
extern (C++) class TemplateParameter
{
public:
Loc loc;
Identifier ident;
/* True if this is a part of precedent parameter specialization pattern.
*
* template A(T : X!TL, alias X, TL...) {}
* // X and TL are dependent template parameter
*
* A dependent template parameter should return MATCHexact in matchArg()
* to respect the match level of the corresponding precedent parameter.
*/
bool dependent;
/* ======================== TemplateParameter =============================== */
final extern (D) this(Loc loc, Identifier ident)
{
this.loc = loc;
this.ident = ident;
this.dependent = false;
}
TemplateTypeParameter isTemplateTypeParameter()
{
return null;
}
TemplateValueParameter isTemplateValueParameter()
{
return null;
}
TemplateAliasParameter isTemplateAliasParameter()
{
return null;
}
TemplateThisParameter isTemplateThisParameter()
{
return null;
}
TemplateTupleParameter isTemplateTupleParameter()
{
return null;
}
abstract TemplateParameter syntaxCopy();
abstract bool declareParameter(Scope* sc);
abstract bool semantic(Scope* sc, TemplateParameters* parameters);
abstract void print(RootObject oarg, RootObject oded);
abstract RootObject specialization();
abstract RootObject defaultArg(Loc instLoc, Scope* sc);
abstract bool hasDefaultArg();
/*******************************************
* Match to a particular TemplateParameter.
* Input:
* instLoc location that the template is instantiated.
* tiargs[] actual arguments to template instance
* i i'th argument
* parameters[] template parameters
* dedtypes[] deduced arguments to template instance
* *psparam set to symbol declared and initialized to dedtypes[i]
*/
MATCH matchArg(Loc instLoc, Scope* sc, Objects* tiargs, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
RootObject oarg;
if (i < tiargs.dim)
oarg = (*tiargs)[i];
else
{
// Get default argument instead
oarg = defaultArg(instLoc, sc);
if (!oarg)
{
assert(i < dedtypes.dim);
// It might have already been deduced
oarg = (*dedtypes)[i];
if (!oarg)
goto Lnomatch;
}
}
return matchArg(sc, oarg, i, parameters, dedtypes, psparam);
Lnomatch:
if (psparam)
*psparam = null;
return MATCHnomatch;
}
abstract MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam);
/* Create dummy argument based on parameter.
*/
abstract void* dummyArg();
void accept(Visitor v)
{
v.visit(this);
}
}
/* Syntax:
* ident : specType = defaultType
*/
extern (C++) class TemplateTypeParameter : TemplateParameter
{
public:
Type specType; // type parameter: if !=NULL, this is the type specialization
Type defaultType;
/* ======================== TemplateTypeParameter =========================== */
// type-parameter
extern (C++) static __gshared Type tdummy = null;
final extern (D) this(Loc loc, Identifier ident, Type specType, Type defaultType)
{
super(loc, ident);
this.ident = ident;
this.specType = specType;
this.defaultType = defaultType;
}
final TemplateTypeParameter isTemplateTypeParameter()
{
return this;
}
TemplateParameter syntaxCopy()
{
return new TemplateTypeParameter(loc, ident, specType ? specType.syntaxCopy() : null, defaultType ? defaultType.syntaxCopy() : null);
}
final bool declareParameter(Scope* sc)
{
//printf("TemplateTypeParameter::declareParameter('%s')\n", ident->toChars());
auto ti = new TypeIdentifier(loc, ident);
Declaration ad = new AliasDeclaration(loc, ident, ti);
return sc.insert(ad) !is null;
}
final bool semantic(Scope* sc, TemplateParameters* parameters)
{
//printf("TemplateTypeParameter::semantic('%s')\n", ident->toChars());
if (specType && !reliesOnTident(specType, parameters))
{
specType = specType.semantic(loc, sc);
}
version (none)
{
// Don't do semantic() until instantiation
if (defaultType)
{
defaultType = defaultType.semantic(loc, sc);
}
}
return !(specType && isError(specType));
}
final void print(RootObject oarg, RootObject oded)
{
printf(" %s\n", ident.toChars());
Type t = isType(oarg);
Type ta = isType(oded);
assert(ta);
if (specType)
printf("\tSpecialization: %s\n", specType.toChars());
if (defaultType)
printf("\tDefault: %s\n", defaultType.toChars());
printf("\tParameter: %s\n", t ? t.toChars() : "NULL");
printf("\tDeduced Type: %s\n", ta.toChars());
}
final RootObject specialization()
{
return specType;
}
final RootObject defaultArg(Loc instLoc, Scope* sc)
{
Type t = defaultType;
if (t)
{
t = t.syntaxCopy();
t = t.semantic(loc, sc); // use the parameter loc
}
return t;
}
final bool hasDefaultArg()
{
return defaultType !is null;
}
final MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
//printf("TemplateTypeParameter::matchArg('%s')\n", ident->toChars());
MATCH m = MATCHexact;
Type ta = isType(oarg);
if (!ta)
{
//printf("%s %p %p %p\n", oarg->toChars(), isExpression(oarg), isDsymbol(oarg), isTuple(oarg));
goto Lnomatch;
}
//printf("ta is %s\n", ta->toChars());
if (specType)
{
if (!ta || ta == tdummy)
goto Lnomatch;
//printf("\tcalling deduceType(): ta is %s, specType is %s\n", ta->toChars(), specType->toChars());
MATCH m2 = deduceType(ta, sc, specType, parameters, dedtypes);
if (m2 <= MATCHnomatch)
{
//printf("\tfailed deduceType\n");
goto Lnomatch;
}
if (m2 < m)
m = m2;
if ((*dedtypes)[i])
{
Type t = cast(Type)(*dedtypes)[i];
if (dependent && !t.equals(ta)) // Bugzilla 14357
goto Lnomatch;
/* This is a self-dependent parameter. For example:
* template X(T : T*) {}
* template X(T : S!T, alias S) {}
*/
//printf("t = %s ta = %s\n", t->toChars(), ta->toChars());
ta = t;
}
}
else
{
if ((*dedtypes)[i])
{
// Must match already deduced type
Type t = cast(Type)(*dedtypes)[i];
if (!t.equals(ta))
{
//printf("t = %s ta = %s\n", t->toChars(), ta->toChars());
goto Lnomatch;
}
}
else
{
// So that matches with specializations are better
m = MATCHconvert;
}
}
(*dedtypes)[i] = ta;
if (psparam)
*psparam = new AliasDeclaration(loc, ident, ta);
//printf("\tm = %d\n", m);
return dependent ? MATCHexact : m;
Lnomatch:
if (psparam)
*psparam = null;
//printf("\tm = %d\n", MATCHnomatch);
return MATCHnomatch;
}
final void* dummyArg()
{
Type t = specType;
if (!t)
{
// Use this for alias-parameter's too (?)
if (!tdummy)
tdummy = new TypeIdentifier(loc, ident);
t = tdummy;
}
return cast(void*)t;
}
void accept(Visitor v)
{
v.visit(this);
}
}
/* Syntax:
* this ident : specType = defaultType
*/
extern (C++) final class TemplateThisParameter : TemplateTypeParameter
{
public:
/* ======================== TemplateThisParameter =========================== */
// this-parameter
extern (D) this(Loc loc, Identifier ident, Type specType, Type defaultType)
{
super(loc, ident, specType, defaultType);
}
TemplateThisParameter isTemplateThisParameter()
{
return this;
}
TemplateParameter syntaxCopy()
{
return new TemplateThisParameter(loc, ident, specType ? specType.syntaxCopy() : null, defaultType ? defaultType.syntaxCopy() : null);
}
void accept(Visitor v)
{
v.visit(this);
}
}
/* Syntax:
* valType ident : specValue = defaultValue
*/
extern (C++) final class TemplateValueParameter : TemplateParameter
{
public:
Type valType;
Expression specValue;
Expression defaultValue;
/* ======================== TemplateValueParameter ========================== */
// value-parameter
extern (C++) static __gshared AA* edummies = null;
extern (D) this(Loc loc, Identifier ident, Type valType, Expression specValue, Expression defaultValue)
{
super(loc, ident);
this.ident = ident;
this.valType = valType;
this.specValue = specValue;
this.defaultValue = defaultValue;
}
TemplateValueParameter isTemplateValueParameter()
{
return this;
}
TemplateParameter syntaxCopy()
{
return new TemplateValueParameter(loc, ident, valType.syntaxCopy(), specValue ? specValue.syntaxCopy() : null, defaultValue ? defaultValue.syntaxCopy() : null);
}
bool declareParameter(Scope* sc)
{
auto v = new VarDeclaration(loc, valType, ident, null);
v.storage_class = STCtemplateparameter;
return sc.insert(v) !is null;
}
bool semantic(Scope* sc, TemplateParameters* parameters)
{
valType = valType.semantic(loc, sc);
version (none)
{
// defer semantic analysis to arg match
if (specValue)
{
Expression e = specValue;
sc = sc.startCTFE();
e = e.semantic(sc);
sc = sc.endCTFE();
e = e.implicitCastTo(sc, valType);
e = e.ctfeInterpret();
if (e.op == TOKint64 || e.op == TOKfloat64 || e.op == TOKcomplex80 || e.op == TOKnull || e.op == TOKstring)
specValue = e;
//e->toInteger();
}
if (defaultValue)
{
Expression e = defaultValue;
sc = sc.startCTFE();
e = e.semantic(sc);
sc = sc.endCTFE();
e = e.implicitCastTo(sc, valType);
e = e.ctfeInterpret();
if (e.op == TOKint64)
defaultValue = e;
//e->toInteger();
}
}
return !isError(valType);
}
void print(RootObject oarg, RootObject oded)
{
printf(" %s\n", ident.toChars());
Expression ea = isExpression(oded);
if (specValue)
printf("\tSpecialization: %s\n", specValue.toChars());
printf("\tParameter Value: %s\n", ea ? ea.toChars() : "NULL");
}
RootObject specialization()
{
return specValue;
}
RootObject defaultArg(Loc instLoc, Scope* sc)
{
Expression e = defaultValue;
if (e)
{
e = e.syntaxCopy();
e = e.semantic(sc);
e = resolveProperties(sc, e);
e = e.resolveLoc(instLoc, sc); // use the instantiated loc
e = e.optimize(WANTvalue);
}
return e;
}
bool hasDefaultArg()
{
return defaultValue !is null;
}
MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
//printf("TemplateValueParameter::matchArg('%s')\n", ident->toChars());
MATCH m = MATCHexact;
Expression ei = isExpression(oarg);
Type vt;
if (!ei && oarg)
{
Dsymbol si = isDsymbol(oarg);
FuncDeclaration f = si ? si.isFuncDeclaration() : null;
if (!f || !f.fbody || f.needThis())
goto Lnomatch;
ei = new VarExp(loc, f);
ei = ei.semantic(sc);
/* If a function is really property-like, and then
* it's CTFEable, ei will be a literal expression.
*/
uint olderrors = global.startGagging();
ei = resolveProperties(sc, ei);
ei = ei.ctfeInterpret();
if (global.endGagging(olderrors) || ei.op == TOKerror)
goto Lnomatch;
/* Bugzilla 14520: A property-like function can match to both
* TemplateAlias and ValueParameter. But for template overloads,
* it should always prefer alias parameter to be consistent
* template match result.
*
* template X(alias f) { enum X = 1; }
* template X(int val) { enum X = 2; }
* int f1() { return 0; } // CTFEable
* int f2(); // body-less function is not CTFEable
* enum x1 = X!f1; // should be 1
* enum x2 = X!f2; // should be 1
*
* e.g. The x1 value must be same even if the f1 definition will be moved
* into di while stripping body code.
*/
m = MATCHconvert;
}
if (ei && ei.op == TOKvar)
{
// Resolve const variables that we had skipped earlier
ei = ei.ctfeInterpret();
}
//printf("\tvalType: %s, ty = %d\n", valType->toChars(), valType->ty);
vt = valType.semantic(loc, sc);
//printf("ei: %s, ei->type: %s\n", ei->toChars(), ei->type->toChars());
//printf("vt = %s\n", vt->toChars());
if (ei.type)
{
MATCH m2 = ei.implicitConvTo(vt);
//printf("m: %d\n", m);
if (m2 < m)
m = m2;
if (m <= MATCHnomatch)
goto Lnomatch;
ei = ei.implicitCastTo(sc, vt);
ei = ei.ctfeInterpret();
}
if (specValue)
{
if (!ei || cast(Expression)dmd_aaGetRvalue(edummies, cast(void*)ei.type) == ei)
goto Lnomatch;
Expression e = specValue;
sc = sc.startCTFE();
e = e.semantic(sc);
e = resolveProperties(sc, e);
sc = sc.endCTFE();
e = e.implicitCastTo(sc, vt);
e = e.ctfeInterpret();
ei = ei.syntaxCopy();
sc = sc.startCTFE();
ei = ei.semantic(sc);
sc = sc.endCTFE();
ei = ei.implicitCastTo(sc, vt);
ei = ei.ctfeInterpret();
//printf("\tei: %s, %s\n", ei->toChars(), ei->type->toChars());
//printf("\te : %s, %s\n", e->toChars(), e->type->toChars());
if (!ei.equals(e))
goto Lnomatch;
}
else
{
if ((*dedtypes)[i])
{
// Must match already deduced value
Expression e = cast(Expression)(*dedtypes)[i];
if (!ei || !ei.equals(e))
goto Lnomatch;
}
}
(*dedtypes)[i] = ei;
if (psparam)
{
Initializer _init = new ExpInitializer(loc, ei);
Declaration sparam = new VarDeclaration(loc, vt, ident, _init);
sparam.storage_class = STCmanifest;
*psparam = sparam;
}
return dependent ? MATCHexact : m;
Lnomatch:
//printf("\tno match\n");
if (psparam)
*psparam = null;
return MATCHnomatch;
}
void* dummyArg()
{
Expression e = specValue;
if (!e)
{
// Create a dummy value
Expression* pe = cast(Expression*)dmd_aaGet(&edummies, cast(void*)valType);
if (!*pe)
*pe = valType.defaultInit();
e = *pe;
}
return cast(void*)e;
}
void accept(Visitor v)
{
v.visit(this);
}
}
extern (C++) RootObject aliasParameterSemantic(Loc loc, Scope* sc, RootObject o, TemplateParameters* parameters)
{
if (o)
{
Expression ea = isExpression(o);
Type ta = isType(o);
if (ta && (!parameters || !reliesOnTident(ta, parameters)))
{
Dsymbol s = ta.toDsymbol(sc);
if (s)
o = s;
else
o = ta.semantic(loc, sc);
}
else if (ea)
{
sc = sc.startCTFE();
ea = ea.semantic(sc);
sc = sc.endCTFE();
o = ea.ctfeInterpret();
}
}
return o;
}
/* Syntax:
* specType ident : specAlias = defaultAlias
*/
extern (C++) final class TemplateAliasParameter : TemplateParameter
{
public:
Type specType;
RootObject specAlias;
RootObject defaultAlias;
/* ======================== TemplateAliasParameter ========================== */
// alias-parameter
extern (C++) static __gshared Dsymbol sdummy = null;
extern (D) this(Loc loc, Identifier ident, Type specType, RootObject specAlias, RootObject defaultAlias)
{
super(loc, ident);
this.ident = ident;
this.specType = specType;
this.specAlias = specAlias;
this.defaultAlias = defaultAlias;
}
TemplateAliasParameter isTemplateAliasParameter()
{
return this;
}
TemplateParameter syntaxCopy()
{
return new TemplateAliasParameter(loc, ident, specType ? specType.syntaxCopy() : null, objectSyntaxCopy(specAlias), objectSyntaxCopy(defaultAlias));
}
bool declareParameter(Scope* sc)
{
auto ti = new TypeIdentifier(loc, ident);
Declaration ad = new AliasDeclaration(loc, ident, ti);
return sc.insert(ad) !is null;
}
bool semantic(Scope* sc, TemplateParameters* parameters)
{
if (specType && !reliesOnTident(specType, parameters))
{
specType = specType.semantic(loc, sc);
}
specAlias = aliasParameterSemantic(loc, sc, specAlias, parameters);
version (none)
{
// Don't do semantic() until instantiation
if (defaultAlias)
defaultAlias = defaultAlias.semantic(loc, sc);
}
return !(specType && isError(specType)) && !(specAlias && isError(specAlias));
}
void print(RootObject oarg, RootObject oded)
{
printf(" %s\n", ident.toChars());
Dsymbol sa = isDsymbol(oded);
assert(sa);
printf("\tParameter alias: %s\n", sa.toChars());
}
RootObject specialization()
{
return specAlias;
}
RootObject defaultArg(Loc instLoc, Scope* sc)
{
RootObject da = defaultAlias;
Type ta = isType(defaultAlias);
if (ta)
{
if (ta.ty == Tinstance)
{
// If the default arg is a template, instantiate for each type
da = ta.syntaxCopy();
}
}
RootObject o = aliasParameterSemantic(loc, sc, da, null); // use the parameter loc
return o;
}
bool hasDefaultArg()
{
return defaultAlias !is null;
}
MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
//printf("TemplateAliasParameter::matchArg('%s')\n", ident->toChars());
MATCH m = MATCHexact;
Type ta = isType(oarg);
RootObject sa = ta && !ta.deco ? null : getDsymbol(oarg);
Expression ea = isExpression(oarg);
if (ea && (ea.op == TOKthis || ea.op == TOKsuper))
sa = (cast(ThisExp)ea).var;
else if (ea && ea.op == TOKimport)
sa = (cast(ScopeExp)ea).sds;
if (sa)
{
if ((cast(Dsymbol)sa).isAggregateDeclaration())
m = MATCHconvert;
/* specType means the alias must be a declaration with a type
* that matches specType.
*/
if (specType)
{
Declaration d = (cast(Dsymbol)sa).isDeclaration();
if (!d)
goto Lnomatch;
if (!d.type.equals(specType))
goto Lnomatch;
}
}
else
{
sa = oarg;
if (ea)
{
if (specType)
{
if (!ea.type.equals(specType))
goto Lnomatch;
}
}
else if (ta && ta.ty == Tinstance && !specAlias)
{
/* Bugzilla xxxxx: Specialized parameter should be prefeerd
* match to the template type parameter.
* template X(alias a) {} // a == this
* template X(alias a : B!A, alias B, A...) {} // B!A => ta
*/
}
else if (sa && sa == TemplateTypeParameter.tdummy)
{
/* Bugzilla 2025: Aggregate Types should preferentially
* match to the template type parameter.
* template X(alias a) {} // a == this
* template X(T) {} // T => sa
*/
}
else
goto Lnomatch;
}
if (specAlias)
{
if (sa == sdummy)
goto Lnomatch;
Dsymbol sx = isDsymbol(sa);
if (sa != specAlias && sx)
{
Type talias = isType(specAlias);
if (!talias)
goto Lnomatch;
TemplateInstance ti = sx.isTemplateInstance();
if (!ti && sx.parent)
{
ti = sx.parent.isTemplateInstance();
if (ti && ti.name != sx.ident)
goto Lnomatch;
}
if (!ti)
goto Lnomatch;
Type t = new TypeInstance(Loc(), ti);
MATCH m2 = deduceType(t, sc, talias, parameters, dedtypes);
if (m2 <= MATCHnomatch)
goto Lnomatch;
}
}
else if ((*dedtypes)[i])
{
// Must match already deduced symbol
RootObject si = (*dedtypes)[i];
if (!sa || si != sa)
goto Lnomatch;
}
(*dedtypes)[i] = sa;
if (psparam)
{
if (Dsymbol s = isDsymbol(sa))
{
*psparam = new AliasDeclaration(loc, ident, s);
}
else if (Type t = isType(sa))
{
*psparam = new AliasDeclaration(loc, ident, t);
}
else
{
assert(ea);
// Declare manifest constant
Initializer _init = new ExpInitializer(loc, ea);
auto v = new VarDeclaration(loc, null, ident, _init);
v.storage_class = STCmanifest;
v.semantic(sc);
*psparam = v;
}
}
return dependent ? MATCHexact : m;
Lnomatch:
if (psparam)
*psparam = null;
//printf("\tm = %d\n", MATCHnomatch);
return MATCHnomatch;
}
void* dummyArg()
{
RootObject s = specAlias;
if (!s)
{
if (!sdummy)
sdummy = new Dsymbol();
s = sdummy;
}
return cast(void*)s;
}
void accept(Visitor v)
{
v.visit(this);
}
}
/* Syntax:
* ident ...
*/
extern (C++) final class TemplateTupleParameter : TemplateParameter
{
public:
/* ======================== TemplateTupleParameter ========================== */
// variadic-parameter
extern (D) this(Loc loc, Identifier ident)
{
super(loc, ident);
this.ident = ident;
}
TemplateTupleParameter isTemplateTupleParameter()
{
return this;
}
TemplateParameter syntaxCopy()
{
return new TemplateTupleParameter(loc, ident);
}
bool declareParameter(Scope* sc)
{
auto ti = new TypeIdentifier(loc, ident);
Declaration ad = new AliasDeclaration(loc, ident, ti);
return sc.insert(ad) !is null;
}
bool semantic(Scope* sc, TemplateParameters* parameters)
{
return true;
}
void print(RootObject oarg, RootObject oded)
{
printf(" %s... [", ident.toChars());
Tuple v = isTuple(oded);
assert(v);
//printf("|%d| ", v->objects.dim);
for (size_t i = 0; i < v.objects.dim; i++)
{
if (i)
printf(", ");
RootObject o = v.objects[i];
Dsymbol sa = isDsymbol(o);
if (sa)
printf("alias: %s", sa.toChars());
Type ta = isType(o);
if (ta)
printf("type: %s", ta.toChars());
Expression ea = isExpression(o);
if (ea)
printf("exp: %s", ea.toChars());
assert(!isTuple(o)); // no nested Tuple arguments
}
printf("]\n");
}
RootObject specialization()
{
return null;
}
RootObject defaultArg(Loc instLoc, Scope* sc)
{
return null;
}
bool hasDefaultArg()
{
return false;
}
MATCH matchArg(Loc instLoc, Scope* sc, Objects* tiargs, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
/* The rest of the actual arguments (tiargs[]) form the match
* for the variadic parameter.
*/
assert(i + 1 == dedtypes.dim); // must be the last one
Tuple ovar;
if (Tuple u = isTuple((*dedtypes)[i]))
{
// It has already been deduced
ovar = u;
}
else if (i + 1 == tiargs.dim && isTuple((*tiargs)[i]))
ovar = isTuple((*tiargs)[i]);
else
{
ovar = new Tuple();
//printf("ovar = %p\n", ovar);
if (i < tiargs.dim)
{
//printf("i = %d, tiargs->dim = %d\n", i, tiargs->dim);
ovar.objects.setDim(tiargs.dim - i);
for (size_t j = 0; j < ovar.objects.dim; j++)
ovar.objects[j] = (*tiargs)[i + j];
}
}
return matchArg(sc, ovar, i, parameters, dedtypes, psparam);
}
MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
//printf("TemplateTupleParameter::matchArg('%s')\n", ident->toChars());
Tuple ovar = isTuple(oarg);
if (!ovar)
return MATCHnomatch;
if ((*dedtypes)[i])
{
Tuple tup = isTuple((*dedtypes)[i]);
if (!tup)
return MATCHnomatch;
if (!match(tup, ovar))
return MATCHnomatch;
}
(*dedtypes)[i] = ovar;
if (psparam)
*psparam = new TupleDeclaration(loc, ident, &ovar.objects);
return dependent ? MATCHexact : MATCHconvert;
}
void* dummyArg()
{
return null;
}
void accept(Visitor v)
{
v.visit(this);
}
}
/* Given:
* foo!(args) =>
* name = foo
* tiargs = args
*/
extern (C++) class TemplateInstance : ScopeDsymbol
{
public:
Identifier name;
// Array of Types/Expressions of template
// instance arguments [int*, char, 10*10]
Objects* tiargs;
// Array of Types/Expressions corresponding
// to TemplateDeclaration.parameters
// [int, char, 100]
Objects tdtypes;
Dsymbol tempdecl; // referenced by foo.bar.abc
Dsymbol enclosing; // if referencing local symbols, this is the context
Dsymbol aliasdecl; // !=NULL if instance is an alias for its sole member
TemplateInstance inst; // refer to existing instance
ScopeDsymbol argsym; // argument symbol table
int nest; // for recursion detection
bool semantictiargsdone; // has semanticTiargs() been done?
bool havetempdecl; // if used second constructor
bool gagged; // if the instantiation is done with error gagging
hash_t hash; // cached result of hashCode()
Expressions* fargs; // for function template, these are the function arguments
TemplateInstances* deferred;
// Used to determine the instance needs code generation.
// Note that these are inaccurate until semantic analysis phase completed.
TemplateInstance tinst; // enclosing template instance
TemplateInstance tnext; // non-first instantiated instances
Module minst; // the top module that instantiated this instance
/* ======================== TemplateInstance ================================ */
final extern (D) this(Loc loc, Identifier ident)
{
super(null);
static if (LOG)
{
printf("TemplateInstance(this = %p, ident = '%s')\n", this, ident ? ident.toChars() : "null");
}
this.loc = loc;
this.name = ident;
this.tiargs = null;
this.tempdecl = null;
this.inst = null;
this.tinst = null;
this.tnext = null;
this.minst = null;
this.deferred = null;
this.argsym = null;
this.aliasdecl = null;
this.semantictiargsdone = false;
this.nest = 0;
this.havetempdecl = false;
this.enclosing = null;
this.gagged = false;
this.hash = 0;
this.fargs = null;
}
/*****************
* This constructor is only called when we figured out which function
* template to instantiate.
*/
final extern (D) this(Loc loc, TemplateDeclaration td, Objects* tiargs)
{
super(null);
static if (LOG)
{
printf("TemplateInstance(this = %p, tempdecl = '%s')\n", this, td.toChars());
}
this.loc = loc;
this.name = td.ident;
this.tiargs = tiargs;
this.tempdecl = td;
this.inst = null;
this.tinst = null;
this.tnext = null;
this.minst = null;
this.deferred = null;
this.argsym = null;
this.aliasdecl = null;
this.semantictiargsdone = true;
this.nest = 0;
this.havetempdecl = true;
this.enclosing = null;
this.gagged = false;
this.hash = 0;
this.fargs = null;
assert(tempdecl._scope);
}
final static Objects* arraySyntaxCopy(Objects* objs)
{
Objects* a = null;
if (objs)
{
a = new Objects();
a.setDim(objs.dim);
for (size_t i = 0; i < objs.dim; i++)
(*a)[i] = objectSyntaxCopy((*objs)[i]);
}
return a;
}
Dsymbol syntaxCopy(Dsymbol s)
{
TemplateInstance ti = s ? cast(TemplateInstance)s : new TemplateInstance(loc, name);
ti.tiargs = arraySyntaxCopy(tiargs);
TemplateDeclaration td;
if (inst && tempdecl && (td = tempdecl.isTemplateDeclaration()) !is null)
td.ScopeDsymbol.syntaxCopy(ti);
else
ScopeDsymbol.syntaxCopy(ti);
return ti;
}
void semantic(Scope* sc, Expressions* fargs)
{
//printf("[%s] TemplateInstance::semantic('%s', this=%p, gag = %d, sc = %p)\n", loc.toChars(), toChars(), this, global.gag, sc);
version (none)
{
for (Dsymbol s = this; 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::semantic('%s', this=%p)\n", toChars(), this);
}
if (inst) // if semantic() was already run
{
static if (LOG)
{
printf("-TemplateInstance::semantic('%s', this=%p) already run\n", inst.toChars(), inst);
}
return;
}
if (semanticRun != PASSinit)
{
static if (LOG)
{
printf("Recursive template expansion\n");
}
auto ungag = Ungag(global.gag);
if (!gagged)
global.gag = 0;
error(loc, "recursive template expansion");
if (gagged)
semanticRun = PASSinit;
else
inst = this;
errors = true;
return;
}
// Get the enclosing template instance from the scope tinst
tinst = sc.tinst;
// Get the instantiating module from the scope minst
minst = sc.minst;
// Bugzilla 10920: If the enclosing function is non-root symbol,
// this instance should be speculative.
if (!tinst && sc.func && sc.func.inNonRoot())
{
minst = null;
}
gagged = (global.gag > 0);
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 (!findTempDecl(sc, null) || !semanticTiargs(sc) || !findBestMatch(sc, fargs))
{
Lerror:
if (gagged)
{
// Bugzilla 13220: Rollback status for later semantic re-running.
semanticRun = PASSinit;
}
else
inst = this;
errors = true;
return;
}
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
// If tempdecl is a mixin, disallow it
if (tempdecl.ismixin)
{
error("mixin templates are not regular templates");
goto Lerror;
}
hasNestedArgs(tiargs, tempdecl.isstatic);
if (errors)
goto Lerror;
/* See if there is an existing TemplateInstantiation that already
* implements the typeargs. If so, just refer to that one instead.
*/
inst = tempdecl.findExistingInstance(this, fargs);
TemplateInstance errinst = null;
if (!inst)
{
// So, we need to implement 'this' instance.
}
else if (inst.gagged && !gagged && inst.errors)
{
// If the first instantiation had failed, re-run semantic,
// so that error messages are shown.
errinst = inst;
}
else
{
// It's a match
parent = inst.parent;
errors = inst.errors;
// If both this and the previous instantiation were gagged,
// use the number of errors that happened last time.
global.errors += errors;
global.gaggedErrors += errors;
// If the first instantiation was gagged, but this is not:
if (inst.gagged)
{
// It had succeeded, mark it is a non-gagged instantiation,
// and reuse it.
inst.gagged = gagged;
}
this.tnext = inst.tnext;
inst.tnext = this;
/* 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 (Bugzilla 2500 & 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 (minst && minst.isRoot() && !(inst.minst && 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 = minst;
TemplateInstance ti = tinst;
minst = inst.minst;
tinst = inst.tinst;
inst.minst = mi;
inst.tinst = ti;
if (minst) // if inst was not speculative
{
/* Add 'inst' once again to the root module members[], then the
* instance members will get codegen chances.
*/
inst.appendToModuleMember();
}
}
static if (LOG)
{
printf("\tit's a match with instance %p, %d\n", inst, inst.semanticRun);
}
return;
}
static if (LOG)
{
printf("\timplement template instance %s '%s'\n", tempdecl.parent.toChars(), toChars());
printf("\ttempdecl %s\n", tempdecl.toChars());
}
uint errorsave = global.errors;
inst = this;
parent = enclosing ? enclosing : tempdecl.parent;
//printf("parent = '%s'\n", parent->kind());
TemplateInstance tempdecl_instance_idx = tempdecl.addInstance(this);
//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 = appendToModuleMember();
size_t target_symbol_list_idx = target_symbol_list ? target_symbol_list.dim - 1 : 0;
// Copy the syntax trees from the TemplateDeclaration
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((*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, members));
members = s;
}
break;
}
// Create our own scope for the template parameters
Scope* _scope = tempdecl._scope;
if (tempdecl.semanticRun == PASSinit)
{
error("template instantiation %s forward references template declaration %s", toChars(), tempdecl.toChars());
return;
}
static if (LOG)
{
printf("\tcreate scope for template parameters '%s'\n", toChars());
}
argsym = new ScopeDsymbol();
argsym.parent = _scope.parent;
_scope = _scope.push(argsym);
_scope.tinst = this;
_scope.minst = 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); // Bugzilla 14169: template parameters should be public
declareParameters(paramscope);
paramscope.pop();
// Add members of template instance to template instance symbol table
// parent = scope->scopesym;
symtab = new DsymbolTable();
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
static if (LOG)
{
printf("\t[%d] adding member '%s' %p kind %s to '%s'\n", i, s.toChars(), s, s.kind(), this.toChars());
}
s.addMember(_scope, this);
}
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 (members.dim)
{
Dsymbol s;
if (Dsymbol.oneMembers(members, &s, tempdecl.ident) && s)
{
//printf("s->kind = '%s'\n", s->kind());
//s->print();
//printf("'%s', '%s'\n", s->ident->toChars(), tempdecl->ident->toChars());
//printf("setting aliasdecl\n");
aliasdecl = s;
}
}
/* If function template declaration
*/
if (fargs && aliasdecl)
{
FuncDeclaration fd = aliasdecl.isFuncDeclaration();
if (fd)
{
/* Transmit fargs to type so that TypeFunction::semantic() 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", toChars());
}
Scope* sc2;
sc2 = _scope.push(this);
//printf("enclosing = %d, sc->parent = %s\n", enclosing, sc->parent->toChars());
sc2.parent = this;
sc2.tinst = this;
sc2.minst = minst;
tryExpandMembers(sc2);
semanticRun = PASSsemanticdone;
/* ConditionalDeclaration may introduce eponymous declaration,
* so we should find it once again after semantic.
*/
if (members.dim)
{
Dsymbol s;
if (Dsymbol.oneMembers(members, &s, tempdecl.ident) && s)
{
if (!aliasdecl || aliasdecl != s)
{
//printf("s->kind = '%s'\n", s->kind());
//s->print();
//printf("'%s', '%s'\n", s->ident->toChars(), tempdecl->ident->toChars());
//printf("setting aliasdecl 2\n");
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 == this)
{
ad.deferred = this;
break;
}
}
}
if (found_deferred_ad || Module.deferred.dim)
goto Laftersemantic;
}
/* The problem is when to parse the initializer for a variable.
* Perhaps VarDeclaration::semantic() should do it like it does
* for initializers inside a function.
*/
//if (sc->parent->isFuncDeclaration())
{
/* BUG 782: this has problems if the classes this depends on
* are forward referenced. Find a way to defer semantic()
* on this template.
*/
semantic2(sc2);
}
if (global.errors != errorsave)
goto Laftersemantic;
if (sc.func && !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 (Bugzilla 9050).
* To avoid the issue, don't run semantic3 until semantic and semantic2 done.
*/
TemplateInstances deferred;
this.deferred = &deferred;
//printf("Run semantic3 on %s\n", toChars());
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);
}
this.deferred = null;
}
else if (tinst)
{
/* Template function instantiation should run semantic3 immediately
* for attribute inference.
*/
if (sc.func && aliasdecl && aliasdecl.toAlias().isFuncDeclaration())
{
trySemantic3(sc2);
}
TemplateInstance ti = tinst;
int nest = 0;
while (ti && !ti.deferred && ti.tinst)
{
ti = ti.tinst;
if (++nest > 500)
{
global.gag = 0; // ensure error message gets printed
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(this);
break;
}
if ((*ti.deferred)[i] == this)
break;
}
}
}
if (aliasdecl)
{
/* Bugzilla 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.
*/
aliasdecl = aliasdecl.toAlias2();
}
Laftersemantic:
sc2.pop();
_scope.pop();
// Give additional context info if error occurred during instantiation
if (global.errors != errorsave)
{
if (!errors)
{
if (!tempdecl.literal)
error(loc, "error instantiating");
if (tinst)
tinst.printInstantiationTrace();
}
errors = true;
if (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 bugzilla 4302 and 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] == this);
target_symbol_list.remove(target_symbol_list_idx);
}
semanticRun = PASSinit;
inst = null;
symtab = null;
}
}
else if (errinst)
{
/* Bugzilla 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.
*/
size_t bi = hash % tempdecl.buckets.dim;
TemplateInstances* instances = tempdecl.buckets[bi];
assert(instances);
for (size_t i = 0; i < instances.dim; i++)
{
TemplateInstance ti = (*instances)[i];
if (ti == errinst)
{
(*instances)[i] = this; // override
break;
}
}
}
static if (LOG)
{
printf("-TemplateInstance::semantic('%s', this=%p)\n", toChars(), this);
}
}
void semantic(Scope* sc)
{
semantic(sc, null);
}
void semantic2(Scope* sc)
{
if (semanticRun >= PASSsemantic2)
return;
semanticRun = PASSsemantic2;
static if (LOG)
{
printf("+TemplateInstance::semantic2('%s')\n", toChars());
}
if (!errors && members)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
sc = tempdecl._scope;
assert(sc);
sc = sc.push(argsym);
sc = sc.push(this);
sc.tinst = this;
sc.minst = minst;
int needGagging = (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 < members.dim; i++)
{
Dsymbol s = (*members)[i];
static if (LOG)
{
printf("\tmember '%s', kind = '%s'\n", s.toChars(), s.kind());
}
s.semantic2(sc);
if (gagged && global.errors != olderrors)
break;
}
if (global.errors != olderrors)
{
if (!errors)
{
if (!tempdecl.literal)
error(loc, "error instantiating");
if (tinst)
tinst.printInstantiationTrace();
}
errors = true;
}
if (needGagging)
global.endGagging(oldGaggedErrors);
sc = sc.pop();
sc.pop();
}
static if (LOG)
{
printf("-TemplateInstance::semantic2('%s')\n", toChars());
}
}
void semantic3(Scope* sc)
{
static if (LOG)
{
printf("TemplateInstance::semantic3('%s'), semanticRun = %d\n", toChars(), semanticRun);
}
//if (toChars()[0] == 'D') *(char*)0=0;
if (semanticRun >= PASSsemantic3)
return;
semanticRun = PASSsemantic3;
if (!errors && members)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
sc = tempdecl._scope;
sc = sc.push(argsym);
sc = sc.push(this);
sc.tinst = this;
sc.minst = minst;
int needGagging = (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 < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.semantic3(sc);
if (gagged && global.errors != olderrors)
break;
}
if (global.errors != olderrors)
{
if (!errors)
{
if (!tempdecl.literal)
error(loc, "error instantiating");
if (tinst)
tinst.printInstantiationTrace();
}
errors = true;
}
if (needGagging)
global.endGagging(oldGaggedErrors);
sc = sc.pop();
sc.pop();
}
}
// resolve real symbol
final Dsymbol toAlias()
{
static if (LOG)
{
printf("TemplateInstance::toAlias()\n");
}
if (!inst)
{
// Maybe we can resolve it
if (_scope)
{
semantic(_scope);
}
if (!inst)
{
error("cannot resolve forward reference");
errors = true;
return this;
}
}
if (inst != this)
return inst.toAlias();
if (aliasdecl)
{
return aliasdecl.toAlias();
}
return inst;
}
const(char)* kind()
{
return "template instance";
}
bool oneMember(Dsymbol* ps, Identifier ident)
{
*ps = null;
return true;
}
char* toChars()
{
OutBuffer buf;
toCBufferInstance(this, &buf);
return buf.extractString();
}
final char* toPrettyCharsHelper()
{
OutBuffer buf;
toCBufferInstance(this, &buf, true);
return buf.extractString();
}
/**************************************
* Given an error instantiating the TemplateInstance,
* give the nested TemplateInstance instantiations that got
* us here. Those are a list threaded into the nested scopes.
*/
final void printInstantiationTrace()
{
if (global.gag)
return;
const(uint) max_shown = 6;
const(char)* format = "instantiated from here: %s";
// determine instantiation depth and number of recursive instantiations
int n_instantiations = 1;
int n_totalrecursions = 0;
for (TemplateInstance cur = this; cur; cur = cur.tinst)
{
++n_instantiations;
// If two instantiations use the same declaration, they are recursive.
// (this works even if they are instantiated from different places in the
// same template).
// In principle, we could also check for multiple-template recursion, but it's
// probably not worthwhile.
if (cur.tinst && cur.tempdecl && cur.tinst.tempdecl && cur.tempdecl.loc.equals(cur.tinst.tempdecl.loc))
++n_totalrecursions;
}
// show full trace only if it's short or verbose is on
if (n_instantiations <= max_shown || global.params.verbose)
{
for (TemplateInstance cur = this; cur; cur = cur.tinst)
{
cur.errors = true;
errorSupplemental(cur.loc, format, cur.toChars());
}
}
else if (n_instantiations - n_totalrecursions <= max_shown)
{
// By collapsing recursive instantiations into a single line,
// we can stay under the limit.
int recursionDepth = 0;
for (TemplateInstance cur = this; cur; cur = cur.tinst)
{
cur.errors = true;
if (cur.tinst && cur.tempdecl && cur.tinst.tempdecl && cur.tempdecl.loc.equals(cur.tinst.tempdecl.loc))
{
++recursionDepth;
}
else
{
if (recursionDepth)
errorSupplemental(cur.loc, "%d recursive instantiations from here: %s", recursionDepth + 2, cur.toChars());
else
errorSupplemental(cur.loc, format, cur.toChars());
recursionDepth = 0;
}
}
}
else
{
// Even after collapsing the recursions, the depth is too deep.
// Just display the first few and last few instantiations.
uint i = 0;
for (TemplateInstance cur = this; cur; cur = cur.tinst)
{
cur.errors = true;
if (i == max_shown / 2)
errorSupplemental(cur.loc, "... (%d instantiations, -v to show) ...", n_instantiations - max_shown);
if (i < max_shown / 2 || i >= n_instantiations - max_shown + max_shown / 2)
errorSupplemental(cur.loc, format, cur.toChars());
++i;
}
}
}
/*************************************
* Lazily generate identifier for template instance.
* This is because 75% of the ident's are never needed.
*/
final Identifier getIdent()
{
if (!ident && inst && !errors)
ident = genIdent(tiargs); // need an identifier for name mangling purposes.
return ident;
}
final int compare(RootObject o)
{
TemplateInstance ti = cast(TemplateInstance)o;
//printf("this = %p, ti = %p\n", this, ti);
assert(tdtypes.dim == ti.tdtypes.dim);
// Nesting must match
if (enclosing != ti.enclosing)
{
//printf("test2 enclosing %s ti->enclosing %s\n", enclosing ? enclosing->toChars() : "", ti->enclosing ? ti->enclosing->toChars() : "");
goto Lnotequals;
}
//printf("parent = %s, ti->parent = %s\n", parent->toPrettyChars(), ti->parent->toPrettyChars());
if (!arrayObjectMatch(&tdtypes, &ti.tdtypes))
goto Lnotequals;
/* Template functions may have different instantiations based on
* "auto ref" parameters.
*/
if (auto fd = ti.toAlias().isFuncDeclaration())
{
if (!fd.errors)
{
auto fparameters = fd.getParameters(null);
size_t nfparams = Parameter.dim(fparameters); // Num function parameters
for (size_t j = 0; j < nfparams; j++)
{
Parameter fparam = Parameter.getNth(fparameters, j);
if (fparam.storageClass & STCautoref) // if "auto ref"
{
if (!fargs)
goto Lnotequals;
if (fargs.dim <= j)
break;
Expression farg = (*fargs)[j];
if (farg.isLvalue())
{
if (!(fparam.storageClass & STCref))
goto Lnotequals;
// auto ref's don't match
}
else
{
if (fparam.storageClass & STCref)
goto Lnotequals;
// auto ref's don't match
}
}
}
}
}
return 0;
Lnotequals:
return 1;
}
final hash_t hashCode()
{
if (!hash)
{
hash = cast(size_t)cast(void*)enclosing;
hash += arrayObjectHash(&tdtypes);
}
return hash;
}
/***********************************************
* Returns true if this is not instantiated in non-root module, and
* is a part of non-speculative instantiatiation.
*
* Note: minst does not stabilize until semantic analysis is completed,
* so don't call this function during semantic analysis to return precise result.
*/
final bool needsCodegen()
{
// Now -allInst is just for the backward compatibility.
if (global.params.allInst)
{
//printf("%s minst = %s, enclosing (%s)->isNonRoot = %d\n",
// toPrettyChars(), minst ? minst->toChars() : NULL,
// enclosing ? enclosing->toPrettyChars() : NULL, enclosing && enclosing->inNonRoot());
if (enclosing)
{
// Bugzilla 14588: If the captured context is not a function
// (e.g. class), the instance layout determination is guaranteed,
// because the semantic/semantic2 pass will be executed
// even for non-root instances.
if (!enclosing.isFuncDeclaration())
return true;
// Bugzilla 14834: If the captured context is a function,
// this excessive instantiation may cause ODR violation, because
// -allInst and others doesn't guarantee the semantic3 execution
// for that function.
// If the enclosing is also an instantiated function,
// we have to rely on the ancestor's needsCodegen() result.
if (TemplateInstance ti = enclosing.isInstantiated())
return ti.needsCodegen();
// Bugzilla 13415: If and only if the enclosing scope needs codegen,
// this nested templates would also need code generation.
return !enclosing.inNonRoot();
}
return true;
}
if (!minst)
{
// If this is a speculative instantiation,
// 1. do codegen if ancestors really needs codegen.
// 2. become non-speculative if siblings are not speculative
TemplateInstance tnext = this.tnext;
TemplateInstance tinst = this.tinst;
// At first, disconnect chain first to prevent infinite recursion.
this.tnext = null;
this.tinst = null;
// Determine necessity of tinst before tnext.
if (tinst && tinst.needsCodegen())
{
minst = tinst.minst; // cache result
assert(minst);
assert(minst.isRoot() || minst.rootImports());
return true;
}
if (tnext && (tnext.needsCodegen() || tnext.minst))
{
minst = tnext.minst; // cache result
assert(minst);
return minst.isRoot() || minst.rootImports();
}
// Elide codegen because this is really speculative.
return false;
}
/* The issue is that if the importee is compiled with a different -debug
* setting than the importer, the importer may believe it exists
* in the compiled importee when it does not, when the instantiation
* is behind a conditional debug declaration.
*/
// workaround for Bugzilla 11239
if (global.params.useUnitTests ||
global.params.debuglevel)
{
// Prefer instantiations from root modules, to maximize link-ability.
if (minst.isRoot())
return true;
TemplateInstance tnext = this.tnext;
TemplateInstance tinst = this.tinst;
this.tnext = null;
this.tinst = null;
if (tinst && tinst.needsCodegen())
{
minst = tinst.minst; // cache result
assert(minst);
assert(minst.isRoot() || minst.rootImports());
return true;
}
if (tnext && tnext.needsCodegen())
{
minst = tnext.minst; // cache result
assert(minst);
assert(minst.isRoot() || minst.rootImports());
return true;
}
// Bugzilla 2500 case
if (minst.rootImports())
return true;
// Elide codegen because this is not included in root instances.
return false;
}
else
{
// Prefer instantiations from non-root module, to minimize object code size.
/* If a TemplateInstance is ever instantiated by non-root modules,
* we do not have to generate code for it,
* because it will be generated when the non-root module is compiled.
*
* But, if the non-root 'minst' imports any root modules, it might still need codegen.
*
* The problem is if A imports B, and B imports A, and both A
* and B instantiate the same template, does the compilation of A
* or the compilation of B do the actual instantiation?
*
* See Bugzilla 2500.
*/
if (!minst.isRoot() && !minst.rootImports())
return false;
TemplateInstance tnext = this.tnext;
this.tnext = null;
if (tnext && !tnext.needsCodegen() && tnext.minst)
{
minst = tnext.minst; // cache result
assert(!minst.isRoot());
return false;
}
// Do codegen because this is not included in non-root instances.
return true;
}
}
/**********************************************
* Find template declaration corresponding to template instance.
*
* Returns:
* false if finding fails.
* Note:
* This function is reentrant against error occurrence. If returns false,
* any members of this object won't be modified, and repetition call will
* reproduce same error.
*/
final bool findTempDecl(Scope* sc, WithScopeSymbol* pwithsym)
{
if (pwithsym)
*pwithsym = null;
if (havetempdecl)
return true;
//printf("TemplateInstance::findTempDecl() %s\n", toChars());
if (!tempdecl)
{
/* Given:
* foo!( ... )
* figure out which TemplateDeclaration foo refers to.
*/
Identifier id = name;
Dsymbol scopesym;
Dsymbol s = sc.search(loc, id, &scopesym);
if (!s)
{
s = sc.search_correct(id);
if (s)
error("template '%s' is not defined, did you mean %s?", id.toChars(), s.toChars());
else
error("template '%s' is not defined", id.toChars());
return false;
}
static if (LOG)
{
printf("It's an instance of '%s' kind '%s'\n", s.toChars(), s.kind());
if (s.parent)
printf("s->parent = '%s'\n", s.parent.toChars());
}
if (pwithsym)
*pwithsym = scopesym.isWithScopeSymbol();
/* We might have found an alias within a template when
* we really want the template.
*/
TemplateInstance ti;
if (s.parent && (ti = s.parent.isTemplateInstance()) !is null)
{
if (ti.tempdecl && ti.tempdecl.ident == id)
{
/* This is so that one can refer to the enclosing
* template, even if it has the same name as a member
* of the template, if it has a !(arguments)
*/
TemplateDeclaration td = ti.tempdecl.isTemplateDeclaration();
assert(td);
if (td.overroot) // if not start of overloaded list of TemplateDeclaration's
td = td.overroot; // then get the start
s = td;
}
}
if (!updateTempDecl(sc, s))
{
return false;
}
}
assert(tempdecl);
struct ParamFwdTi
{
extern (C++) static int fp(void* param, Dsymbol s)
{
TemplateDeclaration td = s.isTemplateDeclaration();
if (!td)
return 0;
TemplateInstance ti = cast(TemplateInstance)param;
if (td.semanticRun == PASSinit)
{
if (td._scope)
{
// Try to fix forward reference. Ungag errors while doing so.
Ungag ungag = td.ungagSpeculative();
td.semantic(td._scope);
}
if (td.semanticRun == PASSinit)
{
ti.error("%s forward references template declaration %s", ti.toChars(), td.toChars());
return 1;
}
}
return 0;
}
}
// Look for forward references
OverloadSet tovers = tempdecl.isOverloadSet();
size_t overs_dim = tovers ? tovers.a.dim : 1;
for (size_t oi = 0; oi < overs_dim; oi++)
{
if (overloadApply(tovers ? tovers.a[oi] : tempdecl, cast(void*)this, &ParamFwdTi.fp))
return false;
}
return true;
}
/**********************************************
* Confirm s is a valid template, then store it.
* Input:
* sc
* s candidate symbol of template. It may be:
* TemplateDeclaration
* FuncDeclaration with findTemplateDeclRoot() != NULL
* OverloadSet which contains candidates
* Returns:
* true if updating succeeds.
*/
final bool updateTempDecl(Scope* sc, Dsymbol s)
{
if (s)
{
Identifier id = name;
s = s.toAlias();
/* If an OverloadSet, look for a unique member that is a template declaration
*/
OverloadSet os = s.isOverloadSet();
if (os)
{
s = null;
for (size_t i = 0; i < os.a.dim; i++)
{
Dsymbol s2 = os.a[i];
if (FuncDeclaration f = s2.isFuncDeclaration())
s2 = f.findTemplateDeclRoot();
else
s2 = s2.isTemplateDeclaration();
if (s2)
{
if (s)
{
tempdecl = os;
return true;
}
s = s2;
}
}
if (!s)
{
error("template '%s' is not defined", id.toChars());
return false;
}
}
OverDeclaration od = s.isOverDeclaration();
if (od)
{
tempdecl = od; // TODO: more strict check
return true;
}
/* It should be a TemplateDeclaration, not some other symbol
*/
if (FuncDeclaration f = s.isFuncDeclaration())
tempdecl = f.findTemplateDeclRoot();
else
tempdecl = s.isTemplateDeclaration();
if (!tempdecl)
{
if (!s.parent && global.errors)
return false;
if (!s.parent && s.getType())
{
Dsymbol s2 = s.getType().toDsymbol(sc);
if (!s2)
{
error("%s is not a template declaration, it is a %s", id.toChars(), s.kind());
return false;
}
s = s2;
}
debug
{
//if (!s->parent) printf("s = %s %s\n", s->kind(), s->toChars());
}
//assert(s->parent);
TemplateInstance ti = s.parent ? s.parent.isTemplateInstance() : null;
if (ti && (ti.name == s.ident || ti.toAlias().ident == s.ident) && ti.tempdecl)
{
/* This is so that one can refer to the enclosing
* template, even if it has the same name as a member
* of the template, if it has a !(arguments)
*/
TemplateDeclaration td = ti.tempdecl.isTemplateDeclaration();
assert(td);
if (td.overroot) // if not start of overloaded list of TemplateDeclaration's
td = td.overroot; // then get the start
tempdecl = td;
}
else
{
error("%s is not a template declaration, it is a %s", id.toChars(), s.kind());
return false;
}
}
}
return (tempdecl !is null);
}
/**********************************
* Run semantic of tiargs as arguments of template.
* Input:
* loc
* sc
* tiargs array of template arguments
* flags 1: replace const variables with their initializers
* 2: don't devolve Parameter to Type
* Returns:
* false if one or more arguments have errors.
*/
final static bool semanticTiargs(Loc loc, Scope* sc, Objects* tiargs, int flags)
{
// Run semantic on each argument, place results in tiargs[]
//printf("+TemplateInstance::semanticTiargs()\n");
if (!tiargs)
return true;
bool err = false;
for (size_t j = 0; j < tiargs.dim; j++)
{
RootObject o = (*tiargs)[j];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
//printf("1: (*tiargs)[%d] = %p, s=%p, v=%p, ea=%p, ta=%p\n", j, o, isDsymbol(o), isTuple(o), ea, ta);
if (ta)
{
//printf("type %s\n", ta->toChars());
// It might really be an Expression or an Alias
ta.resolve(loc, sc, &ea, &ta, &sa);
if (ea)
goto Lexpr;
if (sa)
goto Ldsym;
if (ta is null)
{
assert(global.errors);
ta = Type.terror;
}
Ltype:
if (ta.ty == Ttuple)
{
// Expand tuple
TypeTuple tt = cast(TypeTuple)ta;
size_t dim = tt.arguments.dim;
tiargs.remove(j);
if (dim)
{
tiargs.reserve(dim);
for (size_t i = 0; i < dim; i++)
{
Parameter arg = (*tt.arguments)[i];
if (flags & 2 && arg.ident)
tiargs.insert(j + i, arg);
else
tiargs.insert(j + i, arg.type);
}
}
j--;
continue;
}
if (ta.ty == Terror)
{
err = true;
continue;
}
(*tiargs)[j] = ta.merge2();
}
else if (ea)
{
Lexpr:
//printf("+[%d] ea = %s %s\n", j, Token::toChars(ea->op), ea->toChars());
if (flags & 1) // only used by __traits
{
ea = ea.semantic(sc);
// must not interpret the args, excepting template parameters
if (ea.op != TOKvar || ((cast(VarExp)ea).var.storage_class & STCtemplateparameter))
{
ea = ea.optimize(WANTvalue);
}
}
else
{
sc = sc.startCTFE();
ea = ea.semantic(sc);
sc = sc.endCTFE();
if (ea.op == TOKvar)
{
/* This test is to skip substituting a const var with
* its initializer. The problem is the initializer won't
* match with an 'alias' parameter. Instead, do the
* const substitution in TemplateValueParameter::matchArg().
*/
}
else if (definitelyValueParameter(ea))
{
if (ea.checkValue()) // check void expression
ea = new ErrorExp();
uint olderrs = global.errors;
ea = ea.ctfeInterpret();
if (global.errors != olderrs)
ea = new ErrorExp();
}
}
//printf("-[%d] ea = %s %s\n", j, Token::toChars(ea->op), ea->toChars());
if (ea.op == TOKtuple)
{
// Expand tuple
TupleExp te = cast(TupleExp)ea;
size_t dim = te.exps.dim;
tiargs.remove(j);
if (dim)
{
tiargs.reserve(dim);
for (size_t i = 0; i < dim; i++)
tiargs.insert(j + i, (*te.exps)[i]);
}
j--;
continue;
}
if (ea.op == TOKerror)
{
err = true;
continue;
}
(*tiargs)[j] = ea;
if (ea.op == TOKtype)
{
ta = ea.type;
goto Ltype;
}
if (ea.op == TOKimport)
{
sa = (cast(ScopeExp)ea).sds;
goto Ldsym;
}
if (ea.op == TOKfunction)
{
FuncExp fe = cast(FuncExp)ea;
/* A function literal, that is passed to template and
* already semanticed as function pointer, never requires
* outer frame. So convert it to global function is valid.
*/
if (fe.fd.tok == TOKreserved && fe.type.ty == Tpointer)
{
// change to non-nested
fe.fd.tok = TOKfunction;
fe.fd.vthis = null;
}
else if (fe.td)
{
/* If template argument is a template lambda,
* get template declaration itself. */
//sa = fe->td;
//goto Ldsym;
}
}
if (ea.op == TOKdotvar)
{
// translate expression to dsymbol.
sa = (cast(DotVarExp)ea).var;
goto Ldsym;
}
if (ea.op == TOKtemplate)
{
sa = (cast(TemplateExp)ea).td;
goto Ldsym;
}
if (ea.op == TOKdottd)
{
// translate expression to dsymbol.
sa = (cast(DotTemplateExp)ea).td;
goto Ldsym;
}
}
else if (sa)
{
Ldsym:
//printf("dsym %s %s\n", sa->kind(), sa->toChars());
if (sa.errors)
{
err = true;
continue;
}
TupleDeclaration d = sa.toAlias().isTupleDeclaration();
if (d)
{
// Expand tuple
tiargs.remove(j);
tiargs.insert(j, d.objects);
j--;
continue;
}
if (FuncAliasDeclaration fa = sa.isFuncAliasDeclaration())
{
FuncDeclaration f = fa.toAliasFunc();
if (!fa.hasOverloads && f.isUnique())
{
// Strip FuncAlias only when the aliased function
// does not have any overloads.
sa = f;
}
}
(*tiargs)[j] = sa;
TemplateDeclaration td = sa.isTemplateDeclaration();
if (td && td.semanticRun == PASSinit && td.literal)
{
td.semantic(sc);
}
FuncDeclaration fd = sa.isFuncDeclaration();
if (fd)
fd.functionSemantic();
}
else if (isParameter(o))
{
}
else
{
assert(0);
}
//printf("1: (*tiargs)[%d] = %p\n", j, (*tiargs)[j]);
}
version (none)
{
printf("-TemplateInstance::semanticTiargs()\n");
for (size_t j = 0; j < tiargs.dim; j++)
{
RootObject o = (*tiargs)[j];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
Tuple va = isTuple(o);
printf("\ttiargs[%d] = ta %p, ea %p, sa %p, va %p\n", j, ta, ea, sa, va);
}
}
return !err;
}
/**********************************
* Run semantic on the elements of tiargs.
* Input:
* sc
* Returns:
* false if one or more arguments have errors.
* Note:
* This function is reentrant against error occurrence. If returns false,
* all elements of tiargs won't be modified.
*/
final bool semanticTiargs(Scope* sc)
{
//printf("+TemplateInstance::semanticTiargs() %s\n", toChars());
if (semantictiargsdone)
return true;
if (semanticTiargs(loc, sc, tiargs, 0))
{
// cache the result iff semantic analysis succeeded entirely
semantictiargsdone = 1;
return true;
}
return false;
}
final bool findBestMatch(Scope* sc, Expressions* fargs)
{
if (havetempdecl)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
assert(tempdecl._scope);
// Deduce tdtypes
tdtypes.setDim(tempdecl.parameters.dim);
if (!tempdecl.matchWithInstance(sc, this, &tdtypes, fargs, 2))
{
error("incompatible arguments for template instantiation");
return false;
}
// TODO: Normalizing tiargs for bugzilla 7469 is necessary?
return true;
}
static if (LOG)
{
printf("TemplateInstance::findBestMatch()\n");
}
uint errs = global.errors;
struct ParamBest
{
// context
Scope* sc;
TemplateInstance ti;
Objects dedtypes;
// result
TemplateDeclaration td_best;
TemplateDeclaration td_ambig;
MATCH m_best;
extern (C++) static int fp(void* param, Dsymbol s)
{
return (cast(ParamBest*)param).fp(s);
}
extern (C++) int fp(Dsymbol s)
{
TemplateDeclaration td = s.isTemplateDeclaration();
if (!td)
return 0;
if (td == td_best) // skip duplicates
return 0;
//printf("td = %s\n", td->toPrettyChars());
// If more arguments than parameters,
// then this is no match.
if (td.parameters.dim < ti.tiargs.dim)
{
if (!td.isVariadic())
return 0;
}
dedtypes.setDim(td.parameters.dim);
dedtypes.zero();
assert(td.semanticRun != PASSinit);
MATCH m = td.matchWithInstance(sc, ti, &dedtypes, ti.fargs, 0);
//printf("matchWithInstance = %d\n", m);
if (m <= MATCHnomatch) // no match at all
return 0;
if (m < m_best)
goto Ltd_best;
if (m > m_best)
goto Ltd;
{
// Disambiguate by picking the most specialized TemplateDeclaration
MATCH c1 = td.leastAsSpecialized(sc, td_best, ti.fargs);
MATCH c2 = td_best.leastAsSpecialized(sc, td, ti.fargs);
//printf("c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2)
goto Ltd;
if (c1 < c2)
goto Ltd_best;
}
td_ambig = td;
return 0;
Ltd_best:
// td_best is the best match so far
td_ambig = null;
return 0;
Ltd:
// td is the new best match
td_ambig = null;
td_best = td;
m_best = m;
ti.tdtypes.setDim(dedtypes.dim);
memcpy(ti.tdtypes.tdata(), dedtypes.tdata(), ti.tdtypes.dim * (void*).sizeof);
return 0;
}
}
ParamBest p;
// context
p.ti = this;
p.sc = sc;
/* Since there can be multiple TemplateDeclaration's with the same
* name, look for the best match.
*/
TemplateDeclaration td_last = null;
OverloadSet tovers = tempdecl.isOverloadSet();
size_t overs_dim = tovers ? tovers.a.dim : 1;
for (size_t oi = 0; oi < overs_dim; oi++)
{
// result
p.td_best = null;
p.td_ambig = null;
p.m_best = MATCHnomatch;
overloadApply(tovers ? tovers.a[oi] : tempdecl, &p, &ParamBest.fp);
if (p.td_ambig)
{
.error(loc, "%s %s.%s matches more than one template declaration:\n%s: %s\nand\n%s: %s", p.td_best.kind(), p.td_best.parent.toPrettyChars(), p.td_best.ident.toChars(), p.td_best.loc.toChars(), p.td_best.toChars(), p.td_ambig.loc.toChars(), p.td_ambig.toChars());
return false;
}
if (p.td_best)
{
if (!td_last)
td_last = p.td_best;
else if (td_last != p.td_best)
{
ScopeDsymbol.multiplyDefined(loc, td_last, p.td_best);
return false;
}
}
}
if (td_last)
{
/* Bugzilla 7469: Normalize tiargs by using corresponding deduced
* template value parameters and tuples for the correct mangling.
*
* By doing this before hasNestedArgs, CTFEable local variable will be
* accepted as a value parameter. For example:
*
* void foo() {
* struct S(int n) {} // non-global template
* const int num = 1; // CTFEable local variable
* S!num s; // S!1 is instantiated, not S!num
* }
*/
size_t dim = td_last.parameters.dim - (td_last.isVariadic() ? 1 : 0);
for (size_t i = 0; i < dim; i++)
{
if (tiargs.dim <= i)
tiargs.push(tdtypes[i]);
assert(i < tiargs.dim);
TemplateValueParameter tvp = (*td_last.parameters)[i].isTemplateValueParameter();
if (!tvp)
continue;
assert(tdtypes[i]);
// tdtypes[i] is already normalized to the required type in matchArg
(*tiargs)[i] = tdtypes[i];
}
if (td_last.isVariadic() && tiargs.dim == dim && tdtypes[dim])
{
Tuple va = isTuple(tdtypes[dim]);
assert(va);
for (size_t i = 0; i < va.objects.dim; i++)
tiargs.push(va.objects[i]);
}
}
else if (errors && inst)
{
// instantiation was failed with error reporting
assert(global.errors);
return false;
}
else
{
TemplateDeclaration tdecl = tempdecl.isTemplateDeclaration();
if (errs != global.errors)
errorSupplemental(loc, "while looking for match for %s", toChars());
else if (tdecl && !tdecl.overnext)
{
// Only one template, so we can give better error message
error("does not match template declaration %s", tdecl.toChars());
}
else
.error(loc, "%s %s.%s does not match any template declaration", tempdecl.kind(), tempdecl.parent.toPrettyChars(), tempdecl.ident.toChars());
return false;
}
/* The best match is td_last
*/
tempdecl = td_last;
static if (LOG)
{
printf("\tIt's a match with template declaration '%s'\n", tempdecl.toChars());
}
return (errs == global.errors);
}
/*****************************************************
* Determine if template instance is really a template function,
* and that template function needs to infer types from the function
* arguments.
*
* Like findBestMatch, iterate possible template candidates,
* but just looks only the necessity of type inference.
*/
final bool needsTypeInference(Scope* sc, int flag = 0)
{
//printf("TemplateInstance::needsTypeInference() %s\n", toChars());
if (semanticRun != PASSinit)
return false;
struct ParamNeedsInf
{
// context
Scope* sc;
TemplateInstance ti;
int flag;
// result
Objects dedtypes;
size_t count;
extern (C++) static int fp(void* param, Dsymbol s)
{
return (cast(ParamNeedsInf*)param).fp(s);
}
extern (C++) int fp(Dsymbol s)
{
TemplateDeclaration td = s.isTemplateDeclaration();
if (!td)
{
return 0;
}
/* If any of the overloaded template declarations need inference,
* then return true
*/
FuncDeclaration fd;
if (!td.onemember)
return 0;
if (TemplateDeclaration td2 = td.onemember.isTemplateDeclaration())
{
if (!td2.onemember || !td2.onemember.isFuncDeclaration())
return 0;
if (ti.tiargs.dim > td.parameters.dim && !td.isVariadic())
return 0;
return 1;
}
if ((fd = td.onemember.isFuncDeclaration()) is null || fd.type.ty != Tfunction)
{
return 0;
}
for (size_t i = 0; i < td.parameters.dim; i++)
{
if ((*td.parameters)[i].isTemplateThisParameter())
return 1;
}
/* Determine if the instance arguments, tiargs, are all that is necessary
* to instantiate the template.
*/
//printf("tp = %p, td->parameters->dim = %d, tiargs->dim = %d\n", tp, td->parameters->dim, ti->tiargs->dim);
TypeFunction tf = cast(TypeFunction)fd.type;
if (size_t dim = Parameter.dim(tf.parameters))
{
TemplateParameter tp = td.isVariadic();
if (tp && td.parameters.dim > 1)
return 1;
if (!tp && ti.tiargs.dim < td.parameters.dim)
{
// Can remain tiargs be filled by default arguments?
for (size_t i = ti.tiargs.dim; i < td.parameters.dim; i++)
{
if (!(*td.parameters)[i].hasDefaultArg())
return 1;
}
}
for (size_t i = 0; i < dim; i++)
{
// 'auto ref' needs inference.
if (Parameter.getNth(tf.parameters, i).storageClass & STCauto)
return 1;
}
}
if (!flag)
{
/* Calculate the need for overload resolution.
* When only one template can match with tiargs, inference is not necessary.
*/
dedtypes.setDim(td.parameters.dim);
dedtypes.zero();
if (td.semanticRun == PASSinit)
{
if (td._scope)
{
// Try to fix forward reference. Ungag errors while doing so.
Ungag ungag = td.ungagSpeculative();
td.semantic(td._scope);
}
if (td.semanticRun == PASSinit)
{
ti.error("%s forward references template declaration %s", ti.toChars(), td.toChars());
return 1;
}
}
MATCH m = td.matchWithInstance(sc, ti, &dedtypes, null, 0);
if (m <= MATCHnomatch)
return 0;
}
/* If there is more than one function template which matches, we may
* need type inference (see Bugzilla 4430)
*/
if (++count > 1)
return 1;
return 0;
}
}
ParamNeedsInf p;
// context
p.ti = this;
p.sc = sc;
p.flag = flag;
// result
p.count = 0;
OverloadSet tovers = tempdecl.isOverloadSet();
size_t overs_dim = tovers ? tovers.a.dim : 1;
uint olderrs = global.errors;
for (size_t oi = 0; oi < overs_dim; oi++)
{
if (overloadApply(tovers ? tovers.a[oi] : tempdecl, &p, &ParamNeedsInf.fp))
return true;
}
if (olderrs != global.errors)
{
if (!global.gag)
{
errorSupplemental(loc, "while looking for match for %s", toChars());
semanticRun = PASSsemanticdone;
inst = this;
}
errors = true;
}
//printf("false\n");
return false;
}
/*****************************************
* Determines if a TemplateInstance will need a nested
* generation of the TemplateDeclaration.
* Sets enclosing property if so, and returns != 0;
*/
final bool hasNestedArgs(Objects* args, bool isstatic)
{
int nested = 0;
//printf("TemplateInstance::hasNestedArgs('%s')\n", tempdecl->ident->toChars());
/* A nested instance happens when an argument references a local
* symbol that is on the stack.
*/
for (size_t i = 0; i < args.dim; i++)
{
RootObject o = (*args)[i];
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
Tuple va = isTuple(o);
if (ea)
{
if (ea.op == TOKvar)
{
sa = (cast(VarExp)ea).var;
goto Lsa;
}
if (ea.op == TOKthis)
{
sa = (cast(ThisExp)ea).var;
goto Lsa;
}
if (ea.op == TOKfunction)
{
if ((cast(FuncExp)ea).td)
sa = (cast(FuncExp)ea).td;
else
sa = (cast(FuncExp)ea).fd;
goto Lsa;
}
// Emulate Expression::toMangleBuffer call that had exist in TemplateInstance::genIdent.
if (ea.op != TOKint64 && ea.op != TOKfloat64 && ea.op != TOKcomplex80 && ea.op != TOKnull && ea.op != TOKstring && ea.op != TOKarrayliteral && ea.op != TOKassocarrayliteral && ea.op != TOKstructliteral)
{
ea.error("expression %s is not a valid template value argument", ea.toChars());
errors = true;
}
}
else if (sa)
{
Lsa:
sa = sa.toAlias();
TemplateDeclaration td = sa.isTemplateDeclaration();
if (td)
{
TemplateInstance ti = sa.toParent().isTemplateInstance();
if (ti && ti.enclosing)
sa = ti;
}
TemplateInstance ti = sa.isTemplateInstance();
Declaration d = sa.isDeclaration();
if ((td && td.literal) || (ti && ti.enclosing) || (d && !d.isDataseg() && !(d.storage_class & STCmanifest) && (!d.isFuncDeclaration() || d.isFuncDeclaration().isNested()) && !isTemplateMixin()))
{
// if module level template
if (isstatic)
{
Dsymbol dparent = sa.toParent2();
if (!enclosing)
enclosing = dparent;
else if (enclosing != dparent)
{
/* Select the more deeply nested of the two.
* Error if one is not nested inside the other.
*/
for (Dsymbol p = enclosing; p; p = p.parent)
{
if (p == dparent)
goto L1;
// enclosing is most nested
}
for (Dsymbol p = dparent; p; p = p.parent)
{
if (p == enclosing)
{
enclosing = dparent;
goto L1;
// dparent is most nested
}
}
error("%s is nested in both %s and %s", toChars(), enclosing.toChars(), dparent.toChars());
errors = true;
}
L1:
//printf("\tnested inside %s\n", enclosing->toChars());
nested |= 1;
}
else
{
error("cannot use local '%s' as parameter to non-global template %s", sa.toChars(), tempdecl.toChars());
errors = true;
}
}
}
else if (va)
{
nested |= cast(int)hasNestedArgs(&va.objects, isstatic);
}
}
//printf("-TemplateInstance::hasNestedArgs('%s') = %d\n", tempdecl->ident->toChars(), nested);
return nested != 0;
}
/*****************************************
* Append 'this' to the specific module members[]
*/
final Dsymbols* appendToModuleMember()
{
Module mi = minst; // instantiated -> inserted module
if (global.params.useUnitTests || global.params.debuglevel)
{
// Turn all non-root instances to speculative
if (mi && !mi.isRoot())
mi = null;
}
if (!mi || mi.isRoot())
{
/* If the instantiated module is speculative or root, insert to the
* member of a root module. Then:
* - semantic3 pass will get called on the instance members.
* - codegen pass will get a selection chance to do/skip it.
*/
// insert target is made stable by using the module
// where tempdecl is declared.
mi = tempdecl.getModule();
if (!mi.isRoot())
mi = mi.importedFrom;
assert(mi.isRoot());
}
else
{
/* If the instantiated module is non-root, insert to the member of the
* non-root module. Then:
* - semantic3 pass won't be called on the instance.
* - codegen pass won't reach to the instance.
*/
}
Dsymbols* a = mi.members;
for (size_t i = 0; 1; i++)
{
if (i == a.dim)
{
a.push(this);
if (mi.semanticRun >= PASSsemantic3done && mi.isRoot())
Module.addDeferredSemantic3(this);
break;
}
if (this == (*a)[i]) // if already in Array
{
a = null;
break;
}
}
return a;
}
/****************************************************
* Declare parameters of template instance, initialize them with the
* template instance arguments.
*/
final void declareParameters(Scope* sc)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
//printf("TemplateInstance::declareParameters()\n");
for (size_t i = 0; i < tdtypes.dim; i++)
{
TemplateParameter tp = (*tempdecl.parameters)[i];
//RootObject *o = (*tiargs)[i];
RootObject o = tdtypes[i]; // initializer for tp
//printf("\ttdtypes[%d] = %p\n", i, o);
tempdecl.declareParameter(sc, tp, o);
}
}
/****************************************
* This instance needs an identifier for name mangling purposes.
* Create one by taking the template declaration name and adding
* the type signature for it.
*/
final Identifier genIdent(Objects* args)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
//printf("TemplateInstance::genIdent('%s')\n", tempdecl->ident->toChars());
OutBuffer buf;
char* id = tempdecl.ident.toChars();
if (!members)
{
// Use "__U" for the symbols declared inside template constraint.
buf.printf("__U%llu%s", cast(ulong)strlen(id), id);
}
else
buf.printf("__T%llu%s", cast(ulong)strlen(id), id);
size_t nparams = tempdecl.parameters.dim - (tempdecl.isVariadic() ? 1 : 0);
for (size_t i = 0; i < args.dim; i++)
{
RootObject o = (*args)[i];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
Tuple va = isTuple(o);
//printf("\to [%d] %p ta %p ea %p sa %p va %p\n", i, o, ta, ea, sa, va);
if (i < nparams && (*tempdecl.parameters)[i].specialization())
buf.writeByte('H'); // Bugzilla 6574
if (ta)
{
buf.writeByte('T');
if (ta.deco)
buf.writestring(ta.deco);
else
{
debug
{
if (!global.errors)
printf("ta = %d, %s\n", ta.ty, ta.toChars());
}
assert(global.errors);
}
}
else if (ea)
{
// Don't interpret it yet, it might actually be an alias
ea = ea.optimize(WANTvalue);
if (ea.op == TOKvar)
{
sa = (cast(VarExp)ea).var;
ea = null;
goto Lsa;
}
if (ea.op == TOKthis)
{
sa = (cast(ThisExp)ea).var;
ea = null;
goto Lsa;
}
if (ea.op == TOKfunction)
{
if ((cast(FuncExp)ea).td)
sa = (cast(FuncExp)ea).td;
else
sa = (cast(FuncExp)ea).fd;
ea = null;
goto Lsa;
}
buf.writeByte('V');
if (ea.op == TOKtuple)
{
ea.error("tuple is not a valid template value argument");
continue;
}
// Now that we know it is not an alias, we MUST obtain a value
uint olderr = global.errors;
ea = ea.ctfeInterpret();
if (ea.op == TOKerror || olderr != global.errors)
continue;
/* Use deco that matches what it would be for a function parameter
*/
buf.writestring(ea.type.deco);
mangleToBuffer(ea, &buf);
}
else if (sa)
{
Lsa:
buf.writeByte('S');
sa = sa.toAlias();
Declaration d = sa.isDeclaration();
if (d && (!d.type || !d.type.deco))
{
error("forward reference of %s %s", d.kind(), d.toChars());
continue;
}
const(char)* p = mangle(sa);
/* Bugzilla 3043: if the first character of p is a digit this
* causes ambiguity issues because the digits of the two numbers are adjacent.
* Current demanglers resolve this by trying various places to separate the
* numbers until one gets a successful demangle.
* Unfortunately, fixing this ambiguity will break existing binary
* compatibility and the demanglers, so we'll leave it as is.
*/
buf.printf("%llu%s", cast(ulong)strlen(p), p);
}
else if (va)
{
assert(i + 1 == args.dim); // must be last one
args = &va.objects;
i = -cast(size_t)1;
}
else
assert(0);
}
buf.writeByte('Z');
id = buf.peekString();
//printf("\tgenIdent = %s\n", id);
return Identifier.idPool(id);
}
final void expandMembers(Scope* sc2)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.setScope(sc2);
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.importAll(sc2);
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
//printf("\t[%d] semantic on '%s' %p kind %s in '%s'\n", i, s->toChars(), s, s->kind(), this->toChars());
//printf("test: enclosing = %d, sc2->parent = %s\n", enclosing, sc2->parent->toChars());
// if (enclosing)
// s->parent = sc->parent;
//printf("test3: enclosing = %d, s->parent = %s\n", enclosing, s->parent->toChars());
s.semantic(sc2);
//printf("test4: enclosing = %d, s->parent = %s\n", enclosing, s->parent->toChars());
sc2._module.runDeferredSemantic();
}
}
final void tryExpandMembers(Scope* sc2)
{
static __gshared int nest;
// extracted to a function to allow windows SEH to work without destructors in the same function
//printf("%d\n", nest);
if (++nest > 500)
{
global.gag = 0; // ensure error message gets printed
error("recursive expansion");
fatal();
}
expandMembers(sc2);
nest--;
}
final void trySemantic3(Scope* sc2)
{
// extracted to a function to allow windows SEH to work without destructors in the same function
static __gshared int nest;
//printf("%d\n", nest);
if (++nest > 300)
{
global.gag = 0; // ensure error message gets printed
error("recursive expansion");
fatal();
}
semantic3(sc2);
--nest;
}
final TemplateInstance isTemplateInstance()
{
return this;
}
void accept(Visitor v)
{
v.visit(this);
}
}
/**************************************
* IsExpression can evaluate the specified type speculatively, and even if
* it instantiates any symbols, they are normally unnecessary for the
* final executable.
* However, if those symbols leak to the actual code, compiler should remark
* them as non-speculative to generate their code and link to the final executable.
*/
extern (C++) void unSpeculative(Scope* sc, RootObject o)
{
if (!o)
return;
if (Tuple tup = isTuple(o))
{
for (size_t i = 0; i < tup.objects.dim; i++)
{
unSpeculative(sc, tup.objects[i]);
}
return;
}
Dsymbol s = getDsymbol(o);
if (!s)
return;
Declaration d = s.isDeclaration();
if (d)
{
if (VarDeclaration vd = d.isVarDeclaration())
o = vd.type;
else if (AliasDeclaration ad = d.isAliasDeclaration())
{
o = ad.getType();
if (!o)
o = ad.toAlias();
}
else
o = d.toAlias();
s = getDsymbol(o);
if (!s)
return;
}
if (TemplateInstance ti = s.isTemplateInstance())
{
// If the instance is already non-speculative,
// or it is leaked to the speculative scope.
if (ti.minst !is null || sc.minst is null)
return;
// Remark as non-speculative instance.
ti.minst = sc.minst;
if (!ti.tinst)
ti.tinst = sc.tinst;
unSpeculative(sc, ti.tempdecl);
}
if (TemplateInstance ti = s.isInstantiated())
unSpeculative(sc, ti);
}
/**********************************
* Return true if e could be valid only as a template value parameter.
* Return false if it might be an alias or tuple.
* (Note that even in this case, it could still turn out to be a value).
*/
extern (C++) bool definitelyValueParameter(Expression e)
{
// None of these can be value parameters
if (e.op == TOKtuple || e.op == TOKimport || e.op == TOKtype || e.op == TOKdottype || e.op == TOKtemplate || e.op == TOKdottd || e.op == TOKfunction || e.op == TOKerror || e.op == TOKthis || e.op == TOKsuper)
return false;
if (e.op != TOKdotvar)
return true;
/* Template instantiations involving a DotVar expression are difficult.
* In most cases, they should be treated as a value parameter, and interpreted.
* But they might also just be a fully qualified name, which should be treated
* as an alias.
*/
// x.y.f cannot be a value
FuncDeclaration f = (cast(DotVarExp)e).var.isFuncDeclaration();
if (f)
return false;
while (e.op == TOKdotvar)
{
e = (cast(DotVarExp)e).e1;
}
// this.x.y and super.x.y couldn't possibly be valid values.
if (e.op == TOKthis || e.op == TOKsuper)
return false;
// e.type.x could be an alias
if (e.op == TOKdottype)
return false;
// var.x.y is the only other possible form of alias
if (e.op != TOKvar)
return true;
VarDeclaration v = (cast(VarExp)e).var.isVarDeclaration();
// func.x.y is not an alias
if (!v)
return true;
// TODO: Should we force CTFE if it is a global constant?
return false;
}
extern (C++) final class TemplateMixin : TemplateInstance
{
public:
TypeQualified tqual;
/* ======================== TemplateMixin ================================ */
extern (D) this(Loc loc, Identifier ident, TypeQualified tqual, Objects* tiargs)
{
super(loc, tqual.idents.dim ? cast(Identifier)tqual.idents[tqual.idents.dim - 1] : (cast(TypeIdentifier)tqual).ident);
//printf("TemplateMixin(ident = '%s')\n", ident ? ident->toChars() : "");
this.ident = ident;
this.tqual = tqual;
this.tiargs = tiargs ? tiargs : new Objects();
}
Dsymbol syntaxCopy(Dsymbol s)
{
auto tm = new TemplateMixin(loc, ident, cast(TypeQualified)tqual.syntaxCopy(), tiargs);
return TemplateInstance.syntaxCopy(tm);
}
void semantic(Scope* sc)
{
static if (LOG)
{
printf("+TemplateMixin::semantic('%s', this=%p)\n", toChars(), this);
fflush(stdout);
}
if (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;
}
semanticRun = PASSsemantic;
static if (LOG)
{
printf("\tdo semantic\n");
}
Scope* scx = null;
if (_scope)
{
sc = _scope;
scx = _scope; // save so we don't make redundant copies
_scope = null;
}
/* Run semantic on each argument, place results in tiargs[],
* then find best match template with tiargs
*/
if (!findTempDecl(sc) || !semanticTiargs(sc) || !findBestMatch(sc, null))
{
if (semanticRun == PASSinit) // forward reference had occured
{
/* Cannot handle forward references if mixin is a struct member,
* because addField must happen during struct's semantic, not
* during the mixin semantic.
* runDeferred will re-run mixin's semantic outside of the struct's
* semantic.
*/
AggregateDeclaration ad = toParent().isAggregateDeclaration();
if (ad)
ad.sizeok = SIZEOKfwd;
else
{
// Forward reference
//printf("forward reference - deferring\n");
_scope = scx ? scx : sc.copy();
_scope.setNoFree();
_scope._module.addDeferredSemantic(this);
}
return;
}
inst = this;
errors = true;
return; // error recovery
}
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
if (!ident)
{
/* Assign scope local unique identifier, as same as lambdas.
*/
const(char)* s = "__mixin";
DsymbolTable symtab;
if (FuncDeclaration func = sc.parent.isFuncDeclaration())
{
symtab = func.localsymtab;
if (symtab)
{
// Inside template constraint, symtab is not set yet.
goto L1;
}
}
else
{
symtab = sc.parent.isScopeDsymbol().symtab;
L1:
assert(symtab);
int num = cast(int)dmd_aaLen(symtab.tab) + 1;
ident = Identifier.generateId(s, num);
symtab.insert(this);
}
}
inst = this;
parent = sc.parent;
/* Detect recursive mixin instantiations.
*/
for (Dsymbol s = parent; s; s = s.parent)
{
//printf("\ts = '%s'\n", s->toChars());
TemplateMixin tm = s.isTemplateMixin();
if (!tm || tempdecl != tm.tempdecl)
continue;
/* Different argument list lengths happen with variadic args
*/
if (tiargs.dim != tm.tiargs.dim)
continue;
for (size_t i = 0; i < tiargs.dim; i++)
{
RootObject o = (*tiargs)[i];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
RootObject tmo = (*tm.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);
}
error("recursive mixin instantiation");
return;
Lcontinue:
continue;
}
// Copy the syntax trees from the TemplateDeclaration
members = Dsymbol.arraySyntaxCopy(tempdecl.members);
if (!members)
return;
symtab = new DsymbolTable();
for (Scope* sce = sc; 1; sce = sce.enclosing)
{
ScopeDsymbol sds = cast(ScopeDsymbol)sce.scopesym;
if (sds)
{
sds.importScope(this, Prot(PROTpublic));
break;
}
}
static if (LOG)
{
printf("\tcreate scope for template parameters '%s'\n", toChars());
}
Scope* scy = sc.push(this);
scy.parent = this;
argsym = new ScopeDsymbol();
argsym.parent = scy.parent;
Scope* argscope = scy.push(argsym);
uint errorsave = global.errors;
// Declare each template parameter as an alias for the argument type
declareParameters(argscope);
// Add members to enclosing scope, as well as this scope
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.addMember(argscope, this);
//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", toChars());
}
Scope* sc2 = argscope.push(this);
//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
error("recursive expansion");
fatal();
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.setScope(sc2);
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.importAll(sc2);
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.semantic(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::semantic().
*/
//if (!sc->func && Module::deferred.dim > deferred_dim) {}
AggregateDeclaration ad = toParent().isAggregateDeclaration();
if (sc.func && !ad)
{
semantic2(sc2);
semantic3(sc2);
}
// Give additional context info if error occurred during instantiation
if (global.errors != errorsave)
{
error("error instantiating");
errors = true;
}
sc2.pop();
argscope.pop();
scy.pop();
static if (LOG)
{
printf("-TemplateMixin::semantic('%s', this=%p)\n", toChars(), this);
}
}
void semantic2(Scope* sc)
{
if (semanticRun >= PASSsemantic2)
return;
semanticRun = PASSsemantic2;
static if (LOG)
{
printf("+TemplateMixin::semantic2('%s')\n", toChars());
}
if (members)
{
assert(sc);
sc = sc.push(argsym);
sc = sc.push(this);
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*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", toChars());
}
}
void semantic3(Scope* sc)
{
if (semanticRun >= PASSsemantic3)
return;
semanticRun = PASSsemantic3;
static if (LOG)
{
printf("TemplateMixin::semantic3('%s')\n", toChars());
}
if (members)
{
sc = sc.push(argsym);
sc = sc.push(this);
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.semantic3(sc);
}
sc = sc.pop();
sc.pop();
}
}
const(char)* kind()
{
return "mixin";
}
bool oneMember(Dsymbol* ps, Identifier ident)
{
return Dsymbol.oneMember(ps, ident);
}
int apply(Dsymbol_apply_ft_t fp, void* param)
{
if (members)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
if (s)
{
if (s.apply(fp, param))
return 1;
}
}
}
return 0;
}
bool hasPointers()
{
//printf("TemplateMixin::hasPointers() %s\n", toChars());
if (members)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
//printf(" s = %s %s\n", s->kind(), s->toChars());
if (s.hasPointers())
{
return true;
}
}
}
return false;
}
void setFieldOffset(AggregateDeclaration ad, uint* poffset, bool isunion)
{
//printf("TemplateMixin::setFieldOffset() %s\n", toChars());
if (_scope) // if fwd reference
semantic(null); // try to resolve it
if (members)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
//printf("\t%s\n", s->toChars());
s.setFieldOffset(ad, poffset, isunion);
}
}
}
char* toChars()
{
OutBuffer buf;
toCBufferInstance(this, &buf);
return buf.extractString();
}
bool findTempDecl(Scope* sc)
{
// Follow qualifications to find the TemplateDeclaration
if (!tempdecl)
{
Expression e;
Type t;
Dsymbol s;
tqual.resolve(loc, sc, &e, &t, &s);
if (!s)
{
error("is not defined");
return false;
}
s = s.toAlias();
tempdecl = s.isTemplateDeclaration();
OverloadSet os = s.isOverloadSet();
/* If an OverloadSet, look for a unique member that is a template declaration
*/
if (os)
{
Dsymbol ds = null;
for (size_t i = 0; i < os.a.dim; i++)
{
Dsymbol s2 = os.a[i].isTemplateDeclaration();
if (s2)
{
if (ds)
{
tempdecl = os;
break;
}
ds = s2;
}
}
}
if (!tempdecl)
{
error("%s isn't a template", s.toChars());
return false;
}
}
assert(tempdecl);
struct ParamFwdResTm
{
extern (C++) static int fp(void* param, Dsymbol s)
{
TemplateDeclaration td = s.isTemplateDeclaration();
if (!td)
return 0;
TemplateMixin tm = cast(TemplateMixin)param;
if (td.semanticRun == PASSinit)
{
if (td._scope)
td.semantic(td._scope);
else
{
tm.semanticRun = PASSinit;
return 1;
}
}
return 0;
}
}
// Look for forward references
OverloadSet tovers = tempdecl.isOverloadSet();
size_t overs_dim = tovers ? tovers.a.dim : 1;
for (size_t oi = 0; oi < overs_dim; oi++)
{
if (overloadApply(tovers ? tovers.a[oi] : tempdecl, cast(void*)this, &ParamFwdResTm.fp))
return false;
}
return true;
}
TemplateMixin isTemplateMixin()
{
return this;
}
void accept(Visitor v)
{
v.visit(this);
}
}
|
D
|
module d2d.views.list;
import std.stdio;
import d2d.kernal;
import d2d.views.view;
/**
* List
*/
class List {
private {
Kernal* _kernal = null;
View[] _views;
int _current = -1;
}
this(Kernal kernal) {
_kernal = &kernal;
}
~this() {
foreach(v; _views) {
v.destroy;
}
_views.length = 0;
_current = -1;
}
/**
* next
*/
public View next() {
if(current.next != -1) { _current = current.next; }
return current;
}
/**
* previous
*/
public View previous() {
if(current.previous != -1) { _current = current.previous; }
return current;
}
/**
* add
*/
public void add(View view) {
view.build(_kernal, cast(int)_views.length);
_views ~= view;
}
/**
* current
*/
public View current() {
return _current == -1 ? null : _views[_current];
}
/**
* current
*/
public void current(int index) {
_current = index;
}
}
|
D
|
/substrate-node-template/target/debug/build/rand-aa99c5f91e7334bd/build_script_build-aa99c5f91e7334bd: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/build.rs
/substrate-node-template/target/debug/build/rand-aa99c5f91e7334bd/build_script_build-aa99c5f91e7334bd.d: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/build.rs
/root/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/build.rs:
|
D
|
module test_runner;
import std.file;
import std.stdio;
import std.string;
import core.thread, std.process, std.concurrency;
import core.sys.posix.signal;
import std.exception;
import std.algorithm.searching;
import test_case;
string targetFolder = "tests";
string duckExecutable = "bin/duck-test-ext";
string failCompilation = "not-compilable";
string succeedCompilation = "compilable";
string runnable = "runnable";
bool verbose = false;
string[] specifiedFiles;
struct Proc {
string filename;
int result;
Pid pid;
this(string filename, string options) {
this.filename = filename;
auto command = [duckExecutable, this.filename];
if (options)
command ~= options.split(" ");
this.pipes = pipeProcess(command);//, Redirect.stderr);
this.pid = this.pipes.pid;
//spawn(&streamReader, this.pid.processID(), this.pipes.stderr().getFP());
}
void stop() {
if (tryWait(pid).terminated)
return;
kill(this.pid, SIGKILL);
result = .wait(this.pid);
pid = Pid.init;
}
string wait() {
char[] output;
assumeSafeAppend(output);
while (this.pipes.stderr().isOpen()) {
if (!alive) break;
auto s = this.pipes.stderr().readln();
if (s) {
// Have to ignore lines like the following:
//2015-12-06 11:26:15.572 duck_temp0[84308:8477413] 11:26:15.572 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
if (s.indexOf("deprecated Carbon Component Manager") >= 0) continue;
s = s.replace("\033[0;31m", "");
s = s.replace("\033[0m", "");
output ~= s;
}
//write(s);
}
result = .wait(this.pid);
return output.strip.assumeUnique;
}
@property bool alive() {
return !tryWait(pid).terminated;
}
static void streamReader(int pid, FILE* osFile)
{
import std.string;
File input = File.wrapFile(osFile);
while (!input.eof()) {
string line = input.readln();
//stderr.writefln("[%s] %s", pid, line);
//owner.send(pid, line);
}
}
string output;
ProcessPipes pipes;
}
auto findFiles(string where) {
string[] files;
auto dFiles = dirEntries(targetFolder ~ "/" ~ where, "*.{duck}", SpanMode.depth);
foreach(d; dFiles) {
if (specifiedFiles.length == 0 || specifiedFiles.canFind(d.name))
files ~= d.name;
}
return files;
}
auto advance(string[] s, ref int index, int howMuch) {
import std.uni;
int start = index;
for (int i = 0; i < howMuch; ++i) {
index += 1;
}
return s[start..index];
}
void compare(string[] output, string[] expected) {
import std.algorithm.comparison;
import std.uni;
import std.array;
auto ops = levenshteinDistanceAndPath(output, expected)[1];
int o = 0, e = 0;
//writeln(output.length, ", ", expected.length, " ", ops.length);
for (int i = 0; i < ops.length; ++i) {
int length = 1;
EditOp current = ops[i];
while(i+1 < ops.length && ops[i+1] == current) {
++length;
++i;
}
final switch(current) {
case EditOp.none:
write("\033[0;30m");
write(output.advance(o, length).join("\n"));
expected.advance(e, length);
writeln("\033[0m");
break;
case EditOp.substitute:
write("\033[0;34m");
write(expected.advance(e, length).join("\n"));
writeln("\033[0;31m");
write(output.advance(o, length).join("\n"));
writeln("\033[0m");
break;
case EditOp.insert:
write("\033[0;34m");
write(expected.advance(e, length).join("\n"));
writeln("\033[0m");
break;
case EditOp.remove:
write("\033[0;31m");
write(output.advance(o, length).join("\n"));
writeln("\033[0m");
break;
}
}
}
void compareOutput(string output, string expected) {
if (output != expected) {
writeln("Output not as expected: (blue missing, red unexpected)");
compare(output.split("\n"), expected.split("\n"));
}
return;
/*if (expected) {
writeln("Expected output:");
write("\033[0;33m");
write(expected);
write("\033[0m");
if (output != expected && output) {
writeln("\nActual output:");
}
} else {
if (output != expected && output) {
writeln("Unexpected output:");
}
}
if (output && output != expected) {
write("\033[0;33m");
write(output);
write("\033[0m");
}*/
//writefln("\033[0;9mstrikethrough\033[0m");
}
int failed;
int total;
int succeeded;
auto test(string file, bool expectProcessSuccess, bool run = false)
{
total++;
TestCase testCase = TestCase(file);
string options = (testCase.options ? testCase.options : "") ~ " -n -e null --notreeshake";
if (!run) options ~= " -t check";
auto proc = Proc(file, options);
auto output = proc.wait();
if (output == testCase.output.stderr &&
((expectProcessSuccess && proc.result == 0)||(!expectProcessSuccess && proc.result != 0))) {
succeeded++;
if (verbose)
writeln("\033[0;32mOK ", file, "\033[0m");
}
else {
failed++;
writeln("\033[0;31mFAIL ", file, "\033[0m");
if (!expectProcessSuccess && proc.result <= 0) {
writeln("Unexpected exit code ", proc.result, ", expected > 0.");
}
else if (expectProcessSuccess && proc.result != 0) {
writeln("Unexpected exit code ", proc.result, ", expected 0.");
}
compareOutput(output, testCase.output.stderr);
writeln();
}
}
auto testSucceedCompilation() {
//writefln("****** SUCCEED COMPILATION TESTS ******");
string[] files = findFiles(succeedCompilation);
foreach(string file; files) {
test(file, true);
}
}
auto testFailCompilation() {
//writefln("****** FAIL COMPILATION TESTS ******");
string[] files = findFiles(failCompilation);
foreach(string file; files) {
test(file, false);
}
}
auto testRunnable() {
//writefln("****** FAIL COMPILATION TESTS ******");
string[] files = findFiles(runnable);
foreach(string file; files) {
test(file, true, true);
}
}
int main(string[] args) {
for (int i = 1; i < args.length; ++i) {
string arg = args[i];
if (arg == "--executable" || arg == "-e") {
duckExecutable = args[++i];
}
else if (arg == "--verbose" || arg == "-v") {
verbose = true;
}
else if (arg.startsWith("-")) {
stderr.writeln("Unexpected argument: ", arg);
return 1;
}
else specifiedFiles ~= arg;
}
if (verbose) {
writeln("\n************************************************************************************");
writeln("* Compilable");
writeln("************************************************************************************\n");
}
testSucceedCompilation();
if (verbose) {
writeln("\n************************************************************************************");
writeln("* Not compilable");
writeln("************************************************************************************\n");
}
testFailCompilation();
if (verbose) {
writeln("\n************************************************************************************");
writeln("* Runnable");
writeln("************************************************************************************\n");
}
testRunnable();
if (verbose) {
writeln();
writeln("************************************************************************************");
write("* ");
}
if (failed > 0) {
write("\033[0;31m");
} else {
write("\033[0;32m");
}
write(succeeded, "/", total, " tests succeeded.");
writeln("\033[0m");
if (verbose)
writeln("************************************************************************************");
return failed;
}
|
D
|
/*
Copyright (c) 2018 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module dagon.graphics.shaders.particle;
import std.stdio;
import std.math;
import std.conv;
import dlib.core.memory;
import dlib.math.vector;
import dlib.math.matrix;
import dlib.math.transformation;
import dlib.image.color;
import dagon.core.libs;
import dagon.core.ownership;
import dagon.graphics.rc;
import dagon.graphics.shader;
import dagon.graphics.gbuffer;
class ParticleShader: Shader
{
string vs = import("Particle.vs");
string fs = import("Particle.fs");
GBuffer gbuffer;
this(GBuffer gbuffer, Owner o)
{
auto myProgram = New!ShaderProgram(vs, fs, this);
super(myProgram, o);
this.gbuffer = gbuffer;
}
override void bind(RenderingContext* rc)
{
auto idiffuse = "diffuse" in rc.material.inputs;
auto inormal = "normal" in rc.material.inputs;
auto ienergy = "energy" in rc.material.inputs;
auto itransparency = "transparency" in rc.material.inputs;
auto iparticleColor = "particleColor" in rc.material.inputs;
auto iparticleSphericalNormal = "particleSphericalNormal" in rc.material.inputs;
auto ishadeless = "shadeless" in rc.material.inputs;
// Matrices
setParameter("modelViewMatrix", rc.modelViewMatrix);
setParameter("projectionMatrix", rc.projectionMatrix);
setParameter("normalMatrix", rc.normalMatrix);
setParameter("viewMatrix", rc.viewMatrix);
setParameter("invViewMatrix", rc.invViewMatrix);
setParameter("prevModelViewProjMatrix", rc.prevModelViewProjMatrix);
setParameter("blurModelViewProjMatrix", rc.blurModelViewProjMatrix);
setParameter("viewSize", Vector2f(gbuffer.width, gbuffer.height));
Color4f particleColor = Color4f(1.0f, 1.0f, 1.0f, 1.0f);
if (iparticleColor)
particleColor = Color4f(iparticleColor.asVector4f);
float alpha = 1.0f;
if (itransparency)
alpha = itransparency.asFloat;
float energy = ienergy.asFloat;
setParameter("particleColor", particleColor);
setParameter("alpha", alpha);
setParameter("energy", energy);
setParameter("alphaCutout", rc.shadowPass);
setParameter("alphaCutoutThreshold", 0.25f); // TODO: store in material properties
setParameter("particlePosition", rc.modelViewMatrix.translation);
bool shaded = true;
if (ishadeless)
shaded = !(ishadeless.asBool);
setParameter("shaded", shaded);
// Texture 0 - diffuse texture
if (idiffuse.texture is null)
{
setParameter("diffuseVector", idiffuse.asVector4f);
setParameterSubroutine("diffuse", ShaderType.Fragment, "diffuseColorValue");
}
else
{
glActiveTexture(GL_TEXTURE0);
idiffuse.texture.bind();
setParameter("diffuseTexture", 0);
setParameterSubroutine("diffuse", ShaderType.Fragment, "diffuseColorTexture");
}
// Texture 1 - position texture (for soft particles)
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, gbuffer.positionTexture);
setParameter("positionTexture", 1);
// Texture 2 - normal map
if (inormal.texture is null)
{
bool sphericalNormal = false;
if (iparticleSphericalNormal)
sphericalNormal = iparticleSphericalNormal.asBool;
if (sphericalNormal)
{
setParameterSubroutine("normal", ShaderType.Fragment, "normalFunctionHemisphere");
}
else
{
Vector3f nVec = inormal.asVector3f;
setParameter("normalVector", nVec);
setParameterSubroutine("normal", ShaderType.Fragment, "normalValue");
}
}
else
{
glActiveTexture(GL_TEXTURE2);
inormal.texture.bind();
setParameter("normalTexture", 2);
setParameterSubroutine("normal", ShaderType.Fragment, "normalMap");
}
// Environment
setParameter("sunDirection", rc.environment.sunDirectionEye(rc.viewMatrix));
setParameter("sunColor", rc.environment.sunColor);
setParameter("sunEnergy", rc.environment.sunEnergy);
if (rc.environment.environmentMap)
{
glActiveTexture(GL_TEXTURE3);
rc.environment.environmentMap.bind();
setParameter("envTexture", 3);
setParameterSubroutine("environment", ShaderType.Fragment, "environmentTexture");
}
else
{
setParameter("skyZenithColor", rc.environment.skyZenithColor);
setParameter("skyHorizonColor", rc.environment.skyHorizonColor);
setParameter("groundColor", rc.environment.groundColor);
setParameter("skyEnergy", rc.environment.skyEnergy);
setParameter("groundEnergy", rc.environment.groundEnergy);
setParameterSubroutine("environment", ShaderType.Fragment, "environmentSky");
}
setParameter("environmentBrightness", rc.environment.environmentBrightness);
glActiveTexture(GL_TEXTURE0);
super.bind(rc);
}
override void unbind(RenderingContext* rc)
{
super.unbind(rc);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE3);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE0);
}
}
|
D
|
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Console.build/Activity/ActivityBar.swift.o : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Console.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Console.build/Activity/ActivityBar~partial.swiftmodule : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Console.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Console.build/Activity/ActivityBar~partial.swiftdoc : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Console.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker.o : /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintConfig.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Debugging.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintItem.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintRelation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDescription.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMaker.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Typealiases.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDirectionalInsets.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintInsets.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDirectionalInsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Constraint.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/LayoutConstraint.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintView.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintPriority.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker~partial.swiftmodule : /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintConfig.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Debugging.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintItem.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintRelation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDescription.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMaker.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Typealiases.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDirectionalInsets.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintInsets.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDirectionalInsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Constraint.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/LayoutConstraint.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintView.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintPriority.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker~partial.swiftdoc : /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintConfig.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Debugging.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintItem.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintRelation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDescription.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMaker.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Typealiases.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDirectionalInsets.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintInsets.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDirectionalInsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Constraint.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/LayoutConstraint.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintView.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintPriority.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker~partial.swiftsourceinfo : /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintConfig.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Debugging.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintItem.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintRelation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDescription.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMaker.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Typealiases.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDirectionalInsets.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintInsets.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintDirectionalInsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/Constraint.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/LayoutConstraint.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintView.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/SnapKit/Source/ConstraintPriority.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/Users/spandana.nayakanti/Desktop/InfyProject/Build/Intermediates.noindex/InfyProject.build/Debug-iphonesimulator/InfyProject.build/Objects-normal/x86_64/AppDelegate.o : /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/AppDelegate.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/Model/DataModel.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/TableViewCell.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/ViewController.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/DetailViewController.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/spandana.nayakanti/Desktop/InfyProject/Build/Intermediates.noindex/InfyProject.build/Debug-iphonesimulator/InfyProject.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/AppDelegate.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/Model/DataModel.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/TableViewCell.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/ViewController.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/DetailViewController.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/spandana.nayakanti/Desktop/InfyProject/Build/Intermediates.noindex/InfyProject.build/Debug-iphonesimulator/InfyProject.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/AppDelegate.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/Model/DataModel.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/TableViewCell.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/ViewController.swift /Users/spandana.nayakanti/Desktop/InfyProject/InfyProject/DetailViewController.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
|
; 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_float_to_int_3.java
.class public dot.junit.opcodes.float_to_int.d.T_float_to_int_3
.super java/lang/Object
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public run(F)I
.limit regs 5
const-wide v1, 1234
float-to-int v0, v1
return v0
.end method
|
D
|
/mnt/e/myrcore/lab_code/lab4_code1/os/target/debug/build/syn-a6917fb520320fc4/build_script_build-a6917fb520320fc4: /home/xushanpu123/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/syn-1.0.35/build.rs
/mnt/e/myrcore/lab_code/lab4_code1/os/target/debug/build/syn-a6917fb520320fc4/build_script_build-a6917fb520320fc4.d: /home/xushanpu123/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/syn-1.0.35/build.rs
/home/xushanpu123/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/syn-1.0.35/build.rs:
|
D
|
module build;
/*
Build tool to build all samples or individual samples.
*/
import core.thread : Thread, dur;
import std.algorithm;
import std.array;
import std.conv;
import std.exception;
import std.functional;
import std.stdio;
import std.string;
import std.path;
import std.file;
import std.process;
import std.parallelism;
extern(C) int kbhit();
extern(C) int getch();
string projectRootDir;
int main(string[] args)
{
projectRootDir = getcwd();
args.popFront;
foreach (arg; args)
{
if (arg.toLower == "clean") cleanOnly = true;
else if (arg.toLower == "debug") Debug = true;
else if (arg.toLower == "gdc") compiler = Compiler.GDC;
else if (arg.toLower == "dmd") compiler = Compiler.DMD;
else if (arg.toLower == "run") doRun = true;
else if (arg.toLower == "parallel") parallelBuilding = true;
else
if (arg.isFile && arg.extension == ".d")
{
soloProject = dirName(arg);
}
else
{
if (arg.driveName.length)
{
if (arg.exists && arg.isDir)
{
soloProject = arg;
continue;
}
}
writeln("Cannot build project in path: \"" ~ arg
~ "\". Try wrapping %CD% with quotes when calling build: \"%CD%\"");
return 1;
}
}
if (soloProject.length && parallelBuilding) {
parallelBuilding = false; // only makes sense in multi-sample builds, just ignore for now
}
if (doRun && parallelBuilding) {
writeln("Cannot use both run & parallel as this would open too many apps");
return 1;
}
if (compiler == Compiler.GDC)
{
auto status = executeShell("perl.exe --help > nul 2>&1 ");
if (status.status != 0)
{
writefln("Error: Couldn't invoke perl.exe: %s. Perl is required to run the "
~ "GDMD script, try installing Strawberry Perl: http://strawberryperl.com",
status.output);
return 0;
}
}
string[] dirs;
if (soloProject.length)
{
silent = true;
dirs ~= getSafePath(absolutePath(soloProject));
string dWinPath = findAbsolutePath(".", "DWinProgramming");
chdir(dWinPath);
}
else
{
dirs = getProjectDirs(absolutePath("." ~ `\Samples`));
}
if (!cleanOnly)
{
checkTools();
checkWinLib();
if (!silent)
{
//~ writeln("About to build.");
// @BUG@ The RDMD bundled with DMD 2.053 has input handling bugs,
// wait for 2.054 to print this out. If you have RDMD from github,
// you can press 'q' during the build process to force exit.
//~ writeln("About to build. Press 'q' to stop the build process.");
//~ Thread.sleep(dur!("seconds")(2));
}
}
try
{
buildProjectDirs(dirs, cleanOnly);
}
catch (ForcedExitException)
{
writeln("\nBuild process halted, about to clean..\n");
Thread.sleep(dur!("seconds")(1));
cleanOnly = true;
buildProjectDirs(dirs, cleanOnly);
}
catch (FailedBuildException exc)
{
if (!soloProject.length) // solo already logged once, no need to repeat
{
writefln("\n\n%s projects failed to build:", exc.failedMods.length);
foreach (i, mod; exc.failedMods)
{
writeln(mod, exc.errorMsgs[i]);
}
}
return 1;
}
if (!cleanOnly && !silent)
{
writeln("\nAll examples succesfully built.");
}
return 0;
}
// todo: recover resource compiling code (see first commit)
string[] RCINCLUDES;
bool allExist(string[] paths)
{
foreach (path; paths)
{
if (!path.exists)
return false;
}
return true;
}
void checkWinLib()
{
win32lib = (compiler == Compiler.DMD)
? "dmd_win32.lib"
: "gdc_win32.lib";
string buildScript = (compiler == Compiler.DMD)
? "dmd_build.bat"
: "gdc_build.bat";
enforce(win32lib.exists, format("Not found: %s. You have to compile the WindowsAPI bindings "
~ "first. Use the %s script in the win32 folder.", win32lib, buildScript));
}
void checkTools()
{
executeShell("echo int x; > test.h");
auto res = executeShell("cmd /c htod test.h").status;
if (res == -1 || res == 1)
{
skipHeaderCompile = true;
writeln("Warning: HTOD missing, won't retranslate .h headers.");
}
collectException(std.file.remove("test.h"));
collectException(std.file.remove("test.d"));
if (compiler == Compiler.DMD)
{
executeShell("echo //void > test.rc");
string cmd = (compiler == Compiler.DMD)
? "cmd /c rc test.rc > nul"
: "cmd /c windres test.rc > nul";
res = executeShell(cmd).status;
if (res == -1 || res == 1)
{
skipResCompile = true;
writeln("Warning: RC Compiler not found. Builder will use precompiled resources. "
~ "See README for more details.");
}
collectException(std.file.remove("test.rc"));
collectException(std.file.remove("test.res"));
}
if (!skipResCompile)
{
auto includes = environment.get("RCINCLUDES",
`C:\Program Files\Microsoft SDKs\Windows\v7.1\Include;C:\Program Files\`
~ `Microsoft Visual Studio 10.0\VC\include;C:\Program Files\`
~ `Microsoft Visual Studio 10.0\VC\atlmfc\include`).split(";");
if (includes.allExist)
{
RCINCLUDES = includes;
skipResCompile = false;
}
else
writeln("Won't compile resources.");
}
if (skipResCompile)
{
writeln("Warning: RC Compiler Include dirs not found. "
~ "Builder will will use precompiled resources.");
}
writeln();
Thread.sleep(dur!"seconds"(1));
}
string[] getFilesByExt(string dir, string ext, string ext2 = null)
{
string[] result;
foreach (string file; dirEntries(dir, SpanMode.shallow))
{
if (file.isFile && (file.extension.toLower == ext || file.extension.toLower == ext2))
{
result ~= file;
}
}
return result;
}
__gshared bool Debug;
__gshared bool cleanOnly;
__gshared bool skipHeaderCompile;
__gshared bool skipResCompile;
__gshared bool silent;
__gshared bool doRun;
__gshared bool parallelBuilding;
__gshared string win32lib;
enum Compiler { DMD, GDC }
__gshared Compiler compiler = Compiler.DMD;
string soloProject;
alias reduce!("a ~ ' ' ~ b") flatten;
string[] getProjectDirs(string root)
{
string[] result;
if (!isValidPath(root) || !exists(root))
{
assert(0, format("Path doesn't exist: %s", root));
}
// direntries is not a range in 2.053
foreach (string dir; dirEntries(root, SpanMode.shallow))
{
if (dir.isDir && dir.baseName != "MSDN" && dir.baseName != "Extra2")
{
foreach (string subdir; dirEntries(dir, SpanMode.shallow))
{
if (subdir.isDir && subdir.baseName != "todo")
result ~= subdir;
}
}
}
return result;
}
bool buildProject(string dir, out string errorMsg)
{
string appName = absolutePath(dir).baseName;
string exeName = absolutePath(dir) ~ `\` ~ appName ~ ".exe";
string LIBPATH = ".";
string debugFlags = "-IWindowsAPI -I. -version=Unicode -version=WindowsXP -d -g -w -wi";
string releaseFlags = (compiler == Compiler.DMD)
? "-IWindowsAPI -I. -version=Unicode -version=WindowsXP -d -L-Subsystem:Windows:4"
: "-IWindowsAPI -I. -version=Unicode -version=WindowsXP -d -L--subsystem -Lwindows";
string FLAGS = Debug ? debugFlags : releaseFlags;
// there's only one resource and header file for each example
string[] resources;
string[] headers;
if (!skipResCompile)
resources = dir.getFilesByExt(".rc");
if (!skipHeaderCompile)
headers = dir.getFilesByExt(".h");
// have to clean .o files for GCC
if (compiler == Compiler.GDC)
{
executeShell("cmd /c del " ~ absolutePath(dir) ~ `\*.o > nul`);
}
if (resources.length)
{
string res_cmd;
final switch (compiler)
{
case Compiler.DMD:
{
res_cmd = "rc " ~ resources[0].stripExtension ~ ".rc";
break;
}
case Compiler.GDC:
{
res_cmd = "windres -i " ~
resources[0].stripExtension ~ ".rc" ~
" -o " ~
resources[0].stripExtension ~ "_res.o";
break;
}
}
auto pc = executeShell(res_cmd);
auto output = pc.output;
auto res = pc.status;
if (res == -1 || res == 1)
{
errorMsg = format("Compiling resource file failed.\nCommand was:\n%s\n\nError was:\n%s",
res_cmd, output);
return false;
}
}
// @BUG@ htod can't output via -of or -od, causes multithreading issues.
// We're distributing precompiled .d files now.
//~ headers.length && executeShell("htod " ~ headers[0] ~ " " ~ `-IC:\dm\include`);
//~ headers.length && executeShell("copy resource.d " ~ absolutePath(dir) ~ `\resource.d > nul`);
// get sources after any .h header files were converted to .d header files
//~ auto sources = dir.getFilesByExt(".d", "res");
auto sources = dir.getFilesByExt(".d", (compiler == Compiler.DMD)
? ".res"
: ".o");
if (sources.length)
{
string cmd;
final switch (compiler)
{
case Compiler.DMD:
{
cmd = "dmd -vcolumns -m32omf -of" ~ exeName ~
" -od" ~ absolutePath(dir) ~ `\` ~
" -I" ~ LIBPATH ~ `\` ~
" " ~ LIBPATH ~ `\` ~ win32lib ~
" " ~ FLAGS ~
" " ~ sources.flatten;
break;
}
case Compiler.GDC:
{
version(LP_64)
enum bitSwitch = "-m64";
else
enum bitSwitch = "-m32";
cmd = "gdmd.bat " ~ bitSwitch ~ " " ~ "-fignore-unknown-pragmas -mwindows -of"
~ exeName
~ " -od" ~ absolutePath(dir) ~ `\`
~ " -Llibwinmm.a -Llibuxtheme.a -Llibcomctl32.a -Llibwinspool.a "
~ "-Llibws2_32.a -Llibgdi32.a -I" ~ LIBPATH ~ `\`
~ " " ~ LIBPATH ~ `\` ~ win32lib
~ " " ~ FLAGS
~ " " ~ sources.flatten;
break;
}
}
auto res = executeShell(cmd);
if (res.status != 0)
{
errorMsg = res.output;
return false;
}
}
return true;
}
void runApp(string dir)
{
string appName = absolutePath(dir).baseName;
string exeName = absolutePath(dir) ~ `\` ~ appName ~ ".exe";
chdir(absolutePath(dir));
executeShell(exeName);
}
void buildProjectDirs(string[] dirs, bool cleanOnly = false)
{
// @BUG@ Using chdir in parallel builds wreaks havoc on other threads.
alias predicate = (dir) => dir.baseName == "EdrTest"
|| dir.baseName == "ShowBit"
|| dir.baseName == "StrProg";
// isn't there an easier way to do this, via predicate or splitter or something..?
auto serialBuilds = dirs.filter!predicate;
dirs = dirs.filter!(not!predicate).array;
if (cleanOnly)
writeln("Cleaning.. ");
shared string[] errorMsgs;
shared string[] failedBuilds;
void buildDir(string dir)
{
if (!cleanOnly && kbhit())
{
auto key = cast(dchar)getch();
stdin.flush();
enforce(key != 'q', new ForcedExitException);
}
if (cleanOnly)
{
executeShell("cmd /c del " ~ dir ~ `\` ~ "*.obj > nul");
executeShell("cmd /c del " ~ dir ~ `\` ~ "*.exe > nul");
}
else
{
string errorMsg;
if (!buildProject(dir, /* out */ errorMsg))
{
synchronized writefln("Failed to build: %s\n%s", dir.relativePath(), errorMsg);
synchronized errorMsgs ~= errorMsg;
synchronized failedBuilds ~= dir.relativePath() ~ `\` ~ dir.baseName ~ ".exe";
}
else
{
if (!silent)
synchronized writeln("Built ok: " ~ dir.relativePath());
if (doRun) {
try {
runApp(dir);
} catch (Exception ex) {
writeln("Sample failed at runtime. Continuing build..");
}
chdir(projectRootDir); // go back to root
}
}
}
}
// GDC has issues when called in parallel (something seems to lock gdc files)
if (compiler == Compiler.GDC)
parallelBuilding = false;
writefln("Building %s samples..\n", dirs.count + serialBuilds.count);
if (parallelBuilding)
{
foreach (dir; parallel(dirs, 1))
buildDir(dir);
}
else
{
foreach (dir; dirs)
buildDir(dir);
}
foreach (dir; serialBuilds)
{
chdir(absolutePath(dir) ~ `\`);
if (cleanOnly)
{
executeShell("cmd /c del *.obj > nul");
executeShell("cmd /c del *.o > nul");
executeShell("cmd /c del *.exe > nul");
executeShell("cmd /c del *.di > nul");
executeShell("cmd /c del *.dll > nul");
executeShell("cmd /c del *.lib > nul");
}
else
{
string projScript = (compiler == Compiler.DMD)
? "dmd_build.bat"
: "gdc_build.bat";
string debugFlags = "-I. -version=Unicode -version=WindowsXP -g -w -wi";
string releaseFlags = (compiler == Compiler.DMD)
? "-I. -version=Unicode -version=WindowsXP -L-Subsystem:Windows:4"
: "-I. -version=Unicode -version=WindowsXP -L--subsystem -Lwindows";
if (projScript.exists)
{
auto pc = executeShell(projScript ~ " " ~ (Debug ? "-g" : "-L-Subsystem:Windows"));
auto output = pc.output;
auto res = pc.status;
if (res == 1 || res == -1)
{
failedBuilds ~= absolutePath(".") ~ `\.exe`;
errorMsgs ~= output;
}
}
}
}
// todo: simpler way to pass shared..?
enforce(!failedBuilds.length, new FailedBuildException(failedBuilds.to!(string[]),
errorMsgs.to!(string[])));
}
string findAbsolutePath(string path, string input)
{
string result;
foreach (name; path.absolutePath.pathSplitter)
{
result = buildPath(result, name);
if (name == input)
break;
}
return result;
}
/** Remove std.path shenanigans */
string getSafePath(string input)
{
return input.chomp(`\.`);
}
class ForcedExitException : Exception
{
this()
{
super("");
}
}
class FailedBuildException : Exception
{
string[] failedMods;
string[] errorMsgs;
this(string[] failedModules, string[] errorMsgs)
{
this.failedMods = failedModules;
this.errorMsgs = errorMsgs;
super("");
}
}
|
D
|
/Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/Build/Intermediates/protocolos.build/Debug-iphonesimulator/protocolos.build/Objects-normal/x86_64/Actividad.o : /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/Actividad.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/ViewController.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/AppDelegate.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/ViewControllerCalificar.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/TableViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/Build/Intermediates/protocolos.build/Debug-iphonesimulator/protocolos.build/Objects-normal/x86_64/Actividad~partial.swiftmodule : /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/Actividad.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/ViewController.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/AppDelegate.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/ViewControllerCalificar.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/TableViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/Build/Intermediates/protocolos.build/Debug-iphonesimulator/protocolos.build/Objects-normal/x86_64/Actividad~partial.swiftdoc : /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/Actividad.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/ViewController.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/AppDelegate.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/ViewControllerCalificar.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/protocolos/protocolos/TableViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
|
D
|
module android.java.android.app.ActivityManager_RunningServiceInfo;
public import android.java.android.app.ActivityManager_RunningServiceInfo_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!ActivityManager_RunningServiceInfo;
import import1 = android.java.java.lang.Class;
|
D
|
module irc.utils;
import irc.irc;
import std.regex;
import std.string;
public class Target {
@property public IRCBot bot() { return _bot; };
public immutable string target;
private IRCBot _bot;
public this(IRCBot bot, string target) {
this._bot = bot;
this.target = target.idup;
}
public void sendMessage(string msg) {
bot.send(format("PRIVMSG %s :%s", target, msg));
}
public void sendNotice(string msg) {
bot.send(format("NOTICE %s :%s", target, msg));
}
}
public class User : Target {
private enum pattern = regex(`!~|!|@`);
public immutable string user;
public immutable string realname;
public immutable string hostmask;
/**
* User is in form of *!*\@*
*/
public this(IRCBot bot, string user) {
auto captures = user.split(pattern);
this.user = captures[0];
this.realname = captures[1];
this.hostmask = captures[2];
super(bot, this.user);
}
}
public class Channel : Target {
public this(IRCBot bot, string target) {
super(bot, target);
}
/**
* Kicks the user from a channel with an optional reason
*/
public void kick(string user, string reason = "") {
bot.send(format("KICK %s %s :%s", target, user, reason));
}
/**
* Set channel modes. Only provide the user if the channel mode requires it.
* The provided user can be their nickname or hostmask.
*/
public void setMode(string modes, string user = "") {
bot.send(format("MODE %s %s %s", target, modes, user));
}
/**
* The user can be their nickname or hostmask
*/
public void unban(string user) {
setMode("-b", user);
}
/**
* The user can be their nickname or hostmask
*/
public void ban(string user) {
setMode("+b", user);
}
/**
* All-in-one kickban with an optional reason
*/
public void kickban(string user, string reason = "") {
kick(user, reason);
ban(user);
}
}
|
D
|
E: c384, c473, c470, c627, c84, c191, c272, c398, c212, c57, c761, c170, c535, c306, c235, c611, c635, c232, c742, c509, c112, c49, c797, c284, c842, c428, c508, c31, c541, c666, c751, c17, c130, c783, c684, c479, c608, c344, c21, c440, c581, c741, c523, c617, c270, c559, c106, c843, c368, c776, c847, c577, c269, c699, c24, c35, c640, c734, c641, c351, c345, c354, c382, c66, c877, c787, c427, c557, c644, c86, c813, c851, c404, c791, c44, c94, c429, c134, c146, c293, c547, c834, c868, c193, c119, c79, c69, c10, c550, c301, c216, c708, c455, c459, c705, c891, c532, c752, c849, c619, c88, c290, c788, c821, c180, c447, c785, c202, c858, c678, c36, c860, c655, c13, c127, c314, c681, c237, c327, c731, c16, c355, c623, c651, c238, c144, c46, c603, c502, c72, c78, c37, c135, c45, c340, c329, c846, c493, c275, c305, c639, c266, c738, c884, c568, c505, c664, c560, c890, c695, c879, c698, c696, c887, c316, c438, c592, c129, c733, c263, c418, c430, c434, c67, c499, c480, c25, c514, c566, c391, c318, c765, c76, c767, c302, c97, c607, c133, c757, c230, c624, c410, c85, c177, c34, c154, c703, c659, c246, c598, c163, c515, c331, c595, c405, c782, c503, c299, c736, c103, c839, c215, c333, c169, c716, c53, c424, c844, c518, c835, c196, c711, c543, c569, c759, c15, c494, c176, c462, c771, c26, c637, c809, c43, c538, c854, c332, c709, c717, c200, c437, c632, c54, c511, c483, c522, c285, c171, c417, c638, c714, c812, c866, c289, c707, c768, c704, c14, c300, c150, c394, c42, c92, c775, c139, c485, c713, c769, c420, c802, c98, c233, c419, c675, c803, c6, c874, c747, c531, c621, c313, c673, c525, c822, c669, c670, c633, c679, c715, c763, c403, c264, c883, c554, c70, c107, c796, c39, c40, c832, c416, c567, c377, c737, c190, c187, c105, c691, c168, c856, c610, c748, c279, c336, c11, c7, c386, c517, c506, c534, c743, c41, c426, c65, c527, c676, c892, c469, c896, c897, c778, c2, c209, c189, c445, c815, c19, c262, c362, c837, c721, c124, c658, c412, c259, c818, c540, c448, c58, c458, c497, c121, c278, c64, c799, c745, c539, c677, c881, c206, c889, c369, c572, c389, c145, c744, c524, c122, c830, c636, c218, c431, c286, c467, c5, c74, c197, c236, c390, c234, c552, c100, c4, c465, c222, c588, c625, c549, c116, c61, c732, c528, c808, c255, c322, c337, c399, c198, c433, c461, c143, c861, c450, c220, c338, c89, c38, c199, c32, c457, c283, c893, c615, c888, c582, c886, c140, c357, c570, c789, c425, c117, c486, c496, c654, c186, c311, c728, c454, c131, c591, c132, c82, c298, c807, c151, c471, c758, c660, c295, c372, c319, c488, c746, c439, c128, c773, c498, c491, c348, c597, c181, c683, c609, c324, c723, c413, c408, c725, c831, c898, c158, c894, c764, c867, c599, c693, c260, c241, c282, c472, c156, c781, c381, c0, c126, c304, c727, c464, c243, c228, c772, c68, c402, c371, c649, c225, c724, c80, c48, c580, c152, c642, c161, c138, c686, c309, c221, c250, c521, c801, c443, c869, c242, c113, c8, c33, c770, c533, c421, c755, c652, c227, c267, c415, c490, c81, c484, c578, c141, c231, c836, c347, c672, c28, c247, c18, c833, c647, c365, c526, c30, c411, c90, c172, c254, c845, c317, c692, c706, c400, c718, c899, c650, c280, c762, c120, c804, c584, c441, c780, c561, c855, c312, c574, c712, c210, c876, c277, c335, c476, c468, c786, c363, c27, c546, c774, c359, c805, c99, c395, c114, c823, c553, c735, c667, c166, c315, c276, c750, c397, c865, c563, c375, c682, c500, c754, c341, c819, c257, c857, c208, c149, c594, c653, c519, c870, c3, c136, c466, c478, c726, c740, c104, c613, c875, c360, c605, c442, c125, c55, c47, c614, c396, c249, c850, c587, c585, c245, c825, c201, c558, c661, c115, c287, c453, c824, c784, c83, c492, c248, c626, c444, c330, c160, c343, c665, c645, c885, c271, c529, c449, c545, c223.
p9(E,E)
c384,c473
c535,c306
c742,c509
c842,c428
c17,c130
c783,c684
c617,c270
c776,c847
c345,c354
c382,c66
c134,c146
c532,c813
c821,c180
c860,c655
c314,c681
c135,c45
c329,c851
c846,c493
c592,c129
c31,c541
c499,c480
c25,c514
c302,c97
c607,c133
c85,c644
c177,c34
c169,c716
c603,c462
c483,c37
c623,c522
c289,c707
c424,c42
c508,c809
c675,c803
c313,c332
c679,c715
c763,c403
c70,c107
c327,c610
c659,c279
c768,c659
c743,c41
c53,c424
c896,c897
c209,c189
c638,c834
c815,c19
c494,c884
c803,c64
c79,c69
c752,c236
c465,c222
c588,c625
c344,c21
c143,c39
c457,c283
c888,c633
c140,c357
c813,c234
c654,c635
c728,c454
c190,c758
c233,c319
c746,c439
c386,c752
c773,c215
c479,c76
c491,c348
c644,c775
c181,c683
c609,c531
c707,c324
c818,c867
c25,c259
c765,c76
c200,c525
c0,c752
c285,c126
c727,c881
c877,c541
c649,c891
c471,c640
c156,c781
c684,c394
c733,c459
c580,c24
c250,c521
c94,c113
c295,c8
c33,c0
c518,c418
c421,c755
c771,c491
c782,c503
c508,c372
c112,c696
c139,c152
c678,c36
c216,c490
c619,c88
c38,c484
c141,c884
c128,c448
c347,c38
c623,c651
c752,c447
c560,c890
c747,c559
c34,c172
c845,c317
c233,c419
c117,c106
c10,c132
c85,c163
c285,c312
c703,c574
c707,c193
c791,c44
c876,c666
c672,c781
c468,c695
c172,c402
c25,c305
c783,c318
c359,c703
c395,c114
c831,c851
c16,c355
c860,c582
c877,c750
c566,c391
c43,c127
c371,c412
c815,c66
c819,c257
c293,c547
c809,c866
c232,c708
c457,c104
c613,c57
c747,c124
c842,c301
c103,c430
c605,c887
c764,c808
c442,c429
c860,c404
c577,c538
c676,c191
c396,c539
c572,c389
c198,c433
c666,c212
c238,c90
c336,c11
c143,c879
c508,c84
c632,c305
c861,c243
c736,c171
c82,c82
c788,c340
c24,c35
c780,c106
c13,c127
c332,c780
c264,c831
c76,c254
c180,c759
c559,c732
c30,c411
c550,c301
c879,c431
c117,c494
c505,c38
c42,c733
c647,c351
c822,c847
.
p2(E,E)
c470,c627
c84,c191
c212,c57
c666,c751
c479,c608
c577,c269
c428,c734
c851,c404
c193,c119
c666,c752
c290,c788
c275,c655
c305,c639
c327,c695
c879,c698
c696,c887
c354,c430
c191,c318
c66,c767
c391,c703
c541,c595
c269,c405
c581,c299
c215,c333
c169,c13
c106,c559
c890,c511
c483,c285
c150,c394
c775,c139
c485,c713
c193,c769
c404,c196
c531,c621
c525,c37
c796,c299
c284,c679
c230,c377
c163,c190
c97,c134
c635,c748
c847,c6
c76,c778
c299,c2
c42,c445
c696,c262
c362,c837
c259,c13
c129,c818
c88,c785
c651,c540
c41,c497
c124,c721
c717,c278
c847,c539
c130,c534
c759,c5
c891,c390
c714,c552
c44,c808
c716,c176
c322,c270
c266,c412
c306,c699
c633,c670
c430,c199
c595,c32
c447,c615
c418,c434
c438,c316
c789,c479
c132,c332
c82,c298
c459,c455
c752,c807
c696,c471
c38,c89
c332,c295
c298,c488
c340,c235
c503,c725
c158,c894
c105,c24
c683,c67
c834,c282
c621,c156
c304,c243
c598,c246
c781,c48
c35,c603
c21,c399
c738,c134
c301,c80
c856,c550
c69,c533
c509,c535
c715,c652
c351,c821
c127,c267
c431,c234
c559,c418
c424,c231
c851,c28
c429,c94
c433,c881
c877,c833
c357,c332
c866,c812
c90,c672
c279,c25
c37,c78
c234,c269
c189,c578
c415,c278
c813,c712
c14,c509
c11,c144
c319,c372
c459,c598
c752,c511
c355,c99
c270,c465
c480,c27
c419,c276
c418,c682
c418,c524
c36,c341
c857,c208
c870,c284
c152,c478
c707,c898
c740,c566
c858,c764
c171,c870
c389,c842
c597,c131
c514,c669
c491,c27
c115,c876
c708,c824
c640,c269
c72,c502
c547,c638
c644,c788
c780,c277
c66,c176
c809,c867
c230,c496
c462,c626
c539,c402
c767,c471
c450,c636
c394,c693
c554,c362
c133,c416
c746,c442
.
p0(E,E)
c272,c398
c130,c202
c327,c731
c752,c839
c738,c417
c799,c745
c337,c572
c186,c311
c140,c888
c131,c591
c283,c176
c639,c679
c772,c68
c427,c869
c322,c893
c408,c703
c18,c611
c591,c899
c168,c736
c166,c365
c280,c40
c550,c692
c572,c351
c658,c607
c404,c16
c803,c450
.
p7(E,E)
c761,c170
c505,c664
c515,c331
c768,c704
c14,c300
c822,c669
c892,c469
c566,c272
c889,c369
c582,c886
c5,c866
c235,c260
c206,c534
c228,c809
c402,c386
c666,c69
c801,c443
c132,c81
c647,c46
c672,c437
c335,c476
c365,c434
c639,c754
c587,c585
c245,c825
c248,c216
c894,c531
.
p5(E,E)
c235,c611
c557,c644
c216,c708
c434,c67
c49,c332
c567,c327
c426,c65
c206,c738
c74,c386
c498,c58
c714,c854
c64,c627
c812,c773
c259,c770
c480,c365
c735,c667
c771,c677
c397,c865
c563,c636
c633,c65
c97,c665
c572,c271
c887,c449
.
p3(E,E)
c635,c232
c787,c427
c834,c868
c705,c891
c232,c854
c632,c54
c284,c42
c215,c420
c802,c485
c517,c506
c708,c677
c145,c744
c461,c168
c599,c693
c225,c724
c227,c797
c228,c745
c120,c180
c584,c441
c561,c506
c57,c375
c500,c762
c508,c329
c3,c136
c331,c466
c875,c360
c249,c850
c287,c531
c581,c728
c275,c255
c198,c131
c329,c815
c645,c885
.
p6(E,E)
c112,c49
c31,c541
c440,c581
c741,c523
c24,c35
c877,c541
c619,c88
c447,c785
c623,c651
c788,c340
c619,c568
c237,c635
c263,c418
c566,c391
c765,c76
c13,c127
c550,c301
c757,c230
c782,c503
c293,c547
c103,c430
c46,c759
c736,c171
c638,c714
c382,c66
c202,c737
c105,c691
c336,c11
c890,c470
c368,c527
c676,c191
c644,c775
c822,c847
c98,c696
c842,c428
c121,c105
c860,c655
c830,c636
c879,c431
c678,c36
c684,c394
c813,c234
c732,c72
c603,c266
c752,c236
c707,c861
c787,c220
c386,c752
c143,c879
c425,c117
c709,c717
c505,c38
c888,c633
c508,c84
c112,c696
c128,c448
c85,c163
c743,c41
c771,c491
c831,c851
c666,c212
c815,c66
c381,c340
c849,c304
c0,c752
c464,c143
c494,c884
c434,c598
c169,c716
c728,c454
c508,c809
c588,c837
c846,c493
c198,c433
c345,c354
c84,c298
c41,c285
c659,c279
c844,c235
c117,c106
c672,c781
c337,c247
c535,c306
c773,c215
c641,c351
c747,c124
c344,c21
c25,c305
c200,c525
c822,c597
c483,c37
c471,c640
c76,c254
c25,c259
c752,c447
c238,c90
c804,c419
c181,c683
c53,c424
c416,c280
c332,c780
c839,c855
c156,c781
c560,c890
c883,c554
c424,c42
c196,c210
c92,c450
c85,c644
c79,c69
c786,c363
c835,c357
c546,c230
c264,c831
c10,c132
c25,c514
c135,c45
c764,c808
c636,c572
c329,c851
c209,c189
c233,c419
c594,c426
c727,c881
c876,c666
c711,c858
c568,c327
c649,c891
c705,c152
c797,c284
c82,c82
c17,c130
c661,c357
c499,c480
c638,c834
c83,c762
c707,c193
c733,c459
c809,c866
c43,c127
c776,c847
c860,c404
c140,c357
c632,c305
c421,c135
c572,c389
c139,c152
c592,c129
c896,c897
c70,c107
c791,c44
c479,c76
c763,c403
c532,c813
c333,c511
.
p1(E,E)
c797,c284
c508,c84
c344,c21
c843,c368
c641,c351
c791,c44
c293,c547
c79,c69
c550,c301
c858,c459
c678,c36
c13,c127
c16,c355
c603,c266
c738,c884
c560,c890
c329,c851
c557,c154
c577,c470
c85,c163
c757,c230
c53,c424
c844,c235
c17,c130
c835,c196
c43,c127
c709,c717
c103,c430
c479,c76
c98,c696
c233,c419
c6,c874
c883,c554
c736,c171
c168,c856
c822,c847
c782,c503
c752,c447
c483,c37
c434,c598
c846,c493
c566,c391
c112,c696
c632,c305
c860,c655
c572,c389
c336,c11
c887,c122
c607,c133
c528,c31
c139,c255
c664,c399
c198,c433
c92,c450
c200,c525
c568,c327
c711,c858
c345,c354
c570,c86
c747,c559
c835,c357
c822,c597
c408,c351
c10,c132
c728,c454
c241,c348
c472,c496
c135,c45
c156,c781
c371,c412
c491,c577
c139,c152
c676,c191
c569,c831
c82,c82
c559,c732
c896,c897
c732,c72
c264,c831
c437,c438
c578,c57
c117,c106
c140,c357
c508,c809
c25,c514
c84,c298
c672,c781
c623,c651
c263,c418
c30,c411
c535,c306
c890,c470
c577,c538
c417,c269
c771,c491
c655,c35
c831,c851
c879,c431
c638,c714
c842,c428
c128,c448
c888,c633
c860,c404
c743,c41
c499,c480
c506,c368
c659,c279
c508,c372
c332,c780
c809,c866
c815,c66
c233,c319
c24,c35
c773,c215
c237,c635
c76,c254
c684,c394
c776,c847
c149,c713
c592,c129
c31,c541
c318,c653
c279,c765
c787,c220
c25,c259
c302,c97
c788,c340
c46,c759
c125,c543
c505,c38
c238,c90
c169,c716
c382,c66
c284,c574
c453,c691
c386,c752
c532,c813
c0,c752
c531,c94
c787,c733
c143,c879
c673,c613
c70,c107
c619,c88
c313,c332
c494,c884
c666,c212
c889,c529
c845,c317
c747,c124
c638,c834
c763,c403
c619,c568
.
p4(E,E)
c559,c106
c699,c306
c269,c640
c86,c813
c94,c429
c608,c479
c455,c459
c238,c144
c502,c72
c78,c37
c788,c644
c316,c438
c751,c666
c246,c598
c176,c66
c106,c538
c812,c866
c269,c577
c285,c483
c417,c884
c670,c633
c714,c832
c416,c133
c534,c130
c767,c66
c734,c428
c638,c547
c721,c124
c79,c412
c765,c448
c721,c58
c511,c752
c569,c881
c524,c418
c890,c218
c127,c44
c197,c897
c511,c890
c430,c354
c799,c809
c85,c736
c13,c259
c434,c418
c874,c338
c89,c38
c486,c568
c6,c847
c496,c230
c144,c11
c615,c447
c372,c319
c298,c82
c418,c559
c488,c298
c723,c595
c413,c462
c405,c269
c695,c327
c552,c714
c131,c597
c282,c834
c769,c193
c80,c301
c867,c809
c642,c161
c698,c879
c138,c686
c242,c808
c176,c716
c190,c163
c723,c493
c598,c459
c898,c707
c278,c415
c243,c304
c807,c752
c412,c836
c693,c394
c858,c141
c842,c389
c5,c759
c672,c90
c196,c404
c788,c290
c497,c41
c48,c781
c718,c781
c278,c717
c621,c531
c67,c683
c318,c191
c540,c651
c400,c708
c390,c891
c277,c780
c27,c491
c191,c84
c627,c470
c774,c803
c789,c805
c780,c24
c639,c305
c533,c69
c234,c431
c818,c129
c711,c357
c754,c830
c539,c847
c99,c355
c417,c236
c595,c235
c669,c514
c821,c351
c881,c433
c673,c324
c752,c666
c603,c35
c199,c430
c333,c215
c712,c813
c887,c696
c55,c47
c624,c48
c636,c450
c780,c360
c778,c76
c284,c535
c445,c42
c535,c509
c784,c632
c837,c362
c808,c44
c492,c6
c134,c97
c550,c856
c332,c357
c340,c327
c569,c45
c57,c212
c870,c171
c269,c234
c595,c541
c25,c279
.
p10(E,E)
c112,c112
c293,c293
c10,c10
c849,c849
c237,c237
c46,c46
c603,c603
c733,c733
c851,c741
c624,c410
c659,c659
c84,c84
c736,c736
c518,c518
c424,c424
c711,c711
c569,c216
c15,c494
c771,c771
c26,c637
c809,c809
c494,c494
c200,c200
c437,c437
c92,c92
c568,c568
c747,c747
c673,c673
c264,c264
c187,c812
c386,c386
c505,c505
c139,c139
c233,c233
c879,c879
c458,c891
c860,c860
c100,c4
c499,c499
c53,c53
c532,c532
c846,c846
c209,c209
c79,c79
c765,c765
c743,c743
c329,c329
c15,c660
c896,c896
c632,c632
c835,c835
c569,c569
c581,c898
c35,c877
c638,c638
c835,c433
c344,c344
c313,c313
c491,c491
c31,c31
c263,c263
c773,c773
c844,c844
c16,c16
c82,c82
c566,c566
c678,c678
c797,c797
c43,c43
c727,c727
c842,c842
c623,c623
c763,c763
c791,c791
c483,c483
c813,c813
c684,c684
c757,c757
c85,c85
c447,c447
c98,c98
c143,c143
c764,c764
c490,c692
c675,c400
c0,c0
c332,c332
c135,c650
c280,c762
c508,c508
c672,c672
c572,c572
c4,c511
c644,c644
c198,c198
c877,c877
c607,c607
c168,c168
c238,c238
c200,c509
c787,c787
c560,c560
c382,c382
c336,c336
c479,c479
c823,c553
c815,c815
c181,c181
c13,c13
c752,c752
c822,c822
c76,c76
c371,c371
c345,c345
c521,c726
c6,c584
c550,c550
c649,c649
c535,c535
c6,c6
c890,c890
c776,c776
c788,c788
c318,c633
c135,c135
c103,c103
c577,c577
c170,c519
c515,c151
c876,c876
c24,c24
c25,c25
c417,c417
c782,c782
c888,c888
c444,c330
c707,c707
c641,c641
c17,c17
c343,c772
c70,c70
c156,c156
c728,c728
c545,c682
c676,c676
c289,c289
.
p8(E,E)
c543,c752
c39,c40
c7,c736
c275,c658
c354,c146
c286,c467
c549,c116
c61,c588
c815,c893
c236,c151
c704,c696
c764,c768
c309,c221
c610,c757
c526,c582
c706,c654
c228,c538
c527,c315
c519,c666
c355,c764
c614,c609
c201,c558
c775,c53
c813,c160
c223,c304
.
|
D
|
unittest
{
for (int i = 0; i < 10; i++)
foo(i);
{
int i;
for (i = 0; i < 10; i++)
foo(i);
}
for (int i = 0; i < 10; i++)
{
}
}
|
D
|
go away or leave
not being in a specified place
nonexistent
lost in thought
|
D
|
/**
* Forms the symbols available to all D programs. Includes Object, which is
* the root of the class object hierarchy. This module is implicitly
* imported.
*
* Copyright: Copyright Digital Mars 2000 - 2011.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Walter Bright, Sean Kelly
*/
module object;
// NOTE: For some reason, this declaration method doesn't work
// in this particular file (and this file only). It must
// be a DMD thing.
//alias typeof(int.sizeof) size_t;
//alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t;
version (D_LP64)
{
alias size_t = ulong;
alias ptrdiff_t = long;
}
else
{
alias size_t = uint;
alias ptrdiff_t = int;
}
alias sizediff_t = ptrdiff_t; //For backwards compatibility only.
alias hash_t = size_t; //For backwards compatibility only.
alias equals_t = bool; //For backwards compatibility only.
alias string = immutable(char)[];
alias wstring = immutable(wchar)[];
alias dstring = immutable(dchar)[];
version (D_ObjectiveC) public import core.attribute : selector;
int __cmp(T)(scope const T[] lhs, scope const T[] rhs) @trusted
if (__traits(isScalar, T))
{
// Compute U as the implementation type for T
static if (is(T == ubyte) || is(T == void) || is(T == bool))
alias U = char;
else static if (is(T == wchar))
alias U = ushort;
else static if (is(T == dchar))
alias U = uint;
else static if (is(T == ifloat))
alias U = float;
else static if (is(T == idouble))
alias U = double;
else static if (is(T == ireal))
alias U = real;
else
alias U = T;
static if (is(U == char))
{
import core.internal.string : dstrcmp;
return dstrcmp(cast(char[]) lhs, cast(char[]) rhs);
}
else static if (!is(U == T))
{
// Reuse another implementation
return __cmp(cast(U[]) lhs, cast(U[]) rhs);
}
else
{
version (BigEndian)
static if (__traits(isUnsigned, T) ? !is(T == __vector) : is(T : P*, P))
{
if (!__ctfe)
{
import core.stdc.string : memcmp;
int c = memcmp(lhs.ptr, rhs.ptr, (lhs.length <= rhs.length ? lhs.length : rhs.length) * T.sizeof);
if (c)
return c;
static if (size_t.sizeof <= uint.sizeof && T.sizeof >= 2)
return cast(int) lhs.length - cast(int) rhs.length;
else
return int(lhs.length > rhs.length) - int(lhs.length < rhs.length);
}
}
immutable len = lhs.length <= rhs.length ? lhs.length : rhs.length;
foreach (const u; 0 .. len)
{
static if (__traits(isFloating, T))
{
immutable a = lhs.ptr[u], b = rhs.ptr[u];
static if (is(T == cfloat) || is(T == cdouble)
|| is(T == creal))
{
// Use rt.cmath2._Ccmp instead ?
auto r = (a.re > b.re) - (a.re < b.re);
if (!r) r = (a.im > b.im) - (a.im < b.im);
}
else
{
const r = (a > b) - (a < b);
}
if (r) return r;
}
else if (lhs.ptr[u] != rhs.ptr[u])
return lhs.ptr[u] < rhs.ptr[u] ? -1 : 1;
}
return lhs.length < rhs.length ? -1 : (lhs.length > rhs.length);
}
}
// Compare class and interface objects for ordering.
private int __cmp(Obj)(Obj lhs, Obj rhs)
if (is(Obj : Object))
{
if (lhs is rhs)
return 0;
// Regard null references as always being "less than"
if (!lhs)
return -1;
if (!rhs)
return 1;
return lhs.opCmp(rhs);
}
// This function is called by the compiler when dealing with array
// comparisons in the semantic analysis phase of CmpExp. The ordering
// comparison is lowered to a call to this template.
int __cmp(T1, T2)(T1[] s1, T2[] s2)
if (!__traits(isScalar, T1) && !__traits(isScalar, T2))
{
import core.internal.traits : Unqual;
alias U1 = Unqual!T1;
alias U2 = Unqual!T2;
static if (is(U1 == void) && is(U2 == void))
static @trusted ref inout(ubyte) at(inout(void)[] r, size_t i) { return (cast(inout(ubyte)*) r.ptr)[i]; }
else
static @trusted ref R at(R)(R[] r, size_t i) { return r.ptr[i]; }
// All unsigned byte-wide types = > dstrcmp
immutable len = s1.length <= s2.length ? s1.length : s2.length;
foreach (const u; 0 .. len)
{
static if (__traits(compiles, __cmp(at(s1, u), at(s2, u))))
{
auto c = __cmp(at(s1, u), at(s2, u));
if (c != 0)
return c;
}
else static if (__traits(compiles, at(s1, u).opCmp(at(s2, u))))
{
auto c = at(s1, u).opCmp(at(s2, u));
if (c != 0)
return c;
}
else static if (__traits(compiles, at(s1, u) < at(s2, u)))
{
if (at(s1, u) != at(s2, u))
return at(s1, u) < at(s2, u) ? -1 : 1;
}
else
{
// TODO: fix this legacy bad behavior, see
// https://issues.dlang.org/show_bug.cgi?id=17244
static assert(is(U1 == U2), "Internal error.");
import core.stdc.string : memcmp;
auto c = (() @trusted => memcmp(&at(s1, u), &at(s2, u), U1.sizeof))();
if (c != 0)
return c;
}
}
return s1.length < s2.length ? -1 : (s1.length > s2.length);
}
// integral types
@safe unittest
{
void compareMinMax(T)()
{
T[2] a = [T.max, T.max];
T[2] b = [T.min, T.min];
assert(__cmp(a, b) > 0);
assert(__cmp(b, a) < 0);
}
compareMinMax!int;
compareMinMax!uint;
compareMinMax!long;
compareMinMax!ulong;
compareMinMax!short;
compareMinMax!ushort;
compareMinMax!byte;
compareMinMax!dchar;
compareMinMax!wchar;
}
// char types (dstrcmp)
@safe unittest
{
void compareMinMax(T)()
{
T[2] a = [T.max, T.max];
T[2] b = [T.min, T.min];
assert(__cmp(a, b) > 0);
assert(__cmp(b, a) < 0);
}
compareMinMax!ubyte;
compareMinMax!bool;
compareMinMax!char;
compareMinMax!(const char);
string s1 = "aaaa";
string s2 = "bbbb";
assert(__cmp(s2, s1) > 0);
assert(__cmp(s1, s2) < 0);
}
// fp types
@safe unittest
{
void compareMinMax(T)()
{
T[2] a = [T.max, T.max];
T[2] b = [T.min_normal, T.min_normal];
T[2] c = [T.max, T.min_normal];
T[1] d = [T.max];
assert(__cmp(a, b) > 0);
assert(__cmp(b, a) < 0);
assert(__cmp(a, c) > 0);
assert(__cmp(a, d) > 0);
assert(__cmp(d, c) < 0);
assert(__cmp(c, c) == 0);
}
compareMinMax!real;
compareMinMax!float;
compareMinMax!double;
compareMinMax!ireal;
compareMinMax!ifloat;
compareMinMax!idouble;
compareMinMax!creal;
//compareMinMax!cfloat;
compareMinMax!cdouble;
// qualifiers
compareMinMax!(const real);
compareMinMax!(immutable real);
}
// void[]
@safe unittest
{
void[] a;
const(void)[] b;
(() @trusted
{
a = cast(void[]) "bb";
b = cast(const(void)[]) "aa";
})();
assert(__cmp(a, b) > 0);
assert(__cmp(b, a) < 0);
}
// arrays of arrays with mixed modifiers
@safe unittest
{
// https://issues.dlang.org/show_bug.cgi?id=17876
bool less1(immutable size_t[][] a, size_t[][] b) { return a < b; }
bool less2(const void[][] a, void[][] b) { return a < b; }
bool less3(inout size_t[][] a, size_t[][] b) { return a < b; }
immutable size_t[][] a = [[1, 2], [3, 4]];
size_t[][] b = [[1, 2], [3, 5]];
assert(less1(a, b));
assert(less3(a, b));
auto va = [cast(immutable void[])a[0], a[1]];
auto vb = [cast(void[])b[0], b[1]];
assert(less2(va, vb));
}
// objects
@safe unittest
{
class C
{
int i;
this(int i) { this.i = i; }
override int opCmp(Object c) const @safe
{
return i - (cast(C)c).i;
}
}
auto c1 = new C(1);
auto c2 = new C(2);
assert(__cmp(c1, null) > 0);
assert(__cmp(null, c1) < 0);
assert(__cmp(c1, c1) == 0);
assert(__cmp(c1, c2) < 0);
assert(__cmp(c2, c1) > 0);
assert(__cmp([c1, c1][], [c2, c2][]) < 0);
assert(__cmp([c2, c2], [c1, c1]) > 0);
}
// structs
@safe unittest
{
struct C
{
ubyte i;
this(ubyte i) { this.i = i; }
}
auto c1 = C(1);
auto c2 = C(2);
assert(__cmp([c1, c1][], [c2, c2][]) < 0);
assert(__cmp([c2, c2], [c1, c1]) > 0);
assert(__cmp([c2, c2], [c2, c1]) > 0);
}
// `lhs == rhs` lowers to `__equals(lhs, rhs)` for dynamic arrays
bool __equals(T1, T2)(T1[] lhs, T2[] rhs)
{
import core.internal.traits : Unqual;
alias U1 = Unqual!T1;
alias U2 = Unqual!T2;
static @trusted ref R at(R)(R[] r, size_t i) { return r.ptr[i]; }
static @trusted R trustedCast(R, S)(S[] r) { return cast(R) r; }
if (lhs.length != rhs.length)
return false;
if (lhs.length == 0 && rhs.length == 0)
return true;
static if (is(U1 == void) && is(U2 == void))
{
return __equals(trustedCast!(ubyte[])(lhs), trustedCast!(ubyte[])(rhs));
}
else static if (is(U1 == void))
{
return __equals(trustedCast!(ubyte[])(lhs), rhs);
}
else static if (is(U2 == void))
{
return __equals(lhs, trustedCast!(ubyte[])(rhs));
}
else static if (!is(U1 == U2))
{
// This should replace src/object.d _ArrayEq which
// compares arrays of different types such as long & int,
// char & wchar.
// Compiler lowers to __ArrayEq in dmd/src/opover.d
foreach (const u; 0 .. lhs.length)
{
if (at(lhs, u) != at(rhs, u))
return false;
}
return true;
}
else static if (__traits(isIntegral, U1))
{
if (!__ctfe)
{
import core.stdc.string : memcmp;
return () @trusted { return memcmp(cast(void*)lhs.ptr, cast(void*)rhs.ptr, lhs.length * U1.sizeof) == 0; }();
}
else
{
foreach (const u; 0 .. lhs.length)
{
if (at(lhs, u) != at(rhs, u))
return false;
}
return true;
}
}
else
{
foreach (const u; 0 .. lhs.length)
{
static if (__traits(compiles, __equals(at(lhs, u), at(rhs, u))))
{
if (!__equals(at(lhs, u), at(rhs, u)))
return false;
}
else static if (__traits(isFloating, U1))
{
if (at(lhs, u) != at(rhs, u))
return false;
}
else static if (is(U1 : Object) && is(U2 : Object))
{
if (!(cast(Object)at(lhs, u) is cast(Object)at(rhs, u)
|| at(lhs, u) && (cast(Object)at(lhs, u)).opEquals(cast(Object)at(rhs, u))))
return false;
}
else static if (__traits(hasMember, U1, "opEquals"))
{
if (!at(lhs, u).opEquals(at(rhs, u)))
return false;
}
else static if (is(U1 == delegate))
{
if (at(lhs, u) != at(rhs, u))
return false;
}
else static if (is(U1 == U11*, U11))
{
if (at(lhs, u) != at(rhs, u))
return false;
}
else static if (__traits(isAssociativeArray, U1))
{
if (at(lhs, u) != at(rhs, u))
return false;
}
else
{
if (at(lhs, u).tupleof != at(rhs, u).tupleof)
return false;
}
}
return true;
}
}
unittest {
assert(__equals([], []));
assert(!__equals([1, 2], [1, 2, 3]));
}
unittest
{
struct A
{
int a;
}
auto arr1 = [A(0), A(2)];
auto arr2 = [A(0), A(1)];
auto arr3 = [A(0), A(1)];
assert(arr1 != arr2);
assert(arr2 == arr3);
}
unittest
{
struct A
{
int a;
int b;
bool opEquals(const A other)
{
return this.a == other.b && this.b == other.a;
}
}
auto arr1 = [A(1, 0), A(0, 1)];
auto arr2 = [A(1, 0), A(0, 1)];
auto arr3 = [A(0, 1), A(1, 0)];
assert(arr1 != arr2);
assert(arr2 == arr3);
}
// https://issues.dlang.org/show_bug.cgi?id=18252
unittest
{
string[int][] a1, a2;
assert(__equals(a1, a2));
assert(a1 == a2);
a1 ~= [0: "zero"];
a2 ~= [0: "zero"];
assert(__equals(a1, a2));
assert(a1 == a2);
a2[0][1] = "one";
assert(!__equals(a1, a2));
assert(a1 != a2);
}
/**
Destroys the given object and sets it back to its initial state. It's used to
_destroy an object, calling its destructor or finalizer so it no longer
references any other objects. It does $(I not) initiate a GC cycle or free
any GC memory.
*/
void destroy(T)(ref T obj) if (is(T == struct))
{
// We need to re-initialize `obj`. Previously, the code
// `auto init = cast(ubyte[])typeid(T).initializer()` was used, but
// `typeid` is a runtime call and requires the `TypeInfo` object which is
// not usable when compiling with -betterC. If we do `obj = T.init` then we
// end up needlessly calling postblits and destructors. So, we create a
// static immutable lvalue that can be re-used with subsequent calls to `destroy`
shared static immutable T init = T.init;
_destructRecurse(obj);
() @trusted {
import core.stdc.string : memcpy;
auto dest = (cast(ubyte*) &obj)[0 .. T.sizeof];
auto src = (cast(ubyte*) &init)[0 .. T.sizeof];
memcpy(dest.ptr, src.ptr, T.sizeof);
} ();
}
private void _destructRecurse(S)(ref S s)
if (is(S == struct))
{
static if (__traits(hasMember, S, "__xdtor") &&
// Bugzilla 14746: Check that it's the exact member of S.
__traits(isSame, S, __traits(parent, s.__xdtor)))
s.__xdtor();
}
nothrow @safe @nogc unittest
{
{
struct A { string s = "A"; }
A a;
a.s = "asd";
destroy(a);
assert(a.s == "A");
}
{
static int destroyed = 0;
struct C
{
string s = "C";
~this() nothrow @safe @nogc
{
destroyed ++;
}
}
struct B
{
C c;
string s = "B";
~this() nothrow @safe @nogc
{
destroyed ++;
}
}
B a;
a.s = "asd";
a.c.s = "jkl";
destroy(a);
assert(destroyed == 2);
assert(a.s == "B");
assert(a.c.s == "C" );
}
}
/// ditto
void destroy(T)(T obj) if (is(T == class))
{
static if (__traits(getLinkage, T) == "C++")
{
obj.__xdtor();
enum classSize = __traits(classInstanceSize, T);
(cast(void*)obj)[0 .. classSize] = typeid(T).initializer[];
}
else
rt_finalize(cast(void*)obj);
}
/// ditto
void destroy(T)(T obj) if (is(T == interface))
{
destroy(cast(Object)obj);
}
/// Reference type demonstration
unittest
{
class C
{
struct Agg
{
static int dtorCount;
int x = 10;
~this() { dtorCount++; }
}
static int dtorCount;
string s = "S";
Agg a;
~this() { dtorCount++; }
}
C c = new C();
assert(c.dtorCount == 0); // destructor not yet called
assert(c.s == "S"); // initial state `c.s` is `"S"`
assert(c.a.dtorCount == 0); // destructor not yet called
assert(c.a.x == 10); // initial state `c.a.x` is `10`
c.s = "T";
c.a.x = 30;
assert(c.s == "T"); // `c.s` is `"T"`
destroy(c);
assert(c.dtorCount == 1); // `c`'s destructor was called
assert(c.s == "S"); // `c.s` is back to its inital state, `"S"`
assert(c.a.dtorCount == 1); // `c.a`'s destructor was called
assert(c.a.x == 10); // `c.a.x` is back to its inital state, `10`
// check C++ classes work too!
extern (C++) class CPP
{
struct Agg
{
__gshared int dtorCount;
int x = 10;
~this() { dtorCount++; }
}
__gshared int dtorCount;
string s = "S";
Agg a;
~this() { dtorCount++; }
}
CPP cpp = new CPP();
assert(cpp.dtorCount == 0); // destructor not yet called
assert(cpp.s == "S"); // initial state `cpp.s` is `"S"`
assert(cpp.a.dtorCount == 0); // destructor not yet called
assert(cpp.a.x == 10); // initial state `cpp.a.x` is `10`
cpp.s = "T";
cpp.a.x = 30;
assert(cpp.s == "T"); // `cpp.s` is `"T"`
destroy(cpp);
assert(cpp.dtorCount == 1); // `cpp`'s destructor was called
assert(cpp.s == "S"); // `cpp.s` is back to its inital state, `"S"`
assert(cpp.a.dtorCount == 1); // `cpp.a`'s destructor was called
assert(cpp.a.x == 10); // `cpp.a.x` is back to its inital state, `10`
}
/// Value type demonstration
unittest
{
int i;
assert(i == 0); // `i`'s initial state is `0`
i = 1;
assert(i == 1); // `i` changed to `1`
destroy(i);
assert(i == 0); // `i` is back to its initial state `0`
}
unittest
{
interface I { }
{
class A: I { string s = "A"; this() {} }
auto a = new A, b = new A;
a.s = b.s = "asd";
destroy(a);
assert(a.s == "A");
I i = b;
destroy(i);
assert(b.s == "A");
}
{
static bool destroyed = false;
class B: I
{
string s = "B";
this() {}
~this()
{
destroyed = true;
}
}
auto a = new B, b = new B;
a.s = b.s = "asd";
destroy(a);
assert(destroyed);
assert(a.s == "B");
destroyed = false;
I i = b;
destroy(i);
assert(destroyed);
assert(b.s == "B");
}
// this test is invalid now that the default ctor is not run after clearing
version (none)
{
class C
{
string s;
this()
{
s = "C";
}
}
auto a = new C;
a.s = "asd";
destroy(a);
assert(a.s == "C");
}
}
nothrow @safe @nogc unittest
{
{
struct A { string s = "A"; }
A a;
a.s = "asd";
destroy(a);
assert(a.s == "A");
}
{
static int destroyed = 0;
struct C
{
string s = "C";
~this() nothrow @safe @nogc
{
destroyed ++;
}
}
struct B
{
C c;
string s = "B";
~this() nothrow @safe @nogc
{
destroyed ++;
}
}
B a;
a.s = "asd";
a.c.s = "jkl";
destroy(a);
assert(destroyed == 2);
assert(a.s == "B");
assert(a.c.s == "C" );
}
}
/// ditto
void destroy(T : U[n], U, size_t n)(ref T obj) if (!is(T == struct))
{
foreach_reverse (ref e; obj[])
destroy(e);
}
unittest
{
int[2] a;
a[0] = 1;
a[1] = 2;
destroy(a);
assert(a == [ 0, 0 ]);
}
unittest
{
static struct vec2f {
float[2] values;
alias values this;
}
vec2f v;
destroy!vec2f(v);
}
unittest
{
// Bugzilla 15009
static string op;
static struct S
{
int x;
this(int x) { op ~= "C" ~ cast(char)('0'+x); this.x = x; }
this(this) { op ~= "P" ~ cast(char)('0'+x); }
~this() { op ~= "D" ~ cast(char)('0'+x); }
}
{
S[2] a1 = [S(1), S(2)];
op = "";
}
assert(op == "D2D1"); // built-in scope destruction
{
S[2] a1 = [S(1), S(2)];
op = "";
destroy(a1);
assert(op == "D2D1"); // consistent with built-in behavior
}
{
S[2][2] a2 = [[S(1), S(2)], [S(3), S(4)]];
op = "";
}
assert(op == "D4D3D2D1");
{
S[2][2] a2 = [[S(1), S(2)], [S(3), S(4)]];
op = "";
destroy(a2);
assert(op == "D4D3D2D1", op);
}
}
/// ditto
void destroy(T)(ref T obj)
if (!is(T == struct) && !is(T == interface) && !is(T == class) && !_isStaticArray!T)
{
obj = T.init;
}
template _isStaticArray(T : U[N], U, size_t N)
{
enum bool _isStaticArray = true;
}
template _isStaticArray(T)
{
enum bool _isStaticArray = false;
}
unittest
{
{
int a = 42;
destroy(a);
assert(a == 0);
}
{
float a = 42;
destroy(a);
assert(isnan(a));
}
}
private
{
extern (C) Object _d_newclass(const TypeInfo_Class ci);
extern (C) void rt_finalize(void *data, bool det=true);
}
public @trusted @nogc nothrow pure extern (C) void _d_delThrowable(scope Throwable);
/**
* All D class objects inherit from Object.
*/
class Object
{
/**
* Convert Object to a human readable string.
*/
string toString()
{
return typeid(this).name;
}
/**
* Compute hash function for Object.
*/
size_t toHash() @trusted nothrow
{
// BUG: this prevents a compacting GC from working, needs to be fixed
size_t addr = cast(size_t) cast(void*) this;
// The bottom log2((void*).alignof) bits of the address will always
// be 0. Moreover it is likely that each Object is allocated with a
// separate call to malloc. The alignment of malloc differs from
// platform to platform, but rather than having special cases for
// each platform it is safe to use a shift of 4. To minimize
// collisions in the low bits it is more important for the shift to
// not be too small than for the shift to not be too big.
return addr ^ (addr >>> 4);
}
/**
* Compare with another Object obj.
* Returns:
* $(TABLE
* $(TR $(TD this < obj) $(TD < 0))
* $(TR $(TD this == obj) $(TD 0))
* $(TR $(TD this > obj) $(TD > 0))
* )
*/
int opCmp(Object o)
{
// BUG: this prevents a compacting GC from working, needs to be fixed
//return cast(int)cast(void*)this - cast(int)cast(void*)o;
throw new Exception("need opCmp for class " ~ typeid(this).name);
//return this !is o;
}
/**
* Test whether $(D this) is equal to $(D o).
* The default implementation only compares by identity (using the $(D is) operator).
* Generally, overrides for $(D opEquals) should attempt to compare objects by their contents.
*/
bool opEquals(Object o)
{
return this is o;
}
interface Monitor
{
void lock();
void unlock();
}
/**
* Create instance of class specified by the fully qualified name
* classname.
* The class must either have no constructors or have
* a default constructor.
* Returns:
* null if failed
* Example:
* ---
* module foo.bar;
*
* class C
* {
* this() { x = 10; }
* int x;
* }
*
* void main()
* {
* auto c = cast(C)Object.factory("foo.bar.C");
* assert(c !is null && c.x == 10);
* }
* ---
*/
static Object factory(string classname)
{
auto ci = TypeInfo_Class.find(classname);
if (ci)
{
return ci.create();
}
return null;
}
}
bool opEquals(Object lhs, Object rhs)
{
// If aliased to the same object or both null => equal
if (lhs is rhs) return true;
// If either is null => non-equal
if (lhs is null || rhs is null) return false;
// If same exact type => one call to method opEquals
if (typeid(lhs) is typeid(rhs) ||
!__ctfe && typeid(lhs).opEquals(typeid(rhs)))
/* CTFE doesn't like typeid much. 'is' works, but opEquals doesn't
(issue 7147). But CTFE also guarantees that equal TypeInfos are
always identical. So, no opEquals needed during CTFE. */
{
return lhs.opEquals(rhs);
}
// General case => symmetric calls to method opEquals
return lhs.opEquals(rhs) && rhs.opEquals(lhs);
}
/************************
* Returns true if lhs and rhs are equal.
*/
bool opEquals(const Object lhs, const Object rhs)
{
// A hack for the moment.
return opEquals(cast()lhs, cast()rhs);
}
private extern(C) void _d_setSameMutex(shared Object ownee, shared Object owner) nothrow;
void setSameMutex(shared Object ownee, shared Object owner)
{
_d_setSameMutex(ownee, owner);
}
/**
* Information about an interface.
* When an object is accessed via an interface, an Interface* appears as the
* first entry in its vtbl.
*/
struct Interface
{
TypeInfo_Class classinfo; /// .classinfo for this interface (not for containing class)
void*[] vtbl;
size_t offset; /// offset to Interface 'this' from Object 'this'
}
/**
* Array of pairs giving the offset and type information for each
* member in an aggregate.
*/
struct OffsetTypeInfo
{
size_t offset; /// Offset of member from start of object
TypeInfo ti; /// TypeInfo for this member
}
/**
* Runtime type information about a type.
* Can be retrieved for any type using a
* $(GLINK2 expression,TypeidExpression, TypeidExpression).
*/
class TypeInfo
{
override string toString() const pure @safe nothrow
{
return typeid(this).name;
}
override size_t toHash() @trusted const nothrow
{
return hashOf(this.toString());
}
override int opCmp(Object o)
{
import core.internal.string : dstrcmp;
if (this is o)
return 0;
TypeInfo ti = cast(TypeInfo)o;
if (ti is null)
return 1;
return dstrcmp(this.toString(), ti.toString());
}
override bool opEquals(Object o)
{
/* TypeInfo instances are singletons, but duplicates can exist
* across DLL's. Therefore, comparing for a name match is
* sufficient.
*/
if (this is o)
return true;
auto ti = cast(const TypeInfo)o;
return ti && this.toString() == ti.toString();
}
/**
* Computes a hash of the instance of a type.
* Params:
* p = pointer to start of instance of the type
* Returns:
* the hash
* Bugs:
* fix https://issues.dlang.org/show_bug.cgi?id=12516 e.g. by changing this to a truly safe interface.
*/
size_t getHash(scope const void* p) @trusted nothrow const
{
return hashOf(p);
}
/// Compares two instances for equality.
bool equals(in void* p1, in void* p2) const { return p1 == p2; }
/// Compares two instances for <, ==, or >.
int compare(in void* p1, in void* p2) const { return _xopCmp(p1, p2); }
/// Returns size of the type.
@property size_t tsize() nothrow pure const @safe @nogc { return 0; }
/// Swaps two instances of the type.
void swap(void* p1, void* p2) const
{
immutable size_t n = tsize;
for (size_t i = 0; i < n; i++)
{
byte t = (cast(byte *)p1)[i];
(cast(byte*)p1)[i] = (cast(byte*)p2)[i];
(cast(byte*)p2)[i] = t;
}
}
/** Get TypeInfo for 'next' type, as defined by what kind of type this is,
null if none. */
@property inout(TypeInfo) next() nothrow pure inout @nogc { return null; }
/**
* Return default initializer. If the type should be initialized to all
* zeros, an array with a null ptr and a length equal to the type size will
* be returned. For static arrays, this returns the default initializer for
* a single element of the array, use `tsize` to get the correct size.
*/
abstract const(void)[] initializer() nothrow pure const @safe @nogc;
/** Get flags for type: 1 means GC should scan for pointers,
2 means arg of this type is passed in XMM register */
@property uint flags() nothrow pure const @safe @nogc { return 0; }
/// Get type information on the contents of the type; null if not available
const(OffsetTypeInfo)[] offTi() const { return null; }
/// Run the destructor on the object and all its sub-objects
void destroy(void* p) const {}
/// Run the postblit on the object and all its sub-objects
void postblit(void* p) const {}
/// Return alignment of type
@property size_t talign() nothrow pure const @safe @nogc { return tsize; }
/** Return internal info on arguments fitting into 8byte.
* See X86-64 ABI 3.2.3
*/
version (X86_64) int argTypes(out TypeInfo arg1, out TypeInfo arg2) @safe nothrow
{
arg1 = this;
return 0;
}
/** Return info used by the garbage collector to do precise collection.
*/
@property immutable(void)* rtInfo() nothrow pure const @safe @nogc { return null; }
}
class TypeInfo_Enum : TypeInfo
{
override string toString() const { return name; }
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Enum)o;
return c && this.name == c.name &&
this.base == c.base;
}
override size_t getHash(scope const void* p) const { return base.getHash(p); }
override bool equals(in void* p1, in void* p2) const { return base.equals(p1, p2); }
override int compare(in void* p1, in void* p2) const { return base.compare(p1, p2); }
override @property size_t tsize() nothrow pure const { return base.tsize; }
override void swap(void* p1, void* p2) const { return base.swap(p1, p2); }
override @property inout(TypeInfo) next() nothrow pure inout { return base.next; }
override @property uint flags() nothrow pure const { return base.flags; }
override const(void)[] initializer() const
{
return m_init.length ? m_init : base.initializer();
}
override @property size_t talign() nothrow pure const { return base.talign; }
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
return base.argTypes(arg1, arg2);
}
override @property immutable(void)* rtInfo() const { return base.rtInfo; }
TypeInfo base;
string name;
void[] m_init;
}
unittest // issue 12233
{
static assert(is(typeof(TypeInfo.init) == TypeInfo));
assert(TypeInfo.init is null);
}
// Please make sure to keep this in sync with TypeInfo_P (src/rt/typeinfo/ti_ptr.d)
class TypeInfo_Pointer : TypeInfo
{
override string toString() const { return m_next.toString() ~ "*"; }
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Pointer)o;
return c && this.m_next == c.m_next;
}
override size_t getHash(scope const void* p) @trusted const
{
size_t addr = cast(size_t) *cast(const void**)p;
return addr ^ (addr >> 4);
}
override bool equals(in void* p1, in void* p2) const
{
return *cast(void**)p1 == *cast(void**)p2;
}
override int compare(in void* p1, in void* p2) const
{
if (*cast(void**)p1 < *cast(void**)p2)
return -1;
else if (*cast(void**)p1 > *cast(void**)p2)
return 1;
else
return 0;
}
override @property size_t tsize() nothrow pure const
{
return (void*).sizeof;
}
override const(void)[] initializer() const @trusted
{
return (cast(void *)null)[0 .. (void*).sizeof];
}
override void swap(void* p1, void* p2) const
{
void* tmp = *cast(void**)p1;
*cast(void**)p1 = *cast(void**)p2;
*cast(void**)p2 = tmp;
}
override @property inout(TypeInfo) next() nothrow pure inout { return m_next; }
override @property uint flags() nothrow pure const { return 1; }
TypeInfo m_next;
}
class TypeInfo_Array : TypeInfo
{
override string toString() const { return value.toString() ~ "[]"; }
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Array)o;
return c && this.value == c.value;
}
override size_t getHash(scope const void* p) @trusted const
{
void[] a = *cast(void[]*)p;
return getArrayHash(value, a.ptr, a.length);
}
override bool equals(in void* p1, in void* p2) const
{
void[] a1 = *cast(void[]*)p1;
void[] a2 = *cast(void[]*)p2;
if (a1.length != a2.length)
return false;
size_t sz = value.tsize;
for (size_t i = 0; i < a1.length; i++)
{
if (!value.equals(a1.ptr + i * sz, a2.ptr + i * sz))
return false;
}
return true;
}
override int compare(in void* p1, in void* p2) const
{
void[] a1 = *cast(void[]*)p1;
void[] a2 = *cast(void[]*)p2;
size_t sz = value.tsize;
size_t len = a1.length;
if (a2.length < len)
len = a2.length;
for (size_t u = 0; u < len; u++)
{
immutable int result = value.compare(a1.ptr + u * sz, a2.ptr + u * sz);
if (result)
return result;
}
return cast(int)a1.length - cast(int)a2.length;
}
override @property size_t tsize() nothrow pure const
{
return (void[]).sizeof;
}
override const(void)[] initializer() const @trusted
{
return (cast(void *)null)[0 .. (void[]).sizeof];
}
override void swap(void* p1, void* p2) const
{
void[] tmp = *cast(void[]*)p1;
*cast(void[]*)p1 = *cast(void[]*)p2;
*cast(void[]*)p2 = tmp;
}
TypeInfo value;
override @property inout(TypeInfo) next() nothrow pure inout
{
return value;
}
override @property uint flags() nothrow pure const { return 1; }
override @property size_t talign() nothrow pure const
{
return (void[]).alignof;
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
arg1 = typeid(size_t);
arg2 = typeid(void*);
return 0;
}
}
class TypeInfo_StaticArray : TypeInfo
{
override string toString() const
{
import core.internal.string : unsignedToTempString;
char[20] tmpBuff = void;
return value.toString() ~ "[" ~ unsignedToTempString(len, tmpBuff, 10) ~ "]";
}
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_StaticArray)o;
return c && this.len == c.len &&
this.value == c.value;
}
override size_t getHash(scope const void* p) @trusted const
{
return getArrayHash(value, p, len);
}
override bool equals(in void* p1, in void* p2) const
{
size_t sz = value.tsize;
for (size_t u = 0; u < len; u++)
{
if (!value.equals(p1 + u * sz, p2 + u * sz))
return false;
}
return true;
}
override int compare(in void* p1, in void* p2) const
{
size_t sz = value.tsize;
for (size_t u = 0; u < len; u++)
{
immutable int result = value.compare(p1 + u * sz, p2 + u * sz);
if (result)
return result;
}
return 0;
}
override @property size_t tsize() nothrow pure const
{
return len * value.tsize;
}
override void swap(void* p1, void* p2) const
{
import core.memory;
import core.stdc.string : memcpy;
void* tmp;
size_t sz = value.tsize;
ubyte[16] buffer;
void* pbuffer;
if (sz < buffer.sizeof)
tmp = buffer.ptr;
else
tmp = pbuffer = (new void[sz]).ptr;
for (size_t u = 0; u < len; u += sz)
{
size_t o = u * sz;
memcpy(tmp, p1 + o, sz);
memcpy(p1 + o, p2 + o, sz);
memcpy(p2 + o, tmp, sz);
}
if (pbuffer)
GC.free(pbuffer);
}
override const(void)[] initializer() nothrow pure const
{
return value.initializer();
}
override @property inout(TypeInfo) next() nothrow pure inout { return value; }
override @property uint flags() nothrow pure const { return value.flags; }
override void destroy(void* p) const
{
immutable sz = value.tsize;
p += sz * len;
foreach (i; 0 .. len)
{
p -= sz;
value.destroy(p);
}
}
override void postblit(void* p) const
{
immutable sz = value.tsize;
foreach (i; 0 .. len)
{
value.postblit(p);
p += sz;
}
}
TypeInfo value;
size_t len;
override @property size_t talign() nothrow pure const
{
return value.talign;
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
arg1 = typeid(void*);
return 0;
}
}
class TypeInfo_AssociativeArray : TypeInfo
{
override string toString() const
{
return value.toString() ~ "[" ~ key.toString() ~ "]";
}
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_AssociativeArray)o;
return c && this.key == c.key &&
this.value == c.value;
}
override bool equals(in void* p1, in void* p2) @trusted const
{
return !!_aaEqual(this, *cast(const void**) p1, *cast(const void**) p2);
}
override hash_t getHash(scope const void* p) nothrow @trusted const
{
return _aaGetHash(cast(void*)p, this);
}
// BUG: need to add the rest of the functions
override @property size_t tsize() nothrow pure const
{
return (char[int]).sizeof;
}
override const(void)[] initializer() const @trusted
{
return (cast(void *)null)[0 .. (char[int]).sizeof];
}
override @property inout(TypeInfo) next() nothrow pure inout { return value; }
override @property uint flags() nothrow pure const { return 1; }
TypeInfo value;
TypeInfo key;
override @property size_t talign() nothrow pure const
{
return (char[int]).alignof;
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
arg1 = typeid(void*);
return 0;
}
}
class TypeInfo_Vector : TypeInfo
{
override string toString() const { return "__vector(" ~ base.toString() ~ ")"; }
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Vector)o;
return c && this.base == c.base;
}
override size_t getHash(scope const void* p) const { return base.getHash(p); }
override bool equals(in void* p1, in void* p2) const { return base.equals(p1, p2); }
override int compare(in void* p1, in void* p2) const { return base.compare(p1, p2); }
override @property size_t tsize() nothrow pure const { return base.tsize; }
override void swap(void* p1, void* p2) const { return base.swap(p1, p2); }
override @property inout(TypeInfo) next() nothrow pure inout { return base.next; }
override @property uint flags() nothrow pure const { return base.flags; }
override const(void)[] initializer() nothrow pure const
{
return base.initializer();
}
override @property size_t talign() nothrow pure const { return 16; }
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
return base.argTypes(arg1, arg2);
}
TypeInfo base;
}
class TypeInfo_Function : TypeInfo
{
override string toString() const
{
import core.demangle : demangleType;
alias SafeDemangleFunctionType = char[] function (const(char)[] buf, char[] dst = null) @safe nothrow pure;
SafeDemangleFunctionType demangle = ( () @trusted => cast(SafeDemangleFunctionType)(&demangleType) ) ();
return (() @trusted => cast(string)(demangle(deco))) ();
}
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Function)o;
return c && this.deco == c.deco;
}
// BUG: need to add the rest of the functions
override @property size_t tsize() nothrow pure const
{
return 0; // no size for functions
}
override const(void)[] initializer() const @safe
{
return null;
}
TypeInfo next;
/**
* Mangled function type string
*/
string deco;
}
unittest
{
abstract class C
{
void func();
void func(int a);
int func(int a, int b);
}
alias functionTypes = typeof(__traits(getVirtualFunctions, C, "func"));
assert(typeid(functionTypes[0]).toString() == "void function()");
assert(typeid(functionTypes[1]).toString() == "void function(int)");
assert(typeid(functionTypes[2]).toString() == "int function(int, int)");
}
class TypeInfo_Delegate : TypeInfo
{
override string toString() const
{
return cast(string)(next.toString() ~ " delegate()");
}
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Delegate)o;
return c && this.deco == c.deco;
}
override size_t getHash(scope const void* p) @trusted const
{
return hashOf(*cast(void delegate()*)p);
}
override bool equals(in void* p1, in void* p2) const
{
auto dg1 = *cast(void delegate()*)p1;
auto dg2 = *cast(void delegate()*)p2;
return dg1 == dg2;
}
override int compare(in void* p1, in void* p2) const
{
auto dg1 = *cast(void delegate()*)p1;
auto dg2 = *cast(void delegate()*)p2;
if (dg1 < dg2)
return -1;
else if (dg1 > dg2)
return 1;
else
return 0;
}
override @property size_t tsize() nothrow pure const
{
alias dg = int delegate();
return dg.sizeof;
}
override const(void)[] initializer() const @trusted
{
return (cast(void *)null)[0 .. (int delegate()).sizeof];
}
override @property uint flags() nothrow pure const { return 1; }
TypeInfo next;
string deco;
override @property size_t talign() nothrow pure const
{
alias dg = int delegate();
return dg.alignof;
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
arg1 = typeid(void*);
arg2 = typeid(void*);
return 0;
}
}
/**
* Runtime type information about a class.
* Can be retrieved from an object instance by using the
* $(DDSUBLINK spec/property,classinfo, .classinfo) property.
*/
class TypeInfo_Class : TypeInfo
{
override string toString() const { return info.name; }
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Class)o;
return c && this.info.name == c.info.name;
}
override size_t getHash(scope const void* p) @trusted const
{
auto o = *cast(Object*)p;
return o ? o.toHash() : 0;
}
override bool equals(in void* p1, in void* p2) const
{
Object o1 = *cast(Object*)p1;
Object o2 = *cast(Object*)p2;
return (o1 is o2) || (o1 && o1.opEquals(o2));
}
override int compare(in void* p1, in void* p2) const
{
Object o1 = *cast(Object*)p1;
Object o2 = *cast(Object*)p2;
int c = 0;
// Regard null references as always being "less than"
if (o1 !is o2)
{
if (o1)
{
if (!o2)
c = 1;
else
c = o1.opCmp(o2);
}
else
c = -1;
}
return c;
}
override @property size_t tsize() nothrow pure const
{
return Object.sizeof;
}
override const(void)[] initializer() nothrow pure const @safe
{
return m_init;
}
override @property uint flags() nothrow pure const { return 1; }
override @property const(OffsetTypeInfo)[] offTi() nothrow pure const
{
return m_offTi;
}
@property auto info() @safe nothrow pure const { return this; }
@property auto typeinfo() @safe nothrow pure const { return this; }
byte[] m_init; /** class static initializer
* (init.length gives size in bytes of class)
*/
string name; /// class name
void*[] vtbl; /// virtual function pointer table
Interface[] interfaces; /// interfaces this class implements
TypeInfo_Class base; /// base class
void* destructor;
void function(Object) classInvariant;
enum ClassFlags : uint
{
isCOMclass = 0x1,
noPointers = 0x2,
hasOffTi = 0x4,
hasCtor = 0x8,
hasGetMembers = 0x10,
hasTypeInfo = 0x20,
isAbstract = 0x40,
isCPPclass = 0x80,
hasDtor = 0x100,
}
ClassFlags m_flags;
void* deallocator;
OffsetTypeInfo[] m_offTi;
void function(Object) defaultConstructor; // default Constructor
immutable(void)* m_RTInfo; // data for precise GC
override @property immutable(void)* rtInfo() const { return m_RTInfo; }
/**
* Search all modules for TypeInfo_Class corresponding to classname.
* Returns: null if not found
*/
static const(TypeInfo_Class) find(in char[] classname)
{
foreach (m; ModuleInfo)
{
if (m)
{
//writefln("module %s, %d", m.name, m.localClasses.length);
foreach (c; m.localClasses)
{
if (c is null)
continue;
//writefln("\tclass %s", c.name);
if (c.name == classname)
return c;
}
}
}
return null;
}
/**
* Create instance of Object represented by 'this'.
*/
Object create() const
{
if (m_flags & 8 && !defaultConstructor)
return null;
if (m_flags & 64) // abstract
return null;
Object o = _d_newclass(this);
if (m_flags & 8 && defaultConstructor)
{
defaultConstructor(o);
}
return o;
}
}
alias ClassInfo = TypeInfo_Class;
unittest
{
// Bugzilla 14401
static class X
{
int a;
}
assert(typeid(X).initializer is typeid(X).m_init);
assert(typeid(X).initializer.length == typeid(const(X)).initializer.length);
assert(typeid(X).initializer.length == typeid(shared(X)).initializer.length);
assert(typeid(X).initializer.length == typeid(immutable(X)).initializer.length);
}
class TypeInfo_Interface : TypeInfo
{
override string toString() const { return info.name; }
override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Interface)o;
return c && this.info.name == typeid(c).name;
}
override size_t getHash(scope const void* p) @trusted const
{
if (!*cast(void**)p)
{
return 0;
}
Interface* pi = **cast(Interface ***)*cast(void**)p;
Object o = cast(Object)(*cast(void**)p - pi.offset);
assert(o);
return o.toHash();
}
override bool equals(in void* p1, in void* p2) const
{
Interface* pi = **cast(Interface ***)*cast(void**)p1;
Object o1 = cast(Object)(*cast(void**)p1 - pi.offset);
pi = **cast(Interface ***)*cast(void**)p2;
Object o2 = cast(Object)(*cast(void**)p2 - pi.offset);
return o1 == o2 || (o1 && o1.opCmp(o2) == 0);
}
override int compare(in void* p1, in void* p2) const
{
Interface* pi = **cast(Interface ***)*cast(void**)p1;
Object o1 = cast(Object)(*cast(void**)p1 - pi.offset);
pi = **cast(Interface ***)*cast(void**)p2;
Object o2 = cast(Object)(*cast(void**)p2 - pi.offset);
int c = 0;
// Regard null references as always being "less than"
if (o1 != o2)
{
if (o1)
{
if (!o2)
c = 1;
else
c = o1.opCmp(o2);
}
else
c = -1;
}
return c;
}
override @property size_t tsize() nothrow pure const
{
return Object.sizeof;
}
override const(void)[] initializer() const @trusted
{
return (cast(void *)null)[0 .. Object.sizeof];
}
override @property uint flags() nothrow pure const { return 1; }
TypeInfo_Class info;
}
class TypeInfo_Struct : TypeInfo
{
override string toString() const { return name; }
override bool opEquals(Object o)
{
if (this is o)
return true;
auto s = cast(const TypeInfo_Struct)o;
return s && this.name == s.name &&
this.initializer().length == s.initializer().length;
}
override size_t getHash(scope const void* p) @trusted pure nothrow const
{
assert(p);
if (xtoHash)
{
return (*xtoHash)(p);
}
else
{
return hashOf(p[0 .. initializer().length]);
}
}
override bool equals(in void* p1, in void* p2) @trusted pure nothrow const
{
import core.stdc.string : memcmp;
if (!p1 || !p2)
return false;
else if (xopEquals)
return (*xopEquals)(p1, p2);
else if (p1 == p2)
return true;
else
// BUG: relies on the GC not moving objects
return memcmp(p1, p2, initializer().length) == 0;
}
override int compare(in void* p1, in void* p2) @trusted pure nothrow const
{
import core.stdc.string : memcmp;
// Regard null references as always being "less than"
if (p1 != p2)
{
if (p1)
{
if (!p2)
return true;
else if (xopCmp)
return (*xopCmp)(p2, p1);
else
// BUG: relies on the GC not moving objects
return memcmp(p1, p2, initializer().length);
}
else
return -1;
}
return 0;
}
override @property size_t tsize() nothrow pure const
{
return initializer().length;
}
override const(void)[] initializer() nothrow pure const @safe
{
return m_init;
}
override @property uint flags() nothrow pure const { return m_flags; }
override @property size_t talign() nothrow pure const { return m_align; }
final override void destroy(void* p) const
{
if (xdtor)
{
if (m_flags & StructFlags.isDynamicType)
(*xdtorti)(p, this);
else
(*xdtor)(p);
}
}
override void postblit(void* p) const
{
if (xpostblit)
(*xpostblit)(p);
}
string name;
void[] m_init; // initializer; m_init.ptr == null if 0 initialize
@safe pure nothrow
{
size_t function(in void*) xtoHash;
bool function(in void*, in void*) xopEquals;
int function(in void*, in void*) xopCmp;
string function(in void*) xtoString;
enum StructFlags : uint
{
hasPointers = 0x1,
isDynamicType = 0x2, // built at runtime, needs type info in xdtor
}
StructFlags m_flags;
}
union
{
void function(void*) xdtor;
void function(void*, const TypeInfo_Struct ti) xdtorti;
}
void function(void*) xpostblit;
uint m_align;
override @property immutable(void)* rtInfo() const { return m_RTInfo; }
version (X86_64)
{
override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
arg1 = m_arg1;
arg2 = m_arg2;
return 0;
}
TypeInfo m_arg1;
TypeInfo m_arg2;
}
immutable(void)* m_RTInfo; // data for precise GC
}
unittest
{
struct S
{
bool opEquals(ref const S rhs) const
{
return false;
}
}
S s;
assert(!typeid(S).equals(&s, &s));
}
class TypeInfo_Tuple : TypeInfo
{
TypeInfo[] elements;
override string toString() const
{
string s = "(";
foreach (i, element; elements)
{
if (i)
s ~= ',';
s ~= element.toString();
}
s ~= ")";
return s;
}
override bool opEquals(Object o)
{
if (this is o)
return true;
auto t = cast(const TypeInfo_Tuple)o;
if (t && elements.length == t.elements.length)
{
for (size_t i = 0; i < elements.length; i++)
{
if (elements[i] != t.elements[i])
return false;
}
return true;
}
return false;
}
override size_t getHash(scope const void* p) const
{
assert(0);
}
override bool equals(in void* p1, in void* p2) const
{
assert(0);
}
override int compare(in void* p1, in void* p2) const
{
assert(0);
}
override @property size_t tsize() nothrow pure const
{
assert(0);
}
override const(void)[] initializer() const @trusted
{
assert(0);
}
override void swap(void* p1, void* p2) const
{
assert(0);
}
override void destroy(void* p) const
{
assert(0);
}
override void postblit(void* p) const
{
assert(0);
}
override @property size_t talign() nothrow pure const
{
assert(0);
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
assert(0);
}
}
class TypeInfo_Const : TypeInfo
{
override string toString() const
{
return cast(string) ("const(" ~ base.toString() ~ ")");
}
//override bool opEquals(Object o) { return base.opEquals(o); }
override bool opEquals(Object o)
{
if (this is o)
return true;
if (typeid(this) != typeid(o))
return false;
auto t = cast(TypeInfo_Const)o;
return base.opEquals(t.base);
}
override size_t getHash(scope const void *p) const { return base.getHash(p); }
override bool equals(in void *p1, in void *p2) const { return base.equals(p1, p2); }
override int compare(in void *p1, in void *p2) const { return base.compare(p1, p2); }
override @property size_t tsize() nothrow pure const { return base.tsize; }
override void swap(void *p1, void *p2) const { return base.swap(p1, p2); }
override @property inout(TypeInfo) next() nothrow pure inout { return base.next; }
override @property uint flags() nothrow pure const { return base.flags; }
override const(void)[] initializer() nothrow pure const
{
return base.initializer();
}
override @property size_t talign() nothrow pure const { return base.talign; }
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
return base.argTypes(arg1, arg2);
}
TypeInfo base;
}
class TypeInfo_Invariant : TypeInfo_Const
{
override string toString() const
{
return cast(string) ("immutable(" ~ base.toString() ~ ")");
}
}
class TypeInfo_Shared : TypeInfo_Const
{
override string toString() const
{
return cast(string) ("shared(" ~ base.toString() ~ ")");
}
}
class TypeInfo_Inout : TypeInfo_Const
{
override string toString() const
{
return cast(string) ("inout(" ~ base.toString() ~ ")");
}
}
// Contents of Moduleinfo._flags
enum
{
MIctorstart = 0x1, // we've started constructing it
MIctordone = 0x2, // finished construction
MIstandalone = 0x4, // module ctor does not depend on other module
// ctors being done first
MItlsctor = 8,
MItlsdtor = 0x10,
MIctor = 0x20,
MIdtor = 0x40,
MIxgetMembers = 0x80,
MIictor = 0x100,
MIunitTest = 0x200,
MIimportedModules = 0x400,
MIlocalClasses = 0x800,
MIname = 0x1000,
}
/*****************************************
* An instance of ModuleInfo is generated into the object file for each compiled module.
*
* It provides access to various aspects of the module.
* It is not generated for betterC.
*/
struct ModuleInfo
{
uint _flags; // MIxxxx
uint _index; // index into _moduleinfo_array[]
version (all)
{
deprecated("ModuleInfo cannot be copy-assigned because it is a variable-sized struct.")
void opAssign(in ModuleInfo m) { _flags = m._flags; _index = m._index; }
}
else
{
@disable this();
}
const:
private void* addrOf(int flag) nothrow pure @nogc
in
{
assert(flag >= MItlsctor && flag <= MIname);
assert(!(flag & (flag - 1)) && !(flag & ~(flag - 1) << 1));
}
do
{
import core.stdc.string : strlen;
void* p = cast(void*)&this + ModuleInfo.sizeof;
if (flags & MItlsctor)
{
if (flag == MItlsctor) return p;
p += typeof(tlsctor).sizeof;
}
if (flags & MItlsdtor)
{
if (flag == MItlsdtor) return p;
p += typeof(tlsdtor).sizeof;
}
if (flags & MIctor)
{
if (flag == MIctor) return p;
p += typeof(ctor).sizeof;
}
if (flags & MIdtor)
{
if (flag == MIdtor) return p;
p += typeof(dtor).sizeof;
}
if (flags & MIxgetMembers)
{
if (flag == MIxgetMembers) return p;
p += typeof(xgetMembers).sizeof;
}
if (flags & MIictor)
{
if (flag == MIictor) return p;
p += typeof(ictor).sizeof;
}
if (flags & MIunitTest)
{
if (flag == MIunitTest) return p;
p += typeof(unitTest).sizeof;
}
if (flags & MIimportedModules)
{
if (flag == MIimportedModules) return p;
p += size_t.sizeof + *cast(size_t*)p * typeof(importedModules[0]).sizeof;
}
if (flags & MIlocalClasses)
{
if (flag == MIlocalClasses) return p;
p += size_t.sizeof + *cast(size_t*)p * typeof(localClasses[0]).sizeof;
}
if (true || flags & MIname) // always available for now
{
if (flag == MIname) return p;
p += strlen(cast(immutable char*)p);
}
assert(0);
}
@property uint index() nothrow pure @nogc { return _index; }
@property uint flags() nothrow pure @nogc { return _flags; }
/************************
* Returns:
* module constructor for thread locals, `null` if there isn't one
*/
@property void function() tlsctor() nothrow pure @nogc
{
return flags & MItlsctor ? *cast(typeof(return)*)addrOf(MItlsctor) : null;
}
/************************
* Returns:
* module destructor for thread locals, `null` if there isn't one
*/
@property void function() tlsdtor() nothrow pure @nogc
{
return flags & MItlsdtor ? *cast(typeof(return)*)addrOf(MItlsdtor) : null;
}
/*****************************
* Returns:
* address of a module's `const(MemberInfo)[] getMembers(string)` function, `null` if there isn't one
*/
@property void* xgetMembers() nothrow pure @nogc
{
return flags & MIxgetMembers ? *cast(typeof(return)*)addrOf(MIxgetMembers) : null;
}
/************************
* Returns:
* module constructor, `null` if there isn't one
*/
@property void function() ctor() nothrow pure @nogc
{
return flags & MIctor ? *cast(typeof(return)*)addrOf(MIctor) : null;
}
/************************
* Returns:
* module destructor, `null` if there isn't one
*/
@property void function() dtor() nothrow pure @nogc
{
return flags & MIdtor ? *cast(typeof(return)*)addrOf(MIdtor) : null;
}
/************************
* Returns:
* module order independent constructor, `null` if there isn't one
*/
@property void function() ictor() nothrow pure @nogc
{
return flags & MIictor ? *cast(typeof(return)*)addrOf(MIictor) : null;
}
/*************
* Returns:
* address of function that runs the module's unittests, `null` if there isn't one
*/
@property void function() unitTest() nothrow pure @nogc
{
return flags & MIunitTest ? *cast(typeof(return)*)addrOf(MIunitTest) : null;
}
/****************
* Returns:
* array of pointers to the ModuleInfo's of modules imported by this one
*/
@property immutable(ModuleInfo*)[] importedModules() nothrow pure @nogc
{
if (flags & MIimportedModules)
{
auto p = cast(size_t*)addrOf(MIimportedModules);
return (cast(immutable(ModuleInfo*)*)(p + 1))[0 .. *p];
}
return null;
}
/****************
* Returns:
* array of TypeInfo_Class references for classes defined in this module
*/
@property TypeInfo_Class[] localClasses() nothrow pure @nogc
{
if (flags & MIlocalClasses)
{
auto p = cast(size_t*)addrOf(MIlocalClasses);
return (cast(TypeInfo_Class*)(p + 1))[0 .. *p];
}
return null;
}
/********************
* Returns:
* name of module, `null` if no name
*/
@property string name() nothrow pure @nogc
{
if (true || flags & MIname) // always available for now
{
import core.stdc.string : strlen;
auto p = cast(immutable char*)addrOf(MIname);
return p[0 .. strlen(p)];
}
// return null;
}
static int opApply(scope int delegate(ModuleInfo*) dg)
{
import core.internal.traits : externDFunc;
alias moduleinfos_apply = externDFunc!("rt.minfo.moduleinfos_apply",
int function(scope int delegate(immutable(ModuleInfo*))));
// Bugzilla 13084 - enforcing immutable ModuleInfo would break client code
return moduleinfos_apply(
(immutable(ModuleInfo*)m) => dg(cast(ModuleInfo*)m));
}
}
unittest
{
ModuleInfo* m1;
foreach (m; ModuleInfo)
{
m1 = m;
}
}
///////////////////////////////////////////////////////////////////////////////
// Throwable
///////////////////////////////////////////////////////////////////////////////
/**
* The base class of all thrown objects.
*
* All thrown objects must inherit from Throwable. Class $(D Exception), which
* derives from this class, represents the category of thrown objects that are
* safe to catch and handle. In principle, one should not catch Throwable
* objects that are not derived from $(D Exception), as they represent
* unrecoverable runtime errors. Certain runtime guarantees may fail to hold
* when these errors are thrown, making it unsafe to continue execution after
* catching them.
*/
class Throwable : Object
{
interface TraceInfo
{
int opApply(scope int delegate(ref const(char[]))) const;
int opApply(scope int delegate(ref size_t, ref const(char[]))) const;
string toString() const;
}
string msg; /// A message describing the error.
/**
* The _file name of the D source code corresponding with
* where the error was thrown from.
*/
string file;
/**
* The _line number of the D source code corresponding with
* where the error was thrown from.
*/
size_t line;
/**
* The stack trace of where the error happened. This is an opaque object
* that can either be converted to $(D string), or iterated over with $(D
* foreach) to extract the items in the stack trace (as strings).
*/
TraceInfo info;
/**
* A reference to the _next error in the list. This is used when a new
* $(D Throwable) is thrown from inside a $(D catch) block. The originally
* caught $(D Exception) will be chained to the new $(D Throwable) via this
* field.
*/
private Throwable nextInChain;
private uint _refcount; // 0 : allocated by GC
// 1 : allocated by _d_newThrowable()
// 2.. : reference count + 1
/**
* Returns:
* A reference to the _next error in the list. This is used when a new
* $(D Throwable) is thrown from inside a $(D catch) block. The originally
* caught $(D Exception) will be chained to the new $(D Throwable) via this
* field.
*/
@property inout(Throwable) next() @safe inout return scope pure nothrow @nogc { return nextInChain; }
/**
* Replace next in chain with `tail`.
* Use `chainTogether` instead if at all possible.
*/
@property void next(Throwable tail) @safe scope pure nothrow @nogc
{
if (tail && tail._refcount)
++tail._refcount; // increment the replacement *first*
auto n = nextInChain;
nextInChain = null; // sever the tail before deleting it
if (n && n._refcount)
_d_delThrowable(n); // now delete the old tail
nextInChain = tail; // and set the new tail
}
/**
* Returns:
* mutable reference to the reference count, which is
* 0 - allocated by the GC, 1 - allocated by _d_newThrowable(),
* and >=2 which is the reference count + 1
*/
@system @nogc final pure nothrow ref uint refcount() return scope { return _refcount; }
/**
* Loop over the chain of Throwables.
*/
int opApply(scope int delegate(Throwable) dg)
{
int result = 0;
for (Throwable t = this; t; t = t.nextInChain)
{
result = dg(t);
if (result)
break;
}
return result;
}
/**
* Append `e2` to chain of exceptions that starts with `e1`.
* Params:
* e1 = start of chain (can be null)
* e2 = second part of chain (can be null)
* Returns:
* Throwable that is at the start of the chain; null if both `e1` and `e2` are null
*/
static @__future @system @nogc pure nothrow Throwable chainTogether(return scope Throwable e1, return scope Throwable e2)
{
if (e2 && e2.refcount())
++e2.refcount();
if (!e1)
return e2;
if (!e2)
return e1;
for (auto e = e1; 1; e = e.nextInChain)
{
if (!e.nextInChain)
{
e.nextInChain = e2;
break;
}
}
return e1;
}
@nogc @safe pure nothrow this(string msg, Throwable nextInChain = null)
{
this.msg = msg;
this.nextInChain = nextInChain;
//this.info = _d_traceContext();
}
@nogc @safe pure nothrow this(string msg, string file, size_t line, Throwable nextInChain = null)
{
this(msg, nextInChain);
this.file = file;
this.line = line;
//this.info = _d_traceContext();
}
@trusted nothrow ~this()
{
if (nextInChain && nextInChain._refcount)
_d_delThrowable(nextInChain);
}
/**
* Overrides $(D Object.toString) and returns the error message.
* Internally this forwards to the $(D toString) overload that
* takes a $(D_PARAM sink) delegate.
*/
override string toString()
{
string s;
toString((buf) { s ~= buf; });
return s;
}
/**
* The Throwable hierarchy uses a toString overload that takes a
* $(D_PARAM _sink) delegate to avoid GC allocations, which cannot be
* performed in certain error situations. Override this $(D
* toString) method to customize the error message.
*/
void toString(scope void delegate(in char[]) sink) const
{
import core.internal.string : unsignedToTempString;
char[20] tmpBuff = void;
sink(typeid(this).name);
sink("@"); sink(file);
sink("("); sink(unsignedToTempString(line, tmpBuff, 10)); sink(")");
if (msg.length)
{
sink(": "); sink(msg);
}
if (info)
{
try
{
sink("\n----------------");
foreach (t; info)
{
sink("\n"); sink(t);
}
}
catch (Throwable)
{
// ignore more errors
}
}
}
/**
* Get the message describing the error.
* Base behavior is to return the `Throwable.msg` field.
* Override to return some other error message.
*
* Returns:
* Error message
*/
@__future const(char)[] message() const
{
return this.msg;
}
}
/**
* The base class of all errors that are safe to catch and handle.
*
* In principle, only thrown objects derived from this class are safe to catch
* inside a $(D catch) block. Thrown objects not derived from Exception
* represent runtime errors that should not be caught, as certain runtime
* guarantees may not hold, making it unsafe to continue program execution.
*/
class Exception : Throwable
{
/**
* Creates a new instance of Exception. The nextInChain parameter is used
* internally and should always be $(D null) when passed by user code.
* This constructor does not automatically throw the newly-created
* Exception; the $(D throw) statement should be used for that purpose.
*/
@nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null)
{
super(msg, file, line, nextInChain);
}
@nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__)
{
super(msg, file, line, nextInChain);
}
}
unittest
{
{
auto e = new Exception("msg");
assert(e.file == __FILE__);
assert(e.line == __LINE__ - 2);
assert(e.nextInChain is null);
assert(e.msg == "msg");
}
{
auto e = new Exception("msg", new Exception("It's an Exception!"), "hello", 42);
assert(e.file == "hello");
assert(e.line == 42);
assert(e.nextInChain !is null);
assert(e.msg == "msg");
}
{
auto e = new Exception("msg", "hello", 42, new Exception("It's an Exception!"));
assert(e.file == "hello");
assert(e.line == 42);
assert(e.nextInChain !is null);
assert(e.msg == "msg");
}
{
auto e = new Exception("message");
assert(e.message == "message");
}
}
/**
* The base class of all unrecoverable runtime errors.
*
* This represents the category of $(D Throwable) objects that are $(B not)
* safe to catch and handle. In principle, one should not catch Error
* objects, as they represent unrecoverable runtime errors.
* Certain runtime guarantees may fail to hold when these errors are
* thrown, making it unsafe to continue execution after catching them.
*/
class Error : Throwable
{
/**
* Creates a new instance of Error. The nextInChain parameter is used
* internally and should always be $(D null) when passed by user code.
* This constructor does not automatically throw the newly-created
* Error; the $(D throw) statement should be used for that purpose.
*/
@nogc @safe pure nothrow this(string msg, Throwable nextInChain = null)
{
super(msg, nextInChain);
bypassedException = null;
}
@nogc @safe pure nothrow this(string msg, string file, size_t line, Throwable nextInChain = null)
{
super(msg, file, line, nextInChain);
bypassedException = null;
}
/** The first $(D Exception) which was bypassed when this Error was thrown,
or $(D null) if no $(D Exception)s were pending. */
Throwable bypassedException;
}
unittest
{
{
auto e = new Error("msg");
assert(e.file is null);
assert(e.line == 0);
assert(e.nextInChain is null);
assert(e.msg == "msg");
assert(e.bypassedException is null);
}
{
auto e = new Error("msg", new Exception("It's an Exception!"));
assert(e.file is null);
assert(e.line == 0);
assert(e.nextInChain !is null);
assert(e.msg == "msg");
assert(e.bypassedException is null);
}
{
auto e = new Error("msg", "hello", 42, new Exception("It's an Exception!"));
assert(e.file == "hello");
assert(e.line == 42);
assert(e.nextInChain !is null);
assert(e.msg == "msg");
assert(e.bypassedException is null);
}
}
/* Used in Exception Handling LSDA tables to 'wrap' C++ type info
* so it can be distinguished from D TypeInfo
*/
class __cpp_type_info_ptr
{
void* ptr; // opaque pointer to C++ RTTI type info
}
extern (C)
{
// from druntime/src/rt/aaA.d
// size_t _aaLen(in void* p) pure nothrow @nogc;
private void* _aaGetY(void** paa, const TypeInfo_AssociativeArray ti, in size_t valuesize, in void* pkey) pure nothrow;
private void* _aaGetX(void** paa, const TypeInfo_AssociativeArray ti, in size_t valuesize, in void* pkey, out bool found) pure nothrow;
// inout(void)* _aaGetRvalueX(inout void* p, in TypeInfo keyti, in size_t valuesize, in void* pkey);
inout(void)[] _aaValues(inout void* p, in size_t keysize, in size_t valuesize, const TypeInfo tiValArray) pure nothrow;
inout(void)[] _aaKeys(inout void* p, in size_t keysize, const TypeInfo tiKeyArray) pure nothrow;
void* _aaRehash(void** pp, in TypeInfo keyti) pure nothrow;
void _aaClear(void* p) pure nothrow;
// alias _dg_t = extern(D) int delegate(void*);
// int _aaApply(void* aa, size_t keysize, _dg_t dg);
// alias _dg2_t = extern(D) int delegate(void*, void*);
// int _aaApply2(void* aa, size_t keysize, _dg2_t dg);
private struct AARange { void* impl; size_t idx; }
AARange _aaRange(void* aa) pure nothrow @nogc @safe;
bool _aaRangeEmpty(AARange r) pure nothrow @nogc @safe;
void* _aaRangeFrontKey(AARange r) pure nothrow @nogc @safe;
void* _aaRangeFrontValue(AARange r) pure nothrow @nogc @safe;
void _aaRangePopFront(ref AARange r) pure nothrow @nogc @safe;
int _aaEqual(in TypeInfo tiRaw, in void* e1, in void* e2);
hash_t _aaGetHash(in void* aa, in TypeInfo tiRaw) nothrow;
/*
_d_assocarrayliteralTX marked as pure, because aaLiteral can be called from pure code.
This is a typesystem hole, however this is existing hole.
Early compiler didn't check purity of toHash or postblit functions, if key is a UDT thus
copiler allowed to create AA literal with keys, which have impure unsafe toHash methods.
*/
void* _d_assocarrayliteralTX(const TypeInfo_AssociativeArray ti, void[] keys, void[] values) pure;
}
void* aaLiteral(Key, Value)(Key[] keys, Value[] values) @trusted pure
{
return _d_assocarrayliteralTX(typeid(Value[Key]), *cast(void[]*)&keys, *cast(void[]*)&values);
}
alias AssociativeArray(Key, Value) = Value[Key];
/***********************************
* Removes all remaining keys and values from an associative array.
* Params:
* aa = The associative array.
*/
void clear(T : Value[Key], Value, Key)(T aa)
{
_aaClear(*cast(void **) &aa);
}
/* ditto */
void clear(T : Value[Key], Value, Key)(T* aa)
{
_aaClear(*cast(void **) aa);
}
/***********************************
* Reorganizes the associative array in place so that lookups are more
* efficient.
* Params:
* aa = The associative array.
* Returns:
* The rehashed associative array.
*/
T rehash(T : Value[Key], Value, Key)(T aa)
{
_aaRehash(cast(void**)&aa, typeid(Value[Key]));
return aa;
}
/* ditto */
T rehash(T : Value[Key], Value, Key)(T* aa)
{
_aaRehash(cast(void**)aa, typeid(Value[Key]));
return *aa;
}
/* ditto */
T rehash(T : shared Value[Key], Value, Key)(T aa)
{
_aaRehash(cast(void**)&aa, typeid(Value[Key]));
return aa;
}
/* ditto */
T rehash(T : shared Value[Key], Value, Key)(T* aa)
{
_aaRehash(cast(void**)aa, typeid(Value[Key]));
return *aa;
}
/***********************************
* Create a new associative array of the same size and copy the contents of the
* associative array into it.
* Params:
* aa = The associative array.
*/
V[K] dup(T : V[K], K, V)(T aa)
{
//pragma(msg, "K = ", K, ", V = ", V);
// Bug10720 - check whether V is copyable
static assert(is(typeof({ V v = aa[K.init]; })),
"cannot call " ~ T.stringof ~ ".dup because " ~ V.stringof ~ " is not copyable");
V[K] result;
//foreach (k, ref v; aa)
// result[k] = v; // Bug13701 - won't work if V is not mutable
ref V duplicateElem(ref K k, ref const V v) @trusted pure nothrow
{
import core.stdc.string : memcpy;
void* pv = _aaGetY(cast(void**)&result, typeid(V[K]), V.sizeof, &k);
memcpy(pv, &v, V.sizeof);
return *cast(V*)pv;
}
if (auto postblit = _getPostblit!V())
{
foreach (k, ref v; aa)
postblit(duplicateElem(k, v));
}
else
{
foreach (k, ref v; aa)
duplicateElem(k, v);
}
return result;
}
/* ditto */
V[K] dup(T : V[K], K, V)(T* aa)
{
return (*aa).dup;
}
// this should never be made public.
private AARange _aaToRange(T: V[K], K, V)(ref T aa) pure nothrow @nogc @safe
{
// ensure we are dealing with a genuine AA.
static if (is(const(V[K]) == const(T)))
alias realAA = aa;
else
const(V[K]) realAA = aa;
return _aaRange(() @trusted { return cast(void*)realAA; } ());
}
/***********************************
* Returns a forward range over the keys of the associative array.
* Params:
* aa = The associative array.
* Returns:
* A forward range.
*/
auto byKey(T : V[K], K, V)(T aa) pure nothrow @nogc @safe
{
import core.internal.traits : substInout;
static struct Result
{
AARange r;
pure nothrow @nogc:
@property bool empty() @safe { return _aaRangeEmpty(r); }
@property ref front()
{
auto p = (() @trusted => cast(substInout!K*) _aaRangeFrontKey(r)) ();
return *p;
}
void popFront() @safe { _aaRangePopFront(r); }
@property Result save() { return this; }
}
return Result(_aaToRange(aa));
}
/* ditto */
auto byKey(T : V[K], K, V)(T* aa) pure nothrow @nogc
{
return (*aa).byKey();
}
/***********************************
* Returns a forward range over the values of the associative array.
* Params:
* aa = The associative array.
* Returns:
* A forward range.
*/
auto byValue(T : V[K], K, V)(T aa) pure nothrow @nogc @safe
{
import core.internal.traits : substInout;
static struct Result
{
AARange r;
pure nothrow @nogc:
@property bool empty() @safe { return _aaRangeEmpty(r); }
@property ref front()
{
auto p = (() @trusted => cast(substInout!V*) _aaRangeFrontValue(r)) ();
return *p;
}
void popFront() @safe { _aaRangePopFront(r); }
@property Result save() { return this; }
}
return Result(_aaToRange(aa));
}
/* ditto */
auto byValue(T : V[K], K, V)(T* aa) pure nothrow @nogc
{
return (*aa).byValue();
}
/***********************************
* Returns a forward range over the key value pairs of the associative array.
* Params:
* aa = The associative array.
* Returns:
* A forward range.
*/
auto byKeyValue(T : V[K], K, V)(T aa) pure nothrow @nogc @safe
{
import core.internal.traits : substInout;
static struct Result
{
AARange r;
pure nothrow @nogc:
@property bool empty() @safe { return _aaRangeEmpty(r); }
@property auto front()
{
static struct Pair
{
// We save the pointers here so that the Pair we return
// won't mutate when Result.popFront is called afterwards.
private void* keyp;
private void* valp;
@property ref key() inout
{
auto p = (() @trusted => cast(substInout!K*) keyp) ();
return *p;
}
@property ref value() inout
{
auto p = (() @trusted => cast(substInout!V*) valp) ();
return *p;
}
}
return Pair(_aaRangeFrontKey(r),
_aaRangeFrontValue(r));
}
void popFront() @safe { return _aaRangePopFront(r); }
@property Result save() { return this; }
}
return Result(_aaToRange(aa));
}
/* ditto */
auto byKeyValue(T : V[K], K, V)(T* aa) pure nothrow @nogc
{
return (*aa).byKeyValue();
}
/***********************************
* Returns a dynamic array, the elements of which are the keys in the
* associative array.
* Params:
* aa = The associative array.
* Returns:
* A dynamic array.
*/
Key[] keys(T : Value[Key], Value, Key)(T aa) @property
{
auto a = cast(void[])_aaKeys(cast(inout(void)*)aa, Key.sizeof, typeid(Key[]));
auto res = *cast(Key[]*)&a;
_doPostblit(res);
return res;
}
/* ditto */
Key[] keys(T : Value[Key], Value, Key)(T *aa) @property
{
return (*aa).keys;
}
/***********************************
* Returns a dynamic array, the elements of which are the values in the
* associative array.
* Params:
* aa = The associative array.
* Returns:
* A dynamic array.
*/
Value[] values(T : Value[Key], Value, Key)(T aa) @property
{
auto a = cast(void[])_aaValues(cast(inout(void)*)aa, Key.sizeof, Value.sizeof, typeid(Value[]));
auto res = *cast(Value[]*)&a;
_doPostblit(res);
return res;
}
/* ditto */
Value[] values(T : Value[Key], Value, Key)(T *aa) @property
{
return (*aa).values;
}
/***********************************
* Looks up key; if it exists returns corresponding value else evaluates and
* returns defaultValue.
* Params:
* aa = The associative array.
* key = The key.
* defaultValue = The default value.
* Returns:
* The value.
*/
inout(V) get(K, V)(inout(V[K]) aa, K key, lazy inout(V) defaultValue)
{
auto p = key in aa;
return p ? *p : defaultValue;
}
/* ditto */
inout(V) get(K, V)(inout(V[K])* aa, K key, lazy inout(V) defaultValue)
{
return (*aa).get(key, defaultValue);
}
/***********************************
* Looks up key; if it exists returns corresponding value else evaluates
* value, adds it to the associative array and returns it.
* Params:
* aa = The associative array.
* key = The key.
* value = The required value.
* Returns:
* The value.
*/
ref V require(K, V)(ref V[K] aa, K key, lazy V value = V.init)
{
bool found;
auto p = cast(V*) _aaGetX(cast(void**)&aa, typeid(V[K]), V.sizeof, &key, found);
return found ? *p : (*p = value);
}
// Constraints for aa update. Delegates, Functions or Functors (classes that
// provide opCall) are allowed. See unittest for an example.
private
{
template isCreateOperation(C, V)
{
static if (is(C : V delegate()) || is(C : V function()))
enum bool isCreateOperation = true;
else static if (isCreateOperation!(typeof(&C.opCall), V))
enum bool isCreateOperation = true;
else
enum bool isCreateOperation = false;
}
template isUpdateOperation(U, V)
{
static if (is(U : V delegate(ref V)) || is(U : V function(ref V)))
enum bool isUpdateOperation = true;
else static if (isUpdateOperation!(typeof(&U.opCall), V))
enum bool isUpdateOperation = true;
else
enum bool isUpdateOperation = false;
}
}
/***********************************
* Looks up key; if it exists applies the update delegate else evaluates the
* create delegate and adds it to the associative array
* Params:
* aa = The associative array.
* key = The key.
* create = The delegate to apply on create.
* update = The delegate to apply on update.
*/
void update(K, V, C, U)(ref V[K] aa, K key, scope C create, scope U update)
if (isCreateOperation!(C, V) && isUpdateOperation!(U, V))
{
bool found;
auto p = cast(V*) _aaGetX(cast(void**)&aa, typeid(V[K]), V.sizeof, &key, found);
if (!found)
*p = create();
else
*p = update(*p);
}
private void _destructRecurse(E, size_t n)(ref E[n] arr)
{
import core.internal.traits : hasElaborateDestructor;
static if (hasElaborateDestructor!E)
{
foreach_reverse (ref elem; arr)
_destructRecurse(elem);
}
}
// Public and explicitly undocumented
void _postblitRecurse(S)(ref S s)
if (is(S == struct))
{
static if (__traits(hasMember, S, "__xpostblit") &&
// Bugzilla 14746: Check that it's the exact member of S.
__traits(isSame, S, __traits(parent, s.__xpostblit)))
s.__xpostblit();
}
// Ditto
void _postblitRecurse(E, size_t n)(ref E[n] arr)
{
import core.internal.traits : hasElaborateCopyConstructor;
static if (hasElaborateCopyConstructor!E)
{
size_t i;
scope(failure)
{
for (; i != 0; --i)
{
_destructRecurse(arr[i - 1]); // What to do if this throws?
}
}
for (i = 0; i < arr.length; ++i)
_postblitRecurse(arr[i]);
}
}
// Test destruction/postblit order
@safe nothrow pure unittest
{
string[] order;
struct InnerTop
{
~this() @safe nothrow pure
{
order ~= "destroy inner top";
}
this(this) @safe nothrow pure
{
order ~= "copy inner top";
}
}
struct InnerMiddle {}
version (none) // https://issues.dlang.org/show_bug.cgi?id=14242
struct InnerElement
{
static char counter = '1';
~this() @safe nothrow pure
{
order ~= "destroy inner element #" ~ counter++;
}
this(this) @safe nothrow pure
{
order ~= "copy inner element #" ~ counter++;
}
}
struct InnerBottom
{
~this() @safe nothrow pure
{
order ~= "destroy inner bottom";
}
this(this) @safe nothrow pure
{
order ~= "copy inner bottom";
}
}
struct S
{
char[] s;
InnerTop top;
InnerMiddle middle;
version (none) InnerElement[3] array; // https://issues.dlang.org/show_bug.cgi?id=14242
int a;
InnerBottom bottom;
~this() @safe nothrow pure { order ~= "destroy outer"; }
this(this) @safe nothrow pure { order ~= "copy outer"; }
}
string[] destructRecurseOrder;
{
S s;
_destructRecurse(s);
destructRecurseOrder = order;
order = null;
}
assert(order.length);
assert(destructRecurseOrder == order);
order = null;
S s;
_postblitRecurse(s);
assert(order.length);
auto postblitRecurseOrder = order;
order = null;
S s2 = s;
assert(order.length);
assert(postblitRecurseOrder == order);
}
// Test static struct
nothrow @safe @nogc unittest
{
static int i = 0;
static struct S { ~this() nothrow @safe @nogc { i = 42; } }
S s;
_destructRecurse(s);
assert(i == 42);
}
unittest
{
// Bugzilla 14746
static struct HasDtor
{
~this() { assert(0); }
}
static struct Owner
{
HasDtor* ptr;
alias ptr this;
}
Owner o;
assert(o.ptr is null);
destroy(o); // must not reach in HasDtor.__dtor()
}
unittest
{
// Bugzilla 14746
static struct HasPostblit
{
this(this) { assert(0); }
}
static struct Owner
{
HasPostblit* ptr;
alias ptr this;
}
Owner o;
assert(o.ptr is null);
_postblitRecurse(o); // must not reach in HasPostblit.__postblit()
}
// Test handling of fixed-length arrays
// Separate from first test because of https://issues.dlang.org/show_bug.cgi?id=14242
unittest
{
string[] order;
struct S
{
char id;
this(this)
{
order ~= "copy #" ~ id;
}
~this()
{
order ~= "destroy #" ~ id;
}
}
string[] destructRecurseOrder;
{
S[3] arr = [S('1'), S('2'), S('3')];
_destructRecurse(arr);
destructRecurseOrder = order;
order = null;
}
assert(order.length);
assert(destructRecurseOrder == order);
order = null;
S[3] arr = [S('1'), S('2'), S('3')];
_postblitRecurse(arr);
assert(order.length);
auto postblitRecurseOrder = order;
order = null;
auto arrCopy = arr;
assert(order.length);
assert(postblitRecurseOrder == order);
}
// Test handling of failed postblit
// Not nothrow or @safe because of https://issues.dlang.org/show_bug.cgi?id=14242
/+ nothrow @safe +/ unittest
{
static class FailedPostblitException : Exception { this() nothrow @safe { super(null); } }
static string[] order;
static struct Inner
{
char id;
@safe:
this(this)
{
order ~= "copy inner #" ~ id;
if (id == '2')
throw new FailedPostblitException();
}
~this() nothrow
{
order ~= "destroy inner #" ~ id;
}
}
static struct Outer
{
Inner inner1, inner2, inner3;
nothrow @safe:
this(char first, char second, char third)
{
inner1 = Inner(first);
inner2 = Inner(second);
inner3 = Inner(third);
}
this(this)
{
order ~= "copy outer";
}
~this()
{
order ~= "destroy outer";
}
}
auto outer = Outer('1', '2', '3');
try _postblitRecurse(outer);
catch (FailedPostblitException) {}
catch (Exception) assert(false);
auto postblitRecurseOrder = order;
order = null;
try auto copy = outer;
catch (FailedPostblitException) {}
catch (Exception) assert(false);
assert(postblitRecurseOrder == order);
order = null;
Outer[3] arr = [Outer('1', '1', '1'), Outer('1', '2', '3'), Outer('3', '3', '3')];
try _postblitRecurse(arr);
catch (FailedPostblitException) {}
catch (Exception) assert(false);
postblitRecurseOrder = order;
order = null;
try auto arrCopy = arr;
catch (FailedPostblitException) {}
catch (Exception) assert(false);
assert(postblitRecurseOrder == order);
}
version (unittest)
{
private bool isnan(float x)
{
return x != x;
}
}
private
{
extern (C) void _d_arrayshrinkfit(const TypeInfo ti, void[] arr) nothrow;
extern (C) size_t _d_arraysetcapacity(const TypeInfo ti, size_t newcapacity, void[]* arrptr) pure nothrow;
}
/**
* (Property) Gets the current _capacity of a slice. The _capacity is the size
* that the slice can grow to before the underlying array must be
* reallocated or extended.
*
* If an append must reallocate a slice with no possibility of extension, then
* `0` is returned. This happens when the slice references a static array, or
* if another slice references elements past the end of the current slice.
*
* Note: The _capacity of a slice may be impacted by operations on other slices.
*/
@property size_t capacity(T)(T[] arr) pure nothrow @trusted
{
return _d_arraysetcapacity(typeid(T[]), 0, cast(void[]*)&arr);
}
///
@safe unittest
{
//Static array slice: no capacity
int[4] sarray = [1, 2, 3, 4];
int[] slice = sarray[];
assert(sarray.capacity == 0);
//Appending to slice will reallocate to a new array
slice ~= 5;
assert(slice.capacity >= 5);
//Dynamic array slices
int[] a = [1, 2, 3, 4];
int[] b = a[1 .. $];
int[] c = a[1 .. $ - 1];
debug(SENTINEL) {} else // non-zero capacity very much depends on the array and GC implementation
{
assert(a.capacity != 0);
assert(a.capacity == b.capacity + 1); //both a and b share the same tail
}
assert(c.capacity == 0); //an append to c must relocate c.
}
/**
* Reserves capacity for a slice. The capacity is the size
* that the slice can grow to before the underlying array must be
* reallocated or extended.
*
* Returns: The new capacity of the array (which may be larger than
* the requested capacity).
*/
size_t reserve(T)(ref T[] arr, size_t newcapacity) pure nothrow @trusted
{
return _d_arraysetcapacity(typeid(T[]), newcapacity, cast(void[]*)&arr);
}
///
unittest
{
//Static array slice: no capacity. Reserve relocates.
int[4] sarray = [1, 2, 3, 4];
int[] slice = sarray[];
auto u = slice.reserve(8);
assert(u >= 8);
assert(sarray.ptr !is slice.ptr);
assert(slice.capacity == u);
//Dynamic array slices
int[] a = [1, 2, 3, 4];
a.reserve(8); //prepare a for appending 4 more items
auto p = a.ptr;
u = a.capacity;
a ~= [5, 6, 7, 8];
assert(p == a.ptr); //a should not have been reallocated
assert(u == a.capacity); //a should not have been extended
}
// Issue 6646: should be possible to use array.reserve from SafeD.
@safe unittest
{
int[] a;
a.reserve(10);
}
/**
* Assume that it is safe to append to this array. Appends made to this array
* after calling this function may append in place, even if the array was a
* slice of a larger array to begin with.
*
* Use this only when it is certain there are no elements in use beyond the
* array in the memory block. If there are, those elements will be
* overwritten by appending to this array.
*
* Warning: Calling this function, and then using references to data located after the
* given array results in undefined behavior.
*
* Returns:
* The input is returned.
*/
auto ref inout(T[]) assumeSafeAppend(T)(auto ref inout(T[]) arr) nothrow
{
_d_arrayshrinkfit(typeid(T[]), *(cast(void[]*)&arr));
return arr;
}
///
unittest
{
int[] a = [1, 2, 3, 4];
// Without assumeSafeAppend. Appending relocates.
int[] b = a [0 .. 3];
b ~= 5;
assert(a.ptr != b.ptr);
debug(SENTINEL) {} else
{
// With assumeSafeAppend. Appending overwrites.
int[] c = a [0 .. 3];
c.assumeSafeAppend() ~= 5;
assert(a.ptr == c.ptr);
}
}
unittest
{
int[] arr;
auto newcap = arr.reserve(2000);
assert(newcap >= 2000);
assert(newcap == arr.capacity);
auto ptr = arr.ptr;
foreach (i; 0..2000)
arr ~= i;
assert(ptr == arr.ptr);
arr = arr[0..1];
arr.assumeSafeAppend();
arr ~= 5;
assert(ptr == arr.ptr);
}
unittest
{
int[] arr = [1, 2, 3];
void foo(ref int[] i)
{
i ~= 5;
}
arr = arr[0 .. 2];
foo(assumeSafeAppend(arr)); //pass by ref
assert(arr[]==[1, 2, 5]);
arr = arr[0 .. 1].assumeSafeAppend(); //pass by value
}
// https://issues.dlang.org/show_bug.cgi?id=10574
unittest
{
int[] a;
immutable(int[]) b;
auto a2 = &assumeSafeAppend(a);
auto b2 = &assumeSafeAppend(b);
auto a3 = assumeSafeAppend(a[]);
auto b3 = assumeSafeAppend(b[]);
assert(is(typeof(*a2) == int[]));
assert(is(typeof(*b2) == immutable(int[])));
assert(is(typeof(a3) == int[]));
assert(is(typeof(b3) == immutable(int[])));
}
version (none)
{
// enforce() copied from Phobos std.contracts for destroy(), left out until
// we decide whether to use it.
T _enforce(T, string file = __FILE__, int line = __LINE__)
(T value, lazy const(char)[] msg = null)
{
if (!value) bailOut(file, line, msg);
return value;
}
T _enforce(T, string file = __FILE__, int line = __LINE__)
(T value, scope void delegate() dg)
{
if (!value) dg();
return value;
}
T _enforce(T)(T value, lazy Exception ex)
{
if (!value) throw ex();
return value;
}
private void _bailOut(string file, int line, in char[] msg)
{
char[21] buf;
throw new Exception(cast(string)(file ~ "(" ~ ulongToString(buf[], line) ~ "): " ~ (msg ? msg : "Enforcement failed")));
}
}
version (D_Ddoc)
{
// This lets DDoc produce better documentation.
/**
Calculates the hash value of `arg` with an optional `seed` initial value.
The result might not be equal to `typeid(T).getHash(&arg)`.
Params:
arg = argument to calculate the hash value of
seed = optional `seed` value (may be used for hash chaining)
Return: calculated hash value of `arg`
*/
size_t hashOf(T)(auto ref T arg, size_t seed)
{
static import core.internal.hash;
return core.internal.hash.hashOf(arg, seed);
}
/// ditto
size_t hashOf(T)(auto ref T arg)
{
static import core.internal.hash;
return core.internal.hash.hashOf(arg);
}
}
else
{
public import core.internal.hash : hashOf;
}
///
@system unittest
{
class MyObject
{
size_t myMegaHash() const @safe pure nothrow
{
return 42;
}
}
struct Test
{
int a;
string b;
MyObject c;
size_t toHash() const pure nothrow
{
size_t hash = a.hashOf();
hash = b.hashOf(hash);
size_t h1 = c.myMegaHash();
hash = h1.hashOf(hash); //Mix two hash values
return hash;
}
}
}
bool _xopEquals(in void*, in void*)
{
throw new Error("TypeInfo.equals is not implemented");
}
bool _xopCmp(in void*, in void*)
{
throw new Error("TypeInfo.compare is not implemented");
}
void __ctfeWrite(scope const(char)[] s) @nogc @safe pure nothrow {}
/******************************************
* Create RTInfo for type T
*/
template RTInfo(T)
{
enum RTInfo = null;
}
// Compiler hook into the runtime implementation of array (vector) operations.
template _arrayOp(Args...)
{
import core.internal.arrayop;
alias _arrayOp = arrayOp!Args;
}
/*
* Support for switch statements switching on strings.
* Params:
* caseLabels = sorted array of strings generated by compiler. Note the
strings are sorted by length first, and then lexicographically.
* condition = string to look up in table
* Returns:
* index of match in caseLabels, a negative integer if not found
*/
int __switch(T, caseLabels...)(/*in*/ const scope T[] condition) pure nothrow @safe @nogc
{
// This closes recursion for other cases.
static if (caseLabels.length == 0)
{
return int.min;
}
else static if (caseLabels.length == 1)
{
return __cmp(condition, caseLabels[0]) == 0 ? 0 : int.min;
}
// To be adjusted after measurements
// Compile-time inlined binary search.
else static if (caseLabels.length < 7)
{
int r = void;
enum mid = cast(int)caseLabels.length / 2;
if (condition.length == caseLabels[mid].length)
{
r = __cmp(condition, caseLabels[mid]);
if (r == 0) return mid;
}
else
{
// Equivalent to (but faster than) condition.length > caseLabels[$ / 2].length ? 1 : -1
r = ((condition.length > caseLabels[mid].length) << 1) - 1;
}
if (r < 0)
{
// Search the left side
return __switch!(T, caseLabels[0 .. mid])(condition);
}
else
{
// Search the right side
return __switch!(T, caseLabels[mid + 1 .. $])(condition) + mid + 1;
}
}
else
{
// Need immutable array to be accessible in pure code, but case labels are
// currently coerced to the switch condition type (e.g. const(char)[]).
static immutable T[][caseLabels.length] cases = {
auto res = new immutable(T)[][](caseLabels.length);
foreach (i, s; caseLabels)
res[i] = s.idup;
return res;
}();
// Run-time binary search in a static array of labels.
return __switchSearch!T(cases[], condition);
}
}
// binary search in sorted string cases, also see `__switch`.
private int __switchSearch(T)(/*in*/ const scope T[][] cases, /*in*/ const scope T[] condition) pure nothrow @safe @nogc
{
size_t low = 0;
size_t high = cases.length;
do
{
auto mid = (low + high) / 2;
int r = void;
if (condition.length == cases[mid].length)
{
r = __cmp(condition, cases[mid]);
if (r == 0) return cast(int) mid;
}
else
{
// Generates better code than "expr ? 1 : -1" on dmd and gdc, same with ldc
r = ((condition.length > cases[mid].length) << 1) - 1;
}
if (r > 0) low = mid + 1;
else high = mid;
}
while (low < high);
// Not found
return -1;
}
unittest
{
static void testSwitch(T)()
{
switch (cast(T[]) "c")
{
case "coo":
default:
break;
}
static int bug5381(immutable(T)[] s)
{
switch (s)
{
case "unittest": return 1;
case "D_Version2": return 2;
case "nonenone": return 3;
case "none": return 4;
case "all": return 5;
default: return 6;
}
}
int rc = bug5381("unittest");
assert(rc == 1);
rc = bug5381("D_Version2");
assert(rc == 2);
rc = bug5381("nonenone");
assert(rc == 3);
rc = bug5381("none");
assert(rc == 4);
rc = bug5381("all");
assert(rc == 5);
rc = bug5381("nonerandom");
assert(rc == 6);
static int binarySearch(immutable(T)[] s)
{
switch (s)
{
static foreach (i; 0 .. 16)
case i.stringof: return i;
default: return -1;
}
}
static foreach (i; 0 .. 16)
assert(binarySearch(i.stringof) == i);
assert(binarySearch("") == -1);
assert(binarySearch("sth.") == -1);
assert(binarySearch(null) == -1);
static int bug16739(immutable(T)[] s)
{
switch (s)
{
case "\u0100": return 1;
case "a": return 2;
default: return 3;
}
}
assert(bug16739("\u0100") == 1);
assert(bug16739("a") == 2);
assert(bug16739("foo") == 3);
}
testSwitch!char;
testSwitch!wchar;
testSwitch!dchar;
}
// Compiler lowers final switch default case to this (which is a runtime error)
// Old implementation is in core/exception.d
void __switch_error()(string file = __FILE__, size_t line = __LINE__)
{
import core.exception : __switch_errorT;
__switch_errorT(file, line);
}
// Helper functions
private inout(TypeInfo) getElement(inout TypeInfo value) @trusted pure nothrow
{
TypeInfo element = cast() value;
for (;;)
{
if (auto qualified = cast(TypeInfo_Const) element)
element = qualified.base;
else if (auto redefined = cast(TypeInfo_Enum) element)
element = redefined.base;
else if (auto staticArray = cast(TypeInfo_StaticArray) element)
element = staticArray.value;
else if (auto vector = cast(TypeInfo_Vector) element)
element = vector.base;
else
break;
}
return cast(inout) element;
}
private size_t getArrayHash(in TypeInfo element, in void* ptr, in size_t count) @trusted nothrow
{
if (!count)
return 0;
const size_t elementSize = element.tsize;
if (!elementSize)
return 0;
static bool hasCustomToHash(in TypeInfo value) @trusted pure nothrow
{
const element = getElement(value);
if (const struct_ = cast(const TypeInfo_Struct) element)
return !!struct_.xtoHash;
return cast(const TypeInfo_Array) element
|| cast(const TypeInfo_AssociativeArray) element
|| cast(const ClassInfo) element
|| cast(const TypeInfo_Interface) element;
}
import core.internal.traits : externDFunc;
if (!hasCustomToHash(element))
return hashOf(ptr[0 .. elementSize * count]);
size_t hash = 0;
foreach (size_t i; 0 .. count)
hash = hashOf(element.getHash(ptr + i * elementSize), hash);
return hash;
}
/// Provide the .dup array property.
@property auto dup(T)(T[] a)
if (!is(const(T) : T))
{
import core.internal.traits : Unconst;
static assert(is(T : Unconst!T), "Cannot implicitly convert type "~T.stringof~
" to "~Unconst!T.stringof~" in dup.");
// wrap unsafe _dup in @trusted to preserve @safe postblit
static if (__traits(compiles, (T b) @safe { T a = b; }))
return _trustedDup!(T, Unconst!T)(a);
else
return _dup!(T, Unconst!T)(a);
}
/// ditto
// const overload to support implicit conversion to immutable (unique result, see DIP29)
@property T[] dup(T)(const(T)[] a)
if (is(const(T) : T))
{
// wrap unsafe _dup in @trusted to preserve @safe postblit
static if (__traits(compiles, (T b) @safe { T a = b; }))
return _trustedDup!(const(T), T)(a);
else
return _dup!(const(T), T)(a);
}
/// Provide the .idup array property.
@property immutable(T)[] idup(T)(T[] a)
{
static assert(is(T : immutable(T)), "Cannot implicitly convert type "~T.stringof~
" to immutable in idup.");
// wrap unsafe _dup in @trusted to preserve @safe postblit
static if (__traits(compiles, (T b) @safe { T a = b; }))
return _trustedDup!(T, immutable(T))(a);
else
return _dup!(T, immutable(T))(a);
}
/// ditto
@property immutable(T)[] idup(T:void)(const(T)[] a)
{
return a.dup;
}
private U[] _trustedDup(T, U)(T[] a) @trusted
{
return _dup!(T, U)(a);
}
private U[] _dup(T, U)(T[] a) // pure nothrow depends on postblit
{
if (__ctfe)
{
static if (is(T : void))
assert(0, "Cannot dup a void[] array at compile time.");
else
{
U[] res;
foreach (ref e; a)
res ~= e;
return res;
}
}
import core.stdc.string : memcpy;
void[] arr = _d_newarrayU(typeid(T[]), a.length);
memcpy(arr.ptr, cast(const(void)*)a.ptr, T.sizeof * a.length);
auto res = *cast(U[]*)&arr;
static if (!is(T : void))
_doPostblit(res);
return res;
}
private extern (C) void[] _d_newarrayU(const TypeInfo ti, size_t length) pure nothrow;
/**************
* Get the postblit for type T.
* Returns:
* null if no postblit is necessary
* function pointer for struct postblits
* delegate for class postblits
*/
private auto _getPostblit(T)() @trusted pure nothrow @nogc
{
// infer static postblit type, run postblit if any
static if (is(T == struct))
{
import core.internal.traits : Unqual;
// use typeid(Unqual!T) here to skip TypeInfo_Const/Shared/...
alias _PostBlitType = typeof(function (ref T t){ T a = t; });
return cast(_PostBlitType)typeid(Unqual!T).xpostblit;
}
else if ((&typeid(T).postblit).funcptr !is &TypeInfo.postblit)
{
alias _PostBlitType = typeof(delegate (ref T t){ T a = t; });
return cast(_PostBlitType)&typeid(T).postblit;
}
else
return null;
}
private void _doPostblit(T)(T[] arr)
{
// infer static postblit type, run postblit if any
if (auto postblit = _getPostblit!T())
{
foreach (ref elem; arr)
postblit(elem);
}
}
unittest
{
static struct S1 { int* p; }
static struct S2 { @disable this(); }
static struct S3 { @disable this(this); }
int dg1() pure nothrow @safe
{
{
char[] m;
string i;
m = m.dup;
i = i.idup;
m = i.dup;
i = m.idup;
}
{
S1[] m;
immutable(S1)[] i;
m = m.dup;
i = i.idup;
static assert(!is(typeof(m.idup)));
static assert(!is(typeof(i.dup)));
}
{
S3[] m;
immutable(S3)[] i;
static assert(!is(typeof(m.dup)));
static assert(!is(typeof(i.idup)));
}
{
shared(S1)[] m;
m = m.dup;
static assert(!is(typeof(m.idup)));
}
{
int[] a = (inout(int)) { inout(const(int))[] a; return a.dup; }(0);
}
return 1;
}
int dg2() pure nothrow @safe
{
{
S2[] m = [S2.init, S2.init];
immutable(S2)[] i = [S2.init, S2.init];
m = m.dup;
m = i.dup;
i = m.idup;
i = i.idup;
}
return 2;
}
enum a = dg1();
enum b = dg2();
assert(dg1() == a);
assert(dg2() == b);
}
unittest
{
static struct Sunpure { this(this) @safe nothrow {} }
static struct Sthrow { this(this) @safe pure {} }
static struct Sunsafe { this(this) @system pure nothrow {} }
static assert( __traits(compiles, () { [].dup!Sunpure; }));
static assert(!__traits(compiles, () pure { [].dup!Sunpure; }));
static assert( __traits(compiles, () { [].dup!Sthrow; }));
static assert(!__traits(compiles, () nothrow { [].dup!Sthrow; }));
static assert( __traits(compiles, () { [].dup!Sunsafe; }));
static assert(!__traits(compiles, () @safe { [].dup!Sunsafe; }));
static assert( __traits(compiles, () { [].idup!Sunpure; }));
static assert(!__traits(compiles, () pure { [].idup!Sunpure; }));
static assert( __traits(compiles, () { [].idup!Sthrow; }));
static assert(!__traits(compiles, () nothrow { [].idup!Sthrow; }));
static assert( __traits(compiles, () { [].idup!Sunsafe; }));
static assert(!__traits(compiles, () @safe { [].idup!Sunsafe; }));
}
unittest
{
static int*[] pureFoo() pure { return null; }
{ char[] s; immutable x = s.dup; }
{ immutable x = (cast(int*[])null).dup; }
{ immutable x = pureFoo(); }
{ immutable x = pureFoo().dup; }
}
unittest
{
auto a = [1, 2, 3];
auto b = a.dup;
debug(SENTINEL) {} else
assert(b.capacity >= 3);
}
unittest
{
// Bugzilla 12580
void[] m = [0];
shared(void)[] s = [cast(shared)1];
immutable(void)[] i = [cast(immutable)2];
s = s.dup;
static assert(is(typeof(s.dup) == shared(void)[]));
m = i.dup;
i = m.dup;
i = i.idup;
i = m.idup;
i = s.idup;
i = s.dup;
static assert(!__traits(compiles, m = s.dup));
}
unittest
{
// Bugzilla 13809
static struct S
{
this(this) {}
~this() {}
}
S[] arr;
auto a = arr.dup;
}
unittest
{
// Bugzilla 16504
static struct S
{
__gshared int* gp;
int* p;
// postblit and hence .dup could escape
this(this) { gp = p; }
}
int p;
scope S[1] arr = [S(&p)];
auto a = arr.dup; // dup does escape
}
// compiler frontend lowers dynamic array comparison to this
bool __ArrayEq(T1, T2)(T1[] a, T2[] b)
{
if (a.length != b.length)
return false;
foreach (size_t i; 0 .. a.length)
{
if (a[i] != b[i])
return false;
}
return true;
}
// compiler frontend lowers struct array postblitting to this
void __ArrayPostblit(T)(T[] a)
{
foreach (ref T e; a)
e.__xpostblit();
}
// compiler frontend lowers dynamic array deconstruction to this
void __ArrayDtor(T)(T[] a)
{
foreach_reverse (ref T e; a)
e.__xdtor();
}
/**
Used by `__ArrayCast` to emit a descriptive error message.
It is a template so it can be used by `__ArrayCast` in -betterC
builds. It is separate from `__ArrayCast` to minimize code
bloat.
Params:
fromType = name of the type being cast from
fromSize = total size in bytes of the array being cast from
toType = name of the type being cast o
toSize = total size in bytes of the array being cast to
*/
private void onArrayCastError()(string fromType, size_t fromSize, string toType, size_t toSize) @trusted
{
import core.internal.string : unsignedToTempString;
import core.stdc.stdlib : alloca;
const(char)[][8] msgComponents =
[
"Cannot cast `"
, fromType
, "` to `"
, toType
, "`; an array of size "
, unsignedToTempString(fromSize)
, " does not align on an array of size "
, unsignedToTempString(toSize)
];
// convert discontiguous `msgComponents` to contiguous string on the stack
size_t length = 0;
foreach (m ; msgComponents)
length += m.length;
auto msg = (cast(char*)alloca(length))[0 .. length];
size_t index = 0;
foreach (m ; msgComponents)
foreach (c; m)
msg[index++] = c;
// first argument must evaluate to `false` at compile-time to maintain memory safety in release builds
assert(false, msg);
}
/**
The compiler lowers expressions of `cast(TTo[])TFrom[]` to
this implementation.
Params:
from = the array to reinterpret-cast
Returns:
`from` reinterpreted as `TTo[]`
*/
TTo[] __ArrayCast(TFrom, TTo)(TFrom[] from) @nogc pure @trusted
{
const fromSize = from.length * TFrom.sizeof;
const toLength = fromSize / TTo.sizeof;
if ((fromSize % TTo.sizeof) != 0)
{
onArrayCastError(TFrom.stringof, fromSize, TTo.stringof, toLength * TTo.sizeof);
}
struct Array
{
size_t length;
void* ptr;
}
auto a = cast(Array*)&from;
a.length = toLength; // jam new length
return *cast(TTo[]*)a;
}
@safe @nogc pure nothrow unittest
{
byte[int.sizeof * 3] b = cast(byte) 0xab;
int[] i;
short[] s;
i = __ArrayCast!(byte, int)(b);
assert(i.length == 3);
foreach (v; i)
assert(v == cast(int) 0xabab_abab);
s = __ArrayCast!(byte, short)(b);
assert(s.length == 6);
foreach (v; s)
assert(v == cast(short) 0xabab);
s = __ArrayCast!(int, short)(i);
assert(s.length == 6);
foreach (v; s)
assert(v == cast(short) 0xabab);
}
|
D
|
/*#D*/
// Copyright © 2010-2011, Bernard Helyer. All rights reserved.
// Copyright © 2012, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/volt/license.d (BOOST ver. 1.0).
module volta.ir.token;
import volta.ir.location;
/* If you're adding a new token, be sure to update:
* - the _tokenToString array. Keep it alphabetical, and update its length.
* - the TokenType enum, again keep it alphabetical. It's _vital_ that the order
* is the same in the TokenType enum and the tokenToString array.
* - if you're adding a keyword, add it to identifierType.
*
* Removing is the same thing in reverse. When modifying tokenToString, be sure
* to keep commas between elements -- two string literals straight after one
* another are implicitly concatenated. I warn you of this out of experience.
*/
enum string[] _tokenToString = [
"none", "BEGIN", "END", "DocComment",
"identifier", "string literal", "character literal",
"integer literal", "float literal", "abstract", "alias", "align",
"asm", "assert", "auto", "body", "bool", "break", "i8", "case",
"cast", "catch", "cdouble", "cent", "cfloat", "char", "class",
"const", "continue", "creal", "dchar", "debug", "default",
"delegate", "delete", "deprecated", "dg", "do", "f64", "else", "enum",
"export", "extern", "f32", "f64",
"false", "final", "finally", "f32", "for",
"foreach", "foreach_reverse", "fn", "function", "global", "goto",
"i8", "i16", "i32", "i64", "idouble",
"if", "ifloat", "immutable", "import", "in", "inout", "i32", "interface",
"invariant", "ireal", "is", "isize", "lazy", "local", "i64", "macro", "mixin",
"module", "new", "nothrow", "null", "out", "override", "pragma",
"private", "protected", "public", "pure", "real", "ref", "return",
"scope", "shared", "i16", "static", "struct", "super",
"switch", "synchronized", "template", "this", "throw", "true",
"try", "typedef", "typeid", "typeof",
"u8", "u16", "u32", "u64", "u8", "ucent", "u32",
"u64", "union", "unittest", "u16", "usize", "va_arg", "version", "void",
"volatile", "wchar", "while", "with", "__FILE__", "__FUNCTION__", "__LINE__",
"__LOCATION__", "__PRETTY_FUNCTION__", "__thread", "#run",
"/", "/=", ".", "..", "...", "&", "&=", "&&", "|", "|=", "||",
"-", "-=", "--", "+", "+=", "++", "<", "<=", "<<", "<<=", "<>", "<>=",
">", ">=", ">>=", ">>>=", ">>", ">>>", "!", "!=", "!<>", "!<>=", "!<",
"!<=", "!>", "!>=", "(", ")", "[", "]", "{", "}", "?", ",", ";",
":", ":=", "$", "=", "==", "*", "*=", "%", "%=", "^", "^=", "^^", "^^=", "~", "~=",
"@",
];
/*!
* Ensure that the above list and following enum stay in sync,
* and that the enum starts at zero and increases sequentially
* (i.e. adding a member increases TokenType.max).
*/
version (Volt) {
// @todo static assert
} else {
static assert(TokenType.min == 0);
static assert(_tokenToString.length == TokenType.max + 1, "the tokenToString array and TokenType enum are out of sync.");
}
enum TokenType
{
None = 0,
// Special
Begin,
End,
DocComment,
// Literals
Identifier,
StringLiteral,
CharacterLiteral,
IntegerLiteral,
FloatLiteral,
// Keywords
Abstract, Alias, Align, Asm, Assert, Auto,
Body, Bool, Break, Byte,
Case, Cast, Catch, Cdouble, Cent, Cfloat, Char,
Class, Const, Continue, Creal,
Dchar, Debug, Default, Delegate, Delete,
Deprecated, Dg, Do, Double,
Else, Enum, Export, Extern,
F32, F64,
False, Final, Finally, Float, For, Foreach,
ForeachReverse, Fn, Function,
Global, Goto,
I8, I16, I32, I64,
Idouble, If, Ifloat, Immutable, Import, In,
Inout, Int, Interface, Invariant, Ireal, Is, Isize,
Lazy, Local, Long,
Macro, Mixin, Module,
New, Nothrow, Null,
Out, Override,
Pragma, Private, Protected, Public, Pure,
Real, Ref, Return,
Scope, Shared, Short, Static, Struct, Super,
Switch, Synchronized,
Template, This, Throw, True, Try, Typedef,
Typeid, Typeof,
U8, U16, U32, U64,
Ubyte, Ucent, Uint, Ulong, Union, Unittest, Ushort, Usize,
VaArg, Version, Void, Volatile,
Wchar, While, With,
__File__, __Function__, __Line__, __Location__,
__Pretty_Function__, __Thread,
HashRun,
//! Symbols.
Slash, // /
SlashAssign, // /=
Dot, // .
DoubleDot, // ..
TripleDot, // ...
Ampersand, // &
AmpersandAssign, // &=
DoubleAmpersand, // &&
Pipe, // |
PipeAssign, // |=
DoublePipe, // ||
Dash, // -
DashAssign, // -=
DoubleDash, // --
Plus, // +
PlusAssign, // +=
DoublePlus, // ++
Less, // <
LessAssign, // <=
DoubleLess, // <<
DoubleLessAssign, // <<=
LessGreater, // <>
LessGreaterAssign, // <>=
Greater, // >
GreaterAssign, // >=
DoubleGreaterAssign, // >>=
TripleGreaterAssign, // >>>=
DoubleGreater, // >>
TripleGreater, // >>>
Bang, // !
BangAssign, // !=
BangLessGreater, // !<>
BangLessGreaterAssign, // !<>=
BangLess, // !<
BangLessAssign, // !<=
BangGreater, // !>
BangGreaterAssign, // !>=
OpenParen, // (
CloseParen, // )
OpenBracket, // [
CloseBracket, // ]
OpenBrace, // {
CloseBrace, // }
QuestionMark, // ?
Comma, // ,
Semicolon, // ;
Colon, // :
ColonAssign, // :=
Dollar, // $
Assign, // =
DoubleAssign, // ==
Asterix, // *
AsterixAssign, // *=
Percent, // %
PercentAssign, // %=
Caret, // ^
CaretAssign, // ^=
DoubleCaret, // ^^
DoubleCaretAssign, // ^^=
Tilde, // ~
TildeAssign, // ~=
At, // @
}
string tokenToString(TokenType token)
{
return _tokenToString[token];
}
bool isStorageTypeToken(TokenType token)
{
switch (token) {
case TokenType.Immutable, TokenType.Const:
return true;
default:
return false;
}
}
bool isPrimitiveTypeToken(TokenType token)
{
switch (token) {
case TokenType.Bool, TokenType.Ubyte, TokenType.Byte,
TokenType.Short, TokenType.Ushort,
TokenType.Int, TokenType.Uint, TokenType.Long,
TokenType.Ulong, TokenType.Void, TokenType.Float,
TokenType.Double, TokenType.Real, TokenType.Char,
TokenType.Wchar, TokenType.Dchar, TokenType.I8,
TokenType.I16, TokenType.I32, TokenType.I64,
TokenType.U8, TokenType.U16, TokenType.U32, TokenType.U64,
TokenType.F32, TokenType.F64:
return true;
default:
return false;
}
}
/*!
* Holds the type, the actual string and location within the source file.
*/
struct Token
{
TokenType type;
string value;
Location loc;
bool isBackwardsComment;
}
/*!
* Go from a string identifier to a TokenType.
*
* Side-effects:
* None.
*
* Returns:
* Always a TokenType, for unknown ones TokenType.Identifier.
*/
TokenType identifierType(string ident)
{
switch(ident) with (TokenType) {
case "abstract": return Abstract;
case "alias": return Alias;
case "align": return Align;
case "asm": return Asm;
case "assert": return Assert;
case "auto": return Auto;
case "body": return Body;
case "bool": return Bool;
case "break": return Break;
case "byte": return Byte;
case "case": return Case;
case "cast": return Cast;
case "catch": return Catch;
case "cdouble": return Cdouble;
case "cent": return Cent;
case "cfloat": return Cfloat;
case "char": return Char;
case "class": return Class;
case "const": return Const;
case "continue": return Continue;
case "creal": return Creal;
case "dchar": return Dchar;
case "debug": return Debug;
case "default": return Default;
case "delegate": return Delegate;
case "delete": return Delete;
case "deprecated": return Deprecated;
case "dg": return Dg;
case "do": return Do;
case "double": return Double;
case "else": return Else;
case "enum": return Enum;
case "export": return Export;
case "extern": return Extern;
case "f32": return F32;
case "f64": return F64;
case "false": return False;
case "final": return Final;
case "finally": return Finally;
case "float": return Float;
case "for": return For;
case "foreach": return Foreach;
case "foreach_reverse": return ForeachReverse;
case "fn": return Fn;
case "function": return Function;
case "global": return Global;
case "goto": return Goto;
case "i8": return I8;
case "i16": return I16;
case "i32": return I32;
case "i64": return I64;
case "idouble": return Idouble;
case "if": return If;
case "ifloat": return Ifloat;
case "immutable": return Immutable;
case "import": return Import;
case "in": return In;
case "inout": return Inout;
case "int": return Int;
case "interface": return Interface;
case "invariant": return Invariant;
case "ireal": return Ireal;
case "is": return Is;
case "isize": return Isize;
case "lazy": return Lazy;
case "local": return Local;
case "long": return Long;
case "macro": return Macro;
case "mixin": return Mixin;
case "module": return Module;
case "new": return New;
case "nothrow": return Nothrow;
case "null": return Null;
case "out": return Out;
case "override": return Override;
case "pragma": return Pragma;
case "private": return Private;
case "protected": return Protected;
case "public": return Public;
case "pure": return Pure;
case "real": return Real;
case "ref": return Ref;
case "return": return Return;
case "scope": return Scope;
case "shared": return Shared;
case "short": return Short;
case "static": return Static;
case "struct": return Struct;
case "super": return Super;
case "switch": return Switch;
case "synchronized": return Synchronized;
case "template": return Template;
case "this": return This;
case "throw": return Throw;
case "true": return True;
case "try": return Try;
case "typedef": return Typedef;
case "typeid": return Typeid;
case "typeof": return Typeof;
case "u8": return U8;
case "u16": return U16;
case "u32": return U32;
case "u64": return U64;
case "ubyte": return Ubyte;
case "ucent": return Ucent;
case "uint": return Uint;
case "ulong": return Ulong;
case "union": return Union;
case "unittest": return Unittest;
case "ushort": return Ushort;
case "usize": return Usize;
case "va_arg": return VaArg;
case "version": return Version;
case "void": return Void;
case "volatile": return Volatile;
case "wchar": return Wchar;
case "while": return While;
case "with": return With;
case "__FILE__": return __File__;
case "__FUNCTION__": return __Function__;
case "__LINE__": return __Line__;
case "__LOCATION__": return __Location__;
case "__PRETTY_FUNCTION__": return __Pretty_Function__;
case "__thread": return __Thread;
default: return Identifier;
}
}
|
D
|
/Users/phungdu/Documents/code/vapor/TILApp/Build/Intermediates/TILApp.build/Debug/Async.build/Objects-normal/x86_64/Future+Global.o : /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Async+NIO.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Variadic.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Deprecated.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Void.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/FutureType.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Collection+Future.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+DoCatch.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Global.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Transform.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Flatten.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Map.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Worker.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/QueueHandler.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/AsyncError.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/cpp_magic.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/ifaddrs-android.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Headers/CNIODarwin.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/CNIOAtomics.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/CNIOLinux.h /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--5226887469817572071/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/phungdu/Documents/code/vapor/TILApp/Build/Intermediates/TILApp.build/Debug/Async.build/Objects-normal/x86_64/Future+Global~partial.swiftmodule : /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Async+NIO.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Variadic.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Deprecated.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Void.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/FutureType.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Collection+Future.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+DoCatch.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Global.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Transform.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Flatten.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Map.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Worker.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/QueueHandler.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/AsyncError.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/cpp_magic.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/ifaddrs-android.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Headers/CNIODarwin.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/CNIOAtomics.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/CNIOLinux.h /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--5226887469817572071/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/phungdu/Documents/code/vapor/TILApp/Build/Intermediates/TILApp.build/Debug/Async.build/Objects-normal/x86_64/Future+Global~partial.swiftdoc : /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Async+NIO.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Variadic.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Deprecated.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Void.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/FutureType.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Collection+Future.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+DoCatch.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Global.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Transform.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Flatten.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Future+Map.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Worker.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/QueueHandler.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/AsyncError.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/core.git--3682430780741917418/Sources/Async/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/cpp_magic.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/ifaddrs-android.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Headers/CNIODarwin.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/CNIOAtomics.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/CNIOLinux.h /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--5226887469817572071/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
|
D
|
module linalg.random;
private import linalg.basic;
struct СлучДвиг48
{
const static бцел мин = 0;
const static бцел макс = бцел.max;
/**
Генерирует следующее псевдослучайное число.
Возвращает:
Псевдослучайное число в закрытом интервале [this.мин; this.макс]
*/
бцел вынь();
/**
Реинициализует движок. Устанавливает новое "семя", используя генерацию псевдослучайных чисел.
If two different linear congruential engines are initialized with the same
_seed they will generate equivalent pseudo-number sequences.
Params:
nx = New _seed used for pseudo-random numbers generation.
*/
void сей(бдол nx);
private:
static const бдол a = 25214903917;
static const бдол b = 1L;
static const бдол m = 1uL << 48;
static const бдол маска = m - 1;
бдол x = 0;
}
unittest
{
СлучДвиг48 e1;
e1.сей = 12345;
for (цел i = 0; i < 100; ++i)
e1.вынь();
СлучДвиг48 e2 = e1;
// must generate the same sequence
for (цел i = 0; i < 100; ++i)
assert(e1.вынь() == e2.вынь());
e1.сей = 54321;
e2.сей = 54321;
// must generate the same sequence
for (цел i = 0; i < 100; ++i)
assert(e1.вынь() == e2.вынь());
}
/*********************************************************************/
struct ДвигМерсенаТвистера
{
static const бцел мин = 0;
static const бцел макс = бцел.max;
static const бцел n = 624;
static const бцел m = 397;
бцел вынь();
void сей(бцел x);
private:
бцел[n] s = void;
бцел следщ = 0;
}
unittest
{
ДвигМерсенаТвистера e1;
e1.сей = 12345;
for (цел i = 0; i < 100; ++i)
e1.вынь();
ДвигМерсенаТвистера e2 = e1;
// must generate the same sequence
for (цел i = 0; i < 100; ++i)
assert(e1.вынь() == e2.вынь());
e1.сей = 54321;
e2.сей = 54321;
// must generate the same sequence
for (цел i = 0; i < 100; ++i)
assert(e1.вынь() == e2.вынь());
}
/********************************************************************/
struct ЮниформЮнитДвиг(ДвигОснова, бул слеваЗакрыт, бул справаЗакрыт)
{
private ДвигОснова двигОснова;
const static
{
реал мин = (слеваЗакрыт ? 0 : прирост) * (1/знаменатель);
реал макс = (диапазон + (слеваЗакрыт ? 0 : прирост)) * (1/знаменатель);
}
private const static
{
реал диапазон = cast(реал)(двигОснова.макс - двигОснова.мин);
реал прирост = (двигОснова.макс > бцел.макс) ? 2.L : 0.2L;
реал знаменатель = диапазон + (слеваЗакрыт ? 0 : прирост) + (справаЗакрыт ? 0 : прирост);
}
реал вынь();
void сей(бцел x);
}
unittest
{
alias ЮниформЮнитДвиг!(СлучДвиг48, true, true) полностьюЗакрыт;
alias ЮниформЮнитДвиг!(СлучДвиг48, true, false) слеваЗакрыт;
alias ЮниформЮнитДвиг!(СлучДвиг48, false, true) справаЗакрыт;
alias ЮниформЮнитДвиг!(СлучДвиг48, false, false) полностьюОткрыт;
static assert(полностьюЗакрыт.мин == 0.L);
static assert(полностьюЗакрыт.макс == 1.L);
static assert(слеваЗакрыт.мин == 0.L);
static assert(слеваЗакрыт.макс < 1.L);
static assert(справаЗакрыт.мин > 0.L);
static assert(справаЗакрыт.макс == 1.L);
static assert(полностьюОткрыт.мин > 0.L);
static assert(полностьюОткрыт.макс < 1.L);
}
/********************************************************************/
struct ЮниформЮнитДвигХайреса(ДвигОснова, бул слеваЗакрыт, бул справаЗакрыт)
{
private ДвигОснова двигОснова;
static const
{
реал мин = (слеваЗакрыт ? 0 : прирост) * (1 / знаменатель);
реал макс = (приблМакс + (слеваЗакрыт ? 0 : прирост)) * (1 / знаменатель);
}
private const static
{
реал приблМакс = бцел.max * 0x1p32 + бцел.max;
реал прирост = 2.L;
реал знаменатель = приблМакс + (слеваЗакрыт ? 0 : прирост) + (справаЗакрыт ? 0 : прирост);
}
реал вынь();
void сей(бцел x);
}
unittest
{
alias ЮниформЮнитДвигХайреса!(СлучДвиг48, true, true) полностьюЗакрыт;
alias ЮниформЮнитДвигХайреса!(СлучДвиг48, true, false) слеваЗакрыт;
alias ЮниформЮнитДвигХайреса!(СлучДвиг48, false, true) справаЗакрыт;
alias ЮниформЮнитДвигХайреса!(СлучДвиг48, false, false) полностьюОткрыт;
static assert(полностьюЗакрыт.мин == 0.L);
static assert(полностьюЗакрыт.макс == 1.L);
static assert(слеваЗакрыт.мин == 0.L);
static assert(слеваЗакрыт.макс < 1.L);
static assert(справаЗакрыт.мин > 0.L);
static assert(справаЗакрыт.макс == 1.L);
static assert(полностьюОткрыт.мин > 0.L);
static assert(полностьюОткрыт.макс < 1.L);
}
|
D
|
//https://rosettacode.org/wiki/Arithmetic_coding/As_a_generalized_change_of_radix
import std.array;
import std.bigint;
import std.stdio;
import std.typecons;
BigInt bigPow(BigInt b, BigInt e) {
if (e == 0) {
return BigInt(1);
}
BigInt result = 1;
while (e > 1) {
if (e % 2 == 0) {
b *= b;
e /= 2;
} else {
result *= b;
b *= b;
e = (e - 1) / 2;
}
}
return b * result;
}
long[byte] cumulative_freq(long[byte] freq) {
long[byte] cf;
long total;
foreach (i; 0..256) {
byte b = cast(byte) i;
if (b in freq) {
cf[b] = total;
total += freq[b];
}
}
return cf;
}
Tuple!(BigInt, BigInt, long[byte]) arithmethic_coding(string str, long radix) {
// Convert the string into a slice of bytes
auto chars = cast(byte[]) str;
// The frequency characters
long[byte] freq;
foreach (c; chars) {
freq[c]++;
}
// The cumulative frequency
auto cf = cumulative_freq(freq);
// Base
BigInt base = chars.length;
// Lower bound
BigInt lower = 0;
// Product of all frequencies
BigInt pf = 1;
// Each term is multiplied by the product of the
// frequencies of all previously occurring symbols
foreach (c; chars) {
BigInt x = cf[c];
lower = lower*base + x*pf;
pf = pf*freq[c];
}
// Upper bound
auto upper = lower + pf;
BigInt tmp = pf;
BigInt powr = 0;
while (true) {
tmp = tmp / radix;
if (tmp == 0) {
break;
}
powr++;
}
auto diff = (upper-1) / bigPow(BigInt(radix), powr);
return tuple(diff, powr, freq);
}
string arithmethic_decoding(BigInt num, long radix, BigInt pow, long[byte] freq) {
BigInt powr = radix;
BigInt enc = num * bigPow(powr, pow);
BigInt base = 0;
foreach (v; freq) {
base += v;
}
// Create the cumulative frequency table
auto cf = cumulative_freq(freq);
// Create the dictionary
byte[long] dict;
foreach (k,v; cf) {
dict[v] = k;
}
// Fill the gaps in the dictionary
long lchar = -1;
for (long i=0; i<base; i++) {
if (i in dict) {
lchar = dict[i];
} else if (lchar != -1) {
dict[i] = cast(byte) lchar;
}
}
// Decode the input number
auto decoded = appender!string;
for (BigInt i=base-1; i>=0; i--) {
pow = bigPow(base, i);
auto div = enc / pow;
auto c = dict[div.toLong];
auto fv = freq[c];
auto cv = cf[c];
auto prod = pow * cv;
auto diff = enc - prod;
enc = diff / fv;
decoded.put(c);
}
// Return the decoded output
return decoded.data;
}
void main() {
long radix = 10;
foreach (str; ["DABDDB", "DABDDBBDDBA", "ABRACADABRA", "TOBEORNOTTOBEORTOBEORNOT"]) {
auto output = arithmethic_coding(str, radix);
auto dec = arithmethic_decoding(output[0], radix, output[1], output[2]);
writefln("%-25s=> %19s * %s^%s", str, output[0], radix, output[1]);
if (str != dec) {
throw new Exception("\tHowever that is incorrect!");
}
}
}
|
D
|
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM WT ROCKTYPE
298.399994 61.7000008 5.9000001 0 58 62 -19.6000004 116.099998 141 3.29999995 8 0.712780352 sediments, sandstones, siltstones
310.200012 40.5999985 4.69999981 120.900002 56 59 -33.2000008 151.100006 241 8.60000038 8.60000038 0.976048249 extrusives
219.300003 -4.19999981 9.39999962 22.3999996 56 65 -10 121 7800 4.9000001 9.60000038 0.633082237 extrusives, basalts, andesites
-65.400002 61.2999992 1.39999998 297 50 70 -31.6000004 145.600006 9339 2.20000005 2.20000005 0.597826958 sediments, saprolite
264.399994 75 15.6000004 0 2 65 -8.80000019 126.699997 1206 10.3999996 18 0.322887144 extrusives, intrusives
346 61 9 41.2000008 35 100 -31.3999996 138.600006 1170 13 15 0.448404336 sediments
333 45 9 16.5 35 100 -30.3999996 139.399994 1161 17 18 0.448404336 sediments, tillite
317 57 5 200 35 100 -30.5 139.300003 1165 9 10 0.503748965 sediments, redbeds
329 58 25 4.0999999 35 100 -30.2000008 139 1166 41.5999985 45.5999985 0.155445335 sediments, sandstone, tillite
223 26 13 14.8000002 35 100 -30.2999992 139.5 1157 26 26 0.374223009 extrusives
320 63 9 15.5 34 65 -38 145.5 1854 16 16 0.482151235 extrusives
302.700012 66.8000031 6.80000019 35 34 65 -38 145.5 1819 10.8000002 12.1000004 0.515689887 extrusives
274 66 27.6000004 8.60000038 25 65 -41.2999992 145.899994 1873 39.7999992 46.9000015 0.142001791 intrusives, granite
321 64 6 27.5 25 65 -35.5999985 137.5 1874 10 11 0.511558173 sediments
269 40 30.996521 0 50 300 -32.5999985 151.5 1868 0 0 0.0671177871 extrusives, andesites
294 75 11 7 25 65 -41.0999985 146.100006 1871 16.2999992 18.8999996 0.432114083 sediments, sandstone
315 66 10.5 18 25 65 -41 145.5 1872 18.2000008 19.6000004 0.441352269 extrusives, sediments
298 58.7999992 2.4000001 0 35 65 -27 141.5 1972 3.79999995 3.79999995 0.560307452 sediments, weathered
297.200012 59.2000008 6 0 50 70 -30.5 151.5 1964 9.10000038 9.89999962 0.561558173 sediments, weathered
310.899994 68.5 5.19999981 0 40 60 -35 150 1927 5.19999981 5.19999981 0.570840415 extrusives, basalts
271 63 2.9000001 352 50 80 -34 151 1595 3.5 4.5 0.557408999 intrusives
318 37 6.80000019 41 56 59 -33.2000008 151.100006 1597 13.1999998 13.3999996 0.951173758 intrusives
|
D
|
pragma(msg, "\u0041\u030A");
//static if(!is(typeof(x))) enum y = 2;
//static if(!is(typeof(y))) enum x = 2;
immutable float a = 1.0f;
auto xxx(){
return "static int a;";
}
struct S{
S s;
auto x = bar();
static if({return 1;}()){};
static if(foo()) mixin(xxx()); // error
static bool foo(){return 1||bar();}
static bool bar(){return !!a;} /+ error, picks up static declaration from mixin +/
}
/+template foo(T){
T foo(T arg){
return arg;
}
}
pragma(msg, foo!int.foo(1));+/
|
D
|
import std.stdio;
import parser;
import lexer;
import ast;
import llvmvisitor;
import llvm.c;
import std.string : fromStringz, toStringz;
import std.experimental.logger;
void main(string[] args) {
LLVM.load();
LLVMInitializeNativeTarget();
LLVMInitializeNativeAsmPrinter();
LLVMInitializeNativeAsmParser();
LLVMModuleRef mod = LLVMModuleCreateWithName("ELANG".toStringz());
LLVMExecutionEngineRef engine;
string s = "1337";
auto l = Lexer(s);
auto p = new Parser(l);
PrimaryExpr e = p.parsePrimaryExpr();
auto llvmVis = new LLVMVisitor();
e.visit(llvmVis);
char* str = LLVMPrintValueToString(llvmVis.value);
assert(str !is null);
writeln("IR ", fromStringz(str));
}
|
D
|
/*
*
* AUTO GENERATED! DO NOT EDIT!
*
*/
module bindbc.bgfx.funcs;
private import bindbc.bgfx.types;
extern(C) @nogc nothrow:
version(BindBgfx_Static)
{
/**
* Init attachment.
* Params:
* _handle = Render target texture handle.
* _access = Access. See `Access::Enum`.
* _layer = Cubemap side or depth layer/slice.
* _mip = Mip level.
* _resolve = Resolve flags. See: `BGFX_RESOLVE_*`
*/
void bgfx_attachment_init(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, ushort _layer, ushort _mip, byte _resolve);
/**
* Start VertexLayout.
*/
bgfx_vertex_layout_t* bgfx_vertex_layout_begin(bgfx_vertex_layout_t* _this, bgfx_renderer_type_t _rendererType);
/**
* Add attribute to VertexLayout.
* Remarks: Must be called between begin/end.
* Params:
* _attrib = Attribute semantics. See: `bgfx::Attrib`
* _num = Number of elements 1, 2, 3 or 4.
* _type = Element type.
* _normalized = When using fixed point AttribType (f.e. Uint8)
* value will be normalized for vertex shader usage. When normalized
* is set to true, AttribType::Uint8 value in range 0-255 will be
* in range 0.0-1.0 in vertex shader.
* _asInt = Packaging rule for vertexPack, vertexUnpack, and
* vertexConvert for AttribType::Uint8 and AttribType::Int16.
* Unpacking code must be implemented inside vertex shader.
*/
bgfx_vertex_layout_t* bgfx_vertex_layout_add(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, byte _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
/**
* Decode attribute.
* Params:
* _attrib = Attribute semantics. See: `bgfx::Attrib`
* _num = Number of elements.
* _type = Element type.
* _normalized = Attribute is normalized.
* _asInt = Attribute is packed as int.
*/
void bgfx_vertex_layout_decode(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib, byte* _num, bgfx_attrib_type_t* _type, bool* _normalized, bool* _asInt);
/**
* Returns true if VertexLayout contains attribute.
* Params:
* _attrib = Attribute semantics. See: `bgfx::Attrib`
*/
bool bgfx_vertex_layout_has(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib);
/**
* Skip `_num` bytes in vertex stream.
*/
bgfx_vertex_layout_t* bgfx_vertex_layout_skip(bgfx_vertex_layout_t* _this, byte _num);
/**
* End VertexLayout.
*/
void bgfx_vertex_layout_end(bgfx_vertex_layout_t* _this);
/**
* Pack vertex attribute into vertex stream format.
* Params:
* _input = Value to be packed into vertex stream.
* _inputNormalized = `true` if input value is already normalized.
* _attr = Attribute to pack.
* _layout = Vertex stream layout.
* _data = Destination vertex stream where data will be packed.
* _index = Vertex index that will be modified.
*/
void bgfx_vertex_pack(const float[4] _input, bool _inputNormalized, bgfx_attrib_t _attr, const(bgfx_vertex_layout_t)* _layout, void* _data, uint _index);
/**
* Unpack vertex attribute from vertex stream format.
* Params:
* _output = Result of unpacking.
* _attr = Attribute to unpack.
* _layout = Vertex stream layout.
* _data = Source vertex stream from where data will be unpacked.
* _index = Vertex index that will be unpacked.
*/
void bgfx_vertex_unpack(float[4] _output, bgfx_attrib_t _attr, const(bgfx_vertex_layout_t)* _layout, const(void)* _data, uint _index);
/**
* Converts vertex stream data from one vertex stream format to another.
* Params:
* _dstLayout = Destination vertex stream layout.
* _dstData = Destination vertex stream.
* _srcLayout = Source vertex stream layout.
* _srcData = Source vertex stream data.
* _num = Number of vertices to convert from source to destination.
*/
void bgfx_vertex_convert(const(bgfx_vertex_layout_t)* _dstLayout, void* _dstData, const(bgfx_vertex_layout_t)* _srcLayout, const(void)* _srcData, uint _num);
/**
* Weld vertices.
* Params:
* _output = Welded vertices remapping table. The size of buffer
* must be the same as number of vertices.
* _layout = Vertex stream layout.
* _data = Vertex stream.
* _num = Number of vertices in vertex stream.
* _index32 = Set to `true` if input indices are 32-bit.
* _epsilon = Error tolerance for vertex position comparison.
*/
uint bgfx_weld_vertices(void* _output, const(bgfx_vertex_layout_t)* _layout, const(void)* _data, uint _num, bool _index32, float _epsilon);
/**
* Convert index buffer for use with different primitive topologies.
* Params:
* _conversion = Conversion type, see `TopologyConvert::Enum`.
* _dst = Destination index buffer. If this argument is NULL
* function will return number of indices after conversion.
* _dstSize = Destination index buffer in bytes. It must be
* large enough to contain output indices. If destination size is
* insufficient index buffer will be truncated.
* _indices = Source indices.
* _numIndices = Number of input indices.
* _index32 = Set to `true` if input indices are 32-bit.
*/
uint bgfx_topology_convert(bgfx_topology_convert_t _conversion, void* _dst, uint _dstSize, const(void)* _indices, uint _numIndices, bool _index32);
/**
* Sort indices.
* Params:
* _sort = Sort order, see `TopologySort::Enum`.
* _dst = Destination index buffer.
* _dstSize = Destination index buffer in bytes. It must be
* large enough to contain output indices. If destination size is
* insufficient index buffer will be truncated.
* _dir = Direction (vector must be normalized).
* _pos = Position.
* _vertices = Pointer to first vertex represented as
* float x, y, z. Must contain at least number of vertices
* referencende by index buffer.
* _stride = Vertex stride.
* _indices = Source indices.
* _numIndices = Number of input indices.
* _index32 = Set to `true` if input indices are 32-bit.
*/
void bgfx_topology_sort_tri_list(bgfx_topology_sort_t _sort, void* _dst, uint _dstSize, const float[3] _dir, const float[3] _pos, const(void)* _vertices, uint _stride, const(void)* _indices, uint _numIndices, bool _index32);
/**
* Returns supported backend API renderers.
* Params:
* _max = Maximum number of elements in _enum array.
* _enum = Array where supported renderers will be written.
*/
byte bgfx_get_supported_renderers(byte _max, bgfx_renderer_type_t* _enum);
/**
* Returns name of renderer.
* Params:
* _type = Renderer backend type. See: `bgfx::RendererType`
*/
const(char)* bgfx_get_renderer_name(bgfx_renderer_type_t _type);
void bgfx_init_ctor(bgfx_init_t* _init);
/**
* Initialize bgfx library.
* Params:
* _init = Initialization parameters. See: `bgfx::Init` for more info.
*/
bool bgfx_init(const(bgfx_init_t)* _init);
/**
* Shutdown bgfx library.
*/
void bgfx_shutdown();
/**
* Reset graphic settings and back-buffer size.
* Attention: This call doesn't actually change window size, it just
* resizes back-buffer. Windowing code has to change window size.
* Params:
* _width = Back-buffer width.
* _height = Back-buffer height.
* _flags = See: `BGFX_RESET_*` for more info.
* - `BGFX_RESET_NONE` - No reset flags.
* - `BGFX_RESET_FULLSCREEN` - Not supported yet.
* - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA.
* - `BGFX_RESET_VSYNC` - Enable V-Sync.
* - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy.
* - `BGFX_RESET_CAPTURE` - Begin screen capture.
* - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU.
* - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
* occurs. Default behaviour is that flip occurs before rendering new
* frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
* - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
void bgfx_reset(uint _width, uint _height, uint _flags, bgfx_texture_format_t _format);
/**
* Advance to next frame. When using multithreaded renderer, this call
* just swaps internal buffers, kicks render thread, and returns. In
* singlethreaded renderer this call does frame rendering.
* Params:
* _capture = Capture frame with graphics debugger.
*/
uint bgfx_frame(bool _capture);
/**
* Returns current renderer backend API type.
* Remarks:
* Library must be initialized.
*/
bgfx_renderer_type_t bgfx_get_renderer_type();
/**
* Returns renderer capabilities.
* Remarks:
* Library must be initialized.
*/
const(bgfx_caps_t)* bgfx_get_caps();
/**
* Returns performance counters.
* Attention: Pointer returned is valid until `bgfx::frame` is called.
*/
const(bgfx_stats_t)* bgfx_get_stats();
/**
* Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
* Params:
* _size = Size to allocate.
*/
const(bgfx_memory_t)* bgfx_alloc(uint _size);
/**
* Allocate buffer and copy data into it. Data will be freed inside bgfx.
* Params:
* _data = Pointer to data to be copied.
* _size = Size of data to be copied.
*/
const(bgfx_memory_t)* bgfx_copy(const(void)* _data, uint _size);
/**
* Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
* doesn't allocate memory for data. It just copies the _data pointer. You
* can pass `ReleaseFn` function pointer to release this memory after it's
* consumed, otherwise you must make sure _data is available for at least 2
* `bgfx::frame` calls. `ReleaseFn` function must be able to be called
* from any thread.
* Attention: Data passed must be available for at least 2 `bgfx::frame` calls.
* Params:
* _data = Pointer to data.
* _size = Size of data.
*/
const(bgfx_memory_t)* bgfx_make_ref(const(void)* _data, uint _size);
/**
* Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
* doesn't allocate memory for data. It just copies the _data pointer. You
* can pass `ReleaseFn` function pointer to release this memory after it's
* consumed, otherwise you must make sure _data is available for at least 2
* `bgfx::frame` calls. `ReleaseFn` function must be able to be called
* from any thread.
* Attention: Data passed must be available for at least 2 `bgfx::frame` calls.
* Params:
* _data = Pointer to data.
* _size = Size of data.
* _releaseFn = Callback function to release memory after use.
* _userData = User data to be passed to callback function.
*/
const(bgfx_memory_t)* bgfx_make_ref_release(const(void)* _data, uint _size, void* _releaseFn, void* _userData);
/**
* Set debug flags.
* Params:
* _debug = Available flags:
* - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set
* all rendering calls will be skipped. This is useful when profiling
* to quickly assess potential bottlenecks between CPU and GPU.
* - `BGFX_DEBUG_PROFILER` - Enable profiler.
* - `BGFX_DEBUG_STATS` - Display internal statistics.
* - `BGFX_DEBUG_TEXT` - Display debug text.
* - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering
* primitives will be rendered as lines.
*/
void bgfx_set_debug(uint _debug);
/**
* Clear internal debug text buffer.
* Params:
* _attr = Background color.
* _small = Default 8x16 or 8x8 font.
*/
void bgfx_dbg_text_clear(byte _attr, bool _small);
/**
* Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _attr = Color palette. Where top 4-bits represent index of background, and bottom
* 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
* _format = `printf` style format.
*/
void bgfx_dbg_text_printf(ushort _x, ushort _y, byte _attr, const(char)* _format, ... );
/**
* Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _attr = Color palette. Where top 4-bits represent index of background, and bottom
* 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
* _format = `printf` style format.
* _argList = Variable arguments list for format string.
*/
void bgfx_dbg_text_vprintf(ushort _x, ushort _y, byte _attr, const(char)* _format, va_list _argList);
/**
* Draw image into internal debug text buffer.
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Image width.
* _height = Image height.
* _data = Raw image data (character/attribute raw encoding).
* _pitch = Image pitch in bytes.
*/
void bgfx_dbg_text_image(ushort _x, ushort _y, ushort _width, ushort _height, const(void)* _data, ushort _pitch);
/**
* Create static index buffer.
* Params:
* _mem = Index buffer data.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
bgfx_index_buffer_handle_t bgfx_create_index_buffer(const(bgfx_memory_t)* _mem, ushort _flags);
/**
* Set static index buffer debug name.
* Params:
* _handle = Static index buffer handle.
* _name = Static index buffer name.
* _len = Static index buffer name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string.
*/
void bgfx_set_index_buffer_name(bgfx_index_buffer_handle_t _handle, const(char)* _name, int _len);
/**
* Destroy static index buffer.
* Params:
* _handle = Static index buffer handle.
*/
void bgfx_destroy_index_buffer(bgfx_index_buffer_handle_t _handle);
/**
* Create vertex layout.
* Params:
* _layout = Vertex layout.
*/
bgfx_vertex_layout_handle_t bgfx_create_vertex_layout(const(bgfx_vertex_layout_t)* _layout);
/**
* Destroy vertex layout.
* Params:
* _layoutHandle = Vertex layout handle.
*/
void bgfx_destroy_vertex_layout(bgfx_vertex_layout_handle_t _layoutHandle);
/**
* Create static vertex buffer.
* Params:
* _mem = Vertex buffer data.
* _layout = Vertex layout.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
*/
bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const(bgfx_memory_t)* _mem, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
/**
* Set static vertex buffer debug name.
* Params:
* _handle = Static vertex buffer handle.
* _name = Static vertex buffer name.
* _len = Static vertex buffer name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string.
*/
void bgfx_set_vertex_buffer_name(bgfx_vertex_buffer_handle_t _handle, const(char)* _name, int _len);
/**
* Destroy static vertex buffer.
* Params:
* _handle = Static vertex buffer handle.
*/
void bgfx_destroy_vertex_buffer(bgfx_vertex_buffer_handle_t _handle);
/**
* Create empty dynamic index buffer.
* Params:
* _num = Number of indices.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer(uint _num, ushort _flags);
/**
* Create dynamic index buffer and initialized it.
* Params:
* _mem = Index buffer data.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer_mem(const(bgfx_memory_t)* _mem, ushort _flags);
/**
* Update dynamic index buffer.
* Params:
* _handle = Dynamic index buffer handle.
* _startIndex = Start index.
* _mem = Index buffer data.
*/
void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, uint _startIndex, const(bgfx_memory_t)* _mem);
/**
* Destroy dynamic index buffer.
* Params:
* _handle = Dynamic index buffer handle.
*/
void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle);
/**
* Create empty dynamic vertex buffer.
* Params:
* _num = Number of vertices.
* _layout = Vertex layout.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint _num, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
/**
* Create dynamic vertex buffer and initialize it.
* Params:
* _mem = Vertex buffer data.
* _layout = Vertex layout.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer_mem(const(bgfx_memory_t)* _mem, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
/**
* Update dynamic vertex buffer.
* Params:
* _handle = Dynamic vertex buffer handle.
* _startVertex = Start vertex.
* _mem = Vertex buffer data.
*/
void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, const(bgfx_memory_t)* _mem);
/**
* Destroy dynamic vertex buffer.
* Params:
* _handle = Dynamic vertex buffer handle.
*/
void bgfx_destroy_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle);
/**
* Returns number of requested or maximum available indices.
* Params:
* _num = Number of required indices.
*/
uint bgfx_get_avail_transient_index_buffer(uint _num);
/**
* Returns number of requested or maximum available vertices.
* Params:
* _num = Number of required vertices.
* _layout = Vertex layout.
*/
uint bgfx_get_avail_transient_vertex_buffer(uint _num, const(bgfx_vertex_layout_t)* _layout);
/**
* Returns number of requested or maximum available instance buffer slots.
* Params:
* _num = Number of required instances.
* _stride = Stride per instance.
*/
uint bgfx_get_avail_instance_data_buffer(uint _num, ushort _stride);
/**
* Allocate transient index buffer.
* Remarks:
* Only 16-bit index buffer is supported.
* Params:
* _tib = TransientIndexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _num = Number of indices to allocate.
*/
void bgfx_alloc_transient_index_buffer(bgfx_transient_index_buffer_t* _tib, uint _num);
/**
* Allocate transient vertex buffer.
* Params:
* _tvb = TransientVertexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _num = Number of vertices to allocate.
* _layout = Vertex layout.
*/
void bgfx_alloc_transient_vertex_buffer(bgfx_transient_vertex_buffer_t* _tvb, uint _num, const(bgfx_vertex_layout_t)* _layout);
/**
* Check for required space and allocate transient vertex and index
* buffers. If both space requirements are satisfied function returns
* true.
* Remarks:
* Only 16-bit index buffer is supported.
* Params:
* _tvb = TransientVertexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _layout = Vertex layout.
* _numVertices = Number of vertices to allocate.
* _tib = TransientIndexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _numIndices = Number of indices to allocate.
*/
bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const(bgfx_vertex_layout_t)* _layout, uint _numVertices, bgfx_transient_index_buffer_t* _tib, uint _numIndices);
/**
* Allocate instance data buffer.
* Params:
* _idb = InstanceDataBuffer structure is filled and is valid
* for duration of frame, and it can be reused for multiple draw
* calls.
* _num = Number of instances.
* _stride = Instance stride. Must be multiple of 16.
*/
void bgfx_alloc_instance_data_buffer(bgfx_instance_data_buffer_t* _idb, uint _num, ushort _stride);
/**
* Create draw indirect buffer.
* Params:
* _num = Number of indirect calls.
*/
bgfx_indirect_buffer_handle_t bgfx_create_indirect_buffer(uint _num);
/**
* Destroy draw indirect buffer.
* Params:
* _handle = Indirect buffer handle.
*/
void bgfx_destroy_indirect_buffer(bgfx_indirect_buffer_handle_t _handle);
/**
* Create shader from memory buffer.
* Params:
* _mem = Shader binary.
*/
bgfx_shader_handle_t bgfx_create_shader(const(bgfx_memory_t)* _mem);
/**
* Returns the number of uniforms and uniform handles used inside a shader.
* Remarks:
* Only non-predefined uniforms are returned.
* Params:
* _handle = Shader handle.
* _uniforms = UniformHandle array where data will be stored.
* _max = Maximum capacity of array.
*/
ushort bgfx_get_shader_uniforms(bgfx_shader_handle_t _handle, bgfx_uniform_handle_t* _uniforms, ushort _max);
/**
* Set shader debug name.
* Params:
* _handle = Shader handle.
* _name = Shader name.
* _len = Shader name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string).
*/
void bgfx_set_shader_name(bgfx_shader_handle_t _handle, const(char)* _name, int _len);
/**
* Destroy shader.
* Remarks: Once a shader program is created with _handle,
* it is safe to destroy that shader.
* Params:
* _handle = Shader handle.
*/
void bgfx_destroy_shader(bgfx_shader_handle_t _handle);
/**
* Create program with vertex and fragment shaders.
* Params:
* _vsh = Vertex shader.
* _fsh = Fragment shader.
* _destroyShaders = If true, shaders will be destroyed when program is destroyed.
*/
bgfx_program_handle_t bgfx_create_program(bgfx_shader_handle_t _vsh, bgfx_shader_handle_t _fsh, bool _destroyShaders);
/**
* Create program with compute shader.
* Params:
* _csh = Compute shader.
* _destroyShaders = If true, shaders will be destroyed when program is destroyed.
*/
bgfx_program_handle_t bgfx_create_compute_program(bgfx_shader_handle_t _csh, bool _destroyShaders);
/**
* Destroy program.
* Params:
* _handle = Program handle.
*/
void bgfx_destroy_program(bgfx_program_handle_t _handle);
/**
* Validate texture parameters.
* Params:
* _depth = Depth dimension of volume texture.
* _cubeMap = Indicates that texture contains cubemap.
* _numLayers = Number of layers in texture array.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture flags. See `BGFX_TEXTURE_*`.
*/
bool bgfx_is_texture_valid(ushort _depth, bool _cubeMap, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags);
/**
* Calculate amount of memory required for texture.
* Params:
* _info = Resulting texture info structure. See: `TextureInfo`.
* _width = Width.
* _height = Height.
* _depth = Depth dimension of volume texture.
* _cubeMap = Indicates that texture contains cubemap.
* _hasMips = Indicates that texture contains full mip-map chain.
* _numLayers = Number of layers in texture array.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
void bgfx_calc_texture_size(bgfx_texture_info_t* _info, ushort _width, ushort _height, ushort _depth, bool _cubeMap, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format);
/**
* Create texture from memory buffer.
* Params:
* _mem = DDS, KTX or PVR texture binary data.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
* _skip = Skip top level mips when parsing texture.
* _info = When non-`NULL` is specified it returns parsed texture information.
*/
bgfx_texture_handle_t bgfx_create_texture(const(bgfx_memory_t)* _mem, ulong _flags, byte _skip, bgfx_texture_info_t* _info);
/**
* Create 2D texture.
* Params:
* _width = Width.
* _height = Height.
* _hasMips = Indicates that texture contains full mip-map chain.
* _numLayers = Number of layers in texture array. Must be 1 if caps
* `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
* _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
* `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
* 1, expected memory layout is texture and all mips together for each array element.
*/
bgfx_texture_handle_t bgfx_create_texture_2d(ushort _width, ushort _height, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
/**
* Create texture with size based on backbuffer ratio. Texture will maintain ratio
* if back buffer resolution changes.
* Params:
* _ratio = Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
* _hasMips = Indicates that texture contains full mip-map chain.
* _numLayers = Number of layers in texture array. Must be 1 if caps
* `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
bgfx_texture_handle_t bgfx_create_texture_2d_scaled(bgfx_backbuffer_ratio_t _ratio, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags);
/**
* Create 3D texture.
* Params:
* _width = Width.
* _height = Height.
* _depth = Depth.
* _hasMips = Indicates that texture contains full mip-map chain.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
* _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
* `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
* 1, expected memory layout is texture and all mips together for each array element.
*/
bgfx_texture_handle_t bgfx_create_texture_3d(ushort _width, ushort _height, ushort _depth, bool _hasMips, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
/**
* Create Cube texture.
* Params:
* _size = Cube side size.
* _hasMips = Indicates that texture contains full mip-map chain.
* _numLayers = Number of layers in texture array. Must be 1 if caps
* `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
* _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
* `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
* 1, expected memory layout is texture and all mips together for each array element.
*/
bgfx_texture_handle_t bgfx_create_texture_cube(ushort _size, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
/**
* Update 2D texture.
* Attention: It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
* Params:
* _handle = Texture handle.
* _layer = Layer in texture array.
* _mip = Mip level.
* _x = X offset in texture.
* _y = Y offset in texture.
* _width = Width of texture block.
* _height = Height of texture block.
* _mem = Texture update data.
* _pitch = Pitch of input image (bytes). When _pitch is set to
* UINT16_MAX, it will be calculated internally based on _width.
*/
void bgfx_update_texture_2d(bgfx_texture_handle_t _handle, ushort _layer, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
/**
* Update 3D texture.
* Attention: It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
* Params:
* _handle = Texture handle.
* _mip = Mip level.
* _x = X offset in texture.
* _y = Y offset in texture.
* _z = Z offset in texture.
* _width = Width of texture block.
* _height = Height of texture block.
* _depth = Depth of texture block.
* _mem = Texture update data.
*/
void bgfx_update_texture_3d(bgfx_texture_handle_t _handle, byte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, const(bgfx_memory_t)* _mem);
/**
* Update Cube texture.
* Attention: It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
* Params:
* _handle = Texture handle.
* _layer = Layer in texture array.
* _side = Cubemap side `BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>`,
* where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.
* +----------+
* |-z 2|
* | ^ +y |
* | | | Unfolded cube:
* | +---->+x |
* +----------+----------+----------+----------+
* |+y 1|+y 4|+y 0|+y 5|
* | ^ -x | ^ +z | ^ +x | ^ -z |
* | | | | | | | | |
* | +---->+z | +---->+x | +---->-z | +---->-x |
* +----------+----------+----------+----------+
* |+z 3|
* | ^ -y |
* | | |
* | +---->+x |
* +----------+
* _mip = Mip level.
* _x = X offset in texture.
* _y = Y offset in texture.
* _width = Width of texture block.
* _height = Height of texture block.
* _mem = Texture update data.
* _pitch = Pitch of input image (bytes). When _pitch is set to
* UINT16_MAX, it will be calculated internally based on _width.
*/
void bgfx_update_texture_cube(bgfx_texture_handle_t _handle, ushort _layer, byte _side, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
/**
* Read back texture content.
* Attention: Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
* Params:
* _handle = Texture handle.
* _data = Destination buffer.
* _mip = Mip level.
*/
uint bgfx_read_texture(bgfx_texture_handle_t _handle, void* _data, byte _mip);
/**
* Set texture debug name.
* Params:
* _handle = Texture handle.
* _name = Texture name.
* _len = Texture name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string.
*/
void bgfx_set_texture_name(bgfx_texture_handle_t _handle, const(char)* _name, int _len);
/**
* Returns texture direct access pointer.
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_DIRECT_ACCESS`. This feature
* is available on GPUs that have unified memory architecture (UMA) support.
* Params:
* _handle = Texture handle.
*/
void* bgfx_get_direct_access_ptr(bgfx_texture_handle_t _handle);
/**
* Destroy texture.
* Params:
* _handle = Texture handle.
*/
void bgfx_destroy_texture(bgfx_texture_handle_t _handle);
/**
* Create frame buffer (simple).
* Params:
* _width = Texture width.
* _height = Texture height.
* _format = Texture format. See: `TextureFormat::Enum`.
* _textureFlags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
bgfx_frame_buffer_handle_t bgfx_create_frame_buffer(ushort _width, ushort _height, bgfx_texture_format_t _format, ulong _textureFlags);
/**
* Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
* if back buffer resolution changes.
* Params:
* _ratio = Frame buffer size in respect to back-buffer size. See:
* `BackbufferRatio::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
* _textureFlags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_scaled(bgfx_backbuffer_ratio_t _ratio, bgfx_texture_format_t _format, ulong _textureFlags);
/**
* Create MRT frame buffer from texture handles (simple).
* Params:
* _num = Number of texture handles.
* _handles = Texture attachments.
* _destroyTexture = If true, textures will be destroyed when
* frame buffer is destroyed.
*/
bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_handles(byte _num, const(bgfx_texture_handle_t)* _handles, bool _destroyTexture);
/**
* Create MRT frame buffer from texture handles with specific layer and
* mip level.
* Params:
* _num = Number of attachements.
* _attachment = Attachment texture info. See: `bgfx::Attachment`.
* _destroyTexture = If true, textures will be destroyed when
* frame buffer is destroyed.
*/
bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_attachment(byte _num, const(bgfx_attachment_t)* _attachment, bool _destroyTexture);
/**
* Create frame buffer for multiple window rendering.
* Remarks:
* Frame buffer cannot be used for sampling.
* Attention: Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
* Params:
* _nwh = OS' target native window handle.
* _width = Window back buffer width.
* _height = Window back buffer height.
* _format = Window back buffer color format.
* _depthFormat = Window back buffer depth format.
*/
bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_nwh(void* _nwh, ushort _width, ushort _height, bgfx_texture_format_t _format, bgfx_texture_format_t _depthFormat);
/**
* Set frame buffer debug name.
* Params:
* _handle = Frame buffer handle.
* _name = Frame buffer name.
* _len = Frame buffer name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string.
*/
void bgfx_set_frame_buffer_name(bgfx_frame_buffer_handle_t _handle, const(char)* _name, int _len);
/**
* Obtain texture handle of frame buffer attachment.
* Params:
* _handle = Frame buffer handle.
*/
bgfx_texture_handle_t bgfx_get_texture(bgfx_frame_buffer_handle_t _handle, byte _attachment);
/**
* Destroy frame buffer.
* Params:
* _handle = Frame buffer handle.
*/
void bgfx_destroy_frame_buffer(bgfx_frame_buffer_handle_t _handle);
/**
* Create shader uniform parameter.
* Remarks:
* 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
* multiple times with the same uniform name. The library will always
* return the same handle, but the handle reference count will be
* incremented. This means that the same number of `bgfx::destroyUniform`
* must be called to properly destroy the uniform.
* 2. Predefined uniforms (declared in `bgfx_shader.sh`):
* - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
* view, in pixels.
* - `u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)` - inverse
* width and height
* - `u_view mat4` - view matrix
* - `u_invView mat4` - inverted view matrix
* - `u_proj mat4` - projection matrix
* - `u_invProj mat4` - inverted projection matrix
* - `u_viewProj mat4` - concatenated view projection matrix
* - `u_invViewProj mat4` - concatenated inverted view projection matrix
* - `u_model mat4[BGFX_CONFIG_MAX_BONES]` - array of model matrices.
* - `u_modelView mat4` - concatenated model view matrix, only first
* model matrix from array is used.
* - `u_modelViewProj mat4` - concatenated model view projection matrix.
* - `u_alphaRef float` - alpha reference value for alpha test.
* Params:
* _name = Uniform name in shader.
* _type = Type of uniform (See: `bgfx::UniformType`).
* _num = Number of elements in array.
*/
bgfx_uniform_handle_t bgfx_create_uniform(const(char)* _name, bgfx_uniform_type_t _type, ushort _num);
/**
* Retrieve uniform info.
* Params:
* _handle = Handle to uniform object.
* _info = Uniform info.
*/
void bgfx_get_uniform_info(bgfx_uniform_handle_t _handle, bgfx_uniform_info_t* _info);
/**
* Destroy shader uniform parameter.
* Params:
* _handle = Handle to uniform object.
*/
void bgfx_destroy_uniform(bgfx_uniform_handle_t _handle);
/**
* Create occlusion query.
*/
bgfx_occlusion_query_handle_t bgfx_create_occlusion_query();
/**
* Retrieve occlusion query result from previous frame.
* Params:
* _handle = Handle to occlusion query object.
* _result = Number of pixels that passed test. This argument
* can be `NULL` if result of occlusion query is not needed.
*/
bgfx_occlusion_query_result_t bgfx_get_result(bgfx_occlusion_query_handle_t _handle, int* _result);
/**
* Destroy occlusion query.
* Params:
* _handle = Handle to occlusion query object.
*/
void bgfx_destroy_occlusion_query(bgfx_occlusion_query_handle_t _handle);
/**
* Set palette color value.
* Params:
* _index = Index into palette.
* _rgba = RGBA floating point values.
*/
void bgfx_set_palette_color(byte _index, const float[4] _rgba);
/**
* Set palette color value.
* Params:
* _index = Index into palette.
* _rgba = Packed 32-bit RGBA value.
*/
void bgfx_set_palette_color_rgba8(byte _index, uint _rgba);
/**
* Set view name.
* Remarks:
* This is debug only feature.
* In graphics debugger view name will appear as:
* "nnnc <view name>"
* ^ ^ ^
* | +--- compute (C)
* +------ view id
* Params:
* _id = View id.
* _name = View name.
*/
void bgfx_set_view_name(bgfx_view_id_t _id, const(char)* _name);
/**
* Set view rectangle. Draw primitive outside view will be clipped.
* Params:
* _id = View id.
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Width of view port region.
* _height = Height of view port region.
*/
void bgfx_set_view_rect(bgfx_view_id_t _id, ushort _x, ushort _y, ushort _width, ushort _height);
/**
* Set view rectangle. Draw primitive outside view will be clipped.
* Params:
* _id = View id.
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _ratio = Width and height will be set in respect to back-buffer size.
* See: `BackbufferRatio::Enum`.
*/
void bgfx_set_view_rect_ratio(bgfx_view_id_t _id, ushort _x, ushort _y, bgfx_backbuffer_ratio_t _ratio);
/**
* Set view scissor. Draw primitive outside view will be clipped. When
* _x, _y, _width and _height are set to 0, scissor will be disabled.
* Params:
* _id = View id.
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Width of view scissor region.
* _height = Height of view scissor region.
*/
void bgfx_set_view_scissor(bgfx_view_id_t _id, ushort _x, ushort _y, ushort _width, ushort _height);
/**
* Set view clear flags.
* Params:
* _id = View id.
* _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
* operation. See: `BGFX_CLEAR_*`.
* _rgba = Color clear value.
* _depth = Depth clear value.
* _stencil = Stencil clear value.
*/
void bgfx_set_view_clear(bgfx_view_id_t _id, ushort _flags, uint _rgba, float _depth, byte _stencil);
/**
* Set view clear flags with different clear color for each
* frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
* palette.
* Params:
* _id = View id.
* _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
* operation. See: `BGFX_CLEAR_*`.
* _depth = Depth clear value.
* _stencil = Stencil clear value.
* _c0 = Palette index for frame buffer attachment 0.
* _c1 = Palette index for frame buffer attachment 1.
* _c2 = Palette index for frame buffer attachment 2.
* _c3 = Palette index for frame buffer attachment 3.
* _c4 = Palette index for frame buffer attachment 4.
* _c5 = Palette index for frame buffer attachment 5.
* _c6 = Palette index for frame buffer attachment 6.
* _c7 = Palette index for frame buffer attachment 7.
*/
void bgfx_set_view_clear_mrt(bgfx_view_id_t _id, ushort _flags, float _depth, byte _stencil, byte _c0, byte _c1, byte _c2, byte _c3, byte _c4, byte _c5, byte _c6, byte _c7);
/**
* Set view sorting mode.
* Remarks:
* View mode must be set prior calling `bgfx::submit` for the view.
* Params:
* _id = View id.
* _mode = View sort mode. See `ViewMode::Enum`.
*/
void bgfx_set_view_mode(bgfx_view_id_t _id, bgfx_view_mode_t _mode);
/**
* Set view frame buffer.
* Remarks:
* Not persistent after `bgfx::reset` call.
* Params:
* _id = View id.
* _handle = Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as
* frame buffer handle will draw primitives from this view into
* default back buffer.
*/
void bgfx_set_view_frame_buffer(bgfx_view_id_t _id, bgfx_frame_buffer_handle_t _handle);
/**
* Set view view and projection matrices, all draw primitives in this
* view will use these matrices.
* Params:
* _id = View id.
* _view = View matrix.
* _proj = Projection matrix.
*/
void bgfx_set_view_transform(bgfx_view_id_t _id, const(void)* _view, const(void)* _proj);
/**
* Post submit view reordering.
* Params:
* _id = First view id.
* _num = Number of views to remap.
* _order = View remap id table. Passing `NULL` will reset view ids
* to default state.
*/
void bgfx_set_view_order(bgfx_view_id_t _id, ushort _num, const(bgfx_view_id_t)* _order);
/**
* Reset all view settings to default.
*/
void bgfx_reset_view(bgfx_view_id_t _id);
/**
* Begin submitting draw calls from thread.
* Params:
* _forThread = Explicitly request an encoder for a worker thread.
*/
bgfx_encoder_t* bgfx_encoder_begin(bool _forThread);
/**
* End submitting draw calls from thread.
* Params:
* _encoder = Encoder.
*/
void bgfx_encoder_end(bgfx_encoder_t* _encoder);
/**
* Sets a debug marker. This allows you to group graphics calls together for easy browsing in
* graphics debugging tools.
* Params:
* _marker = Marker string.
*/
void bgfx_encoder_set_marker(bgfx_encoder_t* _this, const(char)* _marker);
/**
* Set render states for draw primitive.
* Remarks:
* 1. To setup more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
* `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
* `BGFX_STATE_BLEND_EQUATION(_equation)`,
* `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
* 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
* equation is specified.
* Params:
* _state = State flags. Default state for primitive type is
* triangles. See: `BGFX_STATE_DEFAULT`.
* - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.
* - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.
* - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
* - `BGFX_STATE_CULL_*` - Backface culling mode.
* - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.
* - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.
* - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
* _rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
* `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
*/
void bgfx_encoder_set_state(bgfx_encoder_t* _this, ulong _state, uint _rgba);
/**
* Set condition for rendering.
* Params:
* _handle = Occlusion query handle.
* _visible = Render if occlusion query is visible.
*/
void bgfx_encoder_set_condition(bgfx_encoder_t* _this, bgfx_occlusion_query_handle_t _handle, bool _visible);
/**
* Set stencil test state.
* Params:
* _fstencil = Front stencil state.
* _bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE`
* _fstencil is applied to both front and back facing primitives.
*/
void bgfx_encoder_set_stencil(bgfx_encoder_t* _this, uint _fstencil, uint _bstencil);
/**
* Set scissor for draw primitive.
* Remarks:
* To scissor for all primitives in view see `bgfx::setViewScissor`.
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Width of view scissor region.
* _height = Height of view scissor region.
*/
ushort bgfx_encoder_set_scissor(bgfx_encoder_t* _this, ushort _x, ushort _y, ushort _width, ushort _height);
/**
* Set scissor from cache for draw primitive.
* Remarks:
* To scissor for all primitives in view see `bgfx::setViewScissor`.
* Params:
* _cache = Index in scissor cache.
*/
void bgfx_encoder_set_scissor_cached(bgfx_encoder_t* _this, ushort _cache);
/**
* Set model matrix for draw primitive. If it is not called,
* the model will be rendered with an identity model matrix.
* Params:
* _mtx = Pointer to first matrix in array.
* _num = Number of matrices in array.
*/
uint bgfx_encoder_set_transform(bgfx_encoder_t* _this, const(void)* _mtx, ushort _num);
/**
* Set model matrix from matrix cache for draw primitive.
* Params:
* _cache = Index in matrix cache.
* _num = Number of matrices from cache.
*/
void bgfx_encoder_set_transform_cached(bgfx_encoder_t* _this, uint _cache, ushort _num);
/**
* Reserve matrices in internal matrix cache.
* Attention: Pointer returned can be modifed until `bgfx::frame` is called.
* Params:
* _transform = Pointer to `Transform` structure.
* _num = Number of matrices.
*/
uint bgfx_encoder_alloc_transform(bgfx_encoder_t* _this, bgfx_transform_t* _transform, ushort _num);
/**
* Set shader uniform parameter for draw primitive.
* Params:
* _handle = Uniform.
* _value = Pointer to uniform data.
* _num = Number of elements. Passing `UINT16_MAX` will
* use the _num passed on uniform creation.
*/
void bgfx_encoder_set_uniform(bgfx_encoder_t* _this, bgfx_uniform_handle_t _handle, const(void)* _value, ushort _num);
/**
* Set index buffer for draw primitive.
* Params:
* _handle = Index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
void bgfx_encoder_set_index_buffer(bgfx_encoder_t* _this, bgfx_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
/**
* Set index buffer for draw primitive.
* Params:
* _handle = Dynamic index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
void bgfx_encoder_set_dynamic_index_buffer(bgfx_encoder_t* _this, bgfx_dynamic_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
/**
* Set index buffer for draw primitive.
* Params:
* _tib = Transient index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
void bgfx_encoder_set_transient_index_buffer(bgfx_encoder_t* _this, const(bgfx_transient_index_buffer_t)* _tib, uint _firstIndex, uint _numIndices);
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _handle = Vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
* _layoutHandle = Vertex layout for aliasing vertex buffer. If invalid
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _handle = Dynamic vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
* _layoutHandle = Vertex layout for aliasing vertex buffer. If invalid
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _tvb = Transient vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
* _layoutHandle = Vertex layout for aliasing vertex buffer. If invalid
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this, byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
* Set number of vertices for auto generated vertices use in conjuction
* with gl_VertexID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
* Params:
* _numVertices = Number of vertices.
*/
void bgfx_encoder_set_vertex_count(bgfx_encoder_t* _this, uint _numVertices);
/**
* Set instance data buffer for draw primitive.
* Params:
* _idb = Transient instance data buffer.
* _start = First instance data.
* _num = Number of data instances.
*/
void bgfx_encoder_set_instance_data_buffer(bgfx_encoder_t* _this, const(bgfx_instance_data_buffer_t)* _idb, uint _start, uint _num);
/**
* Set instance data buffer for draw primitive.
* Params:
* _handle = Vertex buffer.
* _startVertex = First instance data.
* _num = Number of data instances.
* Set instance data buffer for draw primitive.
*/
void bgfx_encoder_set_instance_data_from_vertex_buffer(bgfx_encoder_t* _this, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
/**
* Set instance data buffer for draw primitive.
* Params:
* _handle = Dynamic vertex buffer.
* _startVertex = First instance data.
* _num = Number of data instances.
*/
void bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(bgfx_encoder_t* _this, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
/**
* Set number of instances for auto generated instances use in conjuction
* with gl_InstanceID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*/
void bgfx_encoder_set_instance_count(bgfx_encoder_t* _this, uint _numInstances);
/**
* Set texture stage for draw primitive.
* Params:
* _stage = Texture unit.
* _sampler = Program sampler.
* _handle = Texture handle.
* _flags = Texture sampling mode. Default value UINT32_MAX uses
* texture sampling settings from the texture.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
void bgfx_encoder_set_texture(bgfx_encoder_t* _this, byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
/**
* Submit an empty primitive for rendering. Uniforms and draw state
* will be applied but no geometry will be submitted. Useful in cases
* when no other draw/compute primitive is submitted to view, but it's
* desired to execute clear view.
* Remarks:
* These empty draw calls will sort before ordinary draw calls.
* Params:
* _id = View id.
*/
void bgfx_encoder_touch(bgfx_encoder_t* _this, bgfx_view_id_t _id);
/**
* Submit primitive for rendering.
* Params:
* _id = View id.
* _program = Program.
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
void bgfx_encoder_submit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, byte _flags);
/**
* Submit primitive with occlusion query for rendering.
* Params:
* _id = View id.
* _program = Program.
* _occlusionQuery = Occlusion query.
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
void bgfx_encoder_submit_occlusion_query(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, byte _flags);
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
* Params:
* _id = View id.
* _program = Program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
* _num = Number of dispatches.
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
/**
* Set compute index buffer.
* Params:
* _stage = Compute stage.
* _handle = Index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_encoder_set_compute_index_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute vertex buffer.
* Params:
* _stage = Compute stage.
* _handle = Vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_encoder_set_compute_vertex_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute dynamic index buffer.
* Params:
* _stage = Compute stage.
* _handle = Dynamic index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_encoder_set_compute_dynamic_index_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute dynamic vertex buffer.
* Params:
* _stage = Compute stage.
* _handle = Dynamic vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_encoder_set_compute_dynamic_vertex_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute indirect buffer.
* Params:
* _stage = Compute stage.
* _handle = Indirect buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_encoder_set_compute_indirect_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute image from texture.
* Params:
* _stage = Compute stage.
* _handle = Texture handle.
* _mip = Mip level.
* _access = Image access. See `Access::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
void bgfx_encoder_set_image(bgfx_encoder_t* _this, byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
/**
* Dispatch compute.
* Params:
* _id = View id.
* _program = Compute program.
* _numX = Number of groups X.
* _numY = Number of groups Y.
* _numZ = Number of groups Z.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
void bgfx_encoder_dispatch(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, byte _flags);
/**
* Dispatch compute indirect.
* Params:
* _id = View id.
* _program = Compute program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
* _num = Number of dispatches.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
void bgfx_encoder_dispatch_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, byte _flags);
/**
* Discard previously set state for draw or compute call.
* Params:
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
void bgfx_encoder_discard(bgfx_encoder_t* _this, byte _flags);
/**
* Blit 2D texture region between two 2D textures.
* Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
* Params:
* _id = View id.
* _dst = Destination texture handle.
* _dstMip = Destination texture mip level.
* _dstX = Destination texture X position.
* _dstY = Destination texture Y position.
* _dstZ = If texture is 2D this argument should be 0. If destination texture is cube
* this argument represents destination texture cube face. For 3D texture this argument
* represents destination texture Z position.
* _src = Source texture handle.
* _srcMip = Source texture mip level.
* _srcX = Source texture X position.
* _srcY = Source texture Y position.
* _srcZ = If texture is 2D this argument should be 0. If source texture is cube
* this argument represents source texture cube face. For 3D texture this argument
* represents source texture Z position.
* _width = Width of region.
* _height = Height of region.
* _depth = If texture is 3D this argument represents depth of region, otherwise it's
* unused.
*/
void bgfx_encoder_blit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
/**
* Request screen shot of window back buffer.
* Remarks:
* `bgfx::CallbackI::screenShot` must be implemented.
* Attention: Frame buffer handle must be created with OS' target native window handle.
* Params:
* _handle = Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be
* made for main window back buffer.
* _filePath = Will be passed to `bgfx::CallbackI::screenShot` callback.
*/
void bgfx_request_screen_shot(bgfx_frame_buffer_handle_t _handle, const(char)* _filePath);
/**
* Render frame.
* Attention: `bgfx::renderFrame` is blocking call. It waits for
* `bgfx::frame` to be called from API thread to process frame.
* If timeout value is passed call will timeout and return even
* if `bgfx::frame` is not called.
* Warning: This call should be only used on platforms that don't
* allow creating separate rendering thread. If it is called before
* to bgfx::init, render thread won't be created by bgfx::init call.
* Params:
* _msecs = Timeout in milliseconds.
*/
bgfx_render_frame_t bgfx_render_frame(int _msecs);
/**
* Set platform data.
* Warning: Must be called before `bgfx::init`.
* Params:
* _data = Platform data.
*/
void bgfx_set_platform_data(const(bgfx_platform_data_t)* _data);
/**
* Get internal data for interop.
* Attention: It's expected you understand some bgfx internals before you
* use this call.
* Warning: Must be called only on render thread.
*/
const(bgfx_internal_data_t)* bgfx_get_internal_data();
/**
* Override internal texture with externally created texture. Previously
* created internal texture will released.
* Attention: It's expected you understand some bgfx internals before you
* use this call.
* Warning: Must be called only on render thread.
* Params:
* _handle = Texture handle.
* _ptr = Native API pointer to texture.
*/
ulong bgfx_override_internal_texture_ptr(bgfx_texture_handle_t _handle, ulong _ptr);
/**
* Override internal texture by creating new texture. Previously created
* internal texture will released.
* Attention: It's expected you understand some bgfx internals before you
* use this call.
* Returns: Native API pointer to texture. If result is 0, texture is not created yet from the
* main thread.
* Warning: Must be called only on render thread.
* Params:
* _handle = Texture handle.
* _width = Width.
* _height = Height.
* _numMips = Number of mip-maps.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
ulong bgfx_override_internal_texture(bgfx_texture_handle_t _handle, ushort _width, ushort _height, byte _numMips, bgfx_texture_format_t _format, ulong _flags);
/**
* Sets a debug marker. This allows you to group graphics calls together for easy browsing in
* graphics debugging tools.
* Params:
* _marker = Marker string.
*/
void bgfx_set_marker(const(char)* _marker);
/**
* Set render states for draw primitive.
* Remarks:
* 1. To setup more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
* `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
* `BGFX_STATE_BLEND_EQUATION(_equation)`,
* `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
* 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
* equation is specified.
* Params:
* _state = State flags. Default state for primitive type is
* triangles. See: `BGFX_STATE_DEFAULT`.
* - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.
* - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.
* - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
* - `BGFX_STATE_CULL_*` - Backface culling mode.
* - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.
* - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.
* - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
* _rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
* `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
*/
void bgfx_set_state(ulong _state, uint _rgba);
/**
* Set condition for rendering.
* Params:
* _handle = Occlusion query handle.
* _visible = Render if occlusion query is visible.
*/
void bgfx_set_condition(bgfx_occlusion_query_handle_t _handle, bool _visible);
/**
* Set stencil test state.
* Params:
* _fstencil = Front stencil state.
* _bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE`
* _fstencil is applied to both front and back facing primitives.
*/
void bgfx_set_stencil(uint _fstencil, uint _bstencil);
/**
* Set scissor for draw primitive.
* Remarks:
* To scissor for all primitives in view see `bgfx::setViewScissor`.
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Width of view scissor region.
* _height = Height of view scissor region.
*/
ushort bgfx_set_scissor(ushort _x, ushort _y, ushort _width, ushort _height);
/**
* Set scissor from cache for draw primitive.
* Remarks:
* To scissor for all primitives in view see `bgfx::setViewScissor`.
* Params:
* _cache = Index in scissor cache.
*/
void bgfx_set_scissor_cached(ushort _cache);
/**
* Set model matrix for draw primitive. If it is not called,
* the model will be rendered with an identity model matrix.
* Params:
* _mtx = Pointer to first matrix in array.
* _num = Number of matrices in array.
*/
uint bgfx_set_transform(const(void)* _mtx, ushort _num);
/**
* Set model matrix from matrix cache for draw primitive.
* Params:
* _cache = Index in matrix cache.
* _num = Number of matrices from cache.
*/
void bgfx_set_transform_cached(uint _cache, ushort _num);
/**
* Reserve matrices in internal matrix cache.
* Attention: Pointer returned can be modifed until `bgfx::frame` is called.
* Params:
* _transform = Pointer to `Transform` structure.
* _num = Number of matrices.
*/
uint bgfx_alloc_transform(bgfx_transform_t* _transform, ushort _num);
/**
* Set shader uniform parameter for draw primitive.
* Params:
* _handle = Uniform.
* _value = Pointer to uniform data.
* _num = Number of elements. Passing `UINT16_MAX` will
* use the _num passed on uniform creation.
*/
void bgfx_set_uniform(bgfx_uniform_handle_t _handle, const(void)* _value, ushort _num);
/**
* Set index buffer for draw primitive.
* Params:
* _handle = Index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
void bgfx_set_index_buffer(bgfx_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
/**
* Set index buffer for draw primitive.
* Params:
* _handle = Dynamic index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
void bgfx_set_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
/**
* Set index buffer for draw primitive.
* Params:
* _tib = Transient index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
void bgfx_set_transient_index_buffer(const(bgfx_transient_index_buffer_t)* _tib, uint _firstIndex, uint _numIndices);
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _handle = Vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
void bgfx_set_vertex_buffer(byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _handle = Dynamic vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
void bgfx_set_dynamic_vertex_buffer(byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _tvb = Transient vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
void bgfx_set_transient_vertex_buffer(byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
/**
* Set number of vertices for auto generated vertices use in conjuction
* with gl_VertexID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
* Params:
* _numVertices = Number of vertices.
*/
void bgfx_set_vertex_count(uint _numVertices);
/**
* Set instance data buffer for draw primitive.
* Params:
* _idb = Transient instance data buffer.
* _start = First instance data.
* _num = Number of data instances.
*/
void bgfx_set_instance_data_buffer(const(bgfx_instance_data_buffer_t)* _idb, uint _start, uint _num);
/**
* Set instance data buffer for draw primitive.
* Params:
* _handle = Vertex buffer.
* _startVertex = First instance data.
* _num = Number of data instances.
* Set instance data buffer for draw primitive.
*/
void bgfx_set_instance_data_from_vertex_buffer(bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
/**
* Set instance data buffer for draw primitive.
* Params:
* _handle = Dynamic vertex buffer.
* _startVertex = First instance data.
* _num = Number of data instances.
*/
void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
/**
* Set number of instances for auto generated instances use in conjuction
* with gl_InstanceID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*/
void bgfx_set_instance_count(uint _numInstances);
/**
* Set texture stage for draw primitive.
* Params:
* _stage = Texture unit.
* _sampler = Program sampler.
* _handle = Texture handle.
* _flags = Texture sampling mode. Default value UINT32_MAX uses
* texture sampling settings from the texture.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
void bgfx_set_texture(byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
/**
* Submit an empty primitive for rendering. Uniforms and draw state
* will be applied but no geometry will be submitted.
* Remarks:
* These empty draw calls will sort before ordinary draw calls.
* Params:
* _id = View id.
*/
void bgfx_touch(bgfx_view_id_t _id);
/**
* Submit primitive for rendering.
* Params:
* _id = View id.
* _program = Program.
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See BGFX_DISCARD_
*/
void bgfx_submit(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, byte _flags);
/**
* Submit primitive with occlusion query for rendering.
* Params:
* _id = View id.
* _program = Program.
* _occlusionQuery = Occlusion query.
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See BGFX_DISCARD_
*/
void bgfx_submit_occlusion_query(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, byte _flags);
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
* Params:
* _id = View id.
* _program = Program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
* _num = Number of dispatches.
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See BGFX_DISCARD_
*/
void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
/**
* Set compute index buffer.
* Params:
* _stage = Compute stage.
* _handle = Index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_set_compute_index_buffer(byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute vertex buffer.
* Params:
* _stage = Compute stage.
* _handle = Vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_set_compute_vertex_buffer(byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute dynamic index buffer.
* Params:
* _stage = Compute stage.
* _handle = Dynamic index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_set_compute_dynamic_index_buffer(byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute dynamic vertex buffer.
* Params:
* _stage = Compute stage.
* _handle = Dynamic vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_set_compute_dynamic_vertex_buffer(byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute indirect buffer.
* Params:
* _stage = Compute stage.
* _handle = Indirect buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
void bgfx_set_compute_indirect_buffer(byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute image from texture.
* Params:
* _stage = Compute stage.
* _handle = Texture handle.
* _mip = Mip level.
* _access = Image access. See `Access::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
void bgfx_set_image(byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
/**
* Dispatch compute.
* Params:
* _id = View id.
* _program = Compute program.
* _numX = Number of groups X.
* _numY = Number of groups Y.
* _numZ = Number of groups Z.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
void bgfx_dispatch(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, byte _flags);
/**
* Dispatch compute indirect.
* Params:
* _id = View id.
* _program = Compute program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
* _num = Number of dispatches.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
void bgfx_dispatch_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, byte _flags);
/**
* Discard previously set state for draw or compute call.
* Params:
* _flags = Draw/compute states to discard.
*/
void bgfx_discard(byte _flags);
/**
* Blit 2D texture region between two 2D textures.
* Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
* Params:
* _id = View id.
* _dst = Destination texture handle.
* _dstMip = Destination texture mip level.
* _dstX = Destination texture X position.
* _dstY = Destination texture Y position.
* _dstZ = If texture is 2D this argument should be 0. If destination texture is cube
* this argument represents destination texture cube face. For 3D texture this argument
* represents destination texture Z position.
* _src = Source texture handle.
* _srcMip = Source texture mip level.
* _srcX = Source texture X position.
* _srcY = Source texture Y position.
* _srcZ = If texture is 2D this argument should be 0. If source texture is cube
* this argument represents source texture cube face. For 3D texture this argument
* represents source texture Z position.
* _width = Width of region.
* _height = Height of region.
* _depth = If texture is 3D this argument represents depth of region, otherwise it's
* unused.
*/
void bgfx_blit(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
}
else
{
__gshared
{
/**
* Init attachment.
* Params:
* _handle = Render target texture handle.
* _access = Access. See `Access::Enum`.
* _layer = Cubemap side or depth layer/slice.
* _mip = Mip level.
* _resolve = Resolve flags. See: `BGFX_RESOLVE_*`
*/
alias da_bgfx_attachment_init = void function(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, ushort _layer, ushort _mip, byte _resolve);
da_bgfx_attachment_init bgfx_attachment_init;
/**
* Start VertexLayout.
*/
alias da_bgfx_vertex_layout_begin = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, bgfx_renderer_type_t _rendererType);
da_bgfx_vertex_layout_begin bgfx_vertex_layout_begin;
/**
* Add attribute to VertexLayout.
* Remarks: Must be called between begin/end.
* Params:
* _attrib = Attribute semantics. See: `bgfx::Attrib`
* _num = Number of elements 1, 2, 3 or 4.
* _type = Element type.
* _normalized = When using fixed point AttribType (f.e. Uint8)
* value will be normalized for vertex shader usage. When normalized
* is set to true, AttribType::Uint8 value in range 0-255 will be
* in range 0.0-1.0 in vertex shader.
* _asInt = Packaging rule for vertexPack, vertexUnpack, and
* vertexConvert for AttribType::Uint8 and AttribType::Int16.
* Unpacking code must be implemented inside vertex shader.
*/
alias da_bgfx_vertex_layout_add = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, byte _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
da_bgfx_vertex_layout_add bgfx_vertex_layout_add;
/**
* Decode attribute.
* Params:
* _attrib = Attribute semantics. See: `bgfx::Attrib`
* _num = Number of elements.
* _type = Element type.
* _normalized = Attribute is normalized.
* _asInt = Attribute is packed as int.
*/
alias da_bgfx_vertex_layout_decode = void function(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib, byte* _num, bgfx_attrib_type_t* _type, bool* _normalized, bool* _asInt);
da_bgfx_vertex_layout_decode bgfx_vertex_layout_decode;
/**
* Returns true if VertexLayout contains attribute.
* Params:
* _attrib = Attribute semantics. See: `bgfx::Attrib`
*/
alias da_bgfx_vertex_layout_has = bool function(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib);
da_bgfx_vertex_layout_has bgfx_vertex_layout_has;
/**
* Skip `_num` bytes in vertex stream.
*/
alias da_bgfx_vertex_layout_skip = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, byte _num);
da_bgfx_vertex_layout_skip bgfx_vertex_layout_skip;
/**
* End VertexLayout.
*/
alias da_bgfx_vertex_layout_end = void function(bgfx_vertex_layout_t* _this);
da_bgfx_vertex_layout_end bgfx_vertex_layout_end;
/**
* Pack vertex attribute into vertex stream format.
* Params:
* _input = Value to be packed into vertex stream.
* _inputNormalized = `true` if input value is already normalized.
* _attr = Attribute to pack.
* _layout = Vertex stream layout.
* _data = Destination vertex stream where data will be packed.
* _index = Vertex index that will be modified.
*/
alias da_bgfx_vertex_pack = void function(const float[4] _input, bool _inputNormalized, bgfx_attrib_t _attr, const(bgfx_vertex_layout_t)* _layout, void* _data, uint _index);
da_bgfx_vertex_pack bgfx_vertex_pack;
/**
* Unpack vertex attribute from vertex stream format.
* Params:
* _output = Result of unpacking.
* _attr = Attribute to unpack.
* _layout = Vertex stream layout.
* _data = Source vertex stream from where data will be unpacked.
* _index = Vertex index that will be unpacked.
*/
alias da_bgfx_vertex_unpack = void function(float[4] _output, bgfx_attrib_t _attr, const(bgfx_vertex_layout_t)* _layout, const(void)* _data, uint _index);
da_bgfx_vertex_unpack bgfx_vertex_unpack;
/**
* Converts vertex stream data from one vertex stream format to another.
* Params:
* _dstLayout = Destination vertex stream layout.
* _dstData = Destination vertex stream.
* _srcLayout = Source vertex stream layout.
* _srcData = Source vertex stream data.
* _num = Number of vertices to convert from source to destination.
*/
alias da_bgfx_vertex_convert = void function(const(bgfx_vertex_layout_t)* _dstLayout, void* _dstData, const(bgfx_vertex_layout_t)* _srcLayout, const(void)* _srcData, uint _num);
da_bgfx_vertex_convert bgfx_vertex_convert;
/**
* Weld vertices.
* Params:
* _output = Welded vertices remapping table. The size of buffer
* must be the same as number of vertices.
* _layout = Vertex stream layout.
* _data = Vertex stream.
* _num = Number of vertices in vertex stream.
* _index32 = Set to `true` if input indices are 32-bit.
* _epsilon = Error tolerance for vertex position comparison.
*/
alias da_bgfx_weld_vertices = uint function(void* _output, const(bgfx_vertex_layout_t)* _layout, const(void)* _data, uint _num, bool _index32, float _epsilon);
da_bgfx_weld_vertices bgfx_weld_vertices;
/**
* Convert index buffer for use with different primitive topologies.
* Params:
* _conversion = Conversion type, see `TopologyConvert::Enum`.
* _dst = Destination index buffer. If this argument is NULL
* function will return number of indices after conversion.
* _dstSize = Destination index buffer in bytes. It must be
* large enough to contain output indices. If destination size is
* insufficient index buffer will be truncated.
* _indices = Source indices.
* _numIndices = Number of input indices.
* _index32 = Set to `true` if input indices are 32-bit.
*/
alias da_bgfx_topology_convert = uint function(bgfx_topology_convert_t _conversion, void* _dst, uint _dstSize, const(void)* _indices, uint _numIndices, bool _index32);
da_bgfx_topology_convert bgfx_topology_convert;
/**
* Sort indices.
* Params:
* _sort = Sort order, see `TopologySort::Enum`.
* _dst = Destination index buffer.
* _dstSize = Destination index buffer in bytes. It must be
* large enough to contain output indices. If destination size is
* insufficient index buffer will be truncated.
* _dir = Direction (vector must be normalized).
* _pos = Position.
* _vertices = Pointer to first vertex represented as
* float x, y, z. Must contain at least number of vertices
* referencende by index buffer.
* _stride = Vertex stride.
* _indices = Source indices.
* _numIndices = Number of input indices.
* _index32 = Set to `true` if input indices are 32-bit.
*/
alias da_bgfx_topology_sort_tri_list = void function(bgfx_topology_sort_t _sort, void* _dst, uint _dstSize, const float[3] _dir, const float[3] _pos, const(void)* _vertices, uint _stride, const(void)* _indices, uint _numIndices, bool _index32);
da_bgfx_topology_sort_tri_list bgfx_topology_sort_tri_list;
/**
* Returns supported backend API renderers.
* Params:
* _max = Maximum number of elements in _enum array.
* _enum = Array where supported renderers will be written.
*/
alias da_bgfx_get_supported_renderers = byte function(byte _max, bgfx_renderer_type_t* _enum);
da_bgfx_get_supported_renderers bgfx_get_supported_renderers;
/**
* Returns name of renderer.
* Params:
* _type = Renderer backend type. See: `bgfx::RendererType`
*/
alias da_bgfx_get_renderer_name = const(char)* function(bgfx_renderer_type_t _type);
da_bgfx_get_renderer_name bgfx_get_renderer_name;
alias da_bgfx_init_ctor = void function(bgfx_init_t* _init);
da_bgfx_init_ctor bgfx_init_ctor;
/**
* Initialize bgfx library.
* Params:
* _init = Initialization parameters. See: `bgfx::Init` for more info.
*/
alias da_bgfx_init = bool function(const(bgfx_init_t)* _init);
da_bgfx_init bgfx_init;
/**
* Shutdown bgfx library.
*/
alias da_bgfx_shutdown = void function();
da_bgfx_shutdown bgfx_shutdown;
/**
* Reset graphic settings and back-buffer size.
* Attention: This call doesn't actually change window size, it just
* resizes back-buffer. Windowing code has to change window size.
* Params:
* _width = Back-buffer width.
* _height = Back-buffer height.
* _flags = See: `BGFX_RESET_*` for more info.
* - `BGFX_RESET_NONE` - No reset flags.
* - `BGFX_RESET_FULLSCREEN` - Not supported yet.
* - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA.
* - `BGFX_RESET_VSYNC` - Enable V-Sync.
* - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy.
* - `BGFX_RESET_CAPTURE` - Begin screen capture.
* - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU.
* - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
* occurs. Default behaviour is that flip occurs before rendering new
* frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
* - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
alias da_bgfx_reset = void function(uint _width, uint _height, uint _flags, bgfx_texture_format_t _format);
da_bgfx_reset bgfx_reset;
/**
* Advance to next frame. When using multithreaded renderer, this call
* just swaps internal buffers, kicks render thread, and returns. In
* singlethreaded renderer this call does frame rendering.
* Params:
* _capture = Capture frame with graphics debugger.
*/
alias da_bgfx_frame = uint function(bool _capture);
da_bgfx_frame bgfx_frame;
/**
* Returns current renderer backend API type.
* Remarks:
* Library must be initialized.
*/
alias da_bgfx_get_renderer_type = bgfx_renderer_type_t function();
da_bgfx_get_renderer_type bgfx_get_renderer_type;
/**
* Returns renderer capabilities.
* Remarks:
* Library must be initialized.
*/
alias da_bgfx_get_caps = const(bgfx_caps_t)* function();
da_bgfx_get_caps bgfx_get_caps;
/**
* Returns performance counters.
* Attention: Pointer returned is valid until `bgfx::frame` is called.
*/
alias da_bgfx_get_stats = const(bgfx_stats_t)* function();
da_bgfx_get_stats bgfx_get_stats;
/**
* Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
* Params:
* _size = Size to allocate.
*/
alias da_bgfx_alloc = const(bgfx_memory_t)* function(uint _size);
da_bgfx_alloc bgfx_alloc;
/**
* Allocate buffer and copy data into it. Data will be freed inside bgfx.
* Params:
* _data = Pointer to data to be copied.
* _size = Size of data to be copied.
*/
alias da_bgfx_copy = const(bgfx_memory_t)* function(const(void)* _data, uint _size);
da_bgfx_copy bgfx_copy;
/**
* Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
* doesn't allocate memory for data. It just copies the _data pointer. You
* can pass `ReleaseFn` function pointer to release this memory after it's
* consumed, otherwise you must make sure _data is available for at least 2
* `bgfx::frame` calls. `ReleaseFn` function must be able to be called
* from any thread.
* Attention: Data passed must be available for at least 2 `bgfx::frame` calls.
* Params:
* _data = Pointer to data.
* _size = Size of data.
*/
alias da_bgfx_make_ref = const(bgfx_memory_t)* function(const(void)* _data, uint _size);
da_bgfx_make_ref bgfx_make_ref;
/**
* Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
* doesn't allocate memory for data. It just copies the _data pointer. You
* can pass `ReleaseFn` function pointer to release this memory after it's
* consumed, otherwise you must make sure _data is available for at least 2
* `bgfx::frame` calls. `ReleaseFn` function must be able to be called
* from any thread.
* Attention: Data passed must be available for at least 2 `bgfx::frame` calls.
* Params:
* _data = Pointer to data.
* _size = Size of data.
* _releaseFn = Callback function to release memory after use.
* _userData = User data to be passed to callback function.
*/
alias da_bgfx_make_ref_release = const(bgfx_memory_t)* function(const(void)* _data, uint _size, void* _releaseFn, void* _userData);
da_bgfx_make_ref_release bgfx_make_ref_release;
/**
* Set debug flags.
* Params:
* _debug = Available flags:
* - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set
* all rendering calls will be skipped. This is useful when profiling
* to quickly assess potential bottlenecks between CPU and GPU.
* - `BGFX_DEBUG_PROFILER` - Enable profiler.
* - `BGFX_DEBUG_STATS` - Display internal statistics.
* - `BGFX_DEBUG_TEXT` - Display debug text.
* - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering
* primitives will be rendered as lines.
*/
alias da_bgfx_set_debug = void function(uint _debug);
da_bgfx_set_debug bgfx_set_debug;
/**
* Clear internal debug text buffer.
* Params:
* _attr = Background color.
* _small = Default 8x16 or 8x8 font.
*/
alias da_bgfx_dbg_text_clear = void function(byte _attr, bool _small);
da_bgfx_dbg_text_clear bgfx_dbg_text_clear;
/**
* Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _attr = Color palette. Where top 4-bits represent index of background, and bottom
* 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
* _format = `printf` style format.
*/
alias da_bgfx_dbg_text_printf = void function(ushort _x, ushort _y, byte _attr, const(char)* _format, ... );
da_bgfx_dbg_text_printf bgfx_dbg_text_printf;
/**
* Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _attr = Color palette. Where top 4-bits represent index of background, and bottom
* 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
* _format = `printf` style format.
* _argList = Variable arguments list for format string.
*/
alias da_bgfx_dbg_text_vprintf = void function(ushort _x, ushort _y, byte _attr, const(char)* _format, va_list _argList);
da_bgfx_dbg_text_vprintf bgfx_dbg_text_vprintf;
/**
* Draw image into internal debug text buffer.
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Image width.
* _height = Image height.
* _data = Raw image data (character/attribute raw encoding).
* _pitch = Image pitch in bytes.
*/
alias da_bgfx_dbg_text_image = void function(ushort _x, ushort _y, ushort _width, ushort _height, const(void)* _data, ushort _pitch);
da_bgfx_dbg_text_image bgfx_dbg_text_image;
/**
* Create static index buffer.
* Params:
* _mem = Index buffer data.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
alias da_bgfx_create_index_buffer = bgfx_index_buffer_handle_t function(const(bgfx_memory_t)* _mem, ushort _flags);
da_bgfx_create_index_buffer bgfx_create_index_buffer;
/**
* Set static index buffer debug name.
* Params:
* _handle = Static index buffer handle.
* _name = Static index buffer name.
* _len = Static index buffer name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string.
*/
alias da_bgfx_set_index_buffer_name = void function(bgfx_index_buffer_handle_t _handle, const(char)* _name, int _len);
da_bgfx_set_index_buffer_name bgfx_set_index_buffer_name;
/**
* Destroy static index buffer.
* Params:
* _handle = Static index buffer handle.
*/
alias da_bgfx_destroy_index_buffer = void function(bgfx_index_buffer_handle_t _handle);
da_bgfx_destroy_index_buffer bgfx_destroy_index_buffer;
/**
* Create vertex layout.
* Params:
* _layout = Vertex layout.
*/
alias da_bgfx_create_vertex_layout = bgfx_vertex_layout_handle_t function(const(bgfx_vertex_layout_t)* _layout);
da_bgfx_create_vertex_layout bgfx_create_vertex_layout;
/**
* Destroy vertex layout.
* Params:
* _layoutHandle = Vertex layout handle.
*/
alias da_bgfx_destroy_vertex_layout = void function(bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_destroy_vertex_layout bgfx_destroy_vertex_layout;
/**
* Create static vertex buffer.
* Params:
* _mem = Vertex buffer data.
* _layout = Vertex layout.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
*/
alias da_bgfx_create_vertex_buffer = bgfx_vertex_buffer_handle_t function(const(bgfx_memory_t)* _mem, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
da_bgfx_create_vertex_buffer bgfx_create_vertex_buffer;
/**
* Set static vertex buffer debug name.
* Params:
* _handle = Static vertex buffer handle.
* _name = Static vertex buffer name.
* _len = Static vertex buffer name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string.
*/
alias da_bgfx_set_vertex_buffer_name = void function(bgfx_vertex_buffer_handle_t _handle, const(char)* _name, int _len);
da_bgfx_set_vertex_buffer_name bgfx_set_vertex_buffer_name;
/**
* Destroy static vertex buffer.
* Params:
* _handle = Static vertex buffer handle.
*/
alias da_bgfx_destroy_vertex_buffer = void function(bgfx_vertex_buffer_handle_t _handle);
da_bgfx_destroy_vertex_buffer bgfx_destroy_vertex_buffer;
/**
* Create empty dynamic index buffer.
* Params:
* _num = Number of indices.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
alias da_bgfx_create_dynamic_index_buffer = bgfx_dynamic_index_buffer_handle_t function(uint _num, ushort _flags);
da_bgfx_create_dynamic_index_buffer bgfx_create_dynamic_index_buffer;
/**
* Create dynamic index buffer and initialized it.
* Params:
* _mem = Index buffer data.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
alias da_bgfx_create_dynamic_index_buffer_mem = bgfx_dynamic_index_buffer_handle_t function(const(bgfx_memory_t)* _mem, ushort _flags);
da_bgfx_create_dynamic_index_buffer_mem bgfx_create_dynamic_index_buffer_mem;
/**
* Update dynamic index buffer.
* Params:
* _handle = Dynamic index buffer handle.
* _startIndex = Start index.
* _mem = Index buffer data.
*/
alias da_bgfx_update_dynamic_index_buffer = void function(bgfx_dynamic_index_buffer_handle_t _handle, uint _startIndex, const(bgfx_memory_t)* _mem);
da_bgfx_update_dynamic_index_buffer bgfx_update_dynamic_index_buffer;
/**
* Destroy dynamic index buffer.
* Params:
* _handle = Dynamic index buffer handle.
*/
alias da_bgfx_destroy_dynamic_index_buffer = void function(bgfx_dynamic_index_buffer_handle_t _handle);
da_bgfx_destroy_dynamic_index_buffer bgfx_destroy_dynamic_index_buffer;
/**
* Create empty dynamic vertex buffer.
* Params:
* _num = Number of vertices.
* _layout = Vertex layout.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
alias da_bgfx_create_dynamic_vertex_buffer = bgfx_dynamic_vertex_buffer_handle_t function(uint _num, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
da_bgfx_create_dynamic_vertex_buffer bgfx_create_dynamic_vertex_buffer;
/**
* Create dynamic vertex buffer and initialize it.
* Params:
* _mem = Vertex buffer data.
* _layout = Vertex layout.
* _flags = Buffer creation flags.
* - `BGFX_BUFFER_NONE` - No flags.
* - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
* - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
* is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
* - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
* - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
* data is passed. If this flag is not specified, and more data is passed on update, the buffer
* will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
* buffers.
* - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
* index buffers.
*/
alias da_bgfx_create_dynamic_vertex_buffer_mem = bgfx_dynamic_vertex_buffer_handle_t function(const(bgfx_memory_t)* _mem, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
da_bgfx_create_dynamic_vertex_buffer_mem bgfx_create_dynamic_vertex_buffer_mem;
/**
* Update dynamic vertex buffer.
* Params:
* _handle = Dynamic vertex buffer handle.
* _startVertex = Start vertex.
* _mem = Vertex buffer data.
*/
alias da_bgfx_update_dynamic_vertex_buffer = void function(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, const(bgfx_memory_t)* _mem);
da_bgfx_update_dynamic_vertex_buffer bgfx_update_dynamic_vertex_buffer;
/**
* Destroy dynamic vertex buffer.
* Params:
* _handle = Dynamic vertex buffer handle.
*/
alias da_bgfx_destroy_dynamic_vertex_buffer = void function(bgfx_dynamic_vertex_buffer_handle_t _handle);
da_bgfx_destroy_dynamic_vertex_buffer bgfx_destroy_dynamic_vertex_buffer;
/**
* Returns number of requested or maximum available indices.
* Params:
* _num = Number of required indices.
*/
alias da_bgfx_get_avail_transient_index_buffer = uint function(uint _num);
da_bgfx_get_avail_transient_index_buffer bgfx_get_avail_transient_index_buffer;
/**
* Returns number of requested or maximum available vertices.
* Params:
* _num = Number of required vertices.
* _layout = Vertex layout.
*/
alias da_bgfx_get_avail_transient_vertex_buffer = uint function(uint _num, const(bgfx_vertex_layout_t)* _layout);
da_bgfx_get_avail_transient_vertex_buffer bgfx_get_avail_transient_vertex_buffer;
/**
* Returns number of requested or maximum available instance buffer slots.
* Params:
* _num = Number of required instances.
* _stride = Stride per instance.
*/
alias da_bgfx_get_avail_instance_data_buffer = uint function(uint _num, ushort _stride);
da_bgfx_get_avail_instance_data_buffer bgfx_get_avail_instance_data_buffer;
/**
* Allocate transient index buffer.
* Remarks:
* Only 16-bit index buffer is supported.
* Params:
* _tib = TransientIndexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _num = Number of indices to allocate.
*/
alias da_bgfx_alloc_transient_index_buffer = void function(bgfx_transient_index_buffer_t* _tib, uint _num);
da_bgfx_alloc_transient_index_buffer bgfx_alloc_transient_index_buffer;
/**
* Allocate transient vertex buffer.
* Params:
* _tvb = TransientVertexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _num = Number of vertices to allocate.
* _layout = Vertex layout.
*/
alias da_bgfx_alloc_transient_vertex_buffer = void function(bgfx_transient_vertex_buffer_t* _tvb, uint _num, const(bgfx_vertex_layout_t)* _layout);
da_bgfx_alloc_transient_vertex_buffer bgfx_alloc_transient_vertex_buffer;
/**
* Check for required space and allocate transient vertex and index
* buffers. If both space requirements are satisfied function returns
* true.
* Remarks:
* Only 16-bit index buffer is supported.
* Params:
* _tvb = TransientVertexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _layout = Vertex layout.
* _numVertices = Number of vertices to allocate.
* _tib = TransientIndexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _numIndices = Number of indices to allocate.
*/
alias da_bgfx_alloc_transient_buffers = bool function(bgfx_transient_vertex_buffer_t* _tvb, const(bgfx_vertex_layout_t)* _layout, uint _numVertices, bgfx_transient_index_buffer_t* _tib, uint _numIndices);
da_bgfx_alloc_transient_buffers bgfx_alloc_transient_buffers;
/**
* Allocate instance data buffer.
* Params:
* _idb = InstanceDataBuffer structure is filled and is valid
* for duration of frame, and it can be reused for multiple draw
* calls.
* _num = Number of instances.
* _stride = Instance stride. Must be multiple of 16.
*/
alias da_bgfx_alloc_instance_data_buffer = void function(bgfx_instance_data_buffer_t* _idb, uint _num, ushort _stride);
da_bgfx_alloc_instance_data_buffer bgfx_alloc_instance_data_buffer;
/**
* Create draw indirect buffer.
* Params:
* _num = Number of indirect calls.
*/
alias da_bgfx_create_indirect_buffer = bgfx_indirect_buffer_handle_t function(uint _num);
da_bgfx_create_indirect_buffer bgfx_create_indirect_buffer;
/**
* Destroy draw indirect buffer.
* Params:
* _handle = Indirect buffer handle.
*/
alias da_bgfx_destroy_indirect_buffer = void function(bgfx_indirect_buffer_handle_t _handle);
da_bgfx_destroy_indirect_buffer bgfx_destroy_indirect_buffer;
/**
* Create shader from memory buffer.
* Params:
* _mem = Shader binary.
*/
alias da_bgfx_create_shader = bgfx_shader_handle_t function(const(bgfx_memory_t)* _mem);
da_bgfx_create_shader bgfx_create_shader;
/**
* Returns the number of uniforms and uniform handles used inside a shader.
* Remarks:
* Only non-predefined uniforms are returned.
* Params:
* _handle = Shader handle.
* _uniforms = UniformHandle array where data will be stored.
* _max = Maximum capacity of array.
*/
alias da_bgfx_get_shader_uniforms = ushort function(bgfx_shader_handle_t _handle, bgfx_uniform_handle_t* _uniforms, ushort _max);
da_bgfx_get_shader_uniforms bgfx_get_shader_uniforms;
/**
* Set shader debug name.
* Params:
* _handle = Shader handle.
* _name = Shader name.
* _len = Shader name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string).
*/
alias da_bgfx_set_shader_name = void function(bgfx_shader_handle_t _handle, const(char)* _name, int _len);
da_bgfx_set_shader_name bgfx_set_shader_name;
/**
* Destroy shader.
* Remarks: Once a shader program is created with _handle,
* it is safe to destroy that shader.
* Params:
* _handle = Shader handle.
*/
alias da_bgfx_destroy_shader = void function(bgfx_shader_handle_t _handle);
da_bgfx_destroy_shader bgfx_destroy_shader;
/**
* Create program with vertex and fragment shaders.
* Params:
* _vsh = Vertex shader.
* _fsh = Fragment shader.
* _destroyShaders = If true, shaders will be destroyed when program is destroyed.
*/
alias da_bgfx_create_program = bgfx_program_handle_t function(bgfx_shader_handle_t _vsh, bgfx_shader_handle_t _fsh, bool _destroyShaders);
da_bgfx_create_program bgfx_create_program;
/**
* Create program with compute shader.
* Params:
* _csh = Compute shader.
* _destroyShaders = If true, shaders will be destroyed when program is destroyed.
*/
alias da_bgfx_create_compute_program = bgfx_program_handle_t function(bgfx_shader_handle_t _csh, bool _destroyShaders);
da_bgfx_create_compute_program bgfx_create_compute_program;
/**
* Destroy program.
* Params:
* _handle = Program handle.
*/
alias da_bgfx_destroy_program = void function(bgfx_program_handle_t _handle);
da_bgfx_destroy_program bgfx_destroy_program;
/**
* Validate texture parameters.
* Params:
* _depth = Depth dimension of volume texture.
* _cubeMap = Indicates that texture contains cubemap.
* _numLayers = Number of layers in texture array.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture flags. See `BGFX_TEXTURE_*`.
*/
alias da_bgfx_is_texture_valid = bool function(ushort _depth, bool _cubeMap, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags);
da_bgfx_is_texture_valid bgfx_is_texture_valid;
/**
* Calculate amount of memory required for texture.
* Params:
* _info = Resulting texture info structure. See: `TextureInfo`.
* _width = Width.
* _height = Height.
* _depth = Depth dimension of volume texture.
* _cubeMap = Indicates that texture contains cubemap.
* _hasMips = Indicates that texture contains full mip-map chain.
* _numLayers = Number of layers in texture array.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
alias da_bgfx_calc_texture_size = void function(bgfx_texture_info_t* _info, ushort _width, ushort _height, ushort _depth, bool _cubeMap, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format);
da_bgfx_calc_texture_size bgfx_calc_texture_size;
/**
* Create texture from memory buffer.
* Params:
* _mem = DDS, KTX or PVR texture binary data.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
* _skip = Skip top level mips when parsing texture.
* _info = When non-`NULL` is specified it returns parsed texture information.
*/
alias da_bgfx_create_texture = bgfx_texture_handle_t function(const(bgfx_memory_t)* _mem, ulong _flags, byte _skip, bgfx_texture_info_t* _info);
da_bgfx_create_texture bgfx_create_texture;
/**
* Create 2D texture.
* Params:
* _width = Width.
* _height = Height.
* _hasMips = Indicates that texture contains full mip-map chain.
* _numLayers = Number of layers in texture array. Must be 1 if caps
* `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
* _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
* `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
* 1, expected memory layout is texture and all mips together for each array element.
*/
alias da_bgfx_create_texture_2d = bgfx_texture_handle_t function(ushort _width, ushort _height, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
da_bgfx_create_texture_2d bgfx_create_texture_2d;
/**
* Create texture with size based on backbuffer ratio. Texture will maintain ratio
* if back buffer resolution changes.
* Params:
* _ratio = Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
* _hasMips = Indicates that texture contains full mip-map chain.
* _numLayers = Number of layers in texture array. Must be 1 if caps
* `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
alias da_bgfx_create_texture_2d_scaled = bgfx_texture_handle_t function(bgfx_backbuffer_ratio_t _ratio, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags);
da_bgfx_create_texture_2d_scaled bgfx_create_texture_2d_scaled;
/**
* Create 3D texture.
* Params:
* _width = Width.
* _height = Height.
* _depth = Depth.
* _hasMips = Indicates that texture contains full mip-map chain.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
* _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
* `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
* 1, expected memory layout is texture and all mips together for each array element.
*/
alias da_bgfx_create_texture_3d = bgfx_texture_handle_t function(ushort _width, ushort _height, ushort _depth, bool _hasMips, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
da_bgfx_create_texture_3d bgfx_create_texture_3d;
/**
* Create Cube texture.
* Params:
* _size = Cube side size.
* _hasMips = Indicates that texture contains full mip-map chain.
* _numLayers = Number of layers in texture array. Must be 1 if caps
* `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
* _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
* `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
* 1, expected memory layout is texture and all mips together for each array element.
*/
alias da_bgfx_create_texture_cube = bgfx_texture_handle_t function(ushort _size, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
da_bgfx_create_texture_cube bgfx_create_texture_cube;
/**
* Update 2D texture.
* Attention: It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
* Params:
* _handle = Texture handle.
* _layer = Layer in texture array.
* _mip = Mip level.
* _x = X offset in texture.
* _y = Y offset in texture.
* _width = Width of texture block.
* _height = Height of texture block.
* _mem = Texture update data.
* _pitch = Pitch of input image (bytes). When _pitch is set to
* UINT16_MAX, it will be calculated internally based on _width.
*/
alias da_bgfx_update_texture_2d = void function(bgfx_texture_handle_t _handle, ushort _layer, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
da_bgfx_update_texture_2d bgfx_update_texture_2d;
/**
* Update 3D texture.
* Attention: It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
* Params:
* _handle = Texture handle.
* _mip = Mip level.
* _x = X offset in texture.
* _y = Y offset in texture.
* _z = Z offset in texture.
* _width = Width of texture block.
* _height = Height of texture block.
* _depth = Depth of texture block.
* _mem = Texture update data.
*/
alias da_bgfx_update_texture_3d = void function(bgfx_texture_handle_t _handle, byte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, const(bgfx_memory_t)* _mem);
da_bgfx_update_texture_3d bgfx_update_texture_3d;
/**
* Update Cube texture.
* Attention: It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
* Params:
* _handle = Texture handle.
* _layer = Layer in texture array.
* _side = Cubemap side `BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>`,
* where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.
* +----------+
* |-z 2|
* | ^ +y |
* | | | Unfolded cube:
* | +---->+x |
* +----------+----------+----------+----------+
* |+y 1|+y 4|+y 0|+y 5|
* | ^ -x | ^ +z | ^ +x | ^ -z |
* | | | | | | | | |
* | +---->+z | +---->+x | +---->-z | +---->-x |
* +----------+----------+----------+----------+
* |+z 3|
* | ^ -y |
* | | |
* | +---->+x |
* +----------+
* _mip = Mip level.
* _x = X offset in texture.
* _y = Y offset in texture.
* _width = Width of texture block.
* _height = Height of texture block.
* _mem = Texture update data.
* _pitch = Pitch of input image (bytes). When _pitch is set to
* UINT16_MAX, it will be calculated internally based on _width.
*/
alias da_bgfx_update_texture_cube = void function(bgfx_texture_handle_t _handle, ushort _layer, byte _side, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
da_bgfx_update_texture_cube bgfx_update_texture_cube;
/**
* Read back texture content.
* Attention: Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
* Params:
* _handle = Texture handle.
* _data = Destination buffer.
* _mip = Mip level.
*/
alias da_bgfx_read_texture = uint function(bgfx_texture_handle_t _handle, void* _data, byte _mip);
da_bgfx_read_texture bgfx_read_texture;
/**
* Set texture debug name.
* Params:
* _handle = Texture handle.
* _name = Texture name.
* _len = Texture name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string.
*/
alias da_bgfx_set_texture_name = void function(bgfx_texture_handle_t _handle, const(char)* _name, int _len);
da_bgfx_set_texture_name bgfx_set_texture_name;
/**
* Returns texture direct access pointer.
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_DIRECT_ACCESS`. This feature
* is available on GPUs that have unified memory architecture (UMA) support.
* Params:
* _handle = Texture handle.
*/
alias da_bgfx_get_direct_access_ptr = void* function(bgfx_texture_handle_t _handle);
da_bgfx_get_direct_access_ptr bgfx_get_direct_access_ptr;
/**
* Destroy texture.
* Params:
* _handle = Texture handle.
*/
alias da_bgfx_destroy_texture = void function(bgfx_texture_handle_t _handle);
da_bgfx_destroy_texture bgfx_destroy_texture;
/**
* Create frame buffer (simple).
* Params:
* _width = Texture width.
* _height = Texture height.
* _format = Texture format. See: `TextureFormat::Enum`.
* _textureFlags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
alias da_bgfx_create_frame_buffer = bgfx_frame_buffer_handle_t function(ushort _width, ushort _height, bgfx_texture_format_t _format, ulong _textureFlags);
da_bgfx_create_frame_buffer bgfx_create_frame_buffer;
/**
* Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
* if back buffer resolution changes.
* Params:
* _ratio = Frame buffer size in respect to back-buffer size. See:
* `BackbufferRatio::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
* _textureFlags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
alias da_bgfx_create_frame_buffer_scaled = bgfx_frame_buffer_handle_t function(bgfx_backbuffer_ratio_t _ratio, bgfx_texture_format_t _format, ulong _textureFlags);
da_bgfx_create_frame_buffer_scaled bgfx_create_frame_buffer_scaled;
/**
* Create MRT frame buffer from texture handles (simple).
* Params:
* _num = Number of texture handles.
* _handles = Texture attachments.
* _destroyTexture = If true, textures will be destroyed when
* frame buffer is destroyed.
*/
alias da_bgfx_create_frame_buffer_from_handles = bgfx_frame_buffer_handle_t function(byte _num, const(bgfx_texture_handle_t)* _handles, bool _destroyTexture);
da_bgfx_create_frame_buffer_from_handles bgfx_create_frame_buffer_from_handles;
/**
* Create MRT frame buffer from texture handles with specific layer and
* mip level.
* Params:
* _num = Number of attachements.
* _attachment = Attachment texture info. See: `bgfx::Attachment`.
* _destroyTexture = If true, textures will be destroyed when
* frame buffer is destroyed.
*/
alias da_bgfx_create_frame_buffer_from_attachment = bgfx_frame_buffer_handle_t function(byte _num, const(bgfx_attachment_t)* _attachment, bool _destroyTexture);
da_bgfx_create_frame_buffer_from_attachment bgfx_create_frame_buffer_from_attachment;
/**
* Create frame buffer for multiple window rendering.
* Remarks:
* Frame buffer cannot be used for sampling.
* Attention: Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
* Params:
* _nwh = OS' target native window handle.
* _width = Window back buffer width.
* _height = Window back buffer height.
* _format = Window back buffer color format.
* _depthFormat = Window back buffer depth format.
*/
alias da_bgfx_create_frame_buffer_from_nwh = bgfx_frame_buffer_handle_t function(void* _nwh, ushort _width, ushort _height, bgfx_texture_format_t _format, bgfx_texture_format_t _depthFormat);
da_bgfx_create_frame_buffer_from_nwh bgfx_create_frame_buffer_from_nwh;
/**
* Set frame buffer debug name.
* Params:
* _handle = Frame buffer handle.
* _name = Frame buffer name.
* _len = Frame buffer name length (if length is INT32_MAX, it's expected
* that _name is zero terminated string.
*/
alias da_bgfx_set_frame_buffer_name = void function(bgfx_frame_buffer_handle_t _handle, const(char)* _name, int _len);
da_bgfx_set_frame_buffer_name bgfx_set_frame_buffer_name;
/**
* Obtain texture handle of frame buffer attachment.
* Params:
* _handle = Frame buffer handle.
*/
alias da_bgfx_get_texture = bgfx_texture_handle_t function(bgfx_frame_buffer_handle_t _handle, byte _attachment);
da_bgfx_get_texture bgfx_get_texture;
/**
* Destroy frame buffer.
* Params:
* _handle = Frame buffer handle.
*/
alias da_bgfx_destroy_frame_buffer = void function(bgfx_frame_buffer_handle_t _handle);
da_bgfx_destroy_frame_buffer bgfx_destroy_frame_buffer;
/**
* Create shader uniform parameter.
* Remarks:
* 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
* multiple times with the same uniform name. The library will always
* return the same handle, but the handle reference count will be
* incremented. This means that the same number of `bgfx::destroyUniform`
* must be called to properly destroy the uniform.
* 2. Predefined uniforms (declared in `bgfx_shader.sh`):
* - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
* view, in pixels.
* - `u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)` - inverse
* width and height
* - `u_view mat4` - view matrix
* - `u_invView mat4` - inverted view matrix
* - `u_proj mat4` - projection matrix
* - `u_invProj mat4` - inverted projection matrix
* - `u_viewProj mat4` - concatenated view projection matrix
* - `u_invViewProj mat4` - concatenated inverted view projection matrix
* - `u_model mat4[BGFX_CONFIG_MAX_BONES]` - array of model matrices.
* - `u_modelView mat4` - concatenated model view matrix, only first
* model matrix from array is used.
* - `u_modelViewProj mat4` - concatenated model view projection matrix.
* - `u_alphaRef float` - alpha reference value for alpha test.
* Params:
* _name = Uniform name in shader.
* _type = Type of uniform (See: `bgfx::UniformType`).
* _num = Number of elements in array.
*/
alias da_bgfx_create_uniform = bgfx_uniform_handle_t function(const(char)* _name, bgfx_uniform_type_t _type, ushort _num);
da_bgfx_create_uniform bgfx_create_uniform;
/**
* Retrieve uniform info.
* Params:
* _handle = Handle to uniform object.
* _info = Uniform info.
*/
alias da_bgfx_get_uniform_info = void function(bgfx_uniform_handle_t _handle, bgfx_uniform_info_t* _info);
da_bgfx_get_uniform_info bgfx_get_uniform_info;
/**
* Destroy shader uniform parameter.
* Params:
* _handle = Handle to uniform object.
*/
alias da_bgfx_destroy_uniform = void function(bgfx_uniform_handle_t _handle);
da_bgfx_destroy_uniform bgfx_destroy_uniform;
/**
* Create occlusion query.
*/
alias da_bgfx_create_occlusion_query = bgfx_occlusion_query_handle_t function();
da_bgfx_create_occlusion_query bgfx_create_occlusion_query;
/**
* Retrieve occlusion query result from previous frame.
* Params:
* _handle = Handle to occlusion query object.
* _result = Number of pixels that passed test. This argument
* can be `NULL` if result of occlusion query is not needed.
*/
alias da_bgfx_get_result = bgfx_occlusion_query_result_t function(bgfx_occlusion_query_handle_t _handle, int* _result);
da_bgfx_get_result bgfx_get_result;
/**
* Destroy occlusion query.
* Params:
* _handle = Handle to occlusion query object.
*/
alias da_bgfx_destroy_occlusion_query = void function(bgfx_occlusion_query_handle_t _handle);
da_bgfx_destroy_occlusion_query bgfx_destroy_occlusion_query;
/**
* Set palette color value.
* Params:
* _index = Index into palette.
* _rgba = RGBA floating point values.
*/
alias da_bgfx_set_palette_color = void function(byte _index, const float[4] _rgba);
da_bgfx_set_palette_color bgfx_set_palette_color;
/**
* Set palette color value.
* Params:
* _index = Index into palette.
* _rgba = Packed 32-bit RGBA value.
*/
alias da_bgfx_set_palette_color_rgba8 = void function(byte _index, uint _rgba);
da_bgfx_set_palette_color_rgba8 bgfx_set_palette_color_rgba8;
/**
* Set view name.
* Remarks:
* This is debug only feature.
* In graphics debugger view name will appear as:
* "nnnc <view name>"
* ^ ^ ^
* | +--- compute (C)
* +------ view id
* Params:
* _id = View id.
* _name = View name.
*/
alias da_bgfx_set_view_name = void function(bgfx_view_id_t _id, const(char)* _name);
da_bgfx_set_view_name bgfx_set_view_name;
/**
* Set view rectangle. Draw primitive outside view will be clipped.
* Params:
* _id = View id.
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Width of view port region.
* _height = Height of view port region.
*/
alias da_bgfx_set_view_rect = void function(bgfx_view_id_t _id, ushort _x, ushort _y, ushort _width, ushort _height);
da_bgfx_set_view_rect bgfx_set_view_rect;
/**
* Set view rectangle. Draw primitive outside view will be clipped.
* Params:
* _id = View id.
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _ratio = Width and height will be set in respect to back-buffer size.
* See: `BackbufferRatio::Enum`.
*/
alias da_bgfx_set_view_rect_ratio = void function(bgfx_view_id_t _id, ushort _x, ushort _y, bgfx_backbuffer_ratio_t _ratio);
da_bgfx_set_view_rect_ratio bgfx_set_view_rect_ratio;
/**
* Set view scissor. Draw primitive outside view will be clipped. When
* _x, _y, _width and _height are set to 0, scissor will be disabled.
* Params:
* _id = View id.
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Width of view scissor region.
* _height = Height of view scissor region.
*/
alias da_bgfx_set_view_scissor = void function(bgfx_view_id_t _id, ushort _x, ushort _y, ushort _width, ushort _height);
da_bgfx_set_view_scissor bgfx_set_view_scissor;
/**
* Set view clear flags.
* Params:
* _id = View id.
* _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
* operation. See: `BGFX_CLEAR_*`.
* _rgba = Color clear value.
* _depth = Depth clear value.
* _stencil = Stencil clear value.
*/
alias da_bgfx_set_view_clear = void function(bgfx_view_id_t _id, ushort _flags, uint _rgba, float _depth, byte _stencil);
da_bgfx_set_view_clear bgfx_set_view_clear;
/**
* Set view clear flags with different clear color for each
* frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
* palette.
* Params:
* _id = View id.
* _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
* operation. See: `BGFX_CLEAR_*`.
* _depth = Depth clear value.
* _stencil = Stencil clear value.
* _c0 = Palette index for frame buffer attachment 0.
* _c1 = Palette index for frame buffer attachment 1.
* _c2 = Palette index for frame buffer attachment 2.
* _c3 = Palette index for frame buffer attachment 3.
* _c4 = Palette index for frame buffer attachment 4.
* _c5 = Palette index for frame buffer attachment 5.
* _c6 = Palette index for frame buffer attachment 6.
* _c7 = Palette index for frame buffer attachment 7.
*/
alias da_bgfx_set_view_clear_mrt = void function(bgfx_view_id_t _id, ushort _flags, float _depth, byte _stencil, byte _c0, byte _c1, byte _c2, byte _c3, byte _c4, byte _c5, byte _c6, byte _c7);
da_bgfx_set_view_clear_mrt bgfx_set_view_clear_mrt;
/**
* Set view sorting mode.
* Remarks:
* View mode must be set prior calling `bgfx::submit` for the view.
* Params:
* _id = View id.
* _mode = View sort mode. See `ViewMode::Enum`.
*/
alias da_bgfx_set_view_mode = void function(bgfx_view_id_t _id, bgfx_view_mode_t _mode);
da_bgfx_set_view_mode bgfx_set_view_mode;
/**
* Set view frame buffer.
* Remarks:
* Not persistent after `bgfx::reset` call.
* Params:
* _id = View id.
* _handle = Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as
* frame buffer handle will draw primitives from this view into
* default back buffer.
*/
alias da_bgfx_set_view_frame_buffer = void function(bgfx_view_id_t _id, bgfx_frame_buffer_handle_t _handle);
da_bgfx_set_view_frame_buffer bgfx_set_view_frame_buffer;
/**
* Set view view and projection matrices, all draw primitives in this
* view will use these matrices.
* Params:
* _id = View id.
* _view = View matrix.
* _proj = Projection matrix.
*/
alias da_bgfx_set_view_transform = void function(bgfx_view_id_t _id, const(void)* _view, const(void)* _proj);
da_bgfx_set_view_transform bgfx_set_view_transform;
/**
* Post submit view reordering.
* Params:
* _id = First view id.
* _num = Number of views to remap.
* _order = View remap id table. Passing `NULL` will reset view ids
* to default state.
*/
alias da_bgfx_set_view_order = void function(bgfx_view_id_t _id, ushort _num, const(bgfx_view_id_t)* _order);
da_bgfx_set_view_order bgfx_set_view_order;
/**
* Reset all view settings to default.
*/
alias da_bgfx_reset_view = void function(bgfx_view_id_t _id);
da_bgfx_reset_view bgfx_reset_view;
/**
* Begin submitting draw calls from thread.
* Params:
* _forThread = Explicitly request an encoder for a worker thread.
*/
alias da_bgfx_encoder_begin = bgfx_encoder_t* function(bool _forThread);
da_bgfx_encoder_begin bgfx_encoder_begin;
/**
* End submitting draw calls from thread.
* Params:
* _encoder = Encoder.
*/
alias da_bgfx_encoder_end = void function(bgfx_encoder_t* _encoder);
da_bgfx_encoder_end bgfx_encoder_end;
/**
* Sets a debug marker. This allows you to group graphics calls together for easy browsing in
* graphics debugging tools.
* Params:
* _marker = Marker string.
*/
alias da_bgfx_encoder_set_marker = void function(bgfx_encoder_t* _this, const(char)* _marker);
da_bgfx_encoder_set_marker bgfx_encoder_set_marker;
/**
* Set render states for draw primitive.
* Remarks:
* 1. To setup more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
* `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
* `BGFX_STATE_BLEND_EQUATION(_equation)`,
* `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
* 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
* equation is specified.
* Params:
* _state = State flags. Default state for primitive type is
* triangles. See: `BGFX_STATE_DEFAULT`.
* - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.
* - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.
* - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
* - `BGFX_STATE_CULL_*` - Backface culling mode.
* - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.
* - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.
* - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
* _rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
* `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
*/
alias da_bgfx_encoder_set_state = void function(bgfx_encoder_t* _this, ulong _state, uint _rgba);
da_bgfx_encoder_set_state bgfx_encoder_set_state;
/**
* Set condition for rendering.
* Params:
* _handle = Occlusion query handle.
* _visible = Render if occlusion query is visible.
*/
alias da_bgfx_encoder_set_condition = void function(bgfx_encoder_t* _this, bgfx_occlusion_query_handle_t _handle, bool _visible);
da_bgfx_encoder_set_condition bgfx_encoder_set_condition;
/**
* Set stencil test state.
* Params:
* _fstencil = Front stencil state.
* _bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE`
* _fstencil is applied to both front and back facing primitives.
*/
alias da_bgfx_encoder_set_stencil = void function(bgfx_encoder_t* _this, uint _fstencil, uint _bstencil);
da_bgfx_encoder_set_stencil bgfx_encoder_set_stencil;
/**
* Set scissor for draw primitive.
* Remarks:
* To scissor for all primitives in view see `bgfx::setViewScissor`.
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Width of view scissor region.
* _height = Height of view scissor region.
*/
alias da_bgfx_encoder_set_scissor = ushort function(bgfx_encoder_t* _this, ushort _x, ushort _y, ushort _width, ushort _height);
da_bgfx_encoder_set_scissor bgfx_encoder_set_scissor;
/**
* Set scissor from cache for draw primitive.
* Remarks:
* To scissor for all primitives in view see `bgfx::setViewScissor`.
* Params:
* _cache = Index in scissor cache.
*/
alias da_bgfx_encoder_set_scissor_cached = void function(bgfx_encoder_t* _this, ushort _cache);
da_bgfx_encoder_set_scissor_cached bgfx_encoder_set_scissor_cached;
/**
* Set model matrix for draw primitive. If it is not called,
* the model will be rendered with an identity model matrix.
* Params:
* _mtx = Pointer to first matrix in array.
* _num = Number of matrices in array.
*/
alias da_bgfx_encoder_set_transform = uint function(bgfx_encoder_t* _this, const(void)* _mtx, ushort _num);
da_bgfx_encoder_set_transform bgfx_encoder_set_transform;
/**
* Set model matrix from matrix cache for draw primitive.
* Params:
* _cache = Index in matrix cache.
* _num = Number of matrices from cache.
*/
alias da_bgfx_encoder_set_transform_cached = void function(bgfx_encoder_t* _this, uint _cache, ushort _num);
da_bgfx_encoder_set_transform_cached bgfx_encoder_set_transform_cached;
/**
* Reserve matrices in internal matrix cache.
* Attention: Pointer returned can be modifed until `bgfx::frame` is called.
* Params:
* _transform = Pointer to `Transform` structure.
* _num = Number of matrices.
*/
alias da_bgfx_encoder_alloc_transform = uint function(bgfx_encoder_t* _this, bgfx_transform_t* _transform, ushort _num);
da_bgfx_encoder_alloc_transform bgfx_encoder_alloc_transform;
/**
* Set shader uniform parameter for draw primitive.
* Params:
* _handle = Uniform.
* _value = Pointer to uniform data.
* _num = Number of elements. Passing `UINT16_MAX` will
* use the _num passed on uniform creation.
*/
alias da_bgfx_encoder_set_uniform = void function(bgfx_encoder_t* _this, bgfx_uniform_handle_t _handle, const(void)* _value, ushort _num);
da_bgfx_encoder_set_uniform bgfx_encoder_set_uniform;
/**
* Set index buffer for draw primitive.
* Params:
* _handle = Index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
alias da_bgfx_encoder_set_index_buffer = void function(bgfx_encoder_t* _this, bgfx_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
da_bgfx_encoder_set_index_buffer bgfx_encoder_set_index_buffer;
/**
* Set index buffer for draw primitive.
* Params:
* _handle = Dynamic index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
alias da_bgfx_encoder_set_dynamic_index_buffer = void function(bgfx_encoder_t* _this, bgfx_dynamic_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
da_bgfx_encoder_set_dynamic_index_buffer bgfx_encoder_set_dynamic_index_buffer;
/**
* Set index buffer for draw primitive.
* Params:
* _tib = Transient index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
alias da_bgfx_encoder_set_transient_index_buffer = void function(bgfx_encoder_t* _this, const(bgfx_transient_index_buffer_t)* _tib, uint _firstIndex, uint _numIndices);
da_bgfx_encoder_set_transient_index_buffer bgfx_encoder_set_transient_index_buffer;
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _handle = Vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
* _layoutHandle = Vertex layout for aliasing vertex buffer. If invalid
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
alias da_bgfx_encoder_set_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_encoder_set_vertex_buffer bgfx_encoder_set_vertex_buffer;
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _handle = Dynamic vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
* _layoutHandle = Vertex layout for aliasing vertex buffer. If invalid
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
alias da_bgfx_encoder_set_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_encoder_set_dynamic_vertex_buffer bgfx_encoder_set_dynamic_vertex_buffer;
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _tvb = Transient vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
* _layoutHandle = Vertex layout for aliasing vertex buffer. If invalid
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
alias da_bgfx_encoder_set_transient_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_encoder_set_transient_vertex_buffer bgfx_encoder_set_transient_vertex_buffer;
/**
* Set number of vertices for auto generated vertices use in conjuction
* with gl_VertexID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
* Params:
* _numVertices = Number of vertices.
*/
alias da_bgfx_encoder_set_vertex_count = void function(bgfx_encoder_t* _this, uint _numVertices);
da_bgfx_encoder_set_vertex_count bgfx_encoder_set_vertex_count;
/**
* Set instance data buffer for draw primitive.
* Params:
* _idb = Transient instance data buffer.
* _start = First instance data.
* _num = Number of data instances.
*/
alias da_bgfx_encoder_set_instance_data_buffer = void function(bgfx_encoder_t* _this, const(bgfx_instance_data_buffer_t)* _idb, uint _start, uint _num);
da_bgfx_encoder_set_instance_data_buffer bgfx_encoder_set_instance_data_buffer;
/**
* Set instance data buffer for draw primitive.
* Params:
* _handle = Vertex buffer.
* _startVertex = First instance data.
* _num = Number of data instances.
* Set instance data buffer for draw primitive.
*/
alias da_bgfx_encoder_set_instance_data_from_vertex_buffer = void function(bgfx_encoder_t* _this, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
da_bgfx_encoder_set_instance_data_from_vertex_buffer bgfx_encoder_set_instance_data_from_vertex_buffer;
/**
* Set instance data buffer for draw primitive.
* Params:
* _handle = Dynamic vertex buffer.
* _startVertex = First instance data.
* _num = Number of data instances.
*/
alias da_bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
da_bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer;
/**
* Set number of instances for auto generated instances use in conjuction
* with gl_InstanceID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*/
alias da_bgfx_encoder_set_instance_count = void function(bgfx_encoder_t* _this, uint _numInstances);
da_bgfx_encoder_set_instance_count bgfx_encoder_set_instance_count;
/**
* Set texture stage for draw primitive.
* Params:
* _stage = Texture unit.
* _sampler = Program sampler.
* _handle = Texture handle.
* _flags = Texture sampling mode. Default value UINT32_MAX uses
* texture sampling settings from the texture.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
alias da_bgfx_encoder_set_texture = void function(bgfx_encoder_t* _this, byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
da_bgfx_encoder_set_texture bgfx_encoder_set_texture;
/**
* Submit an empty primitive for rendering. Uniforms and draw state
* will be applied but no geometry will be submitted. Useful in cases
* when no other draw/compute primitive is submitted to view, but it's
* desired to execute clear view.
* Remarks:
* These empty draw calls will sort before ordinary draw calls.
* Params:
* _id = View id.
*/
alias da_bgfx_encoder_touch = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id);
da_bgfx_encoder_touch bgfx_encoder_touch;
/**
* Submit primitive for rendering.
* Params:
* _id = View id.
* _program = Program.
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
alias da_bgfx_encoder_submit = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, byte _flags);
da_bgfx_encoder_submit bgfx_encoder_submit;
/**
* Submit primitive with occlusion query for rendering.
* Params:
* _id = View id.
* _program = Program.
* _occlusionQuery = Occlusion query.
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
alias da_bgfx_encoder_submit_occlusion_query = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, byte _flags);
da_bgfx_encoder_submit_occlusion_query bgfx_encoder_submit_occlusion_query;
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
* Params:
* _id = View id.
* _program = Program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
* _num = Number of dispatches.
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
alias da_bgfx_encoder_submit_indirect = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
da_bgfx_encoder_submit_indirect bgfx_encoder_submit_indirect;
/**
* Set compute index buffer.
* Params:
* _stage = Compute stage.
* _handle = Index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_encoder_set_compute_index_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_index_buffer bgfx_encoder_set_compute_index_buffer;
/**
* Set compute vertex buffer.
* Params:
* _stage = Compute stage.
* _handle = Vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_encoder_set_compute_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_vertex_buffer bgfx_encoder_set_compute_vertex_buffer;
/**
* Set compute dynamic index buffer.
* Params:
* _stage = Compute stage.
* _handle = Dynamic index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_encoder_set_compute_dynamic_index_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_dynamic_index_buffer bgfx_encoder_set_compute_dynamic_index_buffer;
/**
* Set compute dynamic vertex buffer.
* Params:
* _stage = Compute stage.
* _handle = Dynamic vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_encoder_set_compute_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_dynamic_vertex_buffer bgfx_encoder_set_compute_dynamic_vertex_buffer;
/**
* Set compute indirect buffer.
* Params:
* _stage = Compute stage.
* _handle = Indirect buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_encoder_set_compute_indirect_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_indirect_buffer bgfx_encoder_set_compute_indirect_buffer;
/**
* Set compute image from texture.
* Params:
* _stage = Compute stage.
* _handle = Texture handle.
* _mip = Mip level.
* _access = Image access. See `Access::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
alias da_bgfx_encoder_set_image = void function(bgfx_encoder_t* _this, byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
da_bgfx_encoder_set_image bgfx_encoder_set_image;
/**
* Dispatch compute.
* Params:
* _id = View id.
* _program = Compute program.
* _numX = Number of groups X.
* _numY = Number of groups Y.
* _numZ = Number of groups Z.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
alias da_bgfx_encoder_dispatch = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, byte _flags);
da_bgfx_encoder_dispatch bgfx_encoder_dispatch;
/**
* Dispatch compute indirect.
* Params:
* _id = View id.
* _program = Compute program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
* _num = Number of dispatches.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
alias da_bgfx_encoder_dispatch_indirect = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, byte _flags);
da_bgfx_encoder_dispatch_indirect bgfx_encoder_dispatch_indirect;
/**
* Discard previously set state for draw or compute call.
* Params:
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
alias da_bgfx_encoder_discard = void function(bgfx_encoder_t* _this, byte _flags);
da_bgfx_encoder_discard bgfx_encoder_discard;
/**
* Blit 2D texture region between two 2D textures.
* Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
* Params:
* _id = View id.
* _dst = Destination texture handle.
* _dstMip = Destination texture mip level.
* _dstX = Destination texture X position.
* _dstY = Destination texture Y position.
* _dstZ = If texture is 2D this argument should be 0. If destination texture is cube
* this argument represents destination texture cube face. For 3D texture this argument
* represents destination texture Z position.
* _src = Source texture handle.
* _srcMip = Source texture mip level.
* _srcX = Source texture X position.
* _srcY = Source texture Y position.
* _srcZ = If texture is 2D this argument should be 0. If source texture is cube
* this argument represents source texture cube face. For 3D texture this argument
* represents source texture Z position.
* _width = Width of region.
* _height = Height of region.
* _depth = If texture is 3D this argument represents depth of region, otherwise it's
* unused.
*/
alias da_bgfx_encoder_blit = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
da_bgfx_encoder_blit bgfx_encoder_blit;
/**
* Request screen shot of window back buffer.
* Remarks:
* `bgfx::CallbackI::screenShot` must be implemented.
* Attention: Frame buffer handle must be created with OS' target native window handle.
* Params:
* _handle = Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be
* made for main window back buffer.
* _filePath = Will be passed to `bgfx::CallbackI::screenShot` callback.
*/
alias da_bgfx_request_screen_shot = void function(bgfx_frame_buffer_handle_t _handle, const(char)* _filePath);
da_bgfx_request_screen_shot bgfx_request_screen_shot;
/**
* Render frame.
* Attention: `bgfx::renderFrame` is blocking call. It waits for
* `bgfx::frame` to be called from API thread to process frame.
* If timeout value is passed call will timeout and return even
* if `bgfx::frame` is not called.
* Warning: This call should be only used on platforms that don't
* allow creating separate rendering thread. If it is called before
* to bgfx::init, render thread won't be created by bgfx::init call.
* Params:
* _msecs = Timeout in milliseconds.
*/
alias da_bgfx_render_frame = bgfx_render_frame_t function(int _msecs);
da_bgfx_render_frame bgfx_render_frame;
/**
* Set platform data.
* Warning: Must be called before `bgfx::init`.
* Params:
* _data = Platform data.
*/
alias da_bgfx_set_platform_data = void function(const(bgfx_platform_data_t)* _data);
da_bgfx_set_platform_data bgfx_set_platform_data;
/**
* Get internal data for interop.
* Attention: It's expected you understand some bgfx internals before you
* use this call.
* Warning: Must be called only on render thread.
*/
alias da_bgfx_get_internal_data = const(bgfx_internal_data_t)* function();
da_bgfx_get_internal_data bgfx_get_internal_data;
/**
* Override internal texture with externally created texture. Previously
* created internal texture will released.
* Attention: It's expected you understand some bgfx internals before you
* use this call.
* Warning: Must be called only on render thread.
* Params:
* _handle = Texture handle.
* _ptr = Native API pointer to texture.
*/
alias da_bgfx_override_internal_texture_ptr = ulong function(bgfx_texture_handle_t _handle, ulong _ptr);
da_bgfx_override_internal_texture_ptr bgfx_override_internal_texture_ptr;
/**
* Override internal texture by creating new texture. Previously created
* internal texture will released.
* Attention: It's expected you understand some bgfx internals before you
* use this call.
* Returns: Native API pointer to texture. If result is 0, texture is not created yet from the
* main thread.
* Warning: Must be called only on render thread.
* Params:
* _handle = Texture handle.
* _width = Width.
* _height = Height.
* _numMips = Number of mip-maps.
* _format = Texture format. See: `TextureFormat::Enum`.
* _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
* flags. Default texture sampling mode is linear, and wrap mode is repeat.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
alias da_bgfx_override_internal_texture = ulong function(bgfx_texture_handle_t _handle, ushort _width, ushort _height, byte _numMips, bgfx_texture_format_t _format, ulong _flags);
da_bgfx_override_internal_texture bgfx_override_internal_texture;
/**
* Sets a debug marker. This allows you to group graphics calls together for easy browsing in
* graphics debugging tools.
* Params:
* _marker = Marker string.
*/
alias da_bgfx_set_marker = void function(const(char)* _marker);
da_bgfx_set_marker bgfx_set_marker;
/**
* Set render states for draw primitive.
* Remarks:
* 1. To setup more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
* `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
* `BGFX_STATE_BLEND_EQUATION(_equation)`,
* `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
* 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
* equation is specified.
* Params:
* _state = State flags. Default state for primitive type is
* triangles. See: `BGFX_STATE_DEFAULT`.
* - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.
* - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.
* - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
* - `BGFX_STATE_CULL_*` - Backface culling mode.
* - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.
* - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.
* - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
* _rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
* `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
*/
alias da_bgfx_set_state = void function(ulong _state, uint _rgba);
da_bgfx_set_state bgfx_set_state;
/**
* Set condition for rendering.
* Params:
* _handle = Occlusion query handle.
* _visible = Render if occlusion query is visible.
*/
alias da_bgfx_set_condition = void function(bgfx_occlusion_query_handle_t _handle, bool _visible);
da_bgfx_set_condition bgfx_set_condition;
/**
* Set stencil test state.
* Params:
* _fstencil = Front stencil state.
* _bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE`
* _fstencil is applied to both front and back facing primitives.
*/
alias da_bgfx_set_stencil = void function(uint _fstencil, uint _bstencil);
da_bgfx_set_stencil bgfx_set_stencil;
/**
* Set scissor for draw primitive.
* Remarks:
* To scissor for all primitives in view see `bgfx::setViewScissor`.
* Params:
* _x = Position x from the left corner of the window.
* _y = Position y from the top corner of the window.
* _width = Width of view scissor region.
* _height = Height of view scissor region.
*/
alias da_bgfx_set_scissor = ushort function(ushort _x, ushort _y, ushort _width, ushort _height);
da_bgfx_set_scissor bgfx_set_scissor;
/**
* Set scissor from cache for draw primitive.
* Remarks:
* To scissor for all primitives in view see `bgfx::setViewScissor`.
* Params:
* _cache = Index in scissor cache.
*/
alias da_bgfx_set_scissor_cached = void function(ushort _cache);
da_bgfx_set_scissor_cached bgfx_set_scissor_cached;
/**
* Set model matrix for draw primitive. If it is not called,
* the model will be rendered with an identity model matrix.
* Params:
* _mtx = Pointer to first matrix in array.
* _num = Number of matrices in array.
*/
alias da_bgfx_set_transform = uint function(const(void)* _mtx, ushort _num);
da_bgfx_set_transform bgfx_set_transform;
/**
* Set model matrix from matrix cache for draw primitive.
* Params:
* _cache = Index in matrix cache.
* _num = Number of matrices from cache.
*/
alias da_bgfx_set_transform_cached = void function(uint _cache, ushort _num);
da_bgfx_set_transform_cached bgfx_set_transform_cached;
/**
* Reserve matrices in internal matrix cache.
* Attention: Pointer returned can be modifed until `bgfx::frame` is called.
* Params:
* _transform = Pointer to `Transform` structure.
* _num = Number of matrices.
*/
alias da_bgfx_alloc_transform = uint function(bgfx_transform_t* _transform, ushort _num);
da_bgfx_alloc_transform bgfx_alloc_transform;
/**
* Set shader uniform parameter for draw primitive.
* Params:
* _handle = Uniform.
* _value = Pointer to uniform data.
* _num = Number of elements. Passing `UINT16_MAX` will
* use the _num passed on uniform creation.
*/
alias da_bgfx_set_uniform = void function(bgfx_uniform_handle_t _handle, const(void)* _value, ushort _num);
da_bgfx_set_uniform bgfx_set_uniform;
/**
* Set index buffer for draw primitive.
* Params:
* _handle = Index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
alias da_bgfx_set_index_buffer = void function(bgfx_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
da_bgfx_set_index_buffer bgfx_set_index_buffer;
/**
* Set index buffer for draw primitive.
* Params:
* _handle = Dynamic index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
alias da_bgfx_set_dynamic_index_buffer = void function(bgfx_dynamic_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
da_bgfx_set_dynamic_index_buffer bgfx_set_dynamic_index_buffer;
/**
* Set index buffer for draw primitive.
* Params:
* _tib = Transient index buffer.
* _firstIndex = First index to render.
* _numIndices = Number of indices to render.
*/
alias da_bgfx_set_transient_index_buffer = void function(const(bgfx_transient_index_buffer_t)* _tib, uint _firstIndex, uint _numIndices);
da_bgfx_set_transient_index_buffer bgfx_set_transient_index_buffer;
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _handle = Vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
alias da_bgfx_set_vertex_buffer = void function(byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
da_bgfx_set_vertex_buffer bgfx_set_vertex_buffer;
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _handle = Dynamic vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
alias da_bgfx_set_dynamic_vertex_buffer = void function(byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
da_bgfx_set_dynamic_vertex_buffer bgfx_set_dynamic_vertex_buffer;
/**
* Set vertex buffer for draw primitive.
* Params:
* _stream = Vertex stream.
* _tvb = Transient vertex buffer.
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
alias da_bgfx_set_transient_vertex_buffer = void function(byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
da_bgfx_set_transient_vertex_buffer bgfx_set_transient_vertex_buffer;
/**
* Set number of vertices for auto generated vertices use in conjuction
* with gl_VertexID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
* Params:
* _numVertices = Number of vertices.
*/
alias da_bgfx_set_vertex_count = void function(uint _numVertices);
da_bgfx_set_vertex_count bgfx_set_vertex_count;
/**
* Set instance data buffer for draw primitive.
* Params:
* _idb = Transient instance data buffer.
* _start = First instance data.
* _num = Number of data instances.
*/
alias da_bgfx_set_instance_data_buffer = void function(const(bgfx_instance_data_buffer_t)* _idb, uint _start, uint _num);
da_bgfx_set_instance_data_buffer bgfx_set_instance_data_buffer;
/**
* Set instance data buffer for draw primitive.
* Params:
* _handle = Vertex buffer.
* _startVertex = First instance data.
* _num = Number of data instances.
* Set instance data buffer for draw primitive.
*/
alias da_bgfx_set_instance_data_from_vertex_buffer = void function(bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
da_bgfx_set_instance_data_from_vertex_buffer bgfx_set_instance_data_from_vertex_buffer;
/**
* Set instance data buffer for draw primitive.
* Params:
* _handle = Dynamic vertex buffer.
* _startVertex = First instance data.
* _num = Number of data instances.
*/
alias da_bgfx_set_instance_data_from_dynamic_vertex_buffer = void function(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
da_bgfx_set_instance_data_from_dynamic_vertex_buffer bgfx_set_instance_data_from_dynamic_vertex_buffer;
/**
* Set number of instances for auto generated instances use in conjuction
* with gl_InstanceID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*/
alias da_bgfx_set_instance_count = void function(uint _numInstances);
da_bgfx_set_instance_count bgfx_set_instance_count;
/**
* Set texture stage for draw primitive.
* Params:
* _stage = Texture unit.
* _sampler = Program sampler.
* _handle = Texture handle.
* _flags = Texture sampling mode. Default value UINT32_MAX uses
* texture sampling settings from the texture.
* - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
* mode.
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
alias da_bgfx_set_texture = void function(byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
da_bgfx_set_texture bgfx_set_texture;
/**
* Submit an empty primitive for rendering. Uniforms and draw state
* will be applied but no geometry will be submitted.
* Remarks:
* These empty draw calls will sort before ordinary draw calls.
* Params:
* _id = View id.
*/
alias da_bgfx_touch = void function(bgfx_view_id_t _id);
da_bgfx_touch bgfx_touch;
/**
* Submit primitive for rendering.
* Params:
* _id = View id.
* _program = Program.
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See BGFX_DISCARD_
*/
alias da_bgfx_submit = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, byte _flags);
da_bgfx_submit bgfx_submit;
/**
* Submit primitive with occlusion query for rendering.
* Params:
* _id = View id.
* _program = Program.
* _occlusionQuery = Occlusion query.
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See BGFX_DISCARD_
*/
alias da_bgfx_submit_occlusion_query = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, byte _flags);
da_bgfx_submit_occlusion_query bgfx_submit_occlusion_query;
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
* Params:
* _id = View id.
* _program = Program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
* _num = Number of dispatches.
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See BGFX_DISCARD_
*/
alias da_bgfx_submit_indirect = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
da_bgfx_submit_indirect bgfx_submit_indirect;
/**
* Set compute index buffer.
* Params:
* _stage = Compute stage.
* _handle = Index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_set_compute_index_buffer = void function(byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_index_buffer bgfx_set_compute_index_buffer;
/**
* Set compute vertex buffer.
* Params:
* _stage = Compute stage.
* _handle = Vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_set_compute_vertex_buffer = void function(byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_vertex_buffer bgfx_set_compute_vertex_buffer;
/**
* Set compute dynamic index buffer.
* Params:
* _stage = Compute stage.
* _handle = Dynamic index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_set_compute_dynamic_index_buffer = void function(byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_dynamic_index_buffer bgfx_set_compute_dynamic_index_buffer;
/**
* Set compute dynamic vertex buffer.
* Params:
* _stage = Compute stage.
* _handle = Dynamic vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_set_compute_dynamic_vertex_buffer = void function(byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_dynamic_vertex_buffer bgfx_set_compute_dynamic_vertex_buffer;
/**
* Set compute indirect buffer.
* Params:
* _stage = Compute stage.
* _handle = Indirect buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
alias da_bgfx_set_compute_indirect_buffer = void function(byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_indirect_buffer bgfx_set_compute_indirect_buffer;
/**
* Set compute image from texture.
* Params:
* _stage = Compute stage.
* _handle = Texture handle.
* _mip = Mip level.
* _access = Image access. See `Access::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
alias da_bgfx_set_image = void function(byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
da_bgfx_set_image bgfx_set_image;
/**
* Dispatch compute.
* Params:
* _id = View id.
* _program = Compute program.
* _numX = Number of groups X.
* _numY = Number of groups Y.
* _numZ = Number of groups Z.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
alias da_bgfx_dispatch = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, byte _flags);
da_bgfx_dispatch bgfx_dispatch;
/**
* Dispatch compute indirect.
* Params:
* _id = View id.
* _program = Compute program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
* _num = Number of dispatches.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
alias da_bgfx_dispatch_indirect = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, byte _flags);
da_bgfx_dispatch_indirect bgfx_dispatch_indirect;
/**
* Discard previously set state for draw or compute call.
* Params:
* _flags = Draw/compute states to discard.
*/
alias da_bgfx_discard = void function(byte _flags);
da_bgfx_discard bgfx_discard;
/**
* Blit 2D texture region between two 2D textures.
* Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
* Params:
* _id = View id.
* _dst = Destination texture handle.
* _dstMip = Destination texture mip level.
* _dstX = Destination texture X position.
* _dstY = Destination texture Y position.
* _dstZ = If texture is 2D this argument should be 0. If destination texture is cube
* this argument represents destination texture cube face. For 3D texture this argument
* represents destination texture Z position.
* _src = Source texture handle.
* _srcMip = Source texture mip level.
* _srcX = Source texture X position.
* _srcY = Source texture Y position.
* _srcZ = If texture is 2D this argument should be 0. If source texture is cube
* this argument represents source texture cube face. For 3D texture this argument
* represents source texture Z position.
* _width = Width of region.
* _height = Height of region.
* _depth = If texture is 3D this argument represents depth of region, otherwise it's
* unused.
*/
alias da_bgfx_blit = void function(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
da_bgfx_blit bgfx_blit;
}
}
|
D
|
// Written in the D programming language.
/**
Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_ascending_page_allocator.d)
*/
module std.experimental.allocator.building_blocks.ascending_page_allocator;
import std.experimental.allocator.common;
// Common implementations for shared and thread local AscendingPageAllocator
private mixin template AscendingPageAllocatorImpl(bool isShared)
{
bool deallocate(void[] buf) nothrow @nogc
{
size_t goodSize = goodAllocSize(buf.length);
version(Posix)
{
import core.sys.posix.sys.mman : mmap, MAP_FAILED, MAP_PRIVATE,
MAP_ANON, MAP_FIXED, PROT_NONE, munmap;
auto ptr = mmap(buf.ptr, goodSize, PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, 0);
if (ptr == MAP_FAILED)
return false;
}
else version(Windows)
{
import core.sys.windows.windows : VirtualFree, MEM_RELEASE, MEM_DECOMMIT;
auto ret = VirtualFree(buf.ptr, goodSize, MEM_DECOMMIT);
if (ret == 0)
return false;
}
else
{
static assert(0, "Unsupported OS");
}
static if (!isShared)
{
pagesUsed -= goodSize / pageSize;
}
return true;
}
Ternary owns(void[] buf) nothrow @nogc
{
if (!data)
return Ternary.no;
return Ternary(buf.ptr >= data && buf.ptr < buf.ptr + numPages * pageSize);
}
bool deallocateAll() nothrow @nogc
{
version(Posix)
{
import core.sys.posix.sys.mman : munmap;
auto ret = munmap(cast(void*) data, numPages * pageSize);
if (ret != 0)
assert(0, "Failed to unmap memory, munmap failure");
}
else version(Windows)
{
import core.sys.windows.windows : VirtualFree, MEM_RELEASE;
auto ret = VirtualFree(cast(void*) data, 0, MEM_RELEASE);
if (ret == 0)
assert(0, "Failed to unmap memory, VirtualFree failure");
}
else
{
static assert(0, "Unsupported OS version");
}
data = null;
offset = null;
return true;
}
size_t goodAllocSize(size_t n) nothrow @nogc
{
return n.roundUpToMultipleOf(cast(uint) pageSize);
}
this(size_t n) nothrow @nogc
{
static if (isShared)
{
lock = SpinLock(SpinLock.Contention.brief);
}
version(Posix)
{
import core.sys.posix.sys.mman : mmap, MAP_ANON, PROT_NONE,
MAP_PRIVATE, MAP_FAILED;
import core.sys.posix.unistd : sysconf, _SC_PAGESIZE;
pageSize = cast(size_t) sysconf(_SC_PAGESIZE);
numPages = n.roundUpToMultipleOf(cast(uint) pageSize) / pageSize;
data = cast(typeof(data)) mmap(null, pageSize * numPages,
PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
if (data == MAP_FAILED)
assert(0, "Failed to mmap memory");
}
else version(Windows)
{
import core.sys.windows.windows : VirtualAlloc, PAGE_NOACCESS,
MEM_RESERVE, GetSystemInfo, SYSTEM_INFO;
SYSTEM_INFO si;
GetSystemInfo(&si);
pageSize = cast(size_t) si.dwPageSize;
numPages = n.roundUpToMultipleOf(cast(uint) pageSize) / pageSize;
data = cast(typeof(data)) VirtualAlloc(null, pageSize * numPages,
MEM_RESERVE, PAGE_NOACCESS);
if (!data)
assert(0, "Failed to VirtualAlloc memory");
}
else
{
static assert(0, "Unsupported OS version");
}
offset = data;
readWriteLimit = data;
}
size_t getAvailableSize() nothrow @nogc
{
static if (isShared)
{
lock.lock();
}
auto size = numPages * pageSize + data - offset;
static if (isShared)
{
lock.unlock();
}
return size;
}
// Sets the protection of a memory range to read/write
private bool extendMemoryProtection(void* start, size_t size) nothrow @nogc
{
version(Posix)
{
import core.sys.posix.sys.mman : mprotect, PROT_WRITE, PROT_READ;
auto ret = mprotect(start, size, PROT_WRITE | PROT_READ);
return ret == 0;
}
else version(Windows)
{
import core.sys.windows.windows : VirtualAlloc, MEM_COMMIT, PAGE_READWRITE;
auto ret = VirtualAlloc(start, size, MEM_COMMIT, PAGE_READWRITE);
return ret != null;
}
else
{
static assert(0, "Unsupported OS");
}
}
}
/**
`AscendingPageAllocator` is a fast and safe allocator that rounds all allocations
to multiples of the system's page size. It reserves a range of virtual addresses
(using `mmap` on Posix and `VirtualAlloc` on Windows) and allocates memory at consecutive virtual
addresses.
When a chunk of memory is requested, the allocator finds a range of
virtual pages that satisfy the requested size, changing their protection to
read/write using OS primitives (`mprotect` and `VirtualProtect`, respectively).
The physical memory is allocated on demand, when the pages are accessed.
Deallocation removes any read/write permissions from the target pages
and notifies the OS to reclaim the physical memory, while keeping the virtual
memory.
Because the allocator does not reuse memory, any dangling references to
deallocated memory will always result in deterministically crashing the process.
See_Also:
$(HTTPS microsoft.com/en-us/research/wp-content/uploads/2017/03/kedia2017mem.pdf, Simple Fast and Safe Manual Memory Management) for the general approach.
*/
struct AscendingPageAllocator
{
import std.typecons : Ternary;
// Docs for mixin functions
version (StdDdoc)
{
/**
Rounds the mapping size to the next multiple of the page size and calls
the OS primitive responsible for creating memory mappings: `mmap` on POSIX and
`VirtualAlloc` on Windows.
Params:
n = mapping size in bytes
*/
this(size_t n) nothrow @nogc;
/**
Rounds the requested size to the next multiple of the page size.
*/
size_t goodAllocSize(size_t n) nothrow @nogc;
/**
Decommit all physical memory associated with the buffer given as parameter,
but keep the range of virtual addresses.
On POSIX systems `deallocate` calls `mmap` with `MAP_FIXED' a second time to decommit the memory.
On Windows, it uses `VirtualFree` with `MEM_DECOMMIT`.
*/
void deallocate(void[] b) nothrow @nogc;
/**
Returns `Ternary.yes` if the passed buffer is inside the range of virtual adresses.
Does not guarantee that the passed buffer is still valid.
*/
Ternary owns(void[] buf) nothrow @nogc;
/**
Removes the memory mapping causing all physical memory to be decommited and
the virtual address space to be reclaimed.
*/
bool deallocateAll() nothrow @nogc;
/**
Returns the available size for further allocations in bytes.
*/
size_t getAvailableSize() nothrow @nogc;
}
private:
size_t pageSize;
size_t numPages;
// The start of the virtual address range
void* data;
// Keeps track of there the next allocation should start
void* offset;
// Number of pages which contain alive objects
size_t pagesUsed;
// On allocation requests, we allocate an extra 'extraAllocPages' pages
// The address up to which we have permissions is stored in 'readWriteLimit'
void* readWriteLimit;
enum extraAllocPages = 1000;
public:
enum uint alignment = 4096;
// Inject common function implementations
mixin AscendingPageAllocatorImpl!false;
/**
Rounds the allocation size to the next multiple of the page size.
The allocation only reserves a range of virtual pages but the actual
physical memory is allocated on demand, when accessing the memory.
Params:
n = Bytes to allocate
Returns:
`null` on failure or if the requested size exceeds the remaining capacity.
*/
void[] allocate(size_t n) nothrow @nogc
{
import std.algorithm.comparison : min;
immutable pagedBytes = numPages * pageSize;
size_t goodSize = goodAllocSize(n);
// Requested exceeds the virtual memory range
if (goodSize > pagedBytes || offset - data > pagedBytes - goodSize)
return null;
// Current allocation exceeds readable/writable memory area
if (offset + goodSize > readWriteLimit)
{
// Extend r/w memory range to new limit
void* newReadWriteLimit = min(data + pagedBytes,
offset + goodSize + extraAllocPages * pageSize);
if (newReadWriteLimit != readWriteLimit)
{
assert(newReadWriteLimit > readWriteLimit);
if (!extendMemoryProtection(readWriteLimit, newReadWriteLimit - readWriteLimit))
return null;
readWriteLimit = newReadWriteLimit;
}
}
void* result = offset;
offset += goodSize;
pagesUsed += goodSize / pageSize;
return cast(void[]) result[0 .. n];
}
/**
Rounds the allocation size to the next multiple of the page size.
The allocation only reserves a range of virtual pages but the actual
physical memory is allocated on demand, when accessing the memory.
The allocated memory is aligned to the specified alignment `a`.
Params:
n = Bytes to allocate
a = Alignment
Returns:
`null` on failure or if the requested size exceeds the remaining capacity.
*/
void[] alignedAllocate(size_t n, uint a) nothrow @nogc
{
void* alignedStart = cast(void*) roundUpToMultipleOf(cast(size_t) offset, a);
assert(alignedStart.alignedAt(a));
immutable pagedBytes = numPages * pageSize;
size_t goodSize = goodAllocSize(n);
if (goodSize > pagedBytes ||
alignedStart - data > pagedBytes - goodSize)
return null;
// Same logic as allocate, only that the buffer must be properly aligned
auto oldOffset = offset;
offset = alignedStart;
auto result = allocate(n);
if (!result)
offset = oldOffset;
return result;
}
/**
If the passed buffer is not the last allocation, then `delta` can be
at most the number of bytes left on the last page.
Otherwise, we can expand the last allocation until the end of the virtual
address range.
*/
bool expand(ref void[] b, size_t delta) nothrow @nogc
{
import std.algorithm.comparison : min;
if (!delta) return true;
if (b is null) return false;
size_t goodSize = goodAllocSize(b.length);
size_t bytesLeftOnPage = goodSize - b.length;
// If this is not the last allocation, we can only expand until
// completely filling the last page covered by this buffer
if (b.ptr + goodSize != offset && delta > bytesLeftOnPage)
return false;
size_t extraPages = 0;
// If the extra `delta` bytes requested do not fit the last page
// compute how many extra pages are neeeded
if (delta > bytesLeftOnPage)
{
extraPages = goodAllocSize(delta - bytesLeftOnPage) / pageSize;
}
else
{
b = cast(void[]) b.ptr[0 .. b.length + delta];
return true;
}
if (extraPages > numPages || offset - data > pageSize * (numPages - extraPages))
return false;
void* newPtrEnd = b.ptr + goodSize + extraPages * pageSize;
if (newPtrEnd > readWriteLimit)
{
void* newReadWriteLimit = min(data + numPages * pageSize,
newPtrEnd + extraAllocPages * pageSize);
if (newReadWriteLimit > readWriteLimit)
{
if (!extendMemoryProtection(readWriteLimit, newReadWriteLimit - readWriteLimit))
return false;
readWriteLimit = newReadWriteLimit;
}
}
pagesUsed += extraPages;
offset += extraPages * pageSize;
b = cast(void[]) b.ptr[0 .. b.length + delta];
return true;
}
/**
Returns `Ternary.yes` if the allocator does not contain any alive objects
and `Ternary.no` otherwise.
*/
Ternary empty() nothrow @nogc
{
return Ternary(pagesUsed == 0);
}
/**
Unmaps the whole virtual address range on destruction.
*/
~this() nothrow @nogc
{
if (data)
deallocateAll();
}
}
///
@system @nogc nothrow unittest
{
size_t pageSize = 4096;
size_t numPages = 100;
void[] buf;
void[] prevBuf = null;
AscendingPageAllocator a = AscendingPageAllocator(numPages * pageSize);
foreach (i; 0 .. numPages)
{
// Allocation is rounded up to page size
buf = a.allocate(pageSize - 100);
assert(buf.length == pageSize - 100);
// Allocations are served at increasing addresses
if (prevBuf)
assert(prevBuf.ptr + pageSize == buf.ptr);
assert(a.deallocate(buf));
prevBuf = buf;
}
}
/**
`SharedAscendingPageAllocator` is the threadsafe version of `AscendingPageAllocator`.
*/
shared struct SharedAscendingPageAllocator
{
import std.typecons : Ternary;
import core.internal.spinlock : SpinLock;
// Docs for mixin functions
version (StdDdoc)
{
/**
Rounds the mapping size to the next multiple of the page size and calls
the OS primitive responsible for creating memory mappings: `mmap` on POSIX and
`VirtualAlloc` on Windows.
Params:
n = mapping size in bytes
*/
this(size_t n) nothrow @nogc;
/**
Rounds the requested size to the next multiple of the page size.
*/
size_t goodAllocSize(size_t n) nothrow @nogc;
/**
Decommit all physical memory associated with the buffer given as parameter,
but keep the range of virtual addresses.
On POSIX systems `deallocate` calls `mmap` with `MAP_FIXED' a second time to decommit the memory.
On Windows, it uses `VirtualFree` with `MEM_DECOMMIT`.
*/
void deallocate(void[] b) nothrow @nogc;
/**
Returns `Ternary.yes` if the passed buffer is inside the range of virtual adresses.
Does not guarantee that the passed buffer is still valid.
*/
Ternary owns(void[] buf) nothrow @nogc;
/**
Removes the memory mapping causing all physical memory to be decommited and
the virtual address space to be reclaimed.
*/
bool deallocateAll() nothrow @nogc;
/**
Returns the available size for further allocations in bytes.
*/
size_t getAvailableSize() nothrow @nogc;
}
private:
size_t pageSize;
size_t numPages;
// The start of the virtual address range
shared void* data;
// Keeps track of there the next allocation should start
shared void* offset;
// On allocation requests, we allocate an extra 'extraAllocPages' pages
// The address up to which we have permissions is stored in 'readWriteLimit'
shared void* readWriteLimit;
enum extraAllocPages = 1000;
SpinLock lock;
public:
enum uint alignment = 4096;
// Inject common function implementations
mixin AscendingPageAllocatorImpl!true;
/**
Rounds the allocation size to the next multiple of the page size.
The allocation only reserves a range of virtual pages but the actual
physical memory is allocated on demand, when accessing the memory.
Params:
n = Bytes to allocate
Returns:
`null` on failure or if the requested size exceeds the remaining capacity.
*/
void[] allocate(size_t n) nothrow @nogc
{
return allocateImpl(n, 1);
}
/**
Rounds the allocation size to the next multiple of the page size.
The allocation only reserves a range of virtual pages but the actual
physical memory is allocated on demand, when accessing the memory.
The allocated memory is aligned to the specified alignment `a`.
Params:
n = Bytes to allocate
a = Alignment
Returns:
`null` on failure or if the requested size exceeds the remaining capacity.
*/
void[] alignedAllocate(size_t n, uint a) nothrow @nogc
{
// For regular `allocate` calls, `a` will be set to 1
return allocateImpl(n, a);
}
private void[] allocateImpl(size_t n, uint a) nothrow @nogc
{
import std.algorithm.comparison : min;
size_t localExtraAlloc;
void* localOffset;
immutable pagedBytes = numPages * pageSize;
size_t goodSize = goodAllocSize(n);
if (goodSize > pagedBytes)
return null;
lock.lock();
scope(exit) lock.unlock();
localOffset = cast(void*) offset;
void* alignedStart = cast(void*) roundUpToMultipleOf(cast(size_t) localOffset, a);
assert(alignedStart.alignedAt(a));
if (alignedStart - data > pagedBytes - goodSize)
return null;
localOffset = alignedStart + goodSize;
if (localOffset > readWriteLimit)
{
void* newReadWriteLimit = min(cast(void*) data + pagedBytes,
cast(void*) localOffset + extraAllocPages * pageSize);
assert(newReadWriteLimit > readWriteLimit);
localExtraAlloc = newReadWriteLimit - readWriteLimit;
if (!extendMemoryProtection(cast(void*) readWriteLimit, localExtraAlloc))
return null;
readWriteLimit = cast(shared(void*)) newReadWriteLimit;
}
offset = cast(typeof(offset)) localOffset;
return cast(void[]) alignedStart[0 .. n];
}
/**
If the passed buffer is not the last allocation, then `delta` can be
at most the number of bytes left on the last page.
Otherwise, we can expand the last allocation until the end of the virtual
address range.
*/
bool expand(ref void[] b, size_t delta) nothrow @nogc
{
import std.algorithm.comparison : min;
if (!delta) return true;
if (b is null) return false;
void* localOffset;
size_t localExtraAlloc;
size_t goodSize = goodAllocSize(b.length);
size_t bytesLeftOnPage = goodSize - b.length;
if (bytesLeftOnPage >= delta)
{
b = cast(void[]) b.ptr[0 .. b.length + delta];
return true;
}
lock.lock();
scope(exit) lock.unlock();
localOffset = cast(void*) offset;
if (b.ptr + goodSize != localOffset)
return false;
size_t extraPages = goodAllocSize(delta - bytesLeftOnPage) / pageSize;
if (extraPages > numPages || localOffset - data > pageSize * (numPages - extraPages))
return false;
localOffset = b.ptr + goodSize + extraPages * pageSize;
if (localOffset > readWriteLimit)
{
void* newReadWriteLimit = min(cast(void*) data + numPages * pageSize,
localOffset + extraAllocPages * pageSize);
assert(newReadWriteLimit > readWriteLimit);
localExtraAlloc = newReadWriteLimit - readWriteLimit;
if (!extendMemoryProtection(cast(void*) readWriteLimit, localExtraAlloc))
return false;
readWriteLimit = cast(shared(void*)) newReadWriteLimit;
}
offset = cast(typeof(offset)) localOffset;
b = cast(void[]) b.ptr[0 .. b.length + delta];
return true;
}
}
///
@system unittest
{
import core.thread : ThreadGroup;
enum numThreads = 100;
enum pageSize = 4096;
shared SharedAscendingPageAllocator a = SharedAscendingPageAllocator(pageSize * numThreads);
void fun()
{
void[] b = a.allocate(pageSize);
assert(b.length == pageSize);
assert(a.deallocate(b));
}
auto tg = new ThreadGroup;
foreach (i; 0 .. numThreads)
{
tg.create(&fun);
}
tg.joinAll();
}
version(unittest)
{
static void testrw(void[] b) @nogc nothrow
{
ubyte* buf = cast(ubyte*) b.ptr;
buf[0] = 100;
assert(buf[0] == 100);
buf[b.length - 1] = 101;
assert(buf[b.length - 1] == 101);
}
static size_t getPageSize() @nogc nothrow
{
size_t pageSize;
version(Posix)
{
import core.sys.posix.unistd : sysconf, _SC_PAGESIZE;
pageSize = cast(size_t) sysconf(_SC_PAGESIZE);
}
else version(Windows)
{
import core.sys.windows.windows : GetSystemInfo, SYSTEM_INFO;
SYSTEM_INFO si;
GetSystemInfo(&si);
pageSize = cast(size_t) si.dwPageSize;
}
return pageSize;
}
}
@system @nogc nothrow unittest
{
static void testAlloc(Allocator)(ref Allocator a) @nogc nothrow
{
size_t pageSize = getPageSize();
void[] b1 = a.allocate(1);
assert(a.getAvailableSize() == 3 * pageSize);
testrw(b1);
void[] b2 = a.allocate(2);
assert(a.getAvailableSize() == 2 * pageSize);
testrw(b2);
void[] b3 = a.allocate(pageSize + 1);
assert(a.getAvailableSize() == 0);
testrw(b3);
assert(b1.length == 1);
assert(b2.length == 2);
assert(b3.length == pageSize + 1);
assert(a.offset - a.data == 4 * pageSize);
void[] b4 = a.allocate(4);
assert(!b4);
a.deallocate(b1);
assert(a.data);
a.deallocate(b2);
assert(a.data);
a.deallocate(b3);
}
size_t pageSize = getPageSize();
AscendingPageAllocator a = AscendingPageAllocator(4 * pageSize);
shared SharedAscendingPageAllocator aa = SharedAscendingPageAllocator(4 * pageSize);
testAlloc(a);
testAlloc(aa);
}
@system @nogc nothrow unittest
{
size_t pageSize = getPageSize();
size_t numPages = 26214;
AscendingPageAllocator a = AscendingPageAllocator(numPages * pageSize);
foreach (i; 0 .. numPages)
{
void[] buf = a.allocate(pageSize);
assert(buf.length == pageSize);
testrw(buf);
a.deallocate(buf);
}
assert(!a.allocate(1));
assert(a.getAvailableSize() == 0);
}
@system @nogc nothrow unittest
{
size_t pageSize = getPageSize();
size_t numPages = 26214;
uint alignment = cast(uint) pageSize;
AscendingPageAllocator a = AscendingPageAllocator(numPages * pageSize);
foreach (i; 0 .. numPages)
{
void[] buf = a.alignedAllocate(pageSize, alignment);
assert(buf.length == pageSize);
testrw(buf);
a.deallocate(buf);
}
assert(!a.allocate(1));
assert(a.getAvailableSize() == 0);
}
@system @nogc nothrow unittest
{
static void testAlloc(Allocator)(ref Allocator a) @nogc nothrow
{
import std.traits : hasMember;
size_t pageSize = getPageSize();
size_t numPages = 5;
uint alignment = cast(uint) pageSize;
void[] b1 = a.allocate(pageSize / 2);
assert(b1.length == pageSize / 2);
void[] b2 = a.alignedAllocate(pageSize / 2, alignment);
assert(a.expand(b1, pageSize / 2));
assert(a.expand(b1, 0));
assert(!a.expand(b1, 1));
testrw(b1);
assert(a.expand(b2, pageSize / 2));
testrw(b2);
assert(b2.length == pageSize);
assert(a.getAvailableSize() == pageSize * 3);
void[] b3 = a.allocate(pageSize / 2);
assert(a.reallocate(b1, b1.length));
assert(a.reallocate(b2, b2.length));
assert(a.reallocate(b3, b3.length));
assert(b3.length == pageSize / 2);
testrw(b3);
assert(a.expand(b3, pageSize / 4));
testrw(b3);
assert(a.expand(b3, 0));
assert(b3.length == pageSize / 2 + pageSize / 4);
assert(a.expand(b3, pageSize / 4 - 1));
testrw(b3);
assert(a.expand(b3, 0));
assert(b3.length == pageSize - 1);
assert(a.expand(b3, 2));
assert(a.expand(b3, 0));
assert(a.getAvailableSize() == pageSize);
assert(b3.length == pageSize + 1);
testrw(b3);
assert(a.reallocate(b1, b1.length));
assert(a.reallocate(b2, b2.length));
assert(a.reallocate(b3, b3.length));
assert(a.reallocate(b3, 2 * pageSize));
testrw(b3);
assert(a.reallocate(b1, pageSize - 1));
testrw(b1);
assert(a.expand(b1, 1));
testrw(b1);
assert(!a.expand(b1, 1));
a.deallocate(b1);
a.deallocate(b2);
a.deallocate(b3);
}
size_t pageSize = getPageSize();
size_t numPages = 5;
uint alignment = cast(uint) pageSize;
AscendingPageAllocator a = AscendingPageAllocator(numPages * pageSize);
shared SharedAscendingPageAllocator aa = SharedAscendingPageAllocator(numPages * pageSize);
testAlloc(a);
testAlloc(aa);
}
@system @nogc nothrow unittest
{
size_t pageSize = getPageSize();
size_t numPages = 21000;
enum testNum = 100;
enum allocPages = 10;
void[][testNum] buf;
AscendingPageAllocator a = AscendingPageAllocator(numPages * pageSize);
for (int i = 0; i < numPages; i += testNum * allocPages)
{
foreach (j; 0 .. testNum)
{
buf[j] = a.allocate(pageSize * allocPages);
testrw(buf[j]);
}
foreach (j; 0 .. testNum)
{
a.deallocate(buf[j]);
}
}
}
@system @nogc nothrow unittest
{
size_t pageSize = getPageSize();
size_t numPages = 21000;
enum testNum = 100;
enum allocPages = 10;
void[][testNum] buf;
shared SharedAscendingPageAllocator a = SharedAscendingPageAllocator(numPages * pageSize);
for (int i = 0; i < numPages; i += testNum * allocPages)
{
foreach (j; 0 .. testNum)
{
buf[j] = a.allocate(pageSize * allocPages);
testrw(buf[j]);
}
foreach (j; 0 .. testNum)
{
a.deallocate(buf[j]);
}
}
}
@system @nogc nothrow unittest
{
size_t pageSize = getPageSize();
enum numPages = 2;
AscendingPageAllocator a = AscendingPageAllocator(numPages * pageSize);
void[] b = a.allocate((numPages + 1) * pageSize);
assert(b is null);
b = a.allocate(1);
assert(b.length == 1);
assert(a.getAvailableSize() == pageSize);
a.deallocateAll();
assert(!a.data && !a.offset);
}
@system @nogc nothrow unittest
{
size_t pageSize = getPageSize();
enum numPages = 26;
AscendingPageAllocator a = AscendingPageAllocator(numPages * pageSize);
uint alignment = cast(uint) ((numPages / 2) * pageSize);
void[] b = a.alignedAllocate(pageSize, alignment);
assert(b.length == pageSize);
testrw(b);
assert(b.ptr.alignedAt(alignment));
a.deallocateAll();
assert(!a.data && !a.offset);
}
@system @nogc nothrow unittest
{
size_t pageSize = getPageSize();
enum numPages = 10;
AscendingPageAllocator a = AscendingPageAllocator(numPages * pageSize);
uint alignment = cast(uint) (2 * pageSize);
void[] b1 = a.alignedAllocate(pageSize, alignment);
assert(b1.length == pageSize);
testrw(b1);
assert(b1.ptr.alignedAt(alignment));
void[] b2 = a.alignedAllocate(pageSize, alignment);
assert(b2.length == pageSize);
testrw(b2);
assert(b2.ptr.alignedAt(alignment));
void[] b3 = a.alignedAllocate(pageSize, alignment);
assert(b3.length == pageSize);
testrw(b3);
assert(b3.ptr.alignedAt(alignment));
void[] b4 = a.allocate(pageSize);
assert(b4.length == pageSize);
testrw(b4);
assert(a.deallocate(b1));
assert(a.deallocate(b2));
assert(a.deallocate(b3));
assert(a.deallocate(b4));
a.deallocateAll();
assert(!a.data && !a.offset);
}
@system unittest
{
import core.thread : ThreadGroup;
import std.algorithm.sorting : sort;
import core.internal.spinlock : SpinLock;
enum numThreads = 100;
SpinLock lock = SpinLock(SpinLock.Contention.brief);
ulong[numThreads] ptrVals;
size_t count = 0;
shared SharedAscendingPageAllocator a = SharedAscendingPageAllocator(4096 * numThreads);
void fun()
{
void[] b = a.allocate(4000);
assert(b.length == 4000);
assert(a.expand(b, 96));
assert(b.length == 4096);
lock.lock();
ptrVals[count] = cast(ulong) b.ptr;
count++;
lock.unlock();
}
auto tg = new ThreadGroup;
foreach (i; 0 .. numThreads)
{
tg.create(&fun);
}
tg.joinAll();
ptrVals[].sort();
foreach (i; 0 .. numThreads - 1)
{
assert(ptrVals[i] + 4096 == ptrVals[i + 1]);
}
}
@system unittest
{
import core.thread : ThreadGroup;
import std.algorithm.sorting : sort;
import core.internal.spinlock : SpinLock;
SpinLock lock = SpinLock(SpinLock.Contention.brief);
enum numThreads = 100;
void[][numThreads] buf;
size_t count = 0;
shared SharedAscendingPageAllocator a = SharedAscendingPageAllocator(2 * 4096 * numThreads);
void fun()
{
void[] b = a.allocate(4000);
assert(b.length == 4000);
assert(a.expand(b, 96));
assert(b.length == 4096);
a.expand(b, 4096);
assert(b.length == 4096 || b.length == 8192);
lock.lock();
buf[count] = b;
count++;
lock.unlock();
}
auto tg = new ThreadGroup;
foreach (i; 0 .. numThreads)
{
tg.create(&fun);
}
tg.joinAll();
sort!((a, b) => a.ptr < b.ptr)(buf[0 .. 100]);
foreach (i; 0 .. numThreads - 1)
{
assert(buf[i].ptr + buf[i].length == buf[i + 1].ptr);
}
}
|
D
|
/Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Fluent.build/QueryBuilder/QueryBuilder+Operators.swift.o : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Copy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/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/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/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 /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/DatabaseKit.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 /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/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Fluent.build/QueryBuilder/QueryBuilder+Operators~partial.swiftmodule : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Copy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/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/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/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 /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/DatabaseKit.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 /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/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Fluent.build/QueryBuilder/QueryBuilder+Operators~partial.swiftdoc : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Copy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/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/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/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 /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/DatabaseKit.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 /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 android.java.android.location.GnssStatus_Callback_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import1 = android.java.java.lang.Class_d_interface;
import import0 = android.java.android.location.GnssStatus_d_interface;
@JavaName("GnssStatus$Callback")
final class GnssStatus_Callback : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import this(arsd.jni.Default);
@Import void onStarted();
@Import void onStopped();
@Import void onFirstFix(int);
@Import void onSatelliteStatusChanged(import0.GnssStatus);
@Import import1.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/location/GnssStatus$Callback;";
}
|
D
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range;
alias P = Tuple!(int, "x", int, "y");
void main()
{
auto N = readln.chomp.to!int;
auto us = new int[][200001];
auto rs = new int[][200001];
auto ds = new int[][200001];
auto ls = new int[][200001];
P[] ups, dps;
int[][int] rpps, rmps, lpps, lmps;
foreach (_; 0..N) {
auto xyu = readln.split;
auto p = P(xyu[0].to!int, xyu[1].to!int);
switch (xyu[2]) {
case "U":
us[p.x] ~= p.y;
ups ~= p;
break;
case "R":
rs[p.y] ~= p.x;
rpps[p.x+p.y] ~= p.y;
rmps[p.x-p.y] ~= p.y;
break;
case "D":
ds[p.x] ~= p.y;
dps ~= p;
break;
case "L":
ls[p.y] ~= p.x;
lpps[p.x+p.y] ~= p.y;
lmps[p.x-p.y] ~= p.y;
break;
default:
}
}
auto res = int.max;
void update_same_direction(int a, int b) {
res = min(res, abs(a - b) * 10 / 2);
}
void same_direction(int[][] as, int[][] bs) {
foreach (i, aa; as) if (!aa.empty && !bs[i].empty) {
auto bb = bs[i];
sort(bb);
foreach (u; aa) {
if (bb[0] > u) {
update_same_direction(u, bb[0]);
} else if (bb[$-1] > u) {
int l, r = bb.length.to!int-1;
while (l+1 < r) {
auto m = (l+r)/2;
if (bb[m] > u) {
r = m;
} else {
l = m;
}
}
update_same_direction(u, bb[r]);
}
}
}
}
same_direction(us, ds);
same_direction(rs, ls);
foreach (_, ref v; rpps) sort(v);
foreach (_, ref v; rmps) sort(v);
foreach (_, ref v; lpps) sort(v);
foreach (_, ref v; lmps) sort(v);
void update_perpendicular(int a, int b) {
res = min(res, abs(a - b) * 10);
}
void perpendicular_direction_up(int key, P p, int[][int] pps) {
if (key in pps) {
auto rr = pps[key];
if (rr[0] > p.y) {
update_perpendicular(rr[0], p.y);
} else if (rr[$-1] > p.y) {
int l, r = rr.length.to!int-1;
while (l+1 < r) {
auto m = (l+r)/2;
if (rr[m] > p.y) {
r = m;
} else {
l = m;
}
}
update_perpendicular(rr[r], p.y);
}
}
}
foreach (p; ups) {
perpendicular_direction_up(p.x-p.y, p, lmps);
perpendicular_direction_up(p.x+p.y, p, rpps);
}
void perpendicular_direction_down(int key, P p, int[][int] pps) {
if (key in pps) {
auto rr = pps[key];
if (rr[$-1] < p.y) {
update_perpendicular(rr[$-1], p.y);
} else if (rr[0] < p.y) {
int l, r = rr.length.to!int-1;
while (l+1 < r) {
auto m = (l+r)/2;
if (rr[m] < p.y) {
l = m;
} else {
r = m;
}
}
update_perpendicular(rr[l], p.y);
}
}
}
foreach (p; dps) {
perpendicular_direction_down(p.x-p.y, p, rmps);
perpendicular_direction_down(p.x+p.y, p, lpps);
}
if (res == int.max) {
writeln("SAFE");
} else {
writeln(res);
}
}
/*
8
168 224 U 392/-56
130 175 R 305/-45
111 198 D 309/-87
121 188 L 309/-67
201 116 U 317/85
112 121 R 233/-9
145 239 D 384/-94
185 107 L 292/78
111,198 -> 111,197 -> 111,196 ...
121,188 -> 120,188 -> 119,188 ...
111,198 -> 112,197 -> 113,196 -> 114,195 -> 115,194 -> 116,193 -> 117,192 -> 118,191 -> 119,190 -> 120,189 -> 121,188
2
111 198 D
101 188 R
2
111 178 U
121 188 L
2
101 188 R
111 178 U
0 4 R x+y=4
4 0 U x+y=4
y = -x + b
8 4 L x-y=4
4 0 U x-y=4
y = x + b
0 4 R x-y=-4
4 8 D x-y=-4
y = -x + b
8 4 L x+y=12
4 8 D x+y=12
y = -x + b
*
+
+
+
*+++++++*
+
+
+
*
*/
|
D
|
INSTANCE Info_Mod_Alissandro_Hi (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Hi_Condition;
information = Info_Mod_Alissandro_Hi_Info;
permanent = 0;
important = 0;
description = "Wer bist du?";
};
FUNC INT Info_Mod_Alissandro_Hi_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Alissandro_Hi_Info()
{
B_Say (hero, self, "$WHOAREYOU");
AI_Output(self, hero, "Info_Mod_Alissandro_Hi_28_01"); //Ich bin neuer Erzbaron und Berater von Thorus.
};
INSTANCE Info_Mod_Alissandro_Dieb (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Dieb_Condition;
information = Info_Mod_Alissandro_Dieb_Info;
permanent = 0;
important = 0;
description = "Was weißt du über den Dieb?";
};
FUNC INT Info_Mod_Alissandro_Dieb_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_Hi))
&& (Npc_KnowsInfo(hero, Info_Mod_Thorus_Pruefung))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Dieb_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_Dieb_15_00"); //Was weißt du über den Dieb?
AI_Output(self, hero, "Info_Mod_Alissandro_Dieb_28_01"); //Also, normalerweise ist es zwischen 23 und 6 Uhr, wenn er zuschlägt. Um die Zeit halten vier Gardisten Wache, die davon eigentlich etwas mitbekommen müssten:
AI_Output(self, hero, "Info_Mod_Alissandro_Dieb_28_02"); //Bullit, Cutter, Jackal und Bloodwyn. Dass sie bisher nichts bemerkt haben, macht sie in meinen Augen verdächtig. Zumindest einer wird seine Finger im Spiel haben.
AI_Output(hero, self, "Info_Mod_Alissandro_Dieb_15_03"); //Verstehe, ich werde mich mal umhören.
B_LogEntry (TOPIC_MOD_PDV, "Bullit, Cutter, Jackal und Bloodwyn werden verdächtigt, den Diebstahl begangen zu haben. Ich glaube, ich statte ihnen mal einen Besuch ab.");
};
INSTANCE Info_Mod_Alissandro_Unbekannter (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Unbekannter_Condition;
information = Info_Mod_Alissandro_Unbekannter_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_Unbekannter_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Thorus_Verloren))
&& (Mod_GorKarantoSchwach == 5)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Unbekannter_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_Unbekannter_28_00"); //Du wurdest doch von Thorus beauftragt, dem Unbekannten den Betrug nachzuweisen.
AI_Output(hero, self, "Info_Mod_Alissandro_Unbekannter_15_01"); //Ja, und?
AI_Output(self, hero, "Info_Mod_Alissandro_Unbekannter_28_02"); //Ich weiß, in welcher Hütte der Unbekannte schläft. Wenn du aus der Burg gehst und dann rechts Richtung Arena, dann die Hütte direkt neben Scattys Stand.
AI_Output(hero, self, "Info_Mod_Alissandro_Unbekannter_15_03"); //Danke.
B_LogEntry (TOPIC_MOD_AL_ARENA, "Alissandro hat mir gesagt, wo ich die Hütte von dem Unbekannten finden kann. Es ist die Hütte direkt neben Scattys Stand. Vielleicht sollte ich mich dort mal umsehen.");
Mod_GorKarantoSchwach = 6;
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "START");
};
INSTANCE Info_Mod_Alissandro_ThorusTot (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_ThorusTot_Condition;
information = Info_Mod_Alissandro_ThorusTot_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_ThorusTot_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Makanius_ThorusTot))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_ThorusTot_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_ThorusTot_28_00"); //(benommen) Verdammt, ich habe nichts mehr tun können.
AI_Output(hero, self, "Info_Mod_Alissandro_ThorusTot_15_01"); //Was ist passiert?
AI_Output(self, hero, "Info_Mod_Alissandro_ThorusTot_28_02"); //Dieses Drecksschwein Bartholo hat uns zu dieser Höhle geführt, meinte, die Buddler würden sich auflehnen.
AI_Output(self, hero, "Info_Mod_Alissandro_ThorusTot_28_03"); //Als wir da waren, hat er uns mit einer Horde Gardisten überfallen. Thorus hat er dabei getötet, Arto und ich kämpften bis zum Umfallen, bis wir gemerkt haben, dass wir gegen die Überzahl nicht gewinnen konnten.
AI_Output(self, hero, "Info_Mod_Alissandro_ThorusTot_28_04"); //Also hat mich Arto mit einem Schlafzauber belegt, damit es aussieht, als wäre ich tot. Er konnte fliehen. Er meinte, wir treffen uns im alten Kastell, oben am Berg.
AI_Output(self, hero, "Info_Mod_Alissandro_ThorusTot_28_05"); //Er schlug vor, von da aus unseren Gegenschlag zu planen, denn Bartholo hat das Lager übernommen.
AI_Output(self, hero, "Info_Mod_Alissandro_ThorusTot_28_06"); //Ich werde euch hinführen.
B_LogEntry (TOPIC_MOD_AL_SCHMUGGLER, "Alissandro hat erzählt, dass Bartholo nun das Lager übernommen hat. Makanius will Bartholo seine Hilfe anbieten, um ihn besser beobachten zu können, doch ich werde mich Alissandro anschließen und mit ihm den Gegenschlag planen.");
self.aivar[AIV_PARTYMEMBER] = TRUE;
AI_StopProcessInfos (self);
if (Mod_ALTor_01 == 0)
{
Wld_SendTrigger ("EVT_OC_MAINGATE01_01");
Mod_ALTor_01 = 1;
};
if (Mod_ALTor_03 == 0)
{
Wld_SendTrigger ("EVT_OC_MAINGATE02_02");
Mod_ALTor_03 = 1;
};
B_StartOtherRoutine (self, "GUIDETOKASTELLPARTONE");
};
INSTANCE Info_Mod_Alissandro_ZwischenstationA (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_ZwischenstationA_Condition;
information = Info_Mod_Alissandro_ZwischenstationA_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_ZwischenstationA_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_ThorusTot))
&& (Npc_GetDistToWP(self, "OC_ROUND_18") < 300)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_ZwischenstationA_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_ZwischenstationA_28_00"); //Hm, der Weg hier ist gut bewacht, wir sollten einen anderen nehmen.
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "GUIDETOKASTELLPARTTWO");
};
INSTANCE Info_Mod_Alissandro_ZwischenstationB (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_ZwischenstationB_Condition;
information = Info_Mod_Alissandro_ZwischenstationB_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_ZwischenstationB_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_ZwischenstationA))
&& (Npc_GetDistToWP(self, "OW_PATH_001") < 300)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_ZwischenstationB_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_ZwischenstationB_28_00"); //Von hier aus sollte der Weg nicht mehr allzu schwierig sein.
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "GUIDETOKASTELL");
};
INSTANCE Info_Mod_Alissandro_Kastell (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Kastell_Condition;
information = Info_Mod_Alissandro_Kastell_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_Kastell_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_ZwischenstationB))
&& (Npc_GetDistToWP(self, "CASTLE_01") < 500)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Kastell_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_Kastell_28_00"); //Da wären wir. Hier werden wir uns auf den Gegenschlag vorbereiten.
AI_Output(self, hero, "Info_Mod_Alissandro_Kastell_28_01"); //Ich werde mich mit Arto beraten. Komm morgen wieder.
B_SetTopicStatus (TOPIC_MOD_AL_SCHMUGGLER, LOG_SUCCESS);
self.aivar[AIV_PARTYMEMBER] = FALSE;
Mod_AtKastell = Wld_GetDay();
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "KASTELL");
B_GivePlayerXP (1000);
B_Göttergefallen(2, 2);
};
INSTANCE Info_Mod_Alissandro_Botschafter (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Botschafter_Condition;
information = Info_Mod_Alissandro_Botschafter_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_Botschafter_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_Kastell))
&& (Mod_AtKastell < Wld_GetDay())
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Botschafter_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_Botschafter_28_00"); //Es gibt ein Problem und ich will, dass du es löst.
AI_Output(hero, self, "Info_Mod_Alissandro_Botschafter_15_01"); //Verstehe, was habe ich zu tun?
AI_Output(self, hero, "Info_Mod_Alissandro_Botschafter_28_02"); //Wir haben Botschafter in alle Lager geschickt, um um Hilfe im Kampf gegen Bartholo zu bitten. Allerdings ist ein Botschafter nicht zurückgekommen.
AI_Output(hero, self, "Info_Mod_Alissandro_Botschafter_15_03"); //Wo habt ihr ihn hingeschickt?
AI_Output(self, hero, "Info_Mod_Alissandro_Botschafter_28_04"); //In das Lager der Banditen nahe der Trollschlucht.
AI_Output(hero, self, "Info_Mod_Alissandro_Botschafter_15_05"); //Und da wundert ihr euch, dass er nicht zurückgekommen ist?
AI_Output(self, hero, "Info_Mod_Alissandro_Botschafter_28_06"); //Allerdings. Die Banditen würden ihn nicht ohne Vorwarnung umbringen. Wenn sie Interesse daran hätten, ihn zu töten, hätten sie versucht, Lösegeld für ihn zu kassieren.
Log_CreateTopic (TOPIC_MOD_AL_BOTSCHAFTER, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_AL_BOTSCHAFTER, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_AL_BOTSCHAFTER, "Alissandro schickt mich zum Banditenlager, um aufzuklären, was aus dem Botschafter geworden ist.");
Wld_InsertNpc (Mod_1875_GRD_Botschafter_MT, "OC1");
B_KillNpc (Mod_1875_GRD_Botschafter_MT);
};
INSTANCE Info_Mod_Alissandro_BanditenDabei (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_BanditenDabei_Condition;
information = Info_Mod_Alissandro_BanditenDabei_Info;
permanent = 0;
important = 0;
description = "Die Banditen schließen sich uns an.";
};
FUNC INT Info_Mod_Alissandro_BanditenDabei_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Dexter_Feuerregen))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_BanditenDabei_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_BanditenDabei_15_00"); //Die Banditen schließen sich uns an.
AI_Output(self, hero, "Info_Mod_Alissandro_BanditenDabei_28_01"); //Gut, so haben wir einen Verbündeten mehr.
AI_Output(self, hero, "Info_Mod_Alissandro_BanditenDabei_28_02"); //Hier, nimm deine Belohnung.
CreateInvItems (self, ItMi_Nugget, 5);
B_GiveInvItems (self, hero, ItMi_Nugget, 5);
B_GivePlayerXP (500);
B_Göttergefallen(2, 1);
Mod_AlissandroBanditen_GetDay = Wld_GetDay();
B_LogEntry (TOPIC_MOD_AL_BOTSCHAFTER, "Alissandro ist zufrieden mit mir, nun haben wir ein Lager mehr auf unserer Seite.");
B_SetTopicStatus (TOPIC_MOD_AL_BOTSCHAFTER, LOG_SUCCESS);
};
INSTANCE Info_Mod_Alissandro_EigentlichBereit (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_EigentlichBereit_Condition;
information = Info_Mod_Alissandro_EigentlichBereit_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_EigentlichBereit_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_BanditenDabei))
&& (Wld_GetDay() > Mod_AlissandroBanditen_GetDay)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_EigentlichBereit_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_EigentlichBereit_28_00"); //Wir haben nun genug Leute, um das Alte Lager zu stürmen, allerdings gibt es noch ein Problem.
AI_Output(self, hero, "Info_Mod_Alissandro_EigentlichBereit_28_01"); //Wir kennen die Aufstellung der Gardisten nicht. Und genau da liegt dein nächster Auftrag.
AI_Output(hero, self, "Info_Mod_Alissandro_EigentlichBereit_15_02"); //Gut, was soll ich machen?
AI_Output(self, hero, "Info_Mod_Alissandro_EigentlichBereit_28_03"); //Du sollst in das Lager einbrechen und die Karte mit der Aufstellung stehlen.
AI_Output(hero, self, "Info_Mod_Alissandro_EigentlichBereit_15_04"); //Und wie soll ich in das Lager kommen?
AI_Output(self, hero, "Info_Mod_Alissandro_EigentlichBereit_28_05"); //Ich habe von den Verwandlungsmagiern einige Spruchrollen bekommen, damit kommst du in das Lager.
CreateInvItems (self, ItSc_TrfRabbit, 3);
B_GiveInvItems (self, hero, ItSc_TrfRabbit, 3);
AI_Output(self, hero, "Info_Mod_Alissandro_EigentlichBereit_28_06"); //Du darfst dich nicht zurückverwandeln, bis du in Bartholos Zimmer bist, der Ort, an dem früher Gomez wohnte.
B_StartOtherRoutine (Mod_1106_EBR_Bartholo_MT, "SMALLTALK");
B_StartOtherRoutine (Mod_1876_EBR_Bloodwyn_MT, "SMALLTALK");
Log_CreateTopic (TOPIC_MOD_AL_KARTE, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_AL_KARTE, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_AL_KARTE, "Alissandro hat mich angewiesen, den Plan für die Aufstellung der Gardisten zu stehlen. Dafür gab er mir einige Verwandlungsspruchrollen. Damit sollte ich zu Bartholos Zimmer kommen.");
};
INSTANCE Info_Mod_Alissandro_HierPlan (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_HierPlan_Condition;
information = Info_Mod_Alissandro_HierPlan_Info;
permanent = 0;
important = 0;
description = "Ich habe den Plan.";
};
FUNC INT Info_Mod_Alissandro_HierPlan_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_EigentlichBereit))
&& (Npc_HasItems(hero, AL_Aufstellung) == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_HierPlan_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_HierPlan_15_00"); //Ich habe den Plan.
B_GiveInvItems (hero, self, AL_Aufstellung, 1);
AI_Output(self, hero, "Info_Mod_Alissandro_HierPlan_28_01"); //Gut, dann werden wir das Lager bald angreifen können.
B_GivePlayerXP (500);
B_Göttergefallen(2, 1);
Mod_AlissandroBanditen_GetDay = Wld_GetDay();
B_SetTopicStatus (TOPIC_MOD_AL_KARTE, LOG_SUCCESS);
};
INSTANCE Info_Mod_Alissandro_GotoJackal (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_GotoJackal_Condition;
information = Info_Mod_Alissandro_GotoJackal_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_GotoJackal_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_HierPlan))
&& (Wld_GetDay() > Mod_AlissandroBanditen_GetDay)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_GotoJackal_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_GotoJackal_28_00"); //Bald können wir das Lager angreifen, aber einen Schritt haben wir noch zu machen.
AI_Output(hero, self, "Info_Mod_Alissandro_GotoJackal_15_01"); //Und der wäre?
AI_Output(self, hero, "Info_Mod_Alissandro_GotoJackal_28_02"); //Dem Plan nach sind Bartholos Leute sehr gut geordnet, so dass das Lager kaum verwundbar ist.
AI_Output(hero, self, "Info_Mod_Alissandro_GotoJackal_15_03"); //Und wie soll ich dieses Problem lösen?
AI_Output(self, hero, "Info_Mod_Alissandro_GotoJackal_28_04"); //Der Mann, der dich gerettet hat, hat den Auftrag, die wichtigen Mitglieder des Lagers zu töten. Allerdings hat Bloodwyn ein Auge auf ihn geworfen, Bartholo schöpft vermutlich Verdacht.
AI_Output(self, hero, "Info_Mod_Alissandro_GotoJackal_28_05"); //Nun musst du seinen Auftrag übernehmen.
AI_Output(hero, self, "Info_Mod_Alissandro_GotoJackal_15_06"); //Wer war der Kerl eigentlich?
AI_Output(self, hero, "Info_Mod_Alissandro_GotoJackal_28_07"); //Der Gardist Jackal. Wenn du mehr Fragen hast, unterhalte dich mit ihm.
AI_Output(hero, self, "Info_Mod_Alissandro_GotoJackal_15_08"); //Wie soll ich in das Lager kommen?
AI_Output(self, hero, "Info_Mod_Alissandro_GotoJackal_28_09"); //Ich habe eine Teleportrune von den Heilmagiern bekommen, du kommst damit in das Haus der Magier.
B_GiveInvItems (self, hero, ItRu_TeleportOldcamp, 1);
AI_Output(self, hero, "Info_Mod_Alissandro_GotoJackal_28_10"); //Außerdem bekommst du eine Liste mit den Leuten, die du töten sollst.
B_GiveInvItems (self, hero, ItWr_Alissandro_KillList, 1);
B_StartOtherRoutine (Mod_1874_HMG_Makanius_MT, "TREFFEN");
B_StartOtherRoutine (Mod_1107_GRD_Jackal_MT, "WACHE");
B_StartOtherRoutine (Mod_1113_GRD_Fletcher_MT, "KILLMISSION");
B_StartOtherRoutine (Mod_1025_KGD_Cathran_MT, "KILLMISSION");
Log_CreateTopic (TOPIC_MOD_AL_KillMission, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_AL_KillMission, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_AL_KillMission, "Alissandro hat mich ins Lager geschickt, um bestimmte Mitglieder zu töten. Er hat mir eine Liste gegeben.");
};
INSTANCE Info_Mod_Alissandro_WarnungLagerEntdeckt (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_WarnungLagerEntdeckt_Condition;
information = Info_Mod_Alissandro_WarnungLagerEntdeckt_Info;
permanent = 0;
important = 0;
description = "Die Gardisten kennen unser Versteck, wir müssen fliehen.";
};
FUNC INT Info_Mod_Alissandro_WarnungLagerEntdeckt_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Jackal_BloodwynDead))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_WarnungLagerEntdeckt_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_WarnungLagerEntdeckt_15_00"); //Die Gardisten kennen unser Versteck, wir müssen fliehen.
AI_Output(self, hero, "Info_Mod_Alissandro_WarnungLagerEntdeckt_28_01"); //Verdammt, wir teilen uns auf. Geh zur Goblinhöhle auf dem Weg zum Sumpflager.
AI_Output(self, hero, "Info_Mod_Alissandro_WarnungLagerEntdeckt_28_02"); //Benutze nicht den Bergpass, ich habe dir den Weg auf der Karte eingezeichnet.
B_GiveInvItems (self, hero, ItWr_MapToGobboHoehle, 1);
B_LogEntry (TOPIC_MOD_AL_KillMission, "Alissandro wurde gewarnt. Wir werden uns aufteilen. Ich soll zur alten Goblinhöhle gehen, in der der Almanach versteckt war. Er hat mir den Weg auf der Karte eingezeichnet.");
B_StartOtherRoutine (Mod_1107_GRD_Jackal_MT, "WAITATKASTELL");
// Zufluchten füllen
Wld_InsertNpc (Mod_1917_GRD_Gardist_MT, "OC1");
Wld_InsertNpc (Mod_1918_GRD_Gardist_MT, "OC1");
Wld_InsertNpc (Mod_1919_GRD_Gardist_MT, "OC1");
Wld_InsertNpc (Mod_1920_GRD_Gardist_MT, "OC1");
Wld_InsertNpc (Mod_1921_GRD_Gardist_MT, "OC1");
Wld_InsertNpc (Mod_1922_GRD_Gardist_MT, "OC1");
//Wld_InsertNpc (Mod_1923_GRD_Gardist_MT, "OC1"); //Kommt später wegen Gefangennahme
};
INSTANCE Info_Mod_Alissandro_ThanksForRettung (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_ThanksForRettung_Condition;
information = Info_Mod_Alissandro_ThanksForRettung_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_ThanksForRettung_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Jackal_InOC))
&& (Mod_AL_AlissandroBefreit == 1)
&& (Npc_GetDistToWP(self, "GOBBO_MASTERCAVE") < 500)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_ThanksForRettung_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_ThanksForRettung_28_00"); //Gut, dass ihr mir helfen konntet. Hier, du hast es verdient.
CreateInvItems (self, Grd_Armor_H, 1);
B_GiveInvItems (self, hero, Grd_Armor_H, 1);
Mod_AL_AlissandroBefreit = 2;
B_LogEntry (TOPIC_MOD_AL_WhereAlissandro, "Wir sind in Sicherheit. Alissandro gab mir die schwere Garderüstung.");
B_SetTopicStatus (TOPIC_MOD_AL_WhereAlissandro, LOG_SUCCESS);
B_GivePlayerXP (1000);
B_StartOtherRoutine (Mod_1107_GRD_Jackal_MT, "ALIWACHEZUFLUCHT");
B_StartOtherRoutine (self, "ATZUFLUCHT");
B_Göttergefallen(2, 1);
};
INSTANCE Info_Mod_Alissandro_GotoZufluchten (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_GotoZufluchten_Condition;
information = Info_Mod_Alissandro_GotoZufluchten_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_GotoZufluchten_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_ThanksForRettung))
&& (Mod_AL_AlissandroBefreit == 2)
&& (Npc_GetDistToWP(self, "GOBBO_MASTERCAVE9") < 500)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_GotoZufluchten_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_GotoZufluchten_28_00"); //Es ist nun Zeit, das Lager zurück zu erobern. Ich will, dass du die anderen Zufluchten unserer Leute aufsuchst und sie in das Sektenlager schickst, wo wir eine Beratung abhalten werden.
AI_Output(self, hero, "Info_Mod_Alissandro_GotoZufluchten_28_01"); //Jackal wird in der Zeit die verbündeten Gilden aufsuchen und ihnen diese Botschaft überbringen.
AI_Output(hero, self, "Info_Mod_Alissandro_GotoZufluchten_15_02"); //Wo sind die anderen Zufluchten?
AI_Output(self, hero, "Info_Mod_Alissandro_GotoZufluchten_28_03"); //Du bekommst diese Karte von mir.
CreateInvItems (self, ItWrWorldmapZufluchten, 1);
B_GiveInvItems (self, hero, ItWrWorldmapZufluchten, 1);
AI_Output(self, hero, "Info_Mod_Alissandro_GotoZufluchten_28_04"); //Wenn du bei allen sieben Zufluchten warst, geh ins Sektenlager zum Tempelvorplatz.
Mod_AL_AlissandroBefreit = 3;
Log_CreateTopic (TOPIC_MOD_AL_EROBERUNG, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_AL_EROBERUNG, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "Alissandro hat mir den Auftrag gegeben, die Zufluchten unserer Leute aufzusuchen und sie zum Tempelvorplatz der Sekte zu schicken.");
B_StartOtherRoutine (Mod_1107_GRD_Jackal_MT, "INPSICAMP");
B_StartOtherRoutine (Mod_761_BDT_Dexter_MT, "INPSICAMP");
B_StartOtherRoutine (Mod_1016_KGD_Hymir_MT, "INPSICAMP");
B_StartOtherRoutine (Mod_2005_GUR_CorCadar_MT, "INPSICAMP");
B_StartOtherRoutine (Mod_106_TPL_Angar_MT, "INPSICAMP");
B_StartOtherRoutine (Mod_1874_HMG_Makanius_MT, "INPSICAMP");
B_StartOtherRoutine (self, "INPSICAMP");
Wld_InsertNpc (Mod_1923_GRD_Gardist_MT, "OC1");
};
INSTANCE Info_Mod_Alissandro_Eroberung_01 (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Eroberung_01_Condition;
information = Info_Mod_Alissandro_Eroberung_01_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_Eroberung_01_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Jackal_AtPC))
&& (Npc_GetDistToWP(hero, "PSI_TEMPLE_IN_05") < 500)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Eroberung_01_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_Eroberung_01_28_00"); //Wir haben einen Plan ausgearbeitet, wie wir das Lager einnehmen.
AI_StopProcessInfos (self);
};
INSTANCE Info_Mod_Alissandro_Eroberung_08 (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Eroberung_08_Condition;
information = Info_Mod_Alissandro_Eroberung_08_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_Eroberung_08_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Dexter_Eroberung_07))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Eroberung_08_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_Eroberung_08_28_00"); //Wir kümmern uns in der Zeit nicht um die Schlacht draußen, sondern suchen Bartholo.
AI_StopProcessInfos (self);
};
INSTANCE Info_Mod_Alissandro_Eroberung_10 (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Eroberung_10_Condition;
information = Info_Mod_Alissandro_Eroberung_10_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_Eroberung_10_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Makanius_Eroberung_09))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Eroberung_10_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_Eroberung_10_28_00"); //Also, ich fasse es noch mal zusammen:
AI_Output(self, hero, "Info_Mod_Alissandro_Eroberung_10_28_01"); //1. Schritt: Wir dringen als Sumpfkrauthändler verkleidet in das Lager ein. Als Geleitschutz dienen uns zwei Templer.
AI_Output(self, hero, "Info_Mod_Alissandro_Eroberung_10_28_02"); //2. Schritt: Makanius gibt für unsere Leute im Lager das Zeichen, die Tore zu öffnen.
AI_Output(self, hero, "Info_Mod_Alissandro_Eroberung_10_28_03"); //3. Schritt: Die Banditen vom einen und die Garde vom anderen Tor stoßen zu uns und bekämpfen die Gardisten.
AI_Output(self, hero, "Info_Mod_Alissandro_Eroberung_10_28_04"); //4. Schritt: Unser Auftrag liegt darin, Bartholo zu töten, dabei helfen uns die Heilmagier.
AI_Output(self, hero, "Info_Mod_Alissandro_Eroberung_10_28_05"); //Gut, dann brechen wir nun auf. Folge mir.
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "Er hat mir den Plan erklärt, er lautet:");
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "1. Schritt: Wir dringen als Sumpfkrauthändler verkleidet in das Lager ein. Als Geleitschutz dienen uns zwei Templer.");
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "2. Schritt: Makanius gibt für unsere Leute im Lager das Zeichen, die Tore zu öffnen.");
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "3. Schritt: Die Banditen vom einen und die Garde vom anderen Tor stoßen zu uns und bekämpfen die Gardisten.");
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "4. Schritt: Unser Auftrag liegt darin, Bartholo zu töten, dabei helfen uns die Heilmagier.");
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "GOTOTEMPELVORPLATZ");
};
INSTANCE Info_Mod_Alissandro_BeiBartholo (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_BeiBartholo_Condition;
information = Info_Mod_Alissandro_BeiBartholo_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_BeiBartholo_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_GardistFuerEroberung_Hi_02))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_BeiBartholo_Info()
{
AI_UnequipArmor (self);
AI_EquipArmor (self, EBR_ARMOR_H2);
AI_Output(self, hero, "Info_Mod_Alissandro_BeiBartholo_28_00"); //Angriff!
AI_StopProcessInfos (self);
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "Wir sind nun bei Bartholo und Makanius hat das Signal für die Banditen und königlichen Gardisten gegeben, allerdings ist Bartholo geflohen und hat uns einen Gardisten auf den Hals gehetzt.");
B_StartOtherRoutine (Mod_1106_EBR_Bartholo_MT, "FLUCHTINKERKER");
Wld_SendTrigger ("EVT_KERKERGATE_01");
B_Attack (self, Mod_1156_GRD_Gardist_MT, AR_GuildEnemy, 0);
B_Attack (Mod_1924_TPL_GorNaMon_MT, Mod_1156_GRD_Gardist_MT, AR_GuildEnemy, 0);
B_Attack (Mod_1925_TPL_GorNaKar_MT, Mod_1156_GRD_Gardist_MT, AR_GuildEnemy, 0);
};
INSTANCE Info_Mod_Alissandro_WacheTotWoBartholo (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_WacheTotWoBartholo_Condition;
information = Info_Mod_Alissandro_WacheTotWoBartholo_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_WacheTotWoBartholo_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_BeiBartholo))
&& (Npc_IsDead(Mod_1156_GRD_Gardist_MT))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_WacheTotWoBartholo_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_WacheTotWoBartholo_28_00"); //Jetzt müssen wir Bartholo suchen. Er kann das Lager nicht verlassen haben.
B_StartOtherRoutine (self, "GOTOMAKANIUS");
B_StartOtherRoutine (Mod_1924_TPL_GorNaMon_MT, "STAYATOC");
B_StartOtherRoutine (Mod_1925_TPL_GorNaKar_MT, "STAYATOC");
B_StartOtherRoutine (Mod_1874_HMG_Makanius_MT, "WAITFORPLAYER");
};
INSTANCE Info_Mod_Alissandro_BartholoTot (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_BartholoTot_Condition;
information = Info_Mod_Alissandro_BartholoTot_Info;
permanent = 0;
important = 0;
description = "Das Lager ist nun wieder in unserer Hand.";
};
FUNC INT Info_Mod_Alissandro_BartholoTot_Condition()
{
if (Npc_IsDead(Mod_1106_EBR_Bartholo_MT))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_BartholoTot_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_BartholoTot_15_00"); //Das Lager ist nun wieder in unserer Hand.
AI_Output(self, hero, "Info_Mod_Alissandro_BartholoTot_28_01"); //Gut, nun ist der Kampf vorbei. In diesem Fall hast du es verdient, belohnt zu werden.
AI_Output(self, hero, "Info_Mod_Alissandro_BartholoTot_28_02"); //Komm morgen in den Thronsaal.
AI_StopProcessInfos (self);
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "Ich habe Bartholo in den Kerkern gefunden und getötet. Nun soll ich am nächsten Tag in den Thronsaal kommen.");
B_StartOtherRoutine (Mod_1874_HMG_Makanius_MT, "ALTESLAGER");
B_StartOtherRoutine (self, "BOSS");
Mod_AL_BelohnungFuerEroberung = Wld_GetDay();
};
INSTANCE Info_Mod_Alissandro_BelohnungFuerEroberung (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_BelohnungFuerEroberung_Condition;
information = Info_Mod_Alissandro_BelohnungFuerEroberung_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_BelohnungFuerEroberung_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_BartholoTot))
&& (Wld_GetDay() > Mod_AL_BelohnungFuerEroberung)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_BelohnungFuerEroberung_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_BelohnungFuerEroberung_28_00"); //Gut, du wurdest nun hierher berufen, um den höchsten Rang im Lager einzunehmen.
AI_Output(self, hero, "Info_Mod_Alissandro_BelohnungFuerEroberung_28_01"); //Nimm diese Rüstung in Empfang und sprich mir nach:
CreateInvItems (hero, Ebr_Armor_H2, 1);
B_ShowGivenThings ("Schwere Erzbaronrüstung erhalten");
AI_Output(self, hero, "Info_Mod_Alissandro_BelohnungFuerEroberung_28_02"); //Ich schwöre im Namen jedes Mitgliedes des Lagers, ...
AI_Output(hero, self, "Info_Mod_Alissandro_BelohnungFuerEroberung_15_03"); //Ich schwöre im Namen jedes Mitgliedes des Lagers, ...
AI_Output(self, hero, "Info_Mod_Alissandro_BelohnungFuerEroberung_28_04"); //... ob Buddler, Schatten oder Erzbaron, ...
AI_Output(hero, self, "Info_Mod_Alissandro_BelohnungFuerEroberung_15_05"); //... ob Buddler, Schatten oder Erzbaron, ...
AI_Output(self, hero, "Info_Mod_Alissandro_BelohnungFuerEroberung_28_06"); //... dass ich das Lager gerecht leite und schütze.
AI_Output(hero, self, "Info_Mod_Alissandro_BelohnungFuerEroberung_15_07"); //... dass ich das Lager gerecht leite und schütze.
AI_Output(self, hero, "Info_Mod_Alissandro_BelohnungFuerEroberung_28_08"); //Nun gut, nun bist du Erzbaron des Alten Lagers.
B_LogEntry (TOPIC_MOD_AL_EROBERUNG, "Ich wurde von Alissandro zum Erzbaron ernannt.");
B_SetTopicStatus (TOPIC_MOD_AL_EROBERUNG, LOG_SUCCESS);
B_GivePlayerXP (2500);
B_Göttergefallen(2, 3);
};
INSTANCE Info_Mod_Alissandro_WasTunAlsErzbaron (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_WasTunAlsErzbaron_Condition;
information = Info_Mod_Alissandro_WasTunAlsErzbaron_Info;
permanent = 0;
important = 0;
description = "Was ist meine Aufgabe als Erzbaron?";
};
FUNC INT Info_Mod_Alissandro_WasTunAlsErzbaron_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_BelohnungFuerEroberung))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_WasTunAlsErzbaron_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_WasTunAlsErzbaron_15_00"); //Was ist meine Aufgabe als Erzbaron?
AI_Output(self, hero, "Info_Mod_Alissandro_WasTunAlsErzbaron_28_01"); //Nun, wir kümmern uns um die Probleme des Lagers und versuchen es einflussreicher zu machen.
AI_Output(hero, self, "Info_Mod_Alissandro_WasTunAlsErzbaron_15_02"); //Und wie soll ich dazu beitragen?
AI_Output(self, hero, "Info_Mod_Alissandro_WasTunAlsErzbaron_28_03"); //Unser momentanes Ziel ist es, unseren Einfluss auf Khorinis auszuweiten.
AI_Output(hero, self, "Info_Mod_Alissandro_WasTunAlsErzbaron_15_04"); //Und was kann ich dabei tun?
AI_Output(self, hero, "Info_Mod_Alissandro_WasTunAlsErzbaron_28_05"); //Geh in die Stadt und rede mit Larius, dem Statthalter.
AI_Output(hero, self, "Info_Mod_Alissandro_WasTunAlsErzbaron_15_06"); //Larius' Posten haben doch die Paladine übernommen.
AI_Output(self, hero, "Info_Mod_Alissandro_WasTunAlsErzbaron_28_07"); //Verdammt, das wusste ich nicht.
AI_Output(hero, self, "Info_Mod_Alissandro_WasTunAlsErzbaron_15_08"); //Und was soll ich jetzt machen?
AI_Output(self, hero, "Info_Mod_Alissandro_WasTunAlsErzbaron_28_09"); //Der Schatten Whistler ist bereits auf dem Weg in die Stadt. Unterhalte dich mit ihm.
Log_CreateTopic (TOPIC_MOD_AL_AUSBREITUNGK, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_AL_AUSBREITUNGK, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_AL_AUSBREITUNGK, "Alissandro will, dass wir den Einfluss des Lagers in die Stadt Khorinis ausweiten. Dafür soll ich Whistler vor dem Stadttor treffen.");
B_StartOtherRoutine (Mod_1161_STT_Whistler_MT, "TOT");
AI_Teleport (Mod_1161_STT_Whistler_MT, "TOT");
B_StartOtherRoutine (Mod_948_BDT_Esteban_MT, "TOT");
B_StartOtherRoutine (Mod_790_BDT_Morgahard_MT, "TOT");
};
INSTANCE Info_Mod_Alissandro_Daemonenritter (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Daemonenritter_Condition;
information = Info_Mod_Alissandro_Daemonenritter_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_Daemonenritter_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Whistler_NW_Daemonen))
&& (Npc_IsDead(Mod_1935_DMR_Daemonenritter_MT))
&& (Npc_IsDead(Mod_1936_DMR_Daemonenritter_MT))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Daemonenritter_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_Daemonenritter_28_00"); //Wer sind diese Leute? Was wollen sie von uns?
AI_Output(hero, self, "Info_Mod_Alissandro_Daemonenritter_15_01"); //Das ist eine lange Geschichte, für die wir aber nun keine Zeit haben. Es kommt sicher bald Verstärkung. Wir sollten abhauen, bevor noch mehr von den Kerlen hier sind.
AI_Output(self, hero, "Info_Mod_Alissandro_Daemonenritter_28_02"); //Gut, folgt mir!
B_LogEntry (TOPIC_MOD_AL_MINE, "Es ist zu spät, die Dämonenritter sind schon bei Alissandro. Wir konnten sie schlagen, allerdings wird bald Verstärkung kommen. Wir sollten fliehen.");
B_StartOtherRoutine (self, "TOCAVALORN");
B_StartOtherRoutine (Mod_1105_EBR_Arto_MT, "TOCAVALORN");
};
INSTANCE Info_Mod_Alissandro_AtCavalorn (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_AtCavalorn_Condition;
information = Info_Mod_Alissandro_AtCavalorn_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_AtCavalorn_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_Daemonenritter))
&& (Npc_GetDistToWP(self, "OW_SAWHUT_GREENGOBBO_SPAWN") < 200)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_AtCavalorn_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_AtCavalorn_28_00"); //Hier dürften wir in Sicherheit sein. Und nun erklär mir, was die Leute in den schwarzen Rüstungen von uns wollen.
AI_Output(hero, self, "Info_Mod_Alissandro_AtCavalorn_15_01"); //Diese Kerle arbeiten für Gomez, der das Lager zurück will. Ich ging wie angefordert zu den Dämonenrittern, um ihnen ein Angebot wegen der Alten Mine zu machen.
AI_Output(hero, self, "Info_Mod_Alissandro_AtCavalorn_15_02"); //Es gab bei den Verhandlungen ein paar kleine Probleme, die dazu geführt haben, dass die Dämonenritter jetzt das Alte Lager erobern wollen, damit Gomez, Raven und Scar ihren Platz hier wieder einnehmen können.
AI_Output(self, hero, "Info_Mod_Alissandro_AtCavalorn_28_03"); //Nun gut, jetzt sollten wir den nächsten Schritt planen.
AI_Output(self, hero, "Info_Mod_Alissandro_AtCavalorn_28_04"); //Ich werde etwas darüber nachdenken, wir unterhalten uns morgen darüber.
Mod_AL_AtCavalorn = Wld_GetDay();
B_LogEntry (TOPIC_MOD_AL_MINE, "Ich floh mit Alissandro zu Cavalorns alter Hütte. Hier können wir den nächsten Schritt ausarbeiten.");
B_SetTopicStatus (TOPIC_MOD_AL_MINE, LOG_SUCCESS);
B_GivePlayerXP (1000);
B_StartOtherRoutine (self, "ATCAVALORN");
B_StartOtherRoutine (Mod_1105_EBR_Arto_MT, "ATCAVALORN");
B_Göttergefallen(2, 1);
};
INSTANCE Info_Mod_Alissandro_Flucht (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Flucht_Condition;
information = Info_Mod_Alissandro_Flucht_Info;
permanent = 0;
important = 0;
description = "Was jetzt?";
};
FUNC INT Info_Mod_Alissandro_Flucht_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_AtCavalorn))
&& (Wld_GetDay() > Mod_AL_AtCavalorn)
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Flucht_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_Flucht_15_00"); //Was jetzt?
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_01"); //Wir sind hier nicht lange sicher, vermutlich sucht man schon nach uns.
AI_Output(hero, self, "Info_Mod_Alissandro_Flucht_15_02"); //Dann treten wir denen, die uns suchen, in den Arsch.
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_03"); //Dafür sind es zu viele und wir können keine Verstärkung anfordern. Wir müssen erst einmal fliehen und Unterstützung anfordern und da hätte ich einen Plan ...
AI_Output(hero, self, "Info_Mod_Alissandro_Flucht_15_04"); //Wie sieht der aus?
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_05"); //Die Paladine sind mit Gomez' Leuten verfeindet und sie sind eine starke Gilde, also können wir vielleicht auf ihre Unterstützung hoffen.
AI_Output(hero, self, "Info_Mod_Alissandro_Flucht_15_06"); //Warum sollten die Paladine ausgerechnet uns helfen?
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_07"); //(belustigt) Oh, ich habe einen bemerkenswert guten Draht zu ihnen ...
AI_Output(hero, self, "Info_Mod_Alissandro_Flucht_15_08"); //Wie das?
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_09"); //Na gut, ich denke, ich sollte es dir erzählen ... Bevor ich mich auf Khorinis als Händler niederließ, war ich Paladin in Myrtana und mit Hagen befreundet.
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_10"); //Wir schlugen zusammen die Schlacht von Ishtar, als es von uns besetzt war und der Assassinenführer Zuben die Stadt zurückerobern wollte ... Nun, wir haben den Angriff damals abgewehrt, heute haben die Assassinen allerdings wieder die Macht in Varant...
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_11"); //Das tut allerdings nichts zur Sache. Ich bin jedenfalls mit Lord Hagen befreundet und ich denke, er wird uns helfen.
AI_Output(hero, self, "Info_Mod_Alissandro_Flucht_15_12"); //Gut, wie soll ich aber aus dem Minental herauskommen? Gomez' Leute bewachen alle Ausgänge.
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_13"); //Das ist wahr und macht es schwieriger. Nur haben die Wachen beim Austauschplatz dieses Zeug für sich entdeckt, das sie in Khorata verkaufen ... Wie hieß es noch mal? Frustspender?
AI_Output(hero, self, "Info_Mod_Alissandro_Flucht_15_14"); //Freudenspender ... Ich verstehe. Ich werde versuchen, Lord Hagen zu erreichen.
AI_Output(self, hero, "Info_Mod_Alissandro_Flucht_28_15"); //Gut, viel Glück!
Wld_InsertNpc (DemonKnight_01, "START");
Wld_InsertNpc (DemonKnight_02, "START");
Wld_InsertNpc (Mod_7065_DMR_Daemonenritter_MT, "START");
Wld_InsertNpc (Mod_7066_DMR_Daemonenritter_MT, "START");
Log_CreateTopic (TOPIC_MOD_AL_FLUCHT, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_AL_FLUCHT, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_AL_FLUCHT, "Alissandro hat mich zu den Paladinen geschickt. Um das Minental zu verlassen, sollte ich den weg beim Austauschplatz nehmen.");
};
INSTANCE Info_Mod_Alissandro_Hagen (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Hagen_Condition;
information = Info_Mod_Alissandro_Hagen_Info;
permanent = 0;
important = 0;
description = "Lord Hagen hat uns die Hilfe der Paladine zugesichert.";
};
FUNC INT Info_Mod_Alissandro_Hagen_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Hagen_Alissandro))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Hagen_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_Hagen_15_00"); //Lord Hagen hat uns die Hilfe der Paladine zugesichert.
AI_Output(self, hero, "Info_Mod_Alissandro_Hagen_28_01"); //Sehr gut. Nun warten wir, bis seine Leute kommen.
B_GivePlayerXP (500);
Mod_AL_Alissandro_WaitForOric = Wld_GetDay();
B_LogEntry (TOPIC_MOD_AL_FLUCHT, "Ich habe Alissandro von Lord Hagens Hilfe berichtet.");
B_SetTopicStatus (TOPIC_MOD_AL_FLUCHT, LOG_SUCCESS);
B_Göttergefallen(2, 1);
};
INSTANCE Info_Mod_Alissandro_OricDa (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_OricDa_Condition;
information = Info_Mod_Alissandro_OricDa_Info;
permanent = 0;
important = 0;
description = "Ich hätte etwas mehr Paladine erwartet.";
};
FUNC INT Info_Mod_Alissandro_OricDa_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_Hagen))
&& (Mod_AL_Alissandro_WaitForOric < Wld_GetDay())
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_OricDa_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_OricDa_15_00"); //Ich hätte etwas mehr Paladine erwartet.
AI_Output(self, hero, "Info_Mod_Alissandro_OricDa_28_01"); //Das ist nur die Truppe, mit der wir die ersten Schritte ausführen werden. Für die Befreiung der Mine werden mehr zu uns stoßen und für die Belagerung ebenfalls.
AI_Output(self, hero, "Info_Mod_Alissandro_OricDa_28_02"); //Mit Orics Truppe nehmen wir die Wege aus dem Minental ein. Wir werden nun gleich losgehen und die Alte Mine wie auch den Austauschplatz erobern.
AI_Output(hero, self, "Info_Mod_Alissandro_OricDa_15_03"); //Was machen wir mit den Beliarschreinen?
AI_Output(self, hero, "Info_Mod_Alissandro_OricDa_28_04"); //Die Orks in der Orkstadt sind mit allen Menschen verfeindet. Die in der Festung unterhalten Beziehungen mit dem Schwarzmagier, der die Dämonenritter und die Beschwörer anführt ...
AI_Output(self, hero, "Info_Mod_Alissandro_OricDa_28_05"); //... dieser unterstützt Gomez' Pläne allerdings nicht und hat die Altäre für die Ritter, die mit Gomez zusammenarbeiten, gesperrt.
AI_Output(hero, self, "Info_Mod_Alissandro_OricDa_15_06"); //Das macht die Sache etwas einfacher.
AI_Output(self, hero, "Info_Mod_Alissandro_OricDa_28_07"); //Gut. Wir ziehen's jetzt durch. Folgen wir Oric.
Log_CreateTopic (TOPIC_MOD_AL_ERSTERSCHRITT, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_AL_ERSTERSCHRITT, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_AL_ERSTERSCHRITT, "Wir sollen als Erstes die Zugänge in das Minental einnehmen. Dabei stehen uns einige Paladine unter Oric zur Seite.");
B_StartOtherRoutine (self, "TOVM");
B_StartOtherRoutine (Mod_7039_PAL_Oric_MT, "TOVM");
B_StartOtherRoutine (Mod_7040_RIT_Ritter_MT, "TOVM");
B_StartOtherRoutine (Mod_7041_RIT_Ritter_MT, "TOVM");
B_StartOtherRoutine (Mod_7042_RIT_Ritter_MT, "TOVM");
B_StartOtherRoutine (Mod_7043_RIT_Ritter_MT, "TOVM");
B_StartOtherRoutine (Mod_7044_RIT_Ritter_MT, "TOVM");
B_StartOtherRoutine (Mod_7045_RIT_Ritter_MT, "TOVM");
self.aivar[AIV_PARTYMEMBER] = TRUE;
Mod_7039_PAL_Oric_MT.aivar[AIV_PARTYMEMBER] = TRUE;
Mod_7040_RIT_Ritter_MT.aivar[AIV_PARTYMEMBER] = TRUE;
Mod_7041_RIT_Ritter_MT.aivar[AIV_PARTYMEMBER] = TRUE;
Mod_7042_RIT_Ritter_MT.aivar[AIV_PARTYMEMBER] = TRUE;
Mod_7043_RIT_Ritter_MT.aivar[AIV_PARTYMEMBER] = TRUE;
Mod_7044_RIT_Ritter_MT.aivar[AIV_PARTYMEMBER] = TRUE;
Mod_7045_RIT_Ritter_MT.aivar[AIV_PARTYMEMBER] = TRUE;
Wld_InsertNpc (Mod_7051_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7052_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7053_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7054_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7055_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7056_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7057_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7058_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7059_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7060_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7061_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7062_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7063_DMR_Daemonenritter_MT, "OC1");
Wld_InsertNpc (Mod_7064_DMR_Daemonenritter_MT, "OC1");
Wld_SendTrigger ("EVT_AM_LOB_GATE_BIG");
};
INSTANCE Info_Mod_Alissandro_Lockvogel (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Lockvogel_Condition;
information = Info_Mod_Alissandro_Lockvogel_Info;
permanent = 0;
important = 0;
description = "Wie geht es jetzt weiter?";
};
FUNC INT Info_Mod_Alissandro_Lockvogel_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Oric_MineUns))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Lockvogel_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_Lockvogel_15_00"); //Wie geht es jetzt weiter?
if (Npc_HasItems(hero, ITRU_TELEPORTOLDCAMP) == 1)
{
AI_Output(self, hero, "Info_Mod_Alissandro_Lockvogel_28_01"); //Du hast noch die Teleportrune in das Lager ...
}
else
{
AI_Output(self, hero, "Info_Mod_Alissandro_Lockvogel_28_02"); //Hier hast du eine Teleportrune ins Lager ...
B_GiveInvItems (self, hero, ITRU_TELEPORTOLDCAMP, 1);
Wld_RemoveItem (ITRU_TELEPORTOLDCAMP);
};
AI_Output(self, hero, "Info_Mod_Alissandro_Lockvogel_28_03"); //Sie bringt dich in das Haus der Heilmagier. Sie sind im Haus gefangen, es wird bewacht.
AI_Output(self, hero, "Info_Mod_Alissandro_Lockvogel_28_04"); //Allerdings stehen sie auf unserer Seite. Sie werden dich also nicht verraten, wenn du dich in ihr Gebäude teleportierst.
AI_Output(self, hero, "Info_Mod_Alissandro_Lockvogel_28_05"); //Zusammen mit den Heilmagiern tötest du die Wache des Hauses und nimmst ihre Rüstung.
AI_Output(self, hero, "Info_Mod_Alissandro_Lockvogel_28_06"); //Gehe mit dieser zu Gomez und versuche ihn und seine Leute aus dem Lager in den Wald in der Nähe der Hütte zu locken.
AI_Output(self, hero, "Info_Mod_Alissandro_Lockvogel_28_07"); //Dort werden wir einen Hinterhalt vorbereiten.
AI_Output(hero, self, "Info_Mod_Alissandro_Lockvogel_15_08"); //Klingt riskant. Woher soll ich wissen, dass die anderen Dämonenritter nicht alarmiert werden, wenn ich die Wache bei den Heilmagiern umbringe?
AI_Output(self, hero, "Info_Mod_Alissandro_Lockvogel_28_09"); //Überlass das Makanius. Er scheint einen Plan zu haben. Nun geh und erfülle deine Aufgabe ... viel Glück.
Log_CreateTopic (TOPIC_MOD_AL_LOCKVOGEL, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_AL_LOCKVOGEL, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_AL_LOCKVOGEL, "Alissandro hat einen Plan Gomez auszuschalten, dazu muss ich mich zuerst in das Haus der Heilmagier teleportieren. Makanius wird mir das Übrige erklären.");
};
INSTANCE Info_Mod_Alissandro_Ende (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Ende_Condition;
information = Info_Mod_Alissandro_Ende_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Alissandro_Ende_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_MT_Raven))
&& (!Npc_IsInState(Mod_680_DMB_Xardas_MT, ZS_Talk))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Ende_Info()
{
AI_Output(self, hero, "Info_Mod_Alissandro_Ende_28_00"); //Das wäre geschafft. Nun steht dem Lager nichts mehr im Wege. wir werden es in eine strahlende Zukunft führen!
B_LogEntry (TOPIC_MOD_AL_LOCKVOGEL, "Das Lager ist unser und bleibt es!");
B_SetTopicStatus (TOPIC_MOD_AL_LOCKVOGEL, LOG_SUCCESS);
B_GivePlayerXP (1000);
B_StartOtherRoutine (self, "START");
B_StartOtherRoutine (Mod_7039_PAL_Oric_MT, "TOT");
B_StartOtherRoutine (Mod_1874_HMG_Makanius_MT, "ALTESLAGER");
B_Göttergefallen(2, 1);
};
INSTANCE Info_Mod_Alissandro_Erzbaron (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Erzbaron_Condition;
information = Info_Mod_Alissandro_Erzbaron_Info;
permanent = 0;
important = 0;
description = "Wie bist du Erzbaron geworden?";
};
FUNC INT Info_Mod_Alissandro_Erzbaron_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Alissandro_Hi))
{
return 1;
};
};
FUNC VOID Info_Mod_Alissandro_Erzbaron_Info()
{
AI_Output(hero, self, "Info_Mod_Alissandro_Erzbaron_15_00"); //Wie bist du Erzbaron geworden?
AI_Output(self, hero, "Info_Mod_Alissandro_Erzbaron_28_01"); //Ich war vorher Kaufmann in Khorinis und habe Erz an- und verkauft. Also bin ich nach dem Fall der Barriere in das Minental gekommen, um zu sehen, wie es um das Erz steht.
AI_Output(self, hero, "Info_Mod_Alissandro_Erzbaron_28_02"); //Mein Erkundigungen führten mich ins Alte Lager.
AI_Output(self, hero, "Info_Mod_Alissandro_Erzbaron_28_03"); //Als ich mich ein Weilchen mit Thorus unterhalten hatte, fragte er mich, ob ich ihm nicht mit meinem Handelsgeschick unter die Arme greifen könnte.
AI_Output(self, hero, "Info_Mod_Alissandro_Erzbaron_28_04"); //Nun ja, da ich ja auch das Erz in Aussicht hatte, habe ich natürlich zugestimmt.
AI_Output(self, hero, "Info_Mod_Alissandro_Erzbaron_28_05"); //Und so arbeiten wir hier nun zusammen und ich bin sein oberster Berater.
};
INSTANCE Info_Mod_Alissandro_Pickpocket (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_Pickpocket_Condition;
information = Info_Mod_Alissandro_Pickpocket_Info;
permanent = 1;
important = 0;
description = Pickpocket_180;
};
FUNC INT Info_Mod_Alissandro_Pickpocket_Condition()
{
C_Beklauen (169, ItMi_Gold, 900);
};
FUNC VOID Info_Mod_Alissandro_Pickpocket_Info()
{
Info_ClearChoices (Info_Mod_Alissandro_Pickpocket);
Info_AddChoice (Info_Mod_Alissandro_Pickpocket, DIALOG_BACK, Info_Mod_Alissandro_Pickpocket_BACK);
Info_AddChoice (Info_Mod_Alissandro_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_Alissandro_Pickpocket_DoIt);
};
FUNC VOID Info_Mod_Alissandro_Pickpocket_BACK()
{
Info_ClearChoices (Info_Mod_Alissandro_Pickpocket);
};
FUNC VOID Info_Mod_Alissandro_Pickpocket_DoIt()
{
if (B_Beklauen() == TRUE)
{
Info_ClearChoices (Info_Mod_Alissandro_Pickpocket);
}
else
{
Info_ClearChoices (Info_Mod_Alissandro_Pickpocket);
Info_AddChoice (Info_Mod_Alissandro_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_Alissandro_Pickpocket_Beschimpfen);
Info_AddChoice (Info_Mod_Alissandro_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_Alissandro_Pickpocket_Bestechung);
Info_AddChoice (Info_Mod_Alissandro_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_Alissandro_Pickpocket_Herausreden);
};
};
FUNC VOID Info_Mod_Alissandro_Pickpocket_Beschimpfen()
{
B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN");
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Alissandro_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
};
FUNC VOID Info_Mod_Alissandro_Pickpocket_Bestechung()
{
B_Say (hero, self, "$PICKPOCKET_BESTECHUNG");
var int rnd; rnd = r_max(99);
if (rnd < 25)
|| ((rnd >= 25) && (rnd < 50) && (Npc_HasItems(hero, ItMi_Gold) < 50))
|| ((rnd >= 50) && (rnd < 75) && (Npc_HasItems(hero, ItMi_Gold) < 100))
|| ((rnd >= 75) && (rnd < 100) && (Npc_HasItems(hero, ItMi_Gold) < 200))
{
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Alissandro_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
}
else
{
if (rnd >= 75)
{
B_GiveInvItems (hero, self, ItMi_Gold, 200);
}
else if (rnd >= 50)
{
B_GiveInvItems (hero, self, ItMi_Gold, 100);
}
else if (rnd >= 25)
{
B_GiveInvItems (hero, self, ItMi_Gold, 50);
};
B_Say (self, hero, "$PICKPOCKET_BESTECHUNG_01");
Info_ClearChoices (Info_Mod_Alissandro_Pickpocket);
AI_StopProcessInfos (self);
};
};
FUNC VOID Info_Mod_Alissandro_Pickpocket_Herausreden()
{
B_Say (hero, self, "$PICKPOCKET_HERAUSREDEN");
if (r_max(99) < Mod_Verhandlungsgeschick)
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_01");
Info_ClearChoices (Info_Mod_Alissandro_Pickpocket);
}
else
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02");
};
};
INSTANCE Info_Mod_Alissandro_EXIT (C_INFO)
{
npc = Mod_1870_EBR_Alissandro_MT;
nr = 1;
condition = Info_Mod_Alissandro_EXIT_Condition;
information = Info_Mod_Alissandro_EXIT_Info;
permanent = 1;
important = 0;
description = DIALOG_ENDE;
};
FUNC INT Info_Mod_Alissandro_EXIT_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Alissandro_EXIT_Info()
{
AI_StopProcessInfos (self);
};
|
D
|
const int ATR_HITPOINTS = 0;
const int ATR_HITPOINTS_MAX = 1;
const int ATR_MANA = 2;
const int ATR_MANA_MAX = 3;
const int ATR_STRENGTH = 4;
const int ATR_DEXTERITY = 5;
const int ATR_REGENERATEHP = 6;
const int ATR_REGENERATEMANA = 7;
const int ATR_INDEX_MAX = 8;
const int NPC_FLAG_FRIEND = 1;
const int NPC_FLAG_IMMORTAL = 2;
const int FMODE_NONE = 0;
const int FMODE_FIST = 1;
const int FMODE_MELEE = 2;
const int FMODE_FAR = 5;
const int FMODE_MAGIC = 7;
const int NPC_RUN = 0;
const int NPC_WALK = 1;
const int NPC_SNEAK = 2;
const int NPC_RUN_WEAPON = 128;
const int NPC_WALK_WEAPON = 129;
const int NPC_SNEAK_WEAPON = 130;
const int WEAR_TORSO = 1;
const int WEAR_HEAD = 2;
const int INV_WEAPON = 1;
const int INV_ARMOR = 2;
const int INV_RUNE = 3;
const int INV_MAGIC = 4;
const int INV_FOOD = 5;
const int INV_POTION = 6;
const int INV_DOC = 7;
const int INV_MISC = 8;
const int INV_CAT_MAX = 9;
const int INV_MAX_WEAPONS = 6;
const int INV_MAX_ARMORS = 2;
const int INV_MAX_RUNES = 1000;
const int INV_MAX_FOOD = 15;
const int INV_MAX_DOCS = 1000;
const int INV_MAX_POTIONS = 1000;
const int INV_MAX_MAGIC = 1000;
const int INV_MAX_MISC = 1000;
const int ITM_TEXT_MAX = 6;
const int ITEM_KAT_NONE = 1;
const int ITEM_KAT_NF = 2;
const int ITEM_KAT_FF = 4;
const int ITEM_KAT_MUN = 8;
const int ITEM_KAT_ARMOR = 16;
const int ITEM_KAT_FOOD = 32;
const int ITEM_KAT_DOCS = 64;
const int ITEM_KAT_POTIONS = 128;
const int ITEM_KAT_LIGHT = 256;
const int ITEM_KAT_RUNE = 512;
const int ITEM_KAT_MAGIC = 1 << 31;
const int ITEM_KAT_KEYS = 1;
const int ITEM_BURN = 1 << 10;
const int ITEM_MISSION = 1 << 12;
const int ITEM_MULTI = 1 << 21;
const int ITEM_TORCH = 1 << 28;
const int ITEM_THROW = 1 << 29;
const int ITEM_SWD = 1 << 14;
const int ITEM_AXE = 1 << 15;
const int ITEM_2HD_SWD = 1 << 16;
const int ITEM_2HD_AXE = 1 << 17;
const int ITEM_BOW = 1 << 19;
const int ITEM_CROSSBOW = 1 << 20;
const int ITEM_AMULET = 1 << 22;
const int ITEM_RING = 1 << 11;
const int DAM_INVALID = 0;
const int DAM_BARRIER = 1;
const int DAM_BLUNT = 2;
const int DAM_EDGE = 4;
const int DAM_FIRE = 8;
const int DAM_FLY = 16;
const int DAM_MAGIC = 32;
const int DAM_POINT = 64;
const int DAM_FALL = 128;
const int DAM_INDEX_BARRIER = 0;
const int DAM_INDEX_BLUNT = 1;
const int DAM_INDEX_EDGE = 2;
const int DAM_INDEX_FIRE = 3;
const int DAM_INDEX_FLY = 4;
const int DAM_INDEX_MAGIC = 5;
const int DAM_INDEX_POINT = 6;
const int DAM_INDEX_FALL = 7;
const int DAM_INDEX_MAX = 8;
const int NPC_ATTACK_FINISH_DISTANCE = 180;
const int NPC_BURN_TICKS_PER_DAMAGE_POINT = 100;
const int DAM_CRITICAL_MULTIPLIER = 2;
const int BLOOD_SIZE_DIVISOR = 1000;
const int BLOOD_DAMAGE_MAX = 200;
const int DAMAGE_FLY_CM_MAX = 2000;
const int DAMAGE_FLY_CM_MIN = 300;
const int DAMAGE_FLY_CM_PER_POINT = 5;
const int NPC_DAM_DIVE_TIME = 100;
const int PROT_BARRIER = 0;
const int PROT_BLUNT = 1;
const int PROT_EDGE = 2;
const int PROT_FIRE = 3;
const int PROT_FLY = 4;
const int PROT_MAGIC = 5;
const int PROT_POINT = 6;
const int PROT_FALL = 7;
const int PROT_INDEX_MAX = 8;
const int NPC_TALENT_UNKNOWN = 0;
const int NPC_TALENT_1H = 1;
const int NPC_TALENT_2H = 2;
const int NPC_TALENT_BOW = 3;
const int NPC_TALENT_CROSSBOW = 4;
const int NPC_TALENT_PICKLOCK = 5;
const int NPC_TALENT_PICKPOCKET = 6;
const int NPC_TALENT_MAGE = 7;
const int NPC_TALENT_SNEAK = 8;
const int NPC_TALENT_REGENERATE = 9;
const int NPC_TALENT_FIREMASTER = 10;
const int NPC_TALENT_ACROBAT = 11;
const int NPC_TALENT_MAX = 12;
const int PERC_ASSESSPLAYER = 1;
const int PERC_ASSESSENEMY = 2;
const int PERC_ASSESSFIGHTER = 3;
const int PERC_ASSESSBODY = 4;
const int PERC_ASSESSITEM = 5;
const int SENSE_SEE = 1;
const int SENSE_HEAR = 2;
const int SENSE_SMELL = 4;
const int PERC_ASSESSMURDER = 6;
const int PERC_ASSESSDEFEAT = 7;
const int PERC_ASSESSDAMAGE = 8;
const int PERC_ASSESSOTHERSDAMAGE = 9;
const int PERC_ASSESSTHREAT = 10;
const int PERC_ASSESSREMOVEWEAPON = 11;
const int PERC_OBSERVEINTRUDER = 12;
const int PERC_ASSESSFIGHTSOUND = 13;
const int PERC_ASSESSQUIETSOUND = 14;
const int PERC_ASSESSWARN = 15;
const int PERC_CATCHTHIEF = 16;
const int PERC_ASSESSTHEFT = 17;
const int PERC_ASSESSCALL = 18;
const int PERC_ASSESSTALK = 19;
const int PERC_ASSESSGIVENITEM = 20;
const int PERC_ASSESSFAKEGUILD = 21;
const int PERC_MOVEMOB = 22;
const int PERC_MOVENPC = 23;
const int PERC_DRAWWEAPON = 24;
const int PERC_OBSERVESUSPECT = 25;
const int PERC_NPCCOMMAND = 26;
const int PERC_ASSESSMAGIC = 27;
const int PERC_ASSESSSTOPMAGIC = 28;
const int PERC_ASSESSCASTER = 29;
const int PERC_ASSESSSURPRISE = 30;
const int PERC_ASSESSENTERROOM = 31;
const int PERC_ASSESSUSEMOB = 32;
const int NEWS_DONT_SPREAD = 0;
const int NEWS_SPREAD_NPC_FRIENDLY_TOWARDS_VICTIM = 1;
const int NEWS_SPREAD_NPC_FRIENDLY_TOWARDS_WITNESS = 2;
const int NEWS_SPREAD_NPC_FRIENDLY_TOWARDS_OFFENDER = 3;
const int NEWS_SPREAD_NPC_SAME_GUILD_VICTIM = 4;
const int important = 1;
const int INF_TELL = 0;
const int INF_UNKNOWN = 2;
const int LOG_RUNNING = 1;
const int LOG_SUCCESS = 2;
const int LOG_FAILED = 3;
const int LOG_OBSOLETE = 4;
const int ATT_FRIENDLY = 3;
const int ATT_NEUTRAL = 2;
const int ATT_ANGRY = 1;
const int ATT_HOSTILE = 0;
const int GIL_None = 0;
const int GIL_HUMAN = 1;
const int GIL_EBR = 1;
const int GIL_GRD = 2;
const int GIL_STT = 3;
const int GIL_KDF = 4;
const int GIL_VLK = 5;
const int GIL_KDW = 6;
const int GIL_SLD = 7;
const int GIL_ORG = 8;
const int GIL_BAU = 9;
const int GIL_SFB = 10;
const int GIL_GUR = 11;
const int GIL_NOV = 12;
const int GIL_TPL = 13;
const int GIL_DMB = 14;
const int GIL_BAB = 15;
const int GIL_SEPERATOR_HUM = 16;
const int MAX_GUILDS = 16;
const int GIL_WARAN = 17;
const int GIL_SLF = 18;
const int GIL_GOBBO = 19;
const int GIL_TROLL = 20;
const int GIL_SNAPPER = 21;
const int GIL_MINECRAWLER = 22;
const int GIL_MEATBUG = 23;
const int GIL_SCAVENGER = 24;
const int GIL_DEMON = 25;
const int GIL_WOLF = 26;
const int GIL_SHADOWBEAST = 27;
const int GIL_BLOODFLY = 28;
const int GIL_SWAMPSHARK = 29;
const int GIL_ZOMBIE = 30;
const int GIL_UNDEADORC = 31;
const int GIL_SKELETON = 32;
const int GIL_ORCDOG = 33;
const int GIL_MOLERAT = 34;
const int GIL_GOLEM = 35;
const int GIL_LURKER = 36;
const int GIL_SEPERATOR_ORC = 37;
const int GIL_ORCSHAMAN = 38;
const int GIL_ORCWARRIOR = 39;
const int GIL_ORCSCOUT = 40;
const int GIL_ORCSLAVE = 41;
const int GIL_MAX = 42;
class C_GILVALUES
{
var int water_depth_knee[GIL_MAX];
var int water_depth_chest[GIL_MAX];
var int jumpup_height[GIL_MAX];
var int swim_time[GIL_MAX];
var int dive_time[GIL_MAX];
var int step_height[GIL_MAX];
var int jumplow_height[GIL_MAX];
var int jumpmid_height[GIL_MAX];
var int slide_angle[GIL_MAX];
var int slide_angle2[GIL_MAX];
var int disable_autoroll[GIL_MAX];
var int surface_align[GIL_MAX];
var int climb_heading_angle[GIL_MAX];
var int climb_horiz_angle[GIL_MAX];
var int climb_ground_angle[GIL_MAX];
var int fight_range_base[GIL_MAX];
var int fight_range_fist[GIL_MAX];
var int fight_range_1hs[GIL_MAX];
var int fight_range_1ha[GIL_MAX];
var int fight_range_2hs[GIL_MAX];
var int fight_range_2ha[GIL_MAX];
var int falldown_height[GIL_MAX];
var int falldown_damage[GIL_MAX];
var int blood_disabled[GIL_MAX];
var int blood_max_distance[GIL_MAX];
var int blood_amount[GIL_MAX];
var int blood_flow[GIL_MAX];
var string blood_emitter[GIL_MAX];
var string blood_texture[GIL_MAX];
var int turn_speed[GIL_MAX];
};
const int NPC_SOUND_DROPTAKE = 1;
const int NPC_SOUND_SPEAK = 3;
const int NPC_SOUND_STEPS = 4;
const int NPC_SOUND_THROWCOLL = 5;
const int NPC_SOUND_DRAWWEAPON = 6;
const int NPC_SOUND_SCREAM = 7;
const int NPC_SOUND_FIGHT = 8;
const int MAT_WOOD = 0;
const int MAT_STONE = 1;
const int MAT_METAL = 2;
const int MAT_LEATHER = 3;
const int MAT_CLAY = 4;
const int MAT_GLAS = 5;
const int LOG_MISSION = 0;
const int LOG_NOTE = 1;
const string STR_INFO_TRADE_ACCEPT = "Êóïèòü";
const string STR_INFO_TRADE_RESET = "Îòêàçàòüñÿ";
const string STR_INFO_TRADE_EXIT = "ÍÀÇÀÄ";
const int TIME_INFINITE = -1000;
const int NPC_VOICE_VARIATION_MAX = 10;
|
D
|
// Written in the D programming language.
// Regular Expressions.
/**
* $(RED Deprecated.
* Please use $(LINK2 std_regex.html, std.regex) instead.)
*
* $(LINK2 http://www.digitalmars.com/ctg/regular.html, Regular
* expressions) are a powerful method of string pattern matching. The
* regular expression language used in this library is the same as
* that commonly used, however, some of the very advanced forms may
* behave slightly differently. The standard observed is the $(WEB
* www.ecma-international.org/publications/standards/Ecma-262.htm,
* ECMA standard) for regular expressions.
*
* std.regexp is designed to work only with valid UTF strings as input.
* To validate untrusted input, use std.utf.validate().
*
* In the following guide, $(I pattern)[] refers to a
* $(LINK2 http://www.digitalmars.com/ctg/regular.html, regular expression).
* The $(I attributes)[] refers to
* a string controlling the interpretation
* of the regular expression.
* It consists of a sequence of one or more
* of the following characters:
*
* <table border=1 cellspacing=0 cellpadding=5>
* <caption>Attribute Characters</caption>
* $(TR $(TH Attribute) $(TH Action))
* <tr>
* $(TD $(B g))
* $(TD global; repeat over the whole input string)
* </tr>
* <tr>
* $(TD $(B i))
* $(TD case insensitive)
* </tr>
* <tr>
* $(TD $(B m))
* $(TD treat as multiple lines separated by newlines)
* </tr>
* </table>
*
* The $(I format)[] string has the formatting characters:
*
* <table border=1 cellspacing=0 cellpadding=5>
* <caption>Formatting Characters</caption>
* $(TR $(TH Format) $(TH Replaced With))
* $(TR
* $(TD $(B $$)) $(TD $)
* )
* $(TR
* $(TD $(B $&)) $(TD The matched substring.)
* )
* $(TR
* $(TD $(B $`)) $(TD The portion of string that precedes the matched substring.)
* )
* $(TR
* $(TD $(B $')) $(TD The portion of string that follows the matched substring.)
* )
* $(TR
* $(TD $(B $(DOLLAR))$(I n)) $(TD The $(I n)th capture, where $(I n)
* is a single digit 1-9
* and $$(I n) is not followed by a decimal digit.)
* )
* $(TR
* $(TD $(B $(DOLLAR))$(I nn)) $(TD The $(I nn)th capture, where $(I nn)
* is a two-digit decimal
* number 01-99.
* If $(I nn)th capture is undefined or more than the number
* of parenthesized subexpressions, use the empty
* string instead.)
* )
* </table>
*
* Any other $ are left as is.
*
* References:
* $(LINK2 http://en.wikipedia.org/wiki/Regular_expressions, Wikipedia)
* Macros:
* WIKI = StdRegexp
* DOLLAR = $
*
* Copyright: Copyright Digital Mars 2000 - 2011.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: $(WEB digitalmars.com, Walter Bright)
* Source: $(PHOBOSSRC std/_regexp.d)
*/
/* Copyright Digital Mars 2000 - 2011.
* 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)
*/
/*
Escape sequences:
\nnn starts out a 1, 2 or 3 digit octal sequence,
where n is an octal digit. If nnn is larger than
0377, then the 3rd digit is not part of the sequence
and is not consumed.
For maximal portability, use exactly 3 digits.
\xXX starts out a 1 or 2 digit hex sequence. X
is a hex character. If the first character after the \x
is not a hex character, the value of the sequence is 'x'
and the XX are not consumed.
For maximal portability, use exactly 2 digits.
\uUUUU is a unicode sequence. There are exactly
4 hex characters after the \u, if any are not, then
the value of the sequence is 'u', and the UUUU are not
consumed.
Character classes:
[a-b], where a is greater than b, will produce
an error.
References:
http://www.unicode.org/unicode/reports/tr18/
*/
module std.regexp;
pragma(msg, "Notice: As of Phobos 2.055, std.regexp has been deprecated. " ~
"Please use std.regex instead.");
//debug = regexp; // uncomment to turn on debugging printf's
private
{
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import std.algorithm;
import std.array;
import std.stdio;
import std.string;
import std.ascii;
import std.outbuffer;
import std.bitmanip;
import std.utf;
import std.algorithm;
import std.array;
import std.traits;
}
deprecated:
/** Regular expression to extract an _email address.
* References:
* $(LINK2 http://www.regular-expressions.info/email.html, How to Find or Validate an Email Address)$(BR)
* $(LINK2 http://tools.ietf.org/html/rfc2822#section-3.4.1, RFC 2822 Internet Message Format)
*/
string email =
r"[a-zA-Z]([.]?([[a-zA-Z0-9_]-]+)*)?@([[a-zA-Z0-9_]\-_]+\.)+[a-zA-Z]{2,6}";
/** Regular expression to extract a _url */
string url = r"(([h|H][t|T]|[f|F])[t|T][p|P]([s|S]?)\:\/\/|~/|/)?([\w]+:\w+@)?(([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?)?((/?\w+/)+|/?)(\w+\.[\w]{3,4})?([,]\w+)*((\?\w+=\w+)?(&\w+=\w+)*([,]\w*)*)?";
/************************************
* One of these gets thrown on compilation errors
*/
class RegExpException : Exception
{
this(string msg)
{
super(msg);
}
}
struct regmatch_t
{
sizediff_t rm_so; // index of start of match
sizediff_t rm_eo; // index past end of match
}
private alias char rchar; // so we can make a wchar version
/******************************************************
* Search string for matches with regular expression
* pattern with attributes.
* Replace each match with string generated from format.
* Params:
* s = String to search.
* pattern = Regular expression pattern.
* format = Replacement string format.
* attributes = Regular expression attributes.
* Returns:
* the resulting string
* Example:
* Replace the letters 'a' with the letters 'ZZ'.
* ---
* s = "Strap a rocket engine on a chicken."
* sub(s, "a", "ZZ") // result: StrZZp a rocket engine on a chicken.
* sub(s, "a", "ZZ", "g") // result: StrZZp ZZ rocket engine on ZZ chicken.
* ---
* The replacement format can reference the matches using
* the $&, $$, $', $`, $0 .. $99 notation:
* ---
* sub(s, "[ar]", "[$&]", "g") // result: St[r][a]p [a] [r]ocket engine on [a] chi
* ---
*/
string sub(string s, string pattern, string format, string attributes = null)
{
auto r = new RegExp(pattern, attributes);
auto result = r.replace(s, format);
delete r;
return result;
}
unittest
{
debug(regexp) printf("regexp.sub.unittest\n");
string r = sub("hello", "ll", "ss");
assert(r == "hesso");
}
/*******************************************************
* Search string for matches with regular expression
* pattern with attributes.
* Pass each match to delegate dg.
* Replace each match with the return value from dg.
* Params:
* s = String to search.
* pattern = Regular expression pattern.
* dg = Delegate
* attributes = Regular expression attributes.
* Returns: the resulting string.
* Example:
* Capitalize the letters 'a' and 'r':
* ---
* s = "Strap a rocket engine on a chicken.";
* sub(s, "[ar]",
* delegate char[] (RegExp m)
* {
* return toUpper(m[0]);
* },
* "g"); // result: StRAp A Rocket engine on A chicken.
* ---
*/
string sub(string s, string pattern, string delegate(RegExp) dg, string attributes = null)
{
auto r = new RegExp(pattern, attributes);
string result = s;
size_t lastindex = 0;
size_t offset = 0;
while (r.test(s, lastindex))
{
auto so = r.pmatch[0].rm_so;
auto eo = r.pmatch[0].rm_eo;
string replacement = dg(r);
// Optimize by using std.string.replace if possible - Dave Fladebo
string slice = result[offset + so .. offset + eo];
if (r.attributes & RegExp.REA.global && // global, so replace all
!(r.attributes & RegExp.REA.ignoreCase) && // not ignoring case
!(r.attributes & RegExp.REA.multiline) && // not multiline
pattern == slice) // simple pattern (exact match, no special characters)
{
debug(regexp)
printf("result: %.*s, pattern: %.*s, slice: %.*s, replacement: %.*s\n",
result.length, result.ptr,
pattern.length, pattern.ptr,
slice.length, slice.ptr,
replacement.length, replacement.ptr);
result = replace(result,slice,replacement);
break;
}
result = replaceSlice(result, result[offset + so .. offset + eo], replacement);
if (r.attributes & RegExp.REA.global)
{
offset += replacement.length - (eo - so);
if (lastindex == eo)
lastindex++; // always consume some source
else
lastindex = eo;
}
else
break;
}
delete r;
return result;
}
unittest
{
debug(regexp) printf("regexp.sub.unittest\n");
string foo(RegExp r) { return "ss"; }
auto r = sub("hello", "ll", delegate string(RegExp r) { return "ss"; });
assert(r == "hesso");
r = sub("hello", "l", delegate string(RegExp r) { return "l"; }, "g");
assert(r == "hello");
auto s = sub("Strap a rocket engine on a chicken.",
"[ar]",
delegate string (RegExp m)
{
return std.string.toUpper(m[0]);
},
"g");
assert(s == "StRAp A Rocket engine on A chicken.");
}
/*************************************************
* Search $(D_PARAM s[]) for first match with $(D_PARAM pattern).
* Params:
* s = String to search.
* pattern = Regular expression pattern.
* Returns:
* index into s[] of match if found, -1 if no match.
* Example:
* ---
* auto s = "abcabcabab";
* find(s, RegExp("b")); // match, returns 1
* find(s, RegExp("f")); // no match, returns -1
* ---
*/
sizediff_t find(string s, RegExp pattern)
{
return pattern.test(s)
? pattern.pmatch[0].rm_so
: -1;
}
unittest
{
debug(regexp) printf("regexp.find.unittest\n");
auto i = find("xabcy", RegExp("abc"));
assert(i == 1);
i = find("cba", RegExp("abc"));
assert(i == -1);
}
/**
Returns:
Same as $(D_PARAM find(s, RegExp(pattern, attributes))).
WARNING:
This function is scheduled for deprecation due to unnecessary
ambiguity with the homonym function in std.string. Instead of
$(D_PARAM std.regexp.find(s, p, a)), you may want to use $(D_PARAM
find(s, RegExp(p, a))).
*/
sizediff_t
find(string s, string pattern, string attributes = null)
{
auto r = new RegExp(pattern, attributes);
scope(exit) delete r;
return r.test(s) ? r.pmatch[0].rm_so : -1;
}
unittest
{
debug(regexp) printf("regexp.find.unittest\n");
auto i = find("xabcy", "abc");
assert(i == 1);
i = find("cba", "abc");
assert(i == -1);
}
/*************************************************
* Search $(D_PARAM s[]) for last match with $(D_PARAM pattern).
* Params:
* s = String to search.
* pattern = Regular expression pattern.
* Returns:
* index into s[] of match if found, -1 if no match.
* Example:
* ---
* auto s = "abcabcabab";
* rfind(s, RegExp("b")); // match, returns 9
* rfind(s, RegExp("f")); // no match, returns -1
* ---
*/
sizediff_t rfind(string s, RegExp pattern)
{
sizediff_t i = -1, lastindex = 0;
while (pattern.test(s, lastindex))
{
auto eo = pattern.pmatch[0].rm_eo;
i = pattern.pmatch[0].rm_so;
if (lastindex == eo)
lastindex++; // always consume some source
else
lastindex = eo;
}
return i;
}
unittest
{
sizediff_t i;
debug(regexp) printf("regexp.rfind.unittest\n");
i = rfind("abcdefcdef", RegExp("c"));
assert(i == 6);
i = rfind("abcdefcdef", RegExp("cd"));
assert(i == 6);
i = rfind("abcdefcdef", RegExp("x"));
assert(i == -1);
i = rfind("abcdefcdef", RegExp("xy"));
assert(i == -1);
i = rfind("abcdefcdef", RegExp(""));
assert(i == 10);
}
/*************************************************
Returns:
Same as $(D_PARAM rfind(s, RegExp(pattern, attributes))).
WARNING:
This function is scheduled for deprecation due to unnecessary
ambiguity with the homonym function in std.string. Instead of
$(D_PARAM std.regexp.rfind(s, p, a)), you may want to use $(D_PARAM
rfind(s, RegExp(p, a))).
*/
sizediff_t
rfind(string s, string pattern, string attributes = null)
{
typeof(return) i = -1, lastindex = 0;
auto r = new RegExp(pattern, attributes);
while (r.test(s, lastindex))
{
auto eo = r.pmatch[0].rm_eo;
i = r.pmatch[0].rm_so;
if (lastindex == eo)
lastindex++; // always consume some source
else
lastindex = eo;
}
delete r;
return i;
}
unittest
{
sizediff_t i;
debug(regexp) printf("regexp.rfind.unittest\n");
i = rfind("abcdefcdef", "c");
assert(i == 6);
i = rfind("abcdefcdef", "cd");
assert(i == 6);
i = rfind("abcdefcdef", "x");
assert(i == -1);
i = rfind("abcdefcdef", "xy");
assert(i == -1);
i = rfind("abcdefcdef", "");
assert(i == 10);
}
/********************************************
* Split s[] into an array of strings, using the regular
* expression $(D_PARAM pattern) as the separator.
* Params:
* s = String to search.
* pattern = Regular expression pattern.
* Returns:
* array of slices into s[]
* Example:
* ---
* foreach (s; split("abcabcabab", RegExp("C.", "i")))
* {
* writefln("s = '%s'", s);
* }
* // Prints:
* // s = 'ab'
* // s = 'b'
* // s = 'bab'
* ---
*/
string[] split(string s, RegExp pattern)
{
return pattern.split(s);
}
unittest
{
debug(regexp) printf("regexp.split.unittest()\n");
string[] result;
result = split("ab", RegExp("a*"));
assert(result.length == 2);
assert(result[0] == "");
assert(result[1] == "b");
foreach (i, s; split("abcabcabab", RegExp("C.", "i")))
{
//writefln("s[%d] = '%s'", i, s);
if (i == 0) assert(s == "ab");
else if (i == 1) assert(s == "b");
else if (i == 2) assert(s == "bab");
else assert(0);
}
}
/********************************************
Returns:
Same as $(D_PARAM split(s, RegExp(pattern, attributes))).
WARNING:
This function is scheduled for deprecation due to unnecessary
ambiguity with the homonym function in std.string. Instead of
$(D_PARAM std.regexp.split(s, p, a)), you may want to use $(D_PARAM
split(s, RegExp(p, a))).
*/
string[] split(string s, string pattern, string attributes = null)
{
auto r = new RegExp(pattern, attributes);
auto result = r.split(s);
delete r;
return result;
}
unittest
{
debug(regexp) printf("regexp.split.unittest()\n");
string[] result;
result = split("ab", "a*");
assert(result.length == 2);
assert(result[0] == "");
assert(result[1] == "b");
foreach (i, s; split("abcabcabab", "C.", "i"))
{
//writefln("s[%d] = '%s'", i, s.length, s.ptr);
if (i == 0) assert(s == "ab");
else if (i == 1) assert(s == "b");
else if (i == 2) assert(s == "bab");
else assert(0);
}
}
/****************************************************
* Search s[] for first match with pattern[] with attributes[].
* Params:
* s = String to search.
* pattern = Regular expression pattern.
* attributes = Regular expression attributes.
* Returns:
* corresponding RegExp if found, null if not.
* Example:
* ---
* import std.stdio;
* import std.regexp;
*
* void main()
* {
* if (auto m = std.regexp.search("abcdef", "c"))
* {
* writefln("%s[%s]%s", m.pre, m[0], m.post);
* }
* }
* // Prints:
* // ab[c]def
* ---
*/
RegExp search(string s, string pattern, string attributes = null)
{
auto r = new RegExp(pattern, attributes);
if (!r.test(s))
{ delete r;
assert(r is null);
}
return r;
}
unittest
{
debug(regexp) printf("regexp.string.unittest()\n");
if (auto m = std.regexp.search("abcdef", "c()"))
{
auto result = std.string.format("%s[%s]%s", m.pre, m[0], m.post);
assert(result == "ab[c]def");
assert(m[1] == null);
assert(m[2] == null);
}
else
assert(0);
if (auto n = std.regexp.search("abcdef", "g"))
{
assert(0);
}
}
/* ********************************* RegExp ******************************** */
/*****************************
* RegExp is a class to handle regular expressions.
*
* It is the core foundation for adding powerful string pattern matching
* capabilities to programs like grep, text editors, awk, sed, etc.
*/
class RegExp
{
/*****
* Construct a RegExp object. Compile pattern
* with <i>attributes</i> into
* an internal form for fast execution.
* Params:
* pattern = regular expression
* attributes = _attributes
* Throws: RegExpException if there are any compilation errors.
* Example:
* Declare two variables and assign to them a RegExp object:
* ---
* auto r = new RegExp("pattern");
* auto s = new RegExp(r"p[1-5]\s*");
* ---
*/
public this(string pattern, string attributes = null)
{
pmatch = (&gmatch)[0 .. 1];
compile(pattern, attributes);
}
/*****
* Generate instance of RegExp.
* Params:
* pattern = regular expression
* attributes = _attributes
* Throws: RegExpException if there are any compilation errors.
* Example:
* Declare two variables and assign to them a RegExp object:
* ---
* auto r = RegExp("pattern");
* auto s = RegExp(r"p[1-5]\s*");
* ---
*/
public static RegExp opCall(string pattern, string attributes = null)
{
return new RegExp(pattern, attributes);
}
unittest
{
debug(regexp) printf("regexp.opCall.unittest()\n");
auto r1 = RegExp("hello", "m");
string msg;
try
{
auto r2 = RegExp("hello", "q");
assert(0);
}
catch (RegExpException ree)
{
msg = ree.toString();
//writefln("message: %s", ree);
}
assert(std.algorithm.countUntil(msg, "unrecognized attribute") >= 0);
}
/************************************
* Set up for start of foreach loop.
* Returns:
* search() returns instance of RegExp set up to _search string[].
* Example:
* ---
* import std.stdio;
* import std.regexp;
*
* void main()
* {
* foreach(m; RegExp("ab").search("abcabcabab"))
* {
* writefln("%s[%s]%s", m.pre, m[0], m.post);
* }
* }
* // Prints:
* // [ab]cabcabab
* // abc[ab]cabab
* // abcabc[ab]ab
* // abcabcab[ab]
* ---
*/
public RegExp search(string string)
{
input = string;
pmatch[0].rm_eo = 0;
return this;
}
/** ditto */
public int opApply(scope int delegate(ref RegExp) dg)
{
int result;
RegExp r = this;
while (test())
{
result = dg(r);
if (result)
break;
}
return result;
}
unittest
{
debug(regexp) printf("regexp.search.unittest()\n");
int i;
foreach(m; RegExp("ab").search("abcabcabab"))
{
auto s = std.string.format("%s[%s]%s", m.pre, m[0], m.post);
if (i == 0) assert(s == "[ab]cabcabab");
else if (i == 1) assert(s == "abc[ab]cabab");
else if (i == 2) assert(s == "abcabc[ab]ab");
else if (i == 3) assert(s == "abcabcab[ab]");
else assert(0);
i++;
}
}
/******************
* Retrieve match n.
*
* n==0 means the matched substring, n>0 means the
* n'th parenthesized subexpression.
* if n is larger than the number of parenthesized subexpressions,
* null is returned.
*/
public string opIndex(size_t n)
{
if (n >= pmatch.length)
return null;
else
{
auto rm_so = pmatch[n].rm_so;
auto rm_eo = pmatch[n].rm_eo;
if (rm_so == rm_eo)
return null;
return input[rm_so .. rm_eo];
}
}
/**
Same as $(D_PARAM opIndex(n)).
WARNING:
Scheduled for deprecation due to confusion with overloaded
$(D_PARAM match(string)). Instead of $(D_PARAM regex.match(n))
you may want to use $(D_PARAM regex[n]).
*/
public string match(size_t n)
{
return this[n];
}
/*******************
* Return the slice of the input that precedes the matched substring.
*/
public @property string pre()
{
return input[0 .. pmatch[0].rm_so];
}
/*******************
* Return the slice of the input that follows the matched substring.
*/
public @property string post()
{
return input[pmatch[0].rm_eo .. $];
}
uint re_nsub; // number of parenthesized subexpression matches
regmatch_t[] pmatch; // array [re_nsub + 1]
string input; // the string to search
// per instance:
string pattern; // source text of the regular expression
string flags; // source text of the attributes parameter
int errors;
uint attributes;
enum REA
{
global = 1, // has the g attribute
ignoreCase = 2, // has the i attribute
multiline = 4, // if treat as multiple lines separated
// by newlines, or as a single line
dotmatchlf = 8, // if . matches \n
}
private:
size_t src; // current source index in input[]
size_t src_start; // starting index for match in input[]
size_t p; // position of parser in pattern[]
regmatch_t gmatch; // match for the entire regular expression
// (serves as storage for pmatch[0])
const(ubyte)[] program; // pattern[] compiled into regular expression program
OutBuffer buf;
/******************************************/
// Opcodes
enum : ubyte
{
REend, // end of program
REchar, // single character
REichar, // single character, case insensitive
REdchar, // single UCS character
REidchar, // single wide character, case insensitive
REanychar, // any character
REanystar, // ".*"
REstring, // string of characters
REistring, // string of characters, case insensitive
REtestbit, // any in bitmap, non-consuming
REbit, // any in the bit map
REnotbit, // any not in the bit map
RErange, // any in the string
REnotrange, // any not in the string
REor, // a | b
REplus, // 1 or more
REstar, // 0 or more
REquest, // 0 or 1
REnm, // n..m
REnmq, // n..m, non-greedy version
REbol, // beginning of line
REeol, // end of line
REparen, // parenthesized subexpression
REgoto, // goto offset
REwordboundary,
REnotwordboundary,
REdigit,
REnotdigit,
REspace,
REnotspace,
REword,
REnotword,
REbackref,
};
// BUG: should this include '$'?
private int isword(dchar c) { return isAlphaNum(c) || c == '_'; }
private uint inf = ~0u;
/* ********************************
* Throws RegExpException on error
*/
public void compile(string pattern, string attributes)
{
//printf("RegExp.compile('%.*s', '%.*s')\n", pattern.length, pattern.ptr, attributes.length, attributes.ptr);
this.attributes = 0;
foreach (rchar c; attributes)
{ REA att;
switch (c)
{
case 'g': att = REA.global; break;
case 'i': att = REA.ignoreCase; break;
case 'm': att = REA.multiline; break;
default:
error("unrecognized attribute");
return;
}
if (this.attributes & att)
{ error("redundant attribute");
return;
}
this.attributes |= att;
}
input = null;
this.pattern = pattern;
this.flags = attributes;
uint oldre_nsub = re_nsub;
re_nsub = 0;
errors = 0;
buf = new OutBuffer();
buf.reserve(pattern.length * 8);
p = 0;
parseRegexp();
if (p < pattern.length)
{ error("unmatched ')'");
}
// @@@ SKIPPING OPTIMIZATION SOLVES BUG 941 @@@
//optimize();
program = buf.data;
buf.data = null;
delete buf;
if (re_nsub > oldre_nsub)
{
if (pmatch.ptr is &gmatch)
pmatch = null;
pmatch.length = re_nsub + 1;
}
pmatch[0].rm_so = 0;
pmatch[0].rm_eo = 0;
}
/********************************************
* Split s[] into an array of strings, using the regular
* expression as the separator.
* Returns:
* array of slices into s[]
*/
public string[] split(string s)
{
debug(regexp) printf("regexp.split()\n");
string[] result;
if (s.length)
{
sizediff_t p, q;
for (q = p; q != s.length;)
{
if (test(s, q))
{
q = pmatch[0].rm_so;
auto e = pmatch[0].rm_eo;
if (e != p)
{
result ~= s[p .. q];
for (size_t i = 1; i < pmatch.length; i++)
{
auto so = pmatch[i].rm_so;
auto eo = pmatch[i].rm_eo;
if (so == eo)
{ so = 0; // -1 gives array bounds error
eo = 0;
}
result ~= s[so .. eo];
}
q = p = e;
continue;
}
}
q++;
}
result ~= s[p .. s.length];
}
else if (!test(s))
result ~= s;
return result;
}
unittest
{
debug(regexp) printf("regexp.split.unittest()\n");
auto r = new RegExp("a*?", null);
string[] result;
string j;
int i;
result = r.split("ab");
assert(result.length == 2);
i = std.algorithm.cmp(result[0], "a");
assert(i == 0);
i = std.algorithm.cmp(result[1], "b");
assert(i == 0);
r = new RegExp("a*", null);
result = r.split("ab");
assert(result.length == 2);
i = std.algorithm.cmp(result[0], "");
assert(i == 0);
i = std.algorithm.cmp(result[1], "b");
assert(i == 0);
r = new RegExp("<(\\/)?([^<>]+)>", null);
result = r.split("a<b>font</b>bar<TAG>hello</TAG>");
debug(regexp)
{
for (i = 0; i < result.length; i++)
printf("result[%d] = '%.*s'\n", i, result[i].length, result[i].ptr);
}
j = join(result, ",");
//printf("j = '%.*s'\n", j.length, j.ptr);
i = std.algorithm.cmp(j, "a,,b,font,/,b,bar,,TAG,hello,/,TAG,");
assert(i == 0);
r = new RegExp("a[bc]", null);
result = r.match("123ab");
j = join(result, ",");
i = std.algorithm.cmp(j, "ab");
assert(i == 0);
result = r.match("ac");
j = join(result, ",");
i = std.algorithm.cmp(j, "ac");
assert(i == 0);
}
/*************************************************
* Search string[] for match with regular expression.
* Returns:
* index of match if successful, -1 if not found
*/
public sizediff_t find(string string)
{
if (test(string))
return pmatch[0].rm_so;
else
return -1; // no match
}
//deprecated alias find search;
unittest
{
debug(regexp) printf("regexp.find.unittest()\n");
RegExp r = new RegExp("abc", null);
auto i = r.find("xabcy");
assert(i == 1);
i = r.find("cba");
assert(i == -1);
}
/*************************************************
* Search s[] for match.
* Returns:
* If global attribute, return same value as exec(s).
* If not global attribute, return array of all matches.
*/
public string[] match(string s)
{
string[] result;
if (attributes & REA.global)
{
sizediff_t lastindex = 0;
while (test(s, lastindex))
{
auto eo = pmatch[0].rm_eo;
result ~= input[pmatch[0].rm_so .. eo];
if (lastindex == eo)
lastindex++; // always consume some source
else
lastindex = eo;
}
}
else
{
result = exec(s);
}
return result;
}
unittest
{
debug(regexp) printf("regexp.match.unittest()\n");
int i;
string[] result;
string j;
RegExp r;
r = new RegExp("a[bc]", null);
result = r.match("1ab2ac3");
j = join(result, ",");
i = std.algorithm.cmp(j, "ab");
assert(i == 0);
r = new RegExp("a[bc]", "g");
result = r.match("1ab2ac3");
j = join(result, ",");
i = std.algorithm.cmp(j, "ab,ac");
assert(i == 0);
}
/*************************************************
* Find regular expression matches in s[]. Replace those matches
* with a new string composed of format[] merged with the result of the
* matches.
* If global, replace all matches. Otherwise, replace first match.
* Returns: the new string
*/
public string replace(string s, string format)
{
debug(regexp) printf("string = %.*s, format = %.*s\n", s.length, s.ptr, format.length, format.ptr);
string result = s;
sizediff_t lastindex = 0;
size_t offset = 0;
for (;;)
{
if (!test(s, lastindex))
break;
auto so = pmatch[0].rm_so;
auto eo = pmatch[0].rm_eo;
string replacement = replace(format);
// Optimize by using replace if possible - Dave Fladebo
string slice = result[offset + so .. offset + eo];
if (attributes & REA.global && // global, so replace all
!(attributes & REA.ignoreCase) && // not ignoring case
!(attributes & REA.multiline) && // not multiline
pattern == slice && // simple pattern (exact match, no special characters)
format == replacement) // simple format, not $ formats
{
debug(regexp)
{
auto sss = result[offset + so .. offset + eo];
printf("pattern: %.*s, slice: %.*s, format: %.*s, replacement: %.*s\n",
pattern.length, pattern.ptr, sss.length, sss.ptr, format.length, format.ptr, replacement.length, replacement.ptr);
}
result = std.array.replace(result,slice,replacement);
break;
}
result = replaceSlice(result, result[offset + so .. offset + eo], replacement);
if (attributes & REA.global)
{
offset += replacement.length - (eo - so);
if (lastindex == eo)
lastindex++; // always consume some source
else
lastindex = eo;
}
else
break;
}
return result;
}
unittest
{
debug(regexp) printf("regexp.replace.unittest()\n");
int i;
string result;
RegExp r;
r = new RegExp("a[bc]", "g");
result = r.replace("1ab2ac3", "x$&y");
i = std.algorithm.cmp(result, "1xaby2xacy3");
assert(i == 0);
r = new RegExp("ab", "g");
result = r.replace("1ab2ac3", "xy");
i = std.algorithm.cmp(result, "1xy2ac3");
assert(i == 0);
}
/*************************************************
* Search string[] for match.
* Returns:
* array of slices into string[] representing matches
*/
public string[] exec(string s)
{
debug(regexp) printf("regexp.exec(string = '%.*s')\n", s.length, s.ptr);
input = s;
pmatch[0].rm_so = 0;
pmatch[0].rm_eo = 0;
return exec();
}
/*************************************************
* Pick up where last exec(string) or exec() left off,
* searching string[] for next match.
* Returns:
* array of slices into string[] representing matches
*/
public string[] exec()
{
if (!test())
return null;
auto result = new string[pmatch.length];
for (int i = 0; i < pmatch.length; i++)
{
if (pmatch[i].rm_so == pmatch[i].rm_eo)
result[i] = null;
else
result[i] = input[pmatch[i].rm_so .. pmatch[i].rm_eo];
}
return result;
}
/************************************************
* Search s[] for match.
* Returns: 0 for no match, !=0 for match
* Example:
---
import std.stdio;
import std.regexp;
import std.string;
int grep(int delegate(char[]) pred, char[][] list)
{
int count;
foreach (s; list)
{ if (pred(s))
++count;
}
return count;
}
void main()
{
auto x = grep(&RegExp("[Ff]oo").test,
std.string.split("mary had a foo lamb"));
writefln(x);
}
---
* which prints: 1
*/
//@@@
public bool test(string s)
{
return test(s, 0 /*pmatch[0].rm_eo*/) != 0;
}
/************************************************
* Pick up where last test(string) or test() left off, and search again.
* Returns: 0 for no match, !=0 for match
*/
public int test()
{
return test(input, pmatch[0].rm_eo);
}
/************************************************
* Test s[] starting at startindex against regular expression.
* Returns: 0 for no match, !=0 for match
*/
public int test(string s, size_t startindex)
{
char firstc;
input = s;
debug (regexp) printf("RegExp.test(input[] = '%.*s', startindex = %zd)\n", input.length, input.ptr, startindex);
pmatch[0].rm_so = 0;
pmatch[0].rm_eo = 0;
if (startindex < 0 || startindex > input.length)
{
return 0; // fail
}
//debug(regexp) printProgram(program);
// First character optimization
firstc = 0;
if (program[0] == REchar)
{
firstc = program[1];
if (attributes & REA.ignoreCase && isAlpha(firstc))
firstc = 0;
}
for (auto si = startindex; ; si++)
{
if (firstc)
{
if (si == input.length)
break; // no match
if (input[si] != firstc)
{
si++;
if (!chr(si, firstc)) // if first character not found
break; // no match
}
}
for (size_t i = 0; i < re_nsub + 1; i++)
{
pmatch[i].rm_so = -1;
pmatch[i].rm_eo = -1;
}
src_start = src = si;
if (trymatch(0, program.length))
{
pmatch[0].rm_so = si;
pmatch[0].rm_eo = src;
//debug(regexp) printf("start = %d, end = %d\n", gmatch.rm_so, gmatch.rm_eo);
return 1;
}
// If possible match must start at beginning, we are done
if (program[0] == REbol || program[0] == REanystar)
{
if (attributes & REA.multiline)
{
// Scan for the next \n
if (!chr(si, '\n'))
break; // no match if '\n' not found
}
else
break;
}
if (si == input.length)
break;
debug(regexp)
{
auto sss = input[si + 1 .. input.length];
printf("Starting new try: '%.*s'\n", sss.length, sss.ptr);
}
}
return 0; // no match
}
/**
Returns whether string $(D_PARAM s) matches $(D_PARAM this).
*/
alias test opEquals;
// bool opEquals(string s)
// {
// return test(s);
// }
unittest
{
assert("abc" == RegExp(".b."));
assert("abc" != RegExp(".b.."));
}
int chr(ref size_t si, rchar c)
{
for (; si < input.length; si++)
{
if (input[si] == c)
return 1;
}
return 0;
}
void printProgram(const(ubyte)[] prog)
{
//debug(regexp)
{
size_t len;
uint n;
uint m;
ushort *pu;
uint *puint;
char[] str;
printf("printProgram()\n");
for (size_t pc = 0; pc < prog.length; )
{
printf("%3d: ", pc);
//printf("prog[pc] = %d, REchar = %d, REnmq = %d\n", prog[pc], REchar, REnmq);
switch (prog[pc])
{
case REchar:
printf("\tREchar '%c'\n", prog[pc + 1]);
pc += 1 + char.sizeof;
break;
case REichar:
printf("\tREichar '%c'\n", prog[pc + 1]);
pc += 1 + char.sizeof;
break;
case REdchar:
printf("\tREdchar '%c'\n", *cast(dchar *)&prog[pc + 1]);
pc += 1 + dchar.sizeof;
break;
case REidchar:
printf("\tREidchar '%c'\n", *cast(dchar *)&prog[pc + 1]);
pc += 1 + dchar.sizeof;
break;
case REanychar:
printf("\tREanychar\n");
pc++;
break;
case REstring:
len = *cast(size_t *)&prog[pc + 1];
str = (cast(char*)&prog[pc + 1 + size_t.sizeof])[0 .. len];
printf("\tREstring x%x, '%.*s'\n", len, str.length, str.ptr);
pc += 1 + size_t.sizeof + len * rchar.sizeof;
break;
case REistring:
len = *cast(size_t *)&prog[pc + 1];
str = (cast(char*)&prog[pc + 1 + size_t.sizeof])[0 .. len];
printf("\tREistring x%x, '%.*s'\n", len, str.length, str.ptr);
pc += 1 + size_t.sizeof + len * rchar.sizeof;
break;
case REtestbit:
pu = cast(ushort *)&prog[pc + 1];
printf("\tREtestbit %d, %d\n", pu[0], pu[1]);
len = pu[1];
pc += 1 + 2 * ushort.sizeof + len;
break;
case REbit:
pu = cast(ushort *)&prog[pc + 1];
len = pu[1];
printf("\tREbit cmax=%02x, len=%d:", pu[0], len);
for (n = 0; n < len; n++)
printf(" %02x", prog[pc + 1 + 2 * ushort.sizeof + n]);
printf("\n");
pc += 1 + 2 * ushort.sizeof + len;
break;
case REnotbit:
pu = cast(ushort *)&prog[pc + 1];
printf("\tREnotbit %d, %d\n", pu[0], pu[1]);
len = pu[1];
pc += 1 + 2 * ushort.sizeof + len;
break;
case RErange:
len = *cast(uint *)&prog[pc + 1];
printf("\tRErange %d\n", len);
// BUG: REAignoreCase?
pc += 1 + uint.sizeof + len;
break;
case REnotrange:
len = *cast(uint *)&prog[pc + 1];
printf("\tREnotrange %d\n", len);
// BUG: REAignoreCase?
pc += 1 + uint.sizeof + len;
break;
case REbol:
printf("\tREbol\n");
pc++;
break;
case REeol:
printf("\tREeol\n");
pc++;
break;
case REor:
len = *cast(uint *)&prog[pc + 1];
printf("\tREor %d, pc=>%d\n", len, pc + 1 + uint.sizeof + len);
pc += 1 + uint.sizeof;
break;
case REgoto:
len = *cast(uint *)&prog[pc + 1];
printf("\tREgoto %d, pc=>%d\n", len, pc + 1 + uint.sizeof + len);
pc += 1 + uint.sizeof;
break;
case REanystar:
printf("\tREanystar\n");
pc++;
break;
case REnm:
case REnmq:
// len, n, m, ()
puint = cast(uint *)&prog[pc + 1];
len = puint[0];
n = puint[1];
m = puint[2];
printf("\tREnm%s len=%d, n=%u, m=%u, pc=>%d\n",
(prog[pc] == REnmq) ? "q".ptr : " ".ptr,
len, n, m, pc + 1 + uint.sizeof * 3 + len);
pc += 1 + uint.sizeof * 3;
break;
case REparen:
// len, n, ()
puint = cast(uint *)&prog[pc + 1];
len = puint[0];
n = puint[1];
printf("\tREparen len=%d n=%d, pc=>%d\n", len, n, pc + 1 + uint.sizeof * 2 + len);
pc += 1 + uint.sizeof * 2;
break;
case REend:
printf("\tREend\n");
return;
case REwordboundary:
printf("\tREwordboundary\n");
pc++;
break;
case REnotwordboundary:
printf("\tREnotwordboundary\n");
pc++;
break;
case REdigit:
printf("\tREdigit\n");
pc++;
break;
case REnotdigit:
printf("\tREnotdigit\n");
pc++;
break;
case REspace:
printf("\tREspace\n");
pc++;
break;
case REnotspace:
printf("\tREnotspace\n");
pc++;
break;
case REword:
printf("\tREword\n");
pc++;
break;
case REnotword:
printf("\tREnotword\n");
pc++;
break;
case REbackref:
printf("\tREbackref %d\n", prog[1]);
pc += 2;
break;
default:
assert(0);
}
}
}
}
/**************************************************
* Match input against a section of the program[].
* Returns:
* 1 if successful match
* 0 no match
*/
int trymatch(size_t pc, size_t pcend)
{
size_t len;
size_t n;
size_t m;
size_t count;
size_t pop;
size_t ss;
regmatch_t *psave;
size_t c1;
size_t c2;
ushort* pu;
uint* puint;
debug(regexp)
{
auto sss = input[src .. input.length];
printf("RegExp.trymatch(pc = %zd, src = '%.*s', pcend = %zd)\n", pc, sss.length, sss.ptr, pcend);
}
auto srcsave = src;
psave = null;
for (;;)
{
if (pc == pcend) // if done matching
{ debug(regex) printf("\tprogend\n");
return 1;
}
//printf("\top = %d\n", program[pc]);
switch (program[pc])
{
case REchar:
if (src == input.length)
goto Lnomatch;
debug(regexp) printf("\tREchar '%c', src = '%c'\n", program[pc + 1], input[src]);
if (program[pc + 1] != input[src])
goto Lnomatch;
src++;
pc += 1 + char.sizeof;
break;
case REichar:
if (src == input.length)
goto Lnomatch;
debug(regexp) printf("\tREichar '%c', src = '%c'\n", program[pc + 1], input[src]);
c1 = program[pc + 1];
c2 = input[src];
if (c1 != c2)
{
if (isLower(cast(rchar)c2))
c2 = std.ascii.toUpper(cast(rchar)c2);
else
goto Lnomatch;
if (c1 != c2)
goto Lnomatch;
}
src++;
pc += 1 + char.sizeof;
break;
case REdchar:
debug(regexp) printf("\tREdchar '%c', src = '%c'\n", *(cast(dchar *)&program[pc + 1]), input[src]);
if (src == input.length)
goto Lnomatch;
if (*(cast(dchar *)&program[pc + 1]) != input[src])
goto Lnomatch;
src++;
pc += 1 + dchar.sizeof;
break;
case REidchar:
debug(regexp) printf("\tREidchar '%c', src = '%c'\n", *(cast(dchar *)&program[pc + 1]), input[src]);
if (src == input.length)
goto Lnomatch;
c1 = *(cast(dchar *)&program[pc + 1]);
c2 = input[src];
if (c1 != c2)
{
if (isLower(cast(rchar)c2))
c2 = std.ascii.toUpper(cast(rchar)c2);
else
goto Lnomatch;
if (c1 != c2)
goto Lnomatch;
}
src++;
pc += 1 + dchar.sizeof;
break;
case REanychar:
debug(regexp) printf("\tREanychar\n");
if (src == input.length)
goto Lnomatch;
if (!(attributes & REA.dotmatchlf) && input[src] == cast(rchar)'\n')
goto Lnomatch;
src += std.utf.stride(input, src);
//src++;
pc++;
break;
case REstring:
len = *cast(size_t *)&program[pc + 1];
debug(regexp)
{
auto sss2 = (&program[pc + 1 + size_t.sizeof])[0 .. len];
printf("\tREstring x%x, '%.*s'\n", len, sss2.length, sss2.ptr);
}
if (src + len > input.length)
goto Lnomatch;
if (memcmp(&program[pc + 1 + size_t.sizeof], &input[src], len * rchar.sizeof))
goto Lnomatch;
src += len;
pc += 1 + size_t.sizeof + len * rchar.sizeof;
break;
case REistring:
len = *cast(size_t *)&program[pc + 1];
debug(regexp)
{
auto sss2 = (&program[pc + 1 + size_t.sizeof])[0 .. len];
printf("\tREistring x%x, '%.*s'\n", len, sss2.length, sss2.ptr);
}
if (src + len > input.length)
goto Lnomatch;
if (icmp((cast(char*)&program[pc + 1 + size_t.sizeof])[0..len],
input[src .. src + len]))
goto Lnomatch;
src += len;
pc += 1 + size_t.sizeof + len * rchar.sizeof;
break;
case REtestbit:
pu = (cast(ushort *)&program[pc + 1]);
if (src == input.length)
goto Lnomatch;
debug(regexp) printf("\tREtestbit %d, %d, '%c', x%02x\n",
pu[0], pu[1], input[src], input[src]);
len = pu[1];
c1 = input[src];
//printf("[x%02x]=x%02x, x%02x\n", c1 >> 3, ((&program[pc + 1 + 4])[c1 >> 3] ), (1 << (c1 & 7)));
if (c1 <= pu[0] &&
!((&(program[pc + 1 + 4]))[c1 >> 3] & (1 << (c1 & 7))))
goto Lnomatch;
pc += 1 + 2 * ushort.sizeof + len;
break;
case REbit:
pu = (cast(ushort *)&program[pc + 1]);
if (src == input.length)
goto Lnomatch;
debug(regexp) printf("\tREbit %d, %d, '%c'\n",
pu[0], pu[1], input[src]);
len = pu[1];
c1 = input[src];
if (c1 > pu[0])
goto Lnomatch;
if (!((&program[pc + 1 + 4])[c1 >> 3] & (1 << (c1 & 7))))
goto Lnomatch;
src++;
pc += 1 + 2 * ushort.sizeof + len;
break;
case REnotbit:
pu = (cast(ushort *)&program[pc + 1]);
if (src == input.length)
goto Lnomatch;
debug(regexp) printf("\tREnotbit %d, %d, '%c'\n",
pu[0], pu[1], input[src]);
len = pu[1];
c1 = input[src];
if (c1 <= pu[0] &&
((&program[pc + 1 + 4])[c1 >> 3] & (1 << (c1 & 7))))
goto Lnomatch;
src++;
pc += 1 + 2 * ushort.sizeof + len;
break;
case RErange:
len = *cast(uint *)&program[pc + 1];
debug(regexp) printf("\tRErange %d\n", len);
if (src == input.length)
goto Lnomatch;
// BUG: REA.ignoreCase?
if (memchr(cast(char*)&program[pc + 1 + uint.sizeof], input[src], len) == null)
goto Lnomatch;
src++;
pc += 1 + uint.sizeof + len;
break;
case REnotrange:
len = *cast(uint *)&program[pc + 1];
debug(regexp) printf("\tREnotrange %d\n", len);
if (src == input.length)
goto Lnomatch;
// BUG: REA.ignoreCase?
if (memchr(cast(char*)&program[pc + 1 + uint.sizeof], input[src], len) != null)
goto Lnomatch;
src++;
pc += 1 + uint.sizeof + len;
break;
case REbol:
debug(regexp) printf("\tREbol\n");
if (src == 0)
{
}
else if (attributes & REA.multiline)
{
if (input[src - 1] != '\n')
goto Lnomatch;
}
else
goto Lnomatch;
pc++;
break;
case REeol:
debug(regexp) printf("\tREeol\n");
if (src == input.length)
{
}
else if (attributes & REA.multiline && input[src] == '\n')
src++;
else
goto Lnomatch;
pc++;
break;
case REor:
len = (cast(uint *)&program[pc + 1])[0];
debug(regexp) printf("\tREor %d\n", len);
pop = pc + 1 + uint.sizeof;
ss = src;
if (trymatch(pop, pcend))
{
if (pcend != program.length)
{
auto s = src;
if (trymatch(pcend, program.length))
{ debug(regexp) printf("\tfirst operand matched\n");
src = s;
return 1;
}
else
{
// If second branch doesn't match to end, take first anyway
src = ss;
if (!trymatch(pop + len, program.length))
{
debug(regexp) printf("\tfirst operand matched\n");
src = s;
return 1;
}
}
src = ss;
}
else
{ debug(regexp) printf("\tfirst operand matched\n");
return 1;
}
}
pc = pop + len; // proceed with 2nd branch
break;
case REgoto:
debug(regexp) printf("\tREgoto\n");
len = (cast(uint *)&program[pc + 1])[0];
pc += 1 + uint.sizeof + len;
break;
case REanystar:
debug(regexp) printf("\tREanystar\n");
pc++;
for (;;)
{
auto s1 = src;
if (src == input.length)
break;
if (!(attributes & REA.dotmatchlf) && input[src] == '\n')
break;
src++;
auto s2 = src;
// If no match after consumption, but it
// did match before, then no match
if (!trymatch(pc, program.length))
{
src = s1;
// BUG: should we save/restore pmatch[]?
if (trymatch(pc, program.length))
{
src = s1; // no match
break;
}
}
src = s2;
}
break;
case REnm:
case REnmq:
// len, n, m, ()
puint = cast(uint *)&program[pc + 1];
len = puint[0];
n = puint[1];
m = puint[2];
debug(regexp) printf("\tREnm%s len=%d, n=%u, m=%u\n",
(program[pc] == REnmq) ? "q".ptr : "".ptr, len, n, m);
pop = pc + 1 + uint.sizeof * 3;
for (count = 0; count < n; count++)
{
if (!trymatch(pop, pop + len))
goto Lnomatch;
}
if (!psave && count < m)
{
//version (Win32)
psave = cast(regmatch_t *)alloca((re_nsub + 1) * regmatch_t.sizeof);
//else
//psave = new regmatch_t[re_nsub + 1];
}
if (program[pc] == REnmq) // if minimal munch
{
for (; count < m; count++)
{
memcpy(psave, pmatch.ptr, (re_nsub + 1) * regmatch_t.sizeof);
auto s1 = src;
if (trymatch(pop + len, program.length))
{
src = s1;
memcpy(pmatch.ptr, psave, (re_nsub + 1) * regmatch_t.sizeof);
break;
}
if (!trymatch(pop, pop + len))
{ debug(regexp) printf("\tdoesn't match subexpression\n");
break;
}
// If source is not consumed, don't
// infinite loop on the match
if (s1 == src)
{ debug(regexp) printf("\tsource is not consumed\n");
break;
}
}
}
else // maximal munch
{
for (; count < m; count++)
{
memcpy(psave, pmatch.ptr, (re_nsub + 1) * regmatch_t.sizeof);
auto s1 = src;
if (!trymatch(pop, pop + len))
{ debug(regexp) printf("\tdoesn't match subexpression\n");
break;
}
auto s2 = src;
// If source is not consumed, don't
// infinite loop on the match
if (s1 == s2)
{ debug(regexp) printf("\tsource is not consumed\n");
break;
}
// If no match after consumption, but it
// did match before, then no match
if (!trymatch(pop + len, program.length))
{
src = s1;
if (trymatch(pop + len, program.length))
{
src = s1; // no match
memcpy(pmatch.ptr, psave, (re_nsub + 1) * regmatch_t.sizeof);
break;
}
}
src = s2;
}
}
debug(regexp) printf("\tREnm len=%d, n=%u, m=%u, DONE count=%d\n", len, n, m, count);
pc = pop + len;
break;
case REparen:
// len, ()
debug(regexp) printf("\tREparen\n");
puint = cast(uint *)&program[pc + 1];
len = puint[0];
n = puint[1];
pop = pc + 1 + uint.sizeof * 2;
ss = src;
if (!trymatch(pop, pop + len))
goto Lnomatch;
pmatch[n + 1].rm_so = ss;
pmatch[n + 1].rm_eo = src;
pc = pop + len;
break;
case REend:
debug(regexp) printf("\tREend\n");
return 1; // successful match
case REwordboundary:
debug(regexp) printf("\tREwordboundary\n");
if (src > 0 && src < input.length)
{
c1 = input[src - 1];
c2 = input[src];
if (!(
(isword(cast(rchar)c1) && !isword(cast(rchar)c2)) ||
(!isword(cast(rchar)c1) && isword(cast(rchar)c2))
)
)
goto Lnomatch;
}
pc++;
break;
case REnotwordboundary:
debug(regexp) printf("\tREnotwordboundary\n");
if (src == 0 || src == input.length)
goto Lnomatch;
c1 = input[src - 1];
c2 = input[src];
if (
(isword(cast(rchar)c1) && !isword(cast(rchar)c2)) ||
(!isword(cast(rchar)c1) && isword(cast(rchar)c2))
)
goto Lnomatch;
pc++;
break;
case REdigit:
debug(regexp) printf("\tREdigit\n");
if (src == input.length)
goto Lnomatch;
if (!isDigit(input[src]))
goto Lnomatch;
src++;
pc++;
break;
case REnotdigit:
debug(regexp) printf("\tREnotdigit\n");
if (src == input.length)
goto Lnomatch;
if (isDigit(input[src]))
goto Lnomatch;
src++;
pc++;
break;
case REspace:
debug(regexp) printf("\tREspace\n");
if (src == input.length)
goto Lnomatch;
if (!isWhite(input[src]))
goto Lnomatch;
src++;
pc++;
break;
case REnotspace:
debug(regexp) printf("\tREnotspace\n");
if (src == input.length)
goto Lnomatch;
if (isWhite(input[src]))
goto Lnomatch;
src++;
pc++;
break;
case REword:
debug(regexp) printf("\tREword\n");
if (src == input.length)
goto Lnomatch;
if (!isword(input[src]))
goto Lnomatch;
src++;
pc++;
break;
case REnotword:
debug(regexp) printf("\tREnotword\n");
if (src == input.length)
goto Lnomatch;
if (isword(input[src]))
goto Lnomatch;
src++;
pc++;
break;
case REbackref:
{
n = program[pc + 1];
debug(regexp) printf("\tREbackref %d\n", n);
auto so = pmatch[n + 1].rm_so;
auto eo = pmatch[n + 1].rm_eo;
len = eo - so;
if (src + len > input.length)
goto Lnomatch;
else if (attributes & REA.ignoreCase)
{
if (icmp(input[src .. src + len], input[so .. eo]))
goto Lnomatch;
}
else if (memcmp(&input[src], &input[so], len * rchar.sizeof))
goto Lnomatch;
src += len;
pc += 2;
break;
}
default:
assert(0);
}
}
Lnomatch:
debug(regexp) printf("\tnomatch pc=%d\n", pc);
src = srcsave;
return 0;
}
/* =================== Compiler ================== */
int parseRegexp()
{
size_t gotooffset;
uint len1;
uint len2;
debug(regexp)
{
auto sss = pattern[p .. pattern.length];
printf("parseRegexp() '%.*s'\n", sss.length, sss.ptr);
}
auto offset = buf.offset;
for (;;)
{
assert(p <= pattern.length);
if (p == pattern.length)
{ buf.write(REend);
return 1;
}
switch (pattern[p])
{
case ')':
return 1;
case '|':
p++;
gotooffset = buf.offset;
buf.write(REgoto);
buf.write(cast(uint)0);
len1 = cast(uint)(buf.offset - offset);
buf.spread(offset, 1 + uint.sizeof);
gotooffset += 1 + uint.sizeof;
parseRegexp();
len2 = cast(uint)(buf.offset - (gotooffset + 1 + uint.sizeof));
buf.data[offset] = REor;
(cast(uint *)&buf.data[offset + 1])[0] = len1;
(cast(uint *)&buf.data[gotooffset + 1])[0] = len2;
break;
default:
parsePiece();
break;
}
}
}
int parsePiece()
{
uint len;
uint n;
uint m;
ubyte op;
auto plength = pattern.length;
debug(regexp)
{
auto sss = pattern[p .. pattern.length];
printf("parsePiece() '%.*s'\n", sss.length, sss.ptr);
}
auto offset = buf.offset;
parseAtom();
if (p == plength)
return 1;
switch (pattern[p])
{
case '*':
// Special optimization: replace .* with REanystar
if (buf.offset - offset == 1 &&
buf.data[offset] == REanychar &&
p + 1 < plength &&
pattern[p + 1] != '?')
{
buf.data[offset] = REanystar;
p++;
break;
}
n = 0;
m = inf;
goto Lnm;
case '+':
n = 1;
m = inf;
goto Lnm;
case '?':
n = 0;
m = 1;
goto Lnm;
case '{': // {n} {n,} {n,m}
p++;
if (p == plength || !isDigit(pattern[p]))
goto Lerr;
n = 0;
do
{
// BUG: handle overflow
n = n * 10 + pattern[p] - '0';
p++;
if (p == plength)
goto Lerr;
} while (isDigit(pattern[p]));
if (pattern[p] == '}') // {n}
{ m = n;
goto Lnm;
}
if (pattern[p] != ',')
goto Lerr;
p++;
if (p == plength)
goto Lerr;
if (pattern[p] == /*{*/ '}') // {n,}
{ m = inf;
goto Lnm;
}
if (!isDigit(pattern[p]))
goto Lerr;
m = 0; // {n,m}
do
{
// BUG: handle overflow
m = m * 10 + pattern[p] - '0';
p++;
if (p == plength)
goto Lerr;
} while (isDigit(pattern[p]));
if (pattern[p] != /*{*/ '}')
goto Lerr;
goto Lnm;
Lnm:
p++;
op = REnm;
if (p < plength && pattern[p] == '?')
{ op = REnmq; // minimal munch version
p++;
}
len = cast(uint)(buf.offset - offset);
buf.spread(offset, 1 + uint.sizeof * 3);
buf.data[offset] = op;
uint* puint = cast(uint *)&buf.data[offset + 1];
puint[0] = len;
puint[1] = n;
puint[2] = m;
break;
default:
break;
}
return 1;
Lerr:
error("badly formed {n,m}");
assert(0);
}
int parseAtom()
{ ubyte op;
size_t offset;
rchar c;
debug(regexp)
{
auto sss = pattern[p .. pattern.length];
printf("parseAtom() '%.*s'\n", sss.length, sss.ptr);
}
if (p < pattern.length)
{
c = pattern[p];
switch (c)
{
case '*':
case '+':
case '?':
error("*+? not allowed in atom");
p++;
return 0;
case '(':
p++;
buf.write(REparen);
offset = buf.offset;
buf.write(cast(uint)0); // reserve space for length
buf.write(re_nsub);
re_nsub++;
parseRegexp();
*cast(uint *)&buf.data[offset] =
cast(uint)(buf.offset - (offset + uint.sizeof * 2));
if (p == pattern.length || pattern[p] != ')')
{
error("')' expected");
return 0;
}
p++;
break;
case '[':
if (!parseRange())
return 0;
break;
case '.':
p++;
buf.write(REanychar);
break;
case '^':
p++;
buf.write(REbol);
break;
case '$':
p++;
buf.write(REeol);
break;
case '\\':
p++;
if (p == pattern.length)
{ error("no character past '\\'");
return 0;
}
c = pattern[p];
switch (c)
{
case 'b': op = REwordboundary; goto Lop;
case 'B': op = REnotwordboundary; goto Lop;
case 'd': op = REdigit; goto Lop;
case 'D': op = REnotdigit; goto Lop;
case 's': op = REspace; goto Lop;
case 'S': op = REnotspace; goto Lop;
case 'w': op = REword; goto Lop;
case 'W': op = REnotword; goto Lop;
Lop:
buf.write(op);
p++;
break;
case 'f':
case 'n':
case 'r':
case 't':
case 'v':
case 'c':
case 'x':
case 'u':
case '0':
c = cast(char)escape();
goto Lbyte;
case '1': case '2': case '3':
case '4': case '5': case '6':
case '7': case '8': case '9':
c -= '1';
if (c < re_nsub)
{ buf.write(REbackref);
buf.write(cast(ubyte)c);
}
else
{ error("no matching back reference");
return 0;
}
p++;
break;
default:
p++;
goto Lbyte;
}
break;
default:
p++;
Lbyte:
op = REchar;
if (attributes & REA.ignoreCase)
{
if (isAlpha(c))
{
op = REichar;
c = cast(char)std.ascii.toUpper(c);
}
}
if (op == REchar && c <= 0xFF)
{
// Look ahead and see if we can make this into
// an REstring
auto q = p;
for (; q < pattern.length; ++q)
{ rchar qc = pattern[q];
switch (qc)
{
case '{':
case '*':
case '+':
case '?':
if (q == p)
goto Lchar;
q--;
break;
case '(': case ')':
case '|':
case '[': case ']':
case '.': case '^':
case '$': case '\\':
case '}':
break;
default:
continue;
}
break;
}
auto len = q - p;
if (len > 0)
{
debug(regexp) printf("writing string len %d, c = '%c', pattern[p] = '%c'\n", len+1, c, pattern[p]);
buf.reserve(5 + (1 + len) * rchar.sizeof);
buf.write((attributes & REA.ignoreCase) ? REistring : REstring);
buf.write(len + 1);
buf.write(c);
buf.write(pattern[p .. p + len]);
p = q;
break;
}
}
if (c >= 0x80)
{
// Convert to dchar opcode
op = (op == REchar) ? REdchar : REidchar;
buf.write(op);
buf.write(c);
}
else
{
Lchar:
debug(regexp) printf("It's an REchar '%c'\n", c);
buf.write(op);
buf.write(cast(char)c);
}
break;
}
}
return 1;
}
private:
class Range
{
size_t maxc;
size_t maxb;
OutBuffer buf;
ubyte* base;
BitArray bits;
this(OutBuffer buf)
{
this.buf = buf;
if (buf.data.length)
this.base = &buf.data[buf.offset];
}
void setbitmax(size_t u)
{
//printf("setbitmax(x%x), maxc = x%x\n", u, maxc);
if (u > maxc)
{
maxc = u;
auto b = u / 8;
if (b >= maxb)
{
auto u2 = base ? base - &buf.data[0] : 0;
buf.fill0(b - maxb + 1);
base = &buf.data[u2];
maxb = b + 1;
//bits = (cast(bit*)this.base)[0 .. maxc + 1];
bits.ptr = cast(size_t*)this.base;
}
bits.len = maxc + 1;
}
}
void setbit2(size_t u)
{
setbitmax(u + 1);
//printf("setbit2 [x%02x] |= x%02x\n", u >> 3, 1 << (u & 7));
bits[u] = 1;
}
};
int parseRange()
{
int c;
int c2;
uint i;
uint cmax;
cmax = 0x7F;
p++;
ubyte op = REbit;
if (p == pattern.length)
goto Lerr;
if (pattern[p] == '^')
{ p++;
op = REnotbit;
if (p == pattern.length)
goto Lerr;
}
buf.write(op);
auto offset = buf.offset;
buf.write(cast(uint)0); // reserve space for length
buf.reserve(128 / 8);
auto r = new Range(buf);
if (op == REnotbit)
r.setbit2(0);
switch (pattern[p])
{
case ']':
case '-':
c = pattern[p];
p++;
r.setbit2(c);
break;
default:
break;
}
enum RS { start, rliteral, dash }
RS rs;
rs = RS.start;
for (;;)
{
if (p == pattern.length)
goto Lerr;
switch (pattern[p])
{
case ']':
switch (rs)
{ case RS.dash:
r.setbit2('-');
goto case;
case RS.rliteral:
r.setbit2(c);
break;
case RS.start:
break;
default:
assert(0);
}
p++;
break;
case '\\':
p++;
r.setbitmax(cmax);
if (p == pattern.length)
goto Lerr;
switch (pattern[p])
{
case 'd':
for (i = '0'; i <= '9'; i++)
r.bits[i] = 1;
goto Lrs;
case 'D':
for (i = 1; i < '0'; i++)
r.bits[i] = 1;
for (i = '9' + 1; i <= cmax; i++)
r.bits[i] = 1;
goto Lrs;
case 's':
for (i = 0; i <= cmax; i++)
if (isWhite(i))
r.bits[i] = 1;
goto Lrs;
case 'S':
for (i = 1; i <= cmax; i++)
if (!isWhite(i))
r.bits[i] = 1;
goto Lrs;
case 'w':
for (i = 0; i <= cmax; i++)
if (isword(cast(rchar)i))
r.bits[i] = 1;
goto Lrs;
case 'W':
for (i = 1; i <= cmax; i++)
if (!isword(cast(rchar)i))
r.bits[i] = 1;
goto Lrs;
Lrs:
switch (rs)
{ case RS.dash:
r.setbit2('-');
goto case;
case RS.rliteral:
r.setbit2(c);
break;
default:
break;
}
rs = RS.start;
continue;
default:
break;
}
c2 = escape();
goto Lrange;
case '-':
p++;
if (rs == RS.start)
goto Lrange;
else if (rs == RS.rliteral)
rs = RS.dash;
else if (rs == RS.dash)
{
r.setbit2(c);
r.setbit2('-');
rs = RS.start;
}
continue;
default:
c2 = pattern[p];
p++;
Lrange:
switch (rs)
{ case RS.rliteral:
r.setbit2(c);
goto case;
case RS.start:
c = c2;
rs = RS.rliteral;
break;
case RS.dash:
if (c > c2)
{ error("inverted range in character class");
return 0;
}
r.setbitmax(c2);
//printf("c = %x, c2 = %x\n",c,c2);
for (; c <= c2; c++)
r.bits[c] = 1;
rs = RS.start;
break;
default:
assert(0);
}
continue;
}
break;
}
if (attributes & REA.ignoreCase)
{
// BUG: what about dchar?
r.setbitmax(0x7F);
for (c = 'a'; c <= 'z'; c++)
{
if (r.bits[c])
r.bits[c + 'A' - 'a'] = 1;
else if (r.bits[c + 'A' - 'a'])
r.bits[c] = 1;
}
}
//printf("maxc = %d, maxb = %d\n",r.maxc,r.maxb);
(cast(ushort *)&buf.data[offset])[0] = cast(ushort)r.maxc;
(cast(ushort *)&buf.data[offset])[1] = cast(ushort)r.maxb;
return 1;
Lerr:
error("invalid range");
return 0;
}
void error(string msg)
{
errors++;
debug(regexp) printf("error: %.*s\n", msg.length, msg.ptr);
//assert(0);
//*(char*)0=0;
throw new RegExpException(msg);
}
// p is following the \ char
int escape()
in
{
assert(p < pattern.length);
}
body
{ int c;
int i;
rchar tc;
c = pattern[p]; // none of the cases are multibyte
switch (c)
{
case 'b': c = '\b'; break;
case 'f': c = '\f'; break;
case 'n': c = '\n'; break;
case 'r': c = '\r'; break;
case 't': c = '\t'; break;
case 'v': c = '\v'; break;
// BUG: Perl does \a and \e too, should we?
case 'c':
++p;
if (p == pattern.length)
goto Lretc;
c = pattern[p];
// Note: we are deliberately not allowing dchar letters
if (!(('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')))
{
Lcerr:
error("letter expected following \\c");
return 0;
}
c &= 0x1F;
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
c -= '0';
for (i = 0; i < 2; i++)
{
p++;
if (p == pattern.length)
goto Lretc;
tc = pattern[p];
if ('0' <= tc && tc <= '7')
{ c = c * 8 + (tc - '0');
// Treat overflow as if last
// digit was not an octal digit
if (c >= 0xFF)
{ c >>= 3;
return c;
}
}
else
return c;
}
break;
case 'x':
c = 0;
for (i = 0; i < 2; i++)
{
p++;
if (p == pattern.length)
goto Lretc;
tc = pattern[p];
if ('0' <= tc && tc <= '9')
c = c * 16 + (tc - '0');
else if ('a' <= tc && tc <= 'f')
c = c * 16 + (tc - 'a' + 10);
else if ('A' <= tc && tc <= 'F')
c = c * 16 + (tc - 'A' + 10);
else if (i == 0) // if no hex digits after \x
{
// Not a valid \xXX sequence
return 'x';
}
else
return c;
}
break;
case 'u':
c = 0;
for (i = 0; i < 4; i++)
{
p++;
if (p == pattern.length)
goto Lretc;
tc = pattern[p];
if ('0' <= tc && tc <= '9')
c = c * 16 + (tc - '0');
else if ('a' <= tc && tc <= 'f')
c = c * 16 + (tc - 'a' + 10);
else if ('A' <= tc && tc <= 'F')
c = c * 16 + (tc - 'A' + 10);
else
{
// Not a valid \uXXXX sequence
p -= i;
return 'u';
}
}
break;
default:
break;
}
p++;
Lretc:
return c;
}
/* ==================== optimizer ======================= */
void optimize()
{ ubyte[] prog;
debug(regexp) printf("RegExp.optimize()\n");
prog = buf.toBytes();
for (size_t i = 0; 1;)
{
//printf("\tprog[%d] = %d, %d\n", i, prog[i], REstring);
switch (prog[i])
{
case REend:
case REanychar:
case REanystar:
case REbackref:
case REeol:
case REchar:
case REichar:
case REdchar:
case REidchar:
case REstring:
case REistring:
case REtestbit:
case REbit:
case REnotbit:
case RErange:
case REnotrange:
case REwordboundary:
case REnotwordboundary:
case REdigit:
case REnotdigit:
case REspace:
case REnotspace:
case REword:
case REnotword:
return;
case REbol:
i++;
continue;
case REor:
case REnm:
case REnmq:
case REparen:
case REgoto:
{
auto bitbuf = new OutBuffer;
auto r = new Range(bitbuf);
auto offset = i;
if (starrchars(r, prog[i .. prog.length]))
{
debug(regexp) printf("\tfilter built\n");
buf.spread(offset, 1 + 4 + r.maxb);
buf.data[offset] = REtestbit;
(cast(ushort *)&buf.data[offset + 1])[0] = cast(ushort)r.maxc;
(cast(ushort *)&buf.data[offset + 1])[1] = cast(ushort)r.maxb;
i = offset + 1 + 4;
buf.data[i .. i + r.maxb] = r.base[0 .. r.maxb];
}
return;
}
default:
assert(0);
}
}
}
/////////////////////////////////////////
// OR the leading character bits into r.
// Limit the character range from 0..7F,
// trymatch() will allow through anything over maxc.
// Return 1 if success, 0 if we can't build a filter or
// if there is no point to one.
int starrchars(Range r, const(ubyte)[] prog)
{ rchar c;
uint maxc;
size_t maxb;
size_t len;
uint b;
uint n;
uint m;
const(ubyte)* pop;
//printf("RegExp.starrchars(prog = %p, progend = %p)\n", prog, progend);
for (size_t i = 0; i < prog.length;)
{
switch (prog[i])
{
case REchar:
c = prog[i + 1];
if (c <= 0x7F)
r.setbit2(c);
return 1;
case REichar:
c = prog[i + 1];
if (c <= 0x7F)
{ r.setbit2(c);
r.setbit2(std.ascii.toLower(cast(rchar)c));
}
return 1;
case REdchar:
case REidchar:
return 1;
case REanychar:
return 0; // no point
case REstring:
len = *cast(size_t *)&prog[i + 1];
assert(len);
c = *cast(rchar *)&prog[i + 1 + size_t.sizeof];
debug(regexp) printf("\tREstring %d, '%c'\n", len, c);
if (c <= 0x7F)
r.setbit2(c);
return 1;
case REistring:
len = *cast(size_t *)&prog[i + 1];
assert(len);
c = *cast(rchar *)&prog[i + 1 + size_t.sizeof];
debug(regexp) printf("\tREistring %d, '%c'\n", len, c);
if (c <= 0x7F)
{ r.setbit2(std.ascii.toUpper(cast(rchar)c));
r.setbit2(std.ascii.toLower(cast(rchar)c));
}
return 1;
case REtestbit:
case REbit:
maxc = (cast(ushort *)&prog[i + 1])[0];
maxb = (cast(ushort *)&prog[i + 1])[1];
if (maxc <= 0x7F)
r.setbitmax(maxc);
else
maxb = r.maxb;
for (b = 0; b < maxb; b++)
r.base[b] |= prog[i + 1 + 4 + b];
return 1;
case REnotbit:
maxc = (cast(ushort *)&prog[i + 1])[0];
maxb = (cast(ushort *)&prog[i + 1])[1];
if (maxc <= 0x7F)
r.setbitmax(maxc);
else
maxb = r.maxb;
for (b = 0; b < maxb; b++)
r.base[b] |= ~prog[i + 1 + 4 + b];
return 1;
case REbol:
case REeol:
return 0;
case REor:
len = (cast(uint *)&prog[i + 1])[0];
return starrchars(r, prog[i + 1 + uint.sizeof .. prog.length]) &&
starrchars(r, prog[i + 1 + uint.sizeof + len .. prog.length]);
case REgoto:
len = (cast(uint *)&prog[i + 1])[0];
i += 1 + uint.sizeof + len;
break;
case REanystar:
return 0;
case REnm:
case REnmq:
// len, n, m, ()
len = (cast(uint *)&prog[i + 1])[0];
n = (cast(uint *)&prog[i + 1])[1];
m = (cast(uint *)&prog[i + 1])[2];
pop = &prog[i + 1 + uint.sizeof * 3];
if (!starrchars(r, pop[0 .. len]))
return 0;
if (n)
return 1;
i += 1 + uint.sizeof * 3 + len;
break;
case REparen:
// len, ()
len = (cast(uint *)&prog[i + 1])[0];
n = (cast(uint *)&prog[i + 1])[1];
pop = &prog[0] + i + 1 + uint.sizeof * 2;
return starrchars(r, pop[0 .. len]);
case REend:
return 0;
case REwordboundary:
case REnotwordboundary:
return 0;
case REdigit:
r.setbitmax('9');
for (c = '0'; c <= '9'; c++)
r.bits[c] = 1;
return 1;
case REnotdigit:
r.setbitmax(0x7F);
for (c = 0; c <= '0'; c++)
r.bits[c] = 1;
for (c = '9' + 1; c <= r.maxc; c++)
r.bits[c] = 1;
return 1;
case REspace:
r.setbitmax(0x7F);
for (c = 0; c <= r.maxc; c++)
if (isWhite(c))
r.bits[c] = 1;
return 1;
case REnotspace:
r.setbitmax(0x7F);
for (c = 0; c <= r.maxc; c++)
if (!isWhite(c))
r.bits[c] = 1;
return 1;
case REword:
r.setbitmax(0x7F);
for (c = 0; c <= r.maxc; c++)
if (isword(cast(rchar)c))
r.bits[c] = 1;
return 1;
case REnotword:
r.setbitmax(0x7F);
for (c = 0; c <= r.maxc; c++)
if (!isword(cast(rchar)c))
r.bits[c] = 1;
return 1;
case REbackref:
return 0;
default:
assert(0);
}
}
return 1;
}
/* ==================== replace ======================= */
/***********************
* After a match is found with test(), this function
* will take the match results and, using the format
* string, generate and return a new string.
*/
public string replace(string format)
{
return replace3(format, input, pmatch[0 .. re_nsub + 1]);
}
// Static version that doesn't require a RegExp object to be created
public static string replace3(string format, string input, regmatch_t[] pmatch)
{
string result;
size_t c2;
sizediff_t rm_so, rm_eo, i;
// printf("replace3(format = '%.*s', input = '%.*s')\n", format.length, format.ptr, input.length, input.ptr);
result.length = format.length;
result.length = 0;
for (size_t f = 0; f < format.length; f++)
{
char c = format[f];
L1:
if (c != '$')
{
result ~= c;
continue;
}
++f;
if (f == format.length)
{
result ~= '$';
break;
}
c = format[f];
switch (c)
{
case '&':
rm_so = pmatch[0].rm_so;
rm_eo = pmatch[0].rm_eo;
goto Lstring;
case '`':
rm_so = 0;
rm_eo = pmatch[0].rm_so;
goto Lstring;
case '\'':
rm_so = pmatch[0].rm_eo;
rm_eo = input.length;
goto Lstring;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
i = c - '0';
if (f + 1 == format.length)
{
if (i == 0)
{
result ~= '$';
result ~= c;
continue;
}
}
else
{
c2 = format[f + 1];
if (c2 >= '0' && c2 <= '9')
{
i = (c - '0') * 10 + (c2 - '0');
f++;
}
if (i == 0)
{
result ~= '$';
result ~= c;
c = cast(char)c2;
goto L1;
}
}
if (i < pmatch.length)
{ rm_so = pmatch[i].rm_so;
rm_eo = pmatch[i].rm_eo;
goto Lstring;
}
break;
Lstring:
if (rm_so != rm_eo)
result ~= input[rm_so .. rm_eo];
break;
default:
result ~= '$';
result ~= c;
break;
}
}
return result;
}
/************************************
* Like replace(char[] format), but uses old style formatting:
<table border=1 cellspacing=0 cellpadding=5>
<th>Format
<th>Description
<tr>
<td><b>&</b>
<td>replace with the match
</tr>
<tr>
<td><b>\</b><i>n</i>
<td>replace with the <i>n</i>th parenthesized match, <i>n</i> is 1..9
</tr>
<tr>
<td><b>\</b><i>c</i>
<td>replace with char <i>c</i>.
</tr>
</table>
*/
public string replaceOld(string format)
{
string result;
//printf("replace: this = %p so = %d, eo = %d\n", this, pmatch[0].rm_so, pmatch[0].rm_eo);
//printf("3input = '%.*s'\n", input.length, input.ptr);
result.length = format.length;
result.length = 0;
for (size_t i; i < format.length; i++)
{
char c = format[i];
switch (c)
{
case '&':
{
auto sss = input[pmatch[0].rm_so .. pmatch[0].rm_eo];
//printf("match = '%.*s'\n", sss.length, sss.ptr);
result ~= sss;
}
break;
case '\\':
if (i + 1 < format.length)
{
c = format[++i];
if (c >= '1' && c <= '9')
{ uint j;
j = c - '0';
if (j <= re_nsub && pmatch[j].rm_so != pmatch[j].rm_eo)
result ~= input[pmatch[j].rm_so .. pmatch[j].rm_eo];
break;
}
}
result ~= c;
break;
default:
result ~= c;
break;
}
}
return result;
}
}
unittest
{ // Created and placed in public domain by Don Clugston
auto m = search("aBC r s", `bc\x20r[\40]s`, "i");
assert(m.pre=="a");
assert(m[0]=="BC r s");
auto m2 = search("7xxyxxx", `^\d([a-z]{2})\D\1`);
assert(m2[0]=="7xxyxx");
// Just check the parsing.
auto m3 = search("dcbxx", `ca|b[\d\]\D\s\S\w-\W]`);
auto m4 = search("xy", `[^\ca-\xFa\r\n\b\f\t\v\0123]{2,485}$`);
auto m5 = search("xxx", `^^\r\n\b{13,}\f{4}\t\v\u02aF3a\w\W`);
auto m6 = search("xxy", `.*y`);
assert(m6[0]=="xxy");
auto m7 = search("QWDEfGH", "(ca|b|defg)+", "i");
assert(m7[0]=="DEfG");
auto m8 = search("dcbxx", `a?\B\s\S`);
auto m9 = search("dcbxx", `[-w]`);
auto m10 = search("dcbsfd", `aB[c-fW]dB|\d|\D|\u012356|\w|\W|\s|\S`, "i");
auto m11 = search("dcbsfd", `[]a-]`);
m.replaceOld(`a&b\1c`);
m.replace(`a$&b$'$1c`);
}
// Andrei
//------------------------------------------------------------------------------
struct Pattern(Char)
{
immutable(Char)[] pattern;
this(immutable(Char)[] pattern)
{
this.pattern = pattern;
}
}
Pattern!(Char) pattern(Char)(immutable(Char)[] pat)
{
return typeof(return)(pat);
}
struct Splitter(Range)
{
Range _input;
size_t _chunkLength;
RegExp _rx;
private Range search()
{
//rx = std.regexp.search(_input, "(" ~ _separator.pattern ~ ")");
auto i = std.regexp.find(cast(string) _input, _rx);
return _input[i >= 0 ? i : _input.length .. _input.length];
}
private void advance()
{
//writeln("(" ~ _separator.pattern ~ ")");
//writeln(_input);
//assert(_rx[0].length > 0);
_chunkLength += _rx[0].length;
}
this(Range input, Pattern!(char) separator)
{
_input = input;
_rx = RegExp(separator.pattern);
_chunkLength = _input.length - search().length;
}
ref auto opSlice()
{
return this;
}
@property Range front()
{
return _input[0 .. _chunkLength];
}
@property bool empty()
{
return _input.empty;
}
void popFront()
{
if (_chunkLength == _input.length)
{
_input = _input[_chunkLength .. _input.length];
return;
}
advance();
_input = _input[_chunkLength .. _input.length];
_chunkLength = _input.length - search().length;
}
}
Splitter!(Range) splitter(Range)(Range r, Pattern!(char) pat)
{
static assert(is(Unqual!(typeof(Range.init[0])) == char),
Unqual!(typeof(Range.init[0])).stringof);
return typeof(return)(cast(string) r, pat);
}
unittest
{
auto s1 = ", abc, de, fg, hi, ";
auto sp2 = splitter(s1, pattern(", *"));
//foreach (e; sp2) writeln("[", e, "]");
assert(equal(sp2, ["", "abc", "de", "fg", "hi"][]));
}
unittest
{
auto str= "foo";
string[] re_strs= [
r"^(h|a|)fo[oas]$",
r"^(a|b|)fo[oas]$",
r"^(a|)foo$",
r"(a|)foo",
r"^(h|)foo$",
r"(h|)foo",
r"(h|a|)fo[oas]",
r"^(a|b|)fo[o]$",
r"[abf][ops](o|oo|)(h|a|)",
r"(h|)[abf][ops](o|oo|)",
r"(c|)[abf][ops](o|oo|)"
];
foreach (re_str; re_strs) {
auto re= new RegExp(re_str);
auto matches= cast(bool)re.test(str);
assert(matches);
//writefln("'%s' matches '%s' ? %s", str, re_str, matches);
}
for (char c='a'; c<='z'; ++c) {
auto re_str= "("~c~"|)foo";
auto re= new RegExp(re_str);
auto matches= cast(bool)re.test(str);
assert(matches);
//writefln("'%s' matches '%s' ? %s", str, re_str, matches);
}
}
|
D
|
extern (C) void run_lua_code();
int main()
{
run_lua_code();
return 1;
}
|
D
|
import std.stdio;
import std.socket;
import std.datetime;
import core.thread;
import std.concurrency;
import std.typecons;
import std.string;
import std.conv;
import std.algorithm;
import derelict.opengl.gl;
import derelict.openal.al;
import derelict.sdl.sdl;
import udpnames;
import udpio;
import clientListener;
import component;
import camera;
import error;
import input;
import font;
import player;
import bullet;
import rope;
import level;
import player_list;
import resolution;
alias Client Engine;
void main() {
ushort port = 19863;
write("Address: ");
string address = readln();
if (address == "\n") address = "127.0.0.1";
try {
InternetAddress inet = new InternetAddress(address, port);
} catch (Exception e) {
writeln(address, " is not a valid IP address");
assert(0, address ~ " is not a valid IP address");
return;
}
immutable InternetAddress inet = cast(immutable) (new InternetAddress(address, port));
writeln(inet.toString());
write("Username: ");
string username = readln();
if (username == "\n") username = "hi";
else username = username[0..$ - 1];
DerelictSDL.load();
DerelictGL.load();
DerelictAL.load();
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
SDL_Surface* surface = SDL_SetVideoMode(640, 480, 32, SDL_OPENGL);
writeln("Loaded");
Tid listenThread = spawn(&listen, thisTid(), inet, username);
Client client;
try {client = new Client(listenThread);}
catch (Exception e) {
writeln(e);
return;
}
client.Run();
}
class Client {
static Client instance;
Component[int][string] components;
Updateable[int][string] updateList;
Drawable[int][string] drawList;
Drawable[] drawOrder;
Tuple!(int, string)[] removal = [];
byte[] packet;
string title = "";
Camera camera;
bool paused = false;
Tid listenerThread;
void AddComponent(T)(T component)
if (is(T:Component)) {
//if (typeid(T).toString() !in components) components[typeid(T).toString()] = new Component[string];
components[typeid(T).toString()][component.ID] = component;
if (is(T:Drawable)) {
//if (typeid(T).toString() !in drawList) drawList[typeid(T).toString()] = [];
drawList[typeid(T).toString()][component.ID] = cast(Drawable)component;
if (drawOrder.length > 0) {
int i = 0;
Drawable d = cast(Drawable)component;
while (i < drawOrder.length && drawOrder[i].Depth < d.Depth) i++;
drawOrder = drawOrder[0..i] ~ d ~ drawOrder[i..$];
} else {
drawOrder ~= cast(Drawable)component;
}
}
if (is(T:Updateable)) {
//if (typeid(T).toString() !in updateList) updateList[typeid(T).toString()] = [];
updateList[typeid(T).toString()][component.ID] = cast(Updateable)component;
}
}
Component[int] GetComponents(T)()
if (is(T:Component)) {
if (typeid(T).toString() in components) return components[typeid(T).toString()];
return null;
}
T GetComponent(T)()
if (is(T:Component)) {
if (typeid(T).toString() in components) return cast(T)components[typeid(T).toString()][components[typeid(T).toString()].keys[0]];
return null;
}
T GetComponent(T)(int id)
if (is(T:Component)) {
if (typeid(T).toString() in components && id in components[typeid(T).toString()]) return cast(T)components[typeid(T).toString()][id];
return null;
}
void RemoveComponent(T)(int id)
if (is(T:Component)) {
removal ~= tuple(id, typeid(T).toString());
}
private void DestroyComponent(int id, string type) {
if (type in components && id in components[type]) {
components[type].remove(id);
if (type in drawList) {
Drawable r = drawList[type][id];
drawList[type].remove(id);
foreach (i, d; drawOrder) {
if (d is r) {
drawOrder = drawOrder[0..i] ~ drawOrder[i + 1..$];
break;
}
}
}
if (type in updateList) {
updateList[type].remove(id);
}
}
}
void Run() {
uint oldTicks = SDL_GetTicks();
uint currentTicks = SDL_GetTicks();
uint elapsed = 16;
uint taken = 0;
bool quitting = false;
while (!quitting) {
elapsed = SDL_GetTicks() - oldTicks;
oldTicks = SDL_GetTicks();
quitting = Update();
if (PollMessages()) quitting = true;
if (quitting) {
prioritySend(listenerThread, true);
return;
}
SendPackets();
Draw();
SDL_GL_SwapBuffers();
string s = GLError();
if (s != "") throw new Exception(s);
s = error.ALError();
if (s != "") throw new Exception(s);
taken = SDL_GetTicks() - oldTicks;
if (taken < 16)
SDL_Delay(16 - taken);
}
}
this(Tid thread) {
ALCdevice* ALDevice = alcOpenDevice(null); // select the "preferred device"
ALCcontext* ALContext = alcCreateContext(ALDevice, null);
alcMakeContextCurrent(ALContext);
alListener3f(AL_POSITION, 0, 0, 0);
alListener3f(AL_VELOCITY, 0, 0, 0);
LoadGL();
SDL_WM_SetCaption(toStringz(title), null);
camera = new Camera();
AddComponent(new Keyboard());
AddComponent(new Mouse());
Font f = new Font("images\\Font.fnt");
AddComponent(f);
AddComponent(new PlayerList());
AddComponent(new Resolution());
listenerThread = thread;
instance = this;
}
void LoadGL() {
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
//glEnable(GL_STENCIL_TEST);
//glEnable(GL_TEXTURE_2D);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glMatrixMode(GL_PROJECTION);
glClearColor(.2f, .2f, .2f, 1);
glLoadIdentity();
//0 to 10 for depth, 0 is front, 10 is the back.
glOrtho(-320, 320, 240, -240, -1, 11);
}
bool Update() {
SDL_Event event;
SDL_Event[] events;
bool result = false;
while (SDL_PollEvent(&event)) {
events ~= event;
if (event.type == SDL_QUIT) result = true;
}
if (!paused) {
foreach (uList; updateList) {
foreach (u; uList) {
result |= u.Update(events);
}
}
}
foreach (id; removal) {
DestroyComponent(id[0], id[1]);
}
removal = [];
return result;
}
int playerID;
bool PollMessages() {
bool result;
bool returnVal = false;
do {
result = receiveTimeout(dur!"usecs"(1),
(UDP type, byte id, Tuple!(float, float) pos, Tuple!(float, float) vel) {
Player p = GetComponent!Player(id);
if (p is null) {
p = new Player(id, "");
p.rect.pos = pos;
p.velocity = vel;
AddComponent(p);
AddPacket([cast(byte)UDP.player_list, cast(byte)playerID]);
} else {
p.rect.pos = pos;
p.velocity = vel;
}
},
(UDP type, int id, Tuple!(float, float) pos, Tuple!(float, float) vel) {
Player p = GetComponent!Player(id << 24);
switch (type) {
case UDP.fire_shot:
Bullet b = GetComponent!(Bullet)(id);
if (b is null) {
b = new Bullet(pos, vel, id);
AddComponent(b);
} else {
b.rect.pos = pos;
b.velocity = vel;
}
break;
case UDP.fire_ninja_rope:
Rope r = GetComponent!Rope(id);
if (r is null) {
r = new Rope(pos, vel, id);
AddComponent(r);
} else {
r.rect.pos = pos;
r.velocity = vel;
}
break;
default:
break;
}
},
(UDP type, int id) {
switch (type) {
case UDP.disconnect:
writeln("disconnect");
returnVal = true;
break;
case UDP.damage:
Player p = GetComponent!Player(playerID);
p.Damage(id);
break;
case UDP.disconnect_ninja_rope:
Rope r = GetComponent!Rope(id);
if (r !is null) {
r.Kill();
r.player.state = State.in_air;
}
break;
default:
break;
}
},
(UDP type, byte id, string username) {
switch (type) {
case UDP.connect:
writeln("connect");
AddComponent(new Player(id, true, username));
playerID = id;
break;
default:
break;
}
},
(UDP type, byte id) {
switch (type) {
case UDP.die:
GetComponent!Player(id).dead = true;
break;
case UDP.respawn:
GetComponent!Player(id).dead = false;
break;
default:
break;
}
},
(UDP type, immutable(int)[] ids, immutable(string)[] usernames) {
writeln("Player_List");
foreach (id; GetComponents!Player().keys) {
writeln(id);
if (id != playerID && !canFind(ids, id)) RemoveComponent!Player(id);
}
foreach (i, id; ids) {
if (!canFind(GetComponents!Player().keys, id))
AddComponent(new Player(id, usernames[i]));
}
foreach (i, username; usernames) {
GetComponent!Player(i).username = username;
}
},
(immutable(byte[]) map) {
writeln("map");
AddComponent(new Level(map));
},
(string msg) {
writeln("new message ", msg);
if (msg == "stop") {
returnVal = true;
prioritySend(listenerThread, true);
}
}
);
} while (result == true && returnVal == false);
return returnVal;
}
void AddPacket(byte[] packet) {
this.packet ~= packet;
}
void SendPackets() {
Player p = GetComponent!Player(playerID);
if (p is null) return;
packet ~= UDP.movement;
packet ~= to!byte(p.ID);
packet ~= writeFloat(p.rect.pos[0]);
packet ~= writeFloat(p.rect.pos[1]);
packet ~= writeFloat(p.velocity[0]);
packet ~= writeFloat(p.velocity[1]);
/*foreach (c; GetComponents!Bullet()) {
Bullet b = cast(Bullet)c;
packet ~= UDP.fire_shot;
packet ~= writeInt(b.ID);
packet ~= writeFloat(b.rect.pos[0]);
packet ~= writeFloat(b.rect.pos[1]);
packet ~= writeFloat(b.velocity[0]);
packet ~= writeFloat(b.velocity[1]);
}*/
/*foreach (c; GetComponents!Rope()) {
Bullet b = cast(Bullet)c;
packet ~= UDP.fire_ninja_rope;
packet ~= writeInt(b.ID);
packet ~= writeFloat(b.rect.pos[0]);
packet ~= writeFloat(b.rect.pos[1]);
packet ~= writeFloat(b.velocity[0]);
packet ~= writeFloat(b.velocity[1]);
}*/
send(listenerThread, packet.idup);
packet = [];
}
void Draw() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT/* | GL_STENCIL_BUFFER_BIT*/);
camera.SetWorldMatrix();
foreach (d; drawOrder) {
d.Draw();
}
}
}
|
D
|
/++
+ A simple text templating library.
+ ++/
module aim.templater;
public import aim.templater.core;
|
D
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkControlPointsItem;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
static import vtkObjectBase;
static import SWIGTYPE_p_double;
static import vtkVector2f;
static import vtkIdTypeArray;
static import vtkPen;
static import vtkBrush;
static import vtkContextMouseEvent;
static import vtkContextKeyEvent;
static import vtkPlot;
class vtkControlPointsItem : vtkPlot.vtkPlot {
private void* swigCPtr;
public this(void* cObject, bool ownCObject) {
super(vtkd_im.vtkControlPointsItem_Upcast(cObject), ownCObject);
swigCPtr = cObject;
}
public static void* swigGetCPtr(vtkControlPointsItem obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
public override void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
throw new object.Exception("C++ destructor does not have public access");
}
swigCPtr = null;
super.dispose();
}
}
}
enum {
CurrentPointChangedEvent = vtkCommand::UserEvent,
CurrentPointEditEvent
}
public static int IsTypeOf(string type) {
auto ret = vtkd_im.vtkControlPointsItem_IsTypeOf((type ? std.string.toStringz(type) : null));
return ret;
}
public static vtkControlPointsItem SafeDownCast(vtkObjectBase.vtkObjectBase o) {
void* cPtr = vtkd_im.vtkControlPointsItem_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o));
vtkControlPointsItem ret = (cPtr is null) ? null : new vtkControlPointsItem(cPtr, false);
return ret;
}
public vtkControlPointsItem NewInstance() const {
void* cPtr = vtkd_im.vtkControlPointsItem_NewInstance(cast(void*)swigCPtr);
vtkControlPointsItem ret = (cPtr is null) ? null : new vtkControlPointsItem(cPtr, false);
return ret;
}
alias vtkPlot.vtkPlot.NewInstance NewInstance;
public void SetUserBounds(double _arg1, double _arg2, double _arg3, double _arg4) {
vtkd_im.vtkControlPointsItem_SetUserBounds__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3, _arg4);
}
public void SetUserBounds(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkControlPointsItem_SetUserBounds__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetUserBounds() {
auto ret = cast(double*)vtkd_im.vtkControlPointsItem_GetUserBounds__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetUserBounds(double* _arg1, double* _arg2, double* _arg3, double* _arg4) {
vtkd_im.vtkControlPointsItem_GetUserBounds__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3, cast(void*)_arg4);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetUserBounds(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkControlPointsItem_GetUserBounds__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public void SetValidBounds(double _arg1, double _arg2, double _arg3, double _arg4) {
vtkd_im.vtkControlPointsItem_SetValidBounds__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3, _arg4);
}
public void SetValidBounds(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkControlPointsItem_SetValidBounds__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetValidBounds() {
auto ret = cast(double*)vtkd_im.vtkControlPointsItem_GetValidBounds__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetValidBounds(double* _arg1, double* _arg2, double* _arg3, double* _arg4) {
vtkd_im.vtkControlPointsItem_GetValidBounds__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3, cast(void*)_arg4);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetValidBounds(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkControlPointsItem_GetValidBounds__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public float GetScreenPointRadius() {
auto ret = vtkd_im.vtkControlPointsItem_GetScreenPointRadius(cast(void*)swigCPtr);
return ret;
}
public void SetScreenPointRadius(float _arg) {
vtkd_im.vtkControlPointsItem_SetScreenPointRadius(cast(void*)swigCPtr, _arg);
}
public void SelectPoint(long pointId) {
vtkd_im.vtkControlPointsItem_SelectPoint__SWIG_0(cast(void*)swigCPtr, pointId);
}
public void SelectPoint(double* currentPoint) {
vtkd_im.vtkControlPointsItem_SelectPoint__SWIG_1(cast(void*)swigCPtr, cast(void*)currentPoint);
}
public void SelectAllPoints() {
vtkd_im.vtkControlPointsItem_SelectAllPoints(cast(void*)swigCPtr);
}
public void DeselectPoint(long pointId) {
vtkd_im.vtkControlPointsItem_DeselectPoint__SWIG_0(cast(void*)swigCPtr, pointId);
}
public void DeselectPoint(double* currentPoint) {
vtkd_im.vtkControlPointsItem_DeselectPoint__SWIG_1(cast(void*)swigCPtr, cast(void*)currentPoint);
}
public void DeselectAllPoints() {
vtkd_im.vtkControlPointsItem_DeselectAllPoints(cast(void*)swigCPtr);
}
public void ToggleSelectPoint(long pointId) {
vtkd_im.vtkControlPointsItem_ToggleSelectPoint__SWIG_0(cast(void*)swigCPtr, pointId);
}
public void ToggleSelectPoint(double* currentPoint) {
vtkd_im.vtkControlPointsItem_ToggleSelectPoint__SWIG_1(cast(void*)swigCPtr, cast(void*)currentPoint);
}
public bool SelectPoints(vtkVector2f.vtkVector2f min, vtkVector2f.vtkVector2f max) {
bool ret = vtkd_im.vtkControlPointsItem_SelectPoints(cast(void*)swigCPtr, vtkVector2f.vtkVector2f.swigGetCPtr(min), vtkVector2f.vtkVector2f.swigGetCPtr(max)) ? true : false;
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
return ret;
}
public long GetNumberOfSelectedPoints() const {
auto ret = vtkd_im.vtkControlPointsItem_GetNumberOfSelectedPoints(cast(void*)swigCPtr);
return ret;
}
public long FindPoint(double* pos) {
auto ret = vtkd_im.vtkControlPointsItem_FindPoint(cast(void*)swigCPtr, cast(void*)pos);
return ret;
}
public bool IsOverPoint(double* pos, long pointId) {
bool ret = vtkd_im.vtkControlPointsItem_IsOverPoint(cast(void*)swigCPtr, cast(void*)pos, pointId) ? true : false;
return ret;
}
public long GetControlPointId(double* pos) {
auto ret = vtkd_im.vtkControlPointsItem_GetControlPointId(cast(void*)swigCPtr, cast(void*)pos);
return ret;
}
public void GetControlPointsIds(vtkIdTypeArray.vtkIdTypeArray ids, bool excludeFirstAndLast) const {
vtkd_im.vtkControlPointsItem_GetControlPointsIds__SWIG_0(cast(void*)swigCPtr, vtkIdTypeArray.vtkIdTypeArray.swigGetCPtr(ids), excludeFirstAndLast);
}
public void GetControlPointsIds(vtkIdTypeArray.vtkIdTypeArray ids) const {
vtkd_im.vtkControlPointsItem_GetControlPointsIds__SWIG_1(cast(void*)swigCPtr, vtkIdTypeArray.vtkIdTypeArray.swigGetCPtr(ids));
}
public bool GetStrokeMode() {
bool ret = vtkd_im.vtkControlPointsItem_GetStrokeMode(cast(void*)swigCPtr) ? true : false;
return ret;
}
public void SetSwitchPointsMode(bool _arg) {
vtkd_im.vtkControlPointsItem_SetSwitchPointsMode(cast(void*)swigCPtr, _arg);
}
public bool GetSwitchPointsMode() {
bool ret = vtkd_im.vtkControlPointsItem_GetSwitchPointsMode(cast(void*)swigCPtr) ? true : false;
return ret;
}
public void SetEndPointsXMovable(bool _arg) {
vtkd_im.vtkControlPointsItem_SetEndPointsXMovable(cast(void*)swigCPtr, _arg);
}
public bool GetEndPointsXMovable() {
bool ret = vtkd_im.vtkControlPointsItem_GetEndPointsXMovable(cast(void*)swigCPtr) ? true : false;
return ret;
}
public void SetEndPointsYMovable(bool _arg) {
vtkd_im.vtkControlPointsItem_SetEndPointsYMovable(cast(void*)swigCPtr, _arg);
}
public bool GetEndPointsYMovable() {
bool ret = vtkd_im.vtkControlPointsItem_GetEndPointsYMovable(cast(void*)swigCPtr) ? true : false;
return ret;
}
public bool GetEndPointsMovable() {
bool ret = vtkd_im.vtkControlPointsItem_GetEndPointsMovable(cast(void*)swigCPtr) ? true : false;
return ret;
}
public void SetEndPointsRemovable(bool _arg) {
vtkd_im.vtkControlPointsItem_SetEndPointsRemovable(cast(void*)swigCPtr, _arg);
}
public bool GetEndPointsRemovable() {
bool ret = vtkd_im.vtkControlPointsItem_GetEndPointsRemovable(cast(void*)swigCPtr) ? true : false;
return ret;
}
public long AddPoint(double* newPos) {
auto ret = vtkd_im.vtkControlPointsItem_AddPoint(cast(void*)swigCPtr, cast(void*)newPos);
return ret;
}
public long RemovePoint(double* pos) {
auto ret = vtkd_im.vtkControlPointsItem_RemovePoint__SWIG_0(cast(void*)swigCPtr, cast(void*)pos);
return ret;
}
public long RemovePoint(long pointId) {
auto ret = vtkd_im.vtkControlPointsItem_RemovePoint__SWIG_1(cast(void*)swigCPtr, pointId);
return ret;
}
public void RemoveCurrentPoint() {
vtkd_im.vtkControlPointsItem_RemoveCurrentPoint(cast(void*)swigCPtr);
}
public long GetNumberOfPoints() const {
auto ret = vtkd_im.vtkControlPointsItem_GetNumberOfPoints(cast(void*)swigCPtr);
return ret;
}
public void GetControlPoint(long index, double* point) const {
vtkd_im.vtkControlPointsItem_GetControlPoint(cast(void*)swigCPtr, index, cast(void*)point);
}
public void SetControlPoint(long index, double* point) {
vtkd_im.vtkControlPointsItem_SetControlPoint(cast(void*)swigCPtr, index, cast(void*)point);
}
public void MovePoints(vtkVector2f.vtkVector2f translation, vtkIdTypeArray.vtkIdTypeArray pointIds) {
vtkd_im.vtkControlPointsItem_MovePoints__SWIG_0(cast(void*)swigCPtr, vtkVector2f.vtkVector2f.swigGetCPtr(translation), vtkIdTypeArray.vtkIdTypeArray.swigGetCPtr(pointIds));
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void MovePoints(vtkVector2f.vtkVector2f translation, bool dontMoveFirstAndLast) {
vtkd_im.vtkControlPointsItem_MovePoints__SWIG_1(cast(void*)swigCPtr, vtkVector2f.vtkVector2f.swigGetCPtr(translation), dontMoveFirstAndLast);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void MovePoints(vtkVector2f.vtkVector2f translation) {
vtkd_im.vtkControlPointsItem_MovePoints__SWIG_2(cast(void*)swigCPtr, vtkVector2f.vtkVector2f.swigGetCPtr(translation));
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void SpreadPoints(float factor, vtkIdTypeArray.vtkIdTypeArray pointIds) {
vtkd_im.vtkControlPointsItem_SpreadPoints__SWIG_0(cast(void*)swigCPtr, factor, vtkIdTypeArray.vtkIdTypeArray.swigGetCPtr(pointIds));
}
public void SpreadPoints(float factor, bool dontSpreadFirstAndLast) {
vtkd_im.vtkControlPointsItem_SpreadPoints__SWIG_1(cast(void*)swigCPtr, factor, dontSpreadFirstAndLast);
}
public void SpreadPoints(float factor) {
vtkd_im.vtkControlPointsItem_SpreadPoints__SWIG_2(cast(void*)swigCPtr, factor);
}
public long GetCurrentPoint() const {
auto ret = vtkd_im.vtkControlPointsItem_GetCurrentPoint(cast(void*)swigCPtr);
return ret;
}
public void SetCurrentPoint(long index) {
vtkd_im.vtkControlPointsItem_SetCurrentPoint(cast(void*)swigCPtr, index);
}
public vtkPen.vtkPen GetSelectedPointPen() {
void* cPtr = vtkd_im.vtkControlPointsItem_GetSelectedPointPen(cast(void*)swigCPtr);
vtkPen.vtkPen ret = (cPtr is null) ? null : new vtkPen.vtkPen(cPtr, false);
return ret;
}
public vtkBrush.vtkBrush GetSelectedPointBrush() {
void* cPtr = vtkd_im.vtkControlPointsItem_GetSelectedPointBrush(cast(void*)swigCPtr);
vtkBrush.vtkBrush ret = (cPtr is null) ? null : new vtkBrush.vtkBrush(cPtr, false);
return ret;
}
public void ResetBounds() {
vtkd_im.vtkControlPointsItem_ResetBounds(cast(void*)swigCPtr);
}
public bool MouseButtonPressEvent(vtkContextMouseEvent.vtkContextMouseEvent mouse) {
bool ret = vtkd_im.vtkControlPointsItem_MouseButtonPressEvent(cast(void*)swigCPtr, vtkContextMouseEvent.vtkContextMouseEvent.swigGetCPtr(mouse)) ? true : false;
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
return ret;
}
public bool MouseDoubleClickEvent(vtkContextMouseEvent.vtkContextMouseEvent mouse) {
bool ret = vtkd_im.vtkControlPointsItem_MouseDoubleClickEvent(cast(void*)swigCPtr, vtkContextMouseEvent.vtkContextMouseEvent.swigGetCPtr(mouse)) ? true : false;
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
return ret;
}
public bool MouseMoveEvent(vtkContextMouseEvent.vtkContextMouseEvent mouse) {
bool ret = vtkd_im.vtkControlPointsItem_MouseMoveEvent(cast(void*)swigCPtr, vtkContextMouseEvent.vtkContextMouseEvent.swigGetCPtr(mouse)) ? true : false;
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
return ret;
}
public bool KeyPressEvent(vtkContextKeyEvent.vtkContextKeyEvent key) {
bool ret = vtkd_im.vtkControlPointsItem_KeyPressEvent(cast(void*)swigCPtr, vtkContextKeyEvent.vtkContextKeyEvent.swigGetCPtr(key)) ? true : false;
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
return ret;
}
public bool KeyReleaseEvent(vtkContextKeyEvent.vtkContextKeyEvent key) {
bool ret = vtkd_im.vtkControlPointsItem_KeyReleaseEvent(cast(void*)swigCPtr, vtkContextKeyEvent.vtkContextKeyEvent.swigGetCPtr(key)) ? true : false;
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
return ret;
}
}
|
D
|
/Users/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatik.build/Objects-normal/x86_64/AppDelegate.o : /Users/Natalia/FunChatik/FunChatik/Controller/ProfileVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AddChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/LoginVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AvatarPickerVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChatVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/CreateAccountVC.swift /Users/Natalia/FunChatik/FunChatik/Services/UserDataService.swift /Users/Natalia/FunChatik/FunChatik/Services/MessegeService.swift /Users/Natalia/FunChatik/FunChatik/Services/AuthService.swift /Users/Natalia/FunChatik/FunChatik/Services/SocketService.swift /Users/Natalia/FunChatik/FunChatik/View/CircleImage.swift /Users/Natalia/FunChatik/FunChatik/Model/Message.swift /Users/Natalia/FunChatik/FunChatik/AppDelegate.swift /Users/Natalia/FunChatik/FunChatik/Model/Channel.swift /Users/Natalia/FunChatik/FunChatik/View/MessageCell.swift /Users/Natalia/FunChatik/FunChatik/View/ChannelCell.swift /Users/Natalia/FunChatik/FunChatik/View/AvatarCell.swift /Users/Natalia/FunChatik/FunChatik/View/RoundedButton.swift /Users/Natalia/FunChatik/FunChatik/Utilities/Constants.swift /Users/Natalia/FunChatik/Smack\ Assets/KeyboardBind\ View/KeyboardBoundView.swift /Users/Natalia/FunChatik/FunChatik/View/GradientView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/SocketIO.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/Socket.IO-Client-Swift-umbrella.h /Users/Natalia/FunChatik/FunChatik/Supporting\ Files/FunChatik-Bridging-Header.h /Users/Natalia/FunChatik/Smack\ Assets/SWReveal/SWRevealViewController.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/SocketIO-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-Swift.h /Users/Natalia/FunChatik/Pods/Starscream/zlib/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatik.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/Natalia/FunChatik/FunChatik/Controller/ProfileVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AddChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/LoginVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AvatarPickerVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChatVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/CreateAccountVC.swift /Users/Natalia/FunChatik/FunChatik/Services/UserDataService.swift /Users/Natalia/FunChatik/FunChatik/Services/MessegeService.swift /Users/Natalia/FunChatik/FunChatik/Services/AuthService.swift /Users/Natalia/FunChatik/FunChatik/Services/SocketService.swift /Users/Natalia/FunChatik/FunChatik/View/CircleImage.swift /Users/Natalia/FunChatik/FunChatik/Model/Message.swift /Users/Natalia/FunChatik/FunChatik/AppDelegate.swift /Users/Natalia/FunChatik/FunChatik/Model/Channel.swift /Users/Natalia/FunChatik/FunChatik/View/MessageCell.swift /Users/Natalia/FunChatik/FunChatik/View/ChannelCell.swift /Users/Natalia/FunChatik/FunChatik/View/AvatarCell.swift /Users/Natalia/FunChatik/FunChatik/View/RoundedButton.swift /Users/Natalia/FunChatik/FunChatik/Utilities/Constants.swift /Users/Natalia/FunChatik/Smack\ Assets/KeyboardBind\ View/KeyboardBoundView.swift /Users/Natalia/FunChatik/FunChatik/View/GradientView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/SocketIO.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/Socket.IO-Client-Swift-umbrella.h /Users/Natalia/FunChatik/FunChatik/Supporting\ Files/FunChatik-Bridging-Header.h /Users/Natalia/FunChatik/Smack\ Assets/SWReveal/SWRevealViewController.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/SocketIO-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-Swift.h /Users/Natalia/FunChatik/Pods/Starscream/zlib/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatik.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/Natalia/FunChatik/FunChatik/Controller/ProfileVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AddChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/LoginVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AvatarPickerVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChatVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/CreateAccountVC.swift /Users/Natalia/FunChatik/FunChatik/Services/UserDataService.swift /Users/Natalia/FunChatik/FunChatik/Services/MessegeService.swift /Users/Natalia/FunChatik/FunChatik/Services/AuthService.swift /Users/Natalia/FunChatik/FunChatik/Services/SocketService.swift /Users/Natalia/FunChatik/FunChatik/View/CircleImage.swift /Users/Natalia/FunChatik/FunChatik/Model/Message.swift /Users/Natalia/FunChatik/FunChatik/AppDelegate.swift /Users/Natalia/FunChatik/FunChatik/Model/Channel.swift /Users/Natalia/FunChatik/FunChatik/View/MessageCell.swift /Users/Natalia/FunChatik/FunChatik/View/ChannelCell.swift /Users/Natalia/FunChatik/FunChatik/View/AvatarCell.swift /Users/Natalia/FunChatik/FunChatik/View/RoundedButton.swift /Users/Natalia/FunChatik/FunChatik/Utilities/Constants.swift /Users/Natalia/FunChatik/Smack\ Assets/KeyboardBind\ View/KeyboardBoundView.swift /Users/Natalia/FunChatik/FunChatik/View/GradientView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/SocketIO.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/Socket.IO-Client-Swift-umbrella.h /Users/Natalia/FunChatik/FunChatik/Supporting\ Files/FunChatik-Bridging-Header.h /Users/Natalia/FunChatik/Smack\ Assets/SWReveal/SWRevealViewController.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/SocketIO-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-Swift.h /Users/Natalia/FunChatik/Pods/Starscream/zlib/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.build/WebSocketProtocolErrorHandler.swift.o : /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/SHA1.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/Base64.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketOpcode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrame.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketUpgrader.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrameDecoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrameEncoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketProtocolErrorHandler.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketErrorCodes.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.build/WebSocketProtocolErrorHandler~partial.swiftmodule : /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/SHA1.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/Base64.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketOpcode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrame.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketUpgrader.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrameDecoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrameEncoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketProtocolErrorHandler.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketErrorCodes.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.build/WebSocketProtocolErrorHandler~partial.swiftdoc : /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/SHA1.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/Base64.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketOpcode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrame.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketUpgrader.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrameDecoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketFrameEncoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketProtocolErrorHandler.swift /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/NIOWebSocket/WebSocketErrorCodes.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwtx.jface.text.templates.Template;
import dwtx.jface.text.templates.SimpleTemplateVariableResolver; // packageimport
import dwtx.jface.text.templates.TemplateBuffer; // packageimport
import dwtx.jface.text.templates.TemplateContext; // packageimport
import dwtx.jface.text.templates.TemplateContextType; // packageimport
import dwtx.jface.text.templates.TemplateVariable; // packageimport
import dwtx.jface.text.templates.PositionBasedCompletionProposal; // packageimport
import dwtx.jface.text.templates.TemplateException; // packageimport
import dwtx.jface.text.templates.TemplateTranslator; // packageimport
import dwtx.jface.text.templates.DocumentTemplateContext; // packageimport
import dwtx.jface.text.templates.GlobalTemplateVariables; // packageimport
import dwtx.jface.text.templates.InclusivePositionUpdater; // packageimport
import dwtx.jface.text.templates.TemplateProposal; // packageimport
import dwtx.jface.text.templates.ContextTypeRegistry; // packageimport
import dwtx.jface.text.templates.JFaceTextTemplateMessages; // packageimport
import dwtx.jface.text.templates.TemplateCompletionProcessor; // packageimport
import dwtx.jface.text.templates.TextTemplateMessages; // packageimport
import dwtx.jface.text.templates.TemplateVariableType; // packageimport
import dwtx.jface.text.templates.TemplateVariableResolver; // packageimport
import dwt.dwthelper.utils;
import dwtx.core.runtime.Assert;
/**
* A template consisting of a name and a pattern.
* <p>
* Clients may instantiate this class. May become final in the future.
* </p>
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
*/
public class Template {
private alias .toHash toHash;
private alias .equals equals;
/** The name of this template */
private /*final*/ String fName;
/** A description of this template */
private /*final*/ String fDescription;
/** The name of the context type of this template */
private /*final*/ String fContextTypeId;
/** The template pattern. */
private /*final*/ String fPattern;
/**
* The auto insertable property.
* @since 3.1
*/
private const bool fIsAutoInsertable;
/**
* Creates an empty template.
*/
public this() {
this("", "", "", "", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
/**
* Creates a copy of a template.
*
* @param template the template to copy
*/
public this(Template template_) {
this(template_.getName(), template_.getDescription(), template_.getContextTypeId(), template_.getPattern(), template_.isAutoInsertable());
}
/**
* Creates a template.
*
* @param name the name of the template
* @param description the description of the template
* @param contextTypeId the id of the context type in which the template can be applied
* @param pattern the template pattern
* @deprecated as of 3.1 replaced by {@link #Template(String, String, String, String, bool)}
*/
public this(String name, String description, String contextTypeId, String pattern) {
this(name, description, contextTypeId, pattern, true); // templates are auto insertable per default
}
/**
* Creates a template.
*
* @param name the name of the template
* @param description the description of the template
* @param contextTypeId the id of the context type in which the template can be applied
* @param pattern the template pattern
* @param isAutoInsertable the auto insertable property of the template
* @since 3.1
*/
public this(String name, String description, String contextTypeId, String pattern, bool isAutoInsertable) {
Assert.isNotNull(description);
fDescription= description;
fName= name;
Assert.isNotNull(contextTypeId);
fContextTypeId= contextTypeId;
fPattern= pattern;
fIsAutoInsertable= isAutoInsertable;
}
/*
* @see Object#hashCode()
*/
public override hash_t toHash() {
return fName.toHash() ^ fPattern.toHash() ^ fContextTypeId.toHash();
}
/**
* Sets the description of the template.
*
* @param description the new description
* @deprecated Templates should never be modified
*/
public void setDescription(String description) {
Assert.isNotNull(description);
fDescription= description;
}
/**
* Returns the description of the template.
*
* @return the description of the template
*/
public String getDescription() {
return fDescription;
}
/**
* Sets the name of the context type in which the template can be applied.
*
* @param contextTypeId the new context type name
* @deprecated Templates should never be modified
*/
public void setContextTypeId(String contextTypeId) {
Assert.isNotNull(contextTypeId);
fContextTypeId= contextTypeId;
}
/**
* Returns the id of the context type in which the template can be applied.
*
* @return the id of the context type in which the template can be applied
*/
public String getContextTypeId() {
return fContextTypeId;
}
/**
* Sets the name of the template.
*
* @param name the name of the template
* @deprecated Templates should never be modified
*/
public void setName(String name) {
fName= name;
}
/**
* Returns the name of the template.
*
* @return the name of the template
*/
public String getName() {
return fName;
}
/**
* Sets the pattern of the template.
*
* @param pattern the new pattern of the template
* @deprecated Templates should never be modified
*/
public void setPattern(String pattern) {
fPattern= pattern;
}
/**
* Returns the template pattern.
*
* @return the template pattern
*/
public String getPattern() {
return fPattern;
}
/**
* Returns <code>true</code> if template is enabled and matches the context,
* <code>false</code> otherwise.
*
* @param prefix the prefix (e.g. inside a document) to match
* @param contextTypeId the context type id to match
* @return <code>true</code> if template is enabled and matches the context,
* <code>false</code> otherwise
*/
public bool matches(String prefix, String contextTypeId) {
return fContextTypeId.equals(contextTypeId);
}
/*
* @see java.lang.Object#equals(java.lang.Object)
*/
public bool equals(Object o) {
if (!( cast(Template)o ))
return false;
Template t= cast(Template) o;
if (t is this)
return true;
return t.fName.equals(fName)
&& t.fPattern.equals(fPattern)
&& t.fContextTypeId.equals(fContextTypeId)
&& t.fDescription.equals(fDescription)
&& t.fIsAutoInsertable is fIsAutoInsertable;
}
/**
* Returns the auto insertable property of the template.
*
* @return the auto insertable property of the template
* @since 3.1
*/
public bool isAutoInsertable() {
return fIsAutoInsertable;
}
}
|
D
|
module UnrealScript.Engine.DominantPointLight;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Engine.PointLight;
extern(C++) interface DominantPointLight : PointLight
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.DominantPointLight")); }
private static __gshared DominantPointLight mDefaultProperties;
@property final static DominantPointLight DefaultProperties() { mixin(MGDPC("DominantPointLight", "DominantPointLight Engine.Default__DominantPointLight")); }
}
|
D
|
module hunt.sql.ast.expr.SQLPropertyExpr;
import hunt.sql.ast.SQLExprImpl;
import hunt.sql.ast.SQLName;
import hunt.sql.ast.SQLExpr;
import hunt.sql.ast.SQLObject;
import hunt.sql.ast.statement.SQLColumnDefinition;
import hunt.collection;
import hunt.sql.visitor.SQLASTVisitor;
import hunt.sql.ast.statement.SQLTableSource;
import hunt.sql.ast.statement.SQLCreateProcedureStatement;
import hunt.sql.ast.SQLDataType;
import hunt.sql.ast.statement.SQLSelectItem;
import hunt.sql.ast.statement.SQLSelect;
import hunt.sql.ast.statement.SQLSelectQueryBlock;
import hunt.sql.ast.expr.SQLIdentifierExpr;
import hunt.sql.util.FnvHash;
import hunt.String;
import hunt.sql.SQLUtils;
import hunt.sql.ast.statement.SQLSubqueryTableSource;
import hunt.text;
public class SQLPropertyExpr : SQLExprImpl , SQLName {
private SQLExpr owner;
private string name;
protected long nameHashCod64;
protected long _hashCode64;
protected SQLColumnDefinition resolvedColumn;
protected SQLObject resolvedOwnerObject;
public this(string owner, string name){
this(new SQLIdentifierExpr(owner), name);
}
public this(SQLExpr owner, string name){
setOwner(owner);
this.name = name;
}
public this(SQLExpr owner, string name, long nameHashCod64){
setOwner(owner);
this.name = name;
this.nameHashCod64 = nameHashCod64;
}
public this(){
}
public string getSimpleName() {
return name;
}
public SQLExpr getOwner() {
return this.owner;
}
public string getOwnernName() {
if ( cast(SQLName)owner !is null) {
return (cast(Object) owner).toString();
}
return null;
}
public void setOwner(SQLExpr owner) {
if (owner !is null) {
owner.setParent(this);
}
if ( cast(SQLPropertyExpr)parent !is null) {
SQLPropertyExpr propertyExpr = cast(SQLPropertyExpr) parent;
propertyExpr.computeHashCode64();
}
this.owner = owner;
this._hashCode64 = 0;
}
public void computeHashCode64() {
long hash;
if ( cast(SQLName)owner !is null) {
hash = (cast(SQLName) owner).hashCode64();
hash ^= '.';
hash *= FnvHash.PRIME;
} else if (owner is null){
hash = FnvHash.BASIC;
} else {
hash = FnvHash.fnv1a_64_lower((cast(Object)owner).toString());
hash ^= '.';
hash *= FnvHash.PRIME;
}
hash = FnvHash.hashCode64(hash, name);
_hashCode64 = hash;
}
public void setOwner(string owner) {
this.setOwner(new SQLIdentifierExpr(owner));
}
public string getName() {
return this.name;
}
public void setName(string name) {
this.name = name;
this._hashCode64 = 0;
this.nameHashCod64 = 0;
SQLPropertyExpr propertyExpr = cast(SQLPropertyExpr) parent;
if (propertyExpr !is null) {
propertyExpr.computeHashCode64();
}
}
override public void output(StringBuffer buf) {
import hunt.logging.ConsoleLogger;
SQLIdentifierExpr qe = cast(SQLIdentifierExpr)this.owner;
this.owner.output(buf);
buf.append(".");
buf.append(this.name);
}
override protected void accept0(SQLASTVisitor visitor) {
if (visitor.visit(this)) {
acceptChild(visitor, this.owner);
}
visitor.endVisit(this);
}
override
public List!SQLObject getChildren() {
return Collections.singletonList!SQLObject(this.owner);
}
override
public size_t toHash() @trusted nothrow {
long hash;
try{
hash= hashCode64();
}catch(Exception){}
return cast(size_t)(hash ^ (hash >>> 32));
}
public long hashCode64() {
if (_hashCode64 == 0) {
computeHashCode64();
}
return _hashCode64;
}
override
public bool opEquals(Object obj) {
if (this is obj) {
return true;
}
if (obj is null) {
return false;
}
// if (!(cast(SQLPropertyExpr)(obj) !is null)) {
// return false;
// }
SQLPropertyExpr other = cast(SQLPropertyExpr) obj;
if(other is null)
return false;
if (name is null) {
if (other.name !is null) {
return false;
}
} else if (name != (other.name)) {
return false;
}
if (owner is null) {
if (other.owner !is null) {
return false;
}
} else if (owner != (other.owner)) {
return false;
}
return true;
}
// override bool opEquals(Object o) {
// if (o is this)
// return true;
// return opEquals(o);
// }
// override size_t toHash() @trusted nothrow {
// return hashCode();
// }
override public SQLPropertyExpr clone() {
SQLExpr owner_x = null;
if (owner !is null) {
owner_x = owner.clone();
}
SQLPropertyExpr x = new SQLPropertyExpr(owner_x, name, nameHashCod64);
x._hashCode64 = _hashCode64;
x.resolvedColumn = resolvedColumn;
x.resolvedOwnerObject = resolvedOwnerObject;
return x;
}
public bool matchOwner(string alias_p) {
auto obj = cast(SQLIdentifierExpr) owner;
if (obj !is null) {
return equalsIgnoreCase(obj.getName(),alias_p);
}
return false;
}
public long nameHashCode64() {
if (nameHashCod64 == 0
&& name !is null) {
nameHashCod64 = FnvHash.hashCode64(name);
}
return nameHashCod64;
}
public string normalizedName() {
string ownerName;
if ( cast(SQLIdentifierExpr)owner !is null) {
ownerName = (cast(SQLIdentifierExpr) owner).normalizedName();
} else if ( cast(SQLPropertyExpr)owner !is null) {
ownerName = (cast(SQLPropertyExpr) owner).normalizedName();
} else {
ownerName = (cast(Object)owner).toString();
}
return ownerName ~ '.' ~ SQLUtils.normalize(name);
}
public SQLColumnDefinition getResolvedColumn() {
return resolvedColumn;
}
public void setResolvedColumn(SQLColumnDefinition resolvedColumn) {
this.resolvedColumn = resolvedColumn;
}
public SQLTableSource getResolvedTableSource() {
if ( cast(SQLTableSource)resolvedOwnerObject !is null) {
return cast(SQLTableSource) resolvedOwnerObject;
}
return null;
}
public void setResolvedTableSource(SQLTableSource resolvedTableSource) {
this.resolvedOwnerObject = resolvedTableSource;
}
public void setResolvedProcedure(SQLCreateProcedureStatement stmt) {
this.resolvedOwnerObject = stmt;
}
public void setResolvedOwnerObject(SQLObject resolvedOwnerObject) {
this.resolvedOwnerObject = resolvedOwnerObject;
}
public SQLCreateProcedureStatement getResolvedProcudure() {
// if (cast(SQLCreateProcedureStatement)(this.resolvedOwnerObject) !is null) {
// return (SQLCreateProcedureStatement) this.resolvedOwnerObject;
// }
return cast(SQLCreateProcedureStatement) this.resolvedOwnerObject;
}
public SQLObject getResolvedOwnerObject() {
return resolvedOwnerObject;
}
override public SQLDataType computeDataType() {
if (resolvedColumn !is null) {
return resolvedColumn.getDataType();
}
if (resolvedOwnerObject !is null
&& cast(SQLSubqueryTableSource)resolvedOwnerObject !is null) {
SQLSelect select = (cast(SQLSubqueryTableSource) resolvedOwnerObject).getSelect();
SQLSelectQueryBlock queryBlock = select.getFirstQueryBlock();
if (queryBlock is null) {
return null;
}
SQLSelectItem selectItem = queryBlock.findSelectItem(nameHashCode64());
if (selectItem !is null) {
return selectItem.computeDataType();
}
}
return null;
}
public bool nameEquals(string name) {
return SQLUtils.nameEquals(this.name, name);
}
public SQLPropertyExpr simplify() {
string normalizedName = SQLUtils.normalize(name);
SQLExpr normalizedOwner = this.owner;
if ( cast(SQLIdentifierExpr)normalizedOwner !is null) {
normalizedOwner = (cast(SQLIdentifierExpr) normalizedOwner).simplify();
}
if (normalizedName != name || normalizedOwner != owner) {
return new SQLPropertyExpr(normalizedOwner, normalizedName, _hashCode64);
}
return this;
}
override public string toString() {
if (owner is null) {
return this.name;
}
return (cast(Object)owner).toString() ~ '.' ~ name;
}
}
|
D
|
void foo(const out int x) { }
|
D
|
module org.serviio.ui.representation.BrowsingCategory;
import java.lang.String;
import java.util.ArrayList;
import java.util.List;
import org.serviio.upnp.service.contentdirectory.definition.ContainerVisibilityType;
public class BrowsingCategory
{
private String id;
private String title;
private ContainerVisibilityType visibility;
private List!(BrowsingCategory) subCategories;
public this()
{
subCategories = new ArrayList!(BrowsingCategory)();
}
public this(String id, String title, ContainerVisibilityType visibility)
{
this.id = id;
this.title = title;
this.visibility = visibility;
}
public List!(BrowsingCategory) getSubCategories()
{
return subCategories;
}
public void setSubCategories(List!(BrowsingCategory) subCategories)
{
this.subCategories = subCategories;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ContainerVisibilityType getVisibility() {
return visibility;
}
public void setVisibility(ContainerVisibilityType visibility)
{
this.visibility = visibility;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
/* Location: D:\Program Files\Serviio\lib\serviio.jar
* Qualified Name: org.serviio.ui.representation.BrowsingCategory
* JD-Core Version: 0.6.2
*/
|
D
|
/**
* HibernateD - Object-Relation Mapping for D programming language, with interface similar to Hibernate.
*
* Source file hibernated/dialects/sqlitedialect.d.
*
* This module contains implementation of PGSQLDialect class which provides implementation specific SQL syntax information.
*
* Copyright: Copyright 2013
* License: $(LINK www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Author: Vadim Lopatin
*/
module hibernated.dialects.pgsqldialect;
import std.conv;
import hibernated.dialect;
import hibernated.metadata;
import hibernated.type;
import ddbc.core;
string[] PGSQL_RESERVED_WORDS =
[
"ABORT",
"ACTION",
"ADD",
"AFTER",
"ALL",
"ALTER",
"ANALYZE",
"AND",
"AS",
"ASC",
"ATTACH",
"AUTOINCREMENT",
"BEFORE",
"BEGIN",
"BETWEEN",
"BY",
"CASCADE",
"CASE",
"CAST",
"CHECK",
"COLLATE",
"COLUMN",
"COMMIT",
"CONFLICT",
"CONSTRAINT",
"CREATE",
"CROSS",
"CURRENT_DATE",
"CURRENT_TIME",
"CURRENT_TIMESTAMP",
"DATABASE",
"DEFAULT",
"DEFERRABLE",
"DEFERRED",
"DELETE",
"DESC",
"DETACH",
"DISTINCT",
"DROP",
"EACH",
"ELSE",
"END",
"ESCAPE",
"EXCEPT",
"EXCLUSIVE",
"EXISTS",
"EXPLAIN",
"FAIL",
"FOR",
"FOREIGN",
"FROM",
"FULL",
"GLOB",
"GROUP",
"HAVING",
"IF",
"IGNORE",
"IMMEDIATE",
"IN",
"INDEX",
"INDEXED",
"INITIALLY",
"INNER",
"INSERT",
"INSTEAD",
"INTERSECT",
"INTO",
"IS",
"ISNULL",
"JOIN",
"KEY",
"LEFT",
"LIKE",
"LIMIT",
"MATCH",
"NATURAL",
"NO",
"NOT",
"NOTNULL",
"NULL",
"OF",
"OFFSET",
"ON",
"OR",
"ORDER",
"OUTER",
"PLAN",
"PRAGMA",
"PRIMARY",
"QUERY",
"RAISE",
"REFERENCES",
"REGEXP",
"REINDEX",
"RELEASE",
"RENAME",
"REPLACE",
"RESTRICT",
"RIGHT",
"ROLLBACK",
"ROW",
"SAVEPOINT",
"SELECT",
"SET",
"TABLE",
"TEMP",
"TEMPORARY",
"THEN",
"TO",
"TRANSACTION",
"TRIGGER",
"UNION",
"UNIQUE",
"UPDATE",
"USER",
"USING",
"VACUUM",
"VALUES",
"VIEW",
"VIRTUAL",
"WHEN",
"WHERE",
];
class PGSQLDialect : Dialect {
///The character specific to this dialect used to close a quoted identifier.
override char closeQuote() const { return '"'; }
///The character specific to this dialect used to begin a quoted identifier.
override char openQuote() const { return '"'; }
// returns string like "BIGINT(20) NOT NULL" or "VARCHAR(255) NULL"
override string getColumnTypeDefinition(const PropertyInfo pi, const PropertyInfo overrideTypeFrom = null) {
immutable Type type = overrideTypeFrom !is null ? overrideTypeFrom.columnType : pi.columnType;
immutable SqlType sqlType = type.getSqlType();
bool fk = pi is null;
string nullablility = !fk && pi.nullable ? " NULL" : " NOT NULL";
string pk = !fk && pi.key ? " PRIMARY KEY" : "";
if (!fk && pi.generated) {
if (sqlType == SqlType.SMALLINT || sqlType == SqlType.TINYINT)
return "SERIAL PRIMARY KEY";
if (sqlType == SqlType.INTEGER)
return "SERIAL PRIMARY KEY";
return "BIGSERIAL PRIMARY KEY";
}
string def = "";
int len = 0;
if (cast(NumberType)type !is null) {
len = (cast(NumberType)type).length;
}
if (cast(StringType)type !is null) {
len = (cast(StringType)type).length;
}
string modifiers = nullablility ~ def ~ pk;
string lenmodifiers = "(" ~ to!string(len > 0 ? len : 255) ~ ")" ~ modifiers;
switch (sqlType) {
case SqlType.BIGINT:
return "BIGINT" ~ modifiers;
case SqlType.BIT:
case SqlType.BOOLEAN:
return "BOOLEAN" ~ modifiers;
case SqlType.INTEGER:
return "INT" ~ modifiers;
case SqlType.NUMERIC:
return "INT" ~ modifiers;
case SqlType.SMALLINT:
return "SMALLINT" ~ modifiers;
case SqlType.TINYINT:
return "SMALLINT" ~ modifiers;
case SqlType.FLOAT:
return "FLOAT(24)" ~ modifiers;
case SqlType.DOUBLE:
return "FLOAT(53)" ~ modifiers;
case SqlType.DECIMAL:
return "REAL" ~ modifiers;
case SqlType.DATE:
return "DATE" ~ modifiers;
case SqlType.DATETIME:
return "TIMESTAMP" ~ modifiers;
case SqlType.TIME:
return "TIME" ~ modifiers;
case SqlType.CHAR:
case SqlType.CLOB:
case SqlType.LONGNVARCHAR:
case SqlType.LONGVARBINARY:
case SqlType.LONGVARCHAR:
case SqlType.NCHAR:
case SqlType.NCLOB:
case SqlType.VARBINARY:
case SqlType.VARCHAR:
case SqlType.NVARCHAR:
return "TEXT" ~ modifiers;
case SqlType.BLOB:
return "BYTEA";
default:
return "TEXT";
}
}
override string getCheckTableExistsSQL(string tableName) {
return "select relname from pg_class where relname = " ~ quoteSqlString(tableName) ~ " and relkind='r'";
}
override string getUniqueIndexItemSQL(string indexName, string[] columnNames) {
return "UNIQUE " ~ createFieldListSQL(columnNames);
}
/// for some of RDBMS it's necessary to pass additional clauses in query to get generated value (e.g. in Postgres - " returing id"
override string appendInsertToFetchGeneratedKey(string query, const EntityInfo entity) {
return query ~ " RETURNING " ~ quoteIfNeeded(entity.getKeyProperty().columnName);
}
this() {
addKeywords(PGSQL_RESERVED_WORDS);
}
}
|
D
|
guided by whim and fancy
unpredictably excitable (especially of horses)
|
D
|
/Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.build/CodableReflection/ReflectionDecoders.swift.o : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NotFound.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.build/ReflectionDecoders~partial.swiftmodule : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NotFound.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.build/ReflectionDecoders~partial.swiftdoc : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NotFound.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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
|
module Core.Disassembler;
import std.stdio;
import std.string;
import Core.MMU;
public final class Disassembler {
private MMU _mmu;
private ushort _pc;
public this(MMU mmu) {
_mmu = mmu;
}
public void disassemble(immutable ushort address, immutable ushort opCount) {
_pc = address;
ushort op = 0;
while (op < opCount) {
immutable ushort current = _pc;
immutable ubyte opcode = _mmu.read8(_pc++);
writefln("$%04X: %s", current, decode(opcode));
op++;
}
}
pragma(inline, true)
private string read8() {
immutable ubyte value = _mmu.read8(_pc++);
return format("$%02X", value);
}
pragma(inline, true)
private string read16() {
immutable ushort value = _mmu.read16(_pc);
_pc += 2;
return format("$%04X", value);
}
private string decode(const ubyte opcode) {
switch (opcode) {
case 0x06: return format("LD B, %s", read8());
case 0x0E: return format("LD C, %s", read8());
case 0x16: return format("LD D, %s", read8());
case 0x1E: return format("LD E, %s", read8());
case 0x26: return format("LD H, %s", read8());
case 0x2E: return format("LD L, %s", read8());
case 0x36: return format("LD (HL), %s", read8());
case 0x3E: return format("LD A, %s", read8());
case 0x0A: return format("LD A, (BC)");
case 0x1A: return format("LD A, (DE)");
case 0x7E: return format("LD A, (HL)");
case 0xFA: return format("LD A, (%s)", read16());
case 0x40: return format("LD B, B");
case 0x41: return format("LD B, C");
case 0x42: return format("LD B, D");
case 0x43: return format("LD B, E");
case 0x44: return format("LD B, H");
case 0x45: return format("LD B, L");
case 0x46: return format("LD B, (HL)");
case 0x48: return format("LD C, B");
case 0x49: return format("LD C, C");
case 0x4A: return format("LD C, D");
case 0x4B: return format("LD C, E");
case 0x4C: return format("LD C, H");
case 0x4D: return format("LD C, L");
case 0x4E: return format("LD C, (HL)");
case 0x50: return format("LD D, B");
case 0x51: return format("LD D, C");
case 0x52: return format("LD D, D");
case 0x53: return format("LD D, E");
case 0x54: return format("LD D, H");
case 0x55: return format("LD D, L");
case 0x56: return format("LD D, (HL)");
case 0x58: return format("LD E, B");
case 0x59: return format("LD E, C");
case 0x5A: return format("LD E, D");
case 0x5B: return format("LD E, E");
case 0x5C: return format("LD E, H");
case 0x5D: return format("LD E, L");
case 0x5E: return format("LD E, (HL)");
case 0x60: return format("LD H, B");
case 0x61: return format("LD H, C");
case 0x62: return format("LD H, D");
case 0x63: return format("LD H, E");
case 0x64: return format("LD H, H");
case 0x65: return format("LD H, L");
case 0x66: return format("LD H, (HL)");
case 0x68: return format("LD L, B");
case 0x69: return format("LD L, C");
case 0x6A: return format("LD L, D");
case 0x6B: return format("LD L, E");
case 0x6C: return format("LD L, H");
case 0x6D: return format("LD L, L");
case 0x6E: return format("LD L, (HL)");
case 0x70: return format("LD (HL), B");
case 0x71: return format("LD (HL), C");
case 0x72: return format("LD (HL), D");
case 0x73: return format("LD (HL), E");
case 0x74: return format("LD (HL), H");
case 0x75: return format("LD (HL), L");
case 0x78: return format("LD A, B");
case 0x79: return format("LD A, C");
case 0x7A: return format("LD A, D");
case 0x7B: return format("LD A, E");
case 0x7C: return format("LD A, H");
case 0x7D: return format("LD A, L");
case 0x7F: return format("LD A, A");
case 0x47: return format("LD B, A");
case 0x4F: return format("LD C, A");
case 0x57: return format("LD D, A");
case 0x5F: return format("LD E, A");
case 0x67: return format("LD H, A");
case 0x6F: return format("LD L, A");
case 0x02: return format("LD (BC), A");
case 0x12: return format("LD (DE), A");
case 0x77: return format("LD (HL), A");
case 0xEA: return format("LD (%s), A", read16());
case 0xF2: return format("LD C, ($FF00 + %s)", read8());
case 0xE2: return format("LD ($FF00 + %s), C", read8());
case 0xF0: return format("LD A, ($FF00 + %s)", read8());
case 0xE0: return format("LD ($FF00 + %s), A", read8());
case 0x3A: return format("LD A, (HL-)");
case 0x32: return format("LD (HL-), A");
case 0x2A: return format("LD A, (HL+)");
case 0x22: return format("LD (HL+), A");
case 0x01: return format("LD BC, %s", read16());
case 0x11: return format("LD DE, %s", read16());
case 0x21: return format("LD HL, %s", read16());
case 0x31: return format("LD SP, %s", read16());
case 0xF9: return format("LD SP, HL");
case 0xF8: return format("LD HL, SP + %s", read8());
case 0x08: return format("LD (%s), SP", read16());
case 0xF5: return format("PUSH AF");
case 0xC5: return format("PUSH BC");
case 0xD5: return format("PUSH DE");
case 0xE5: return format("PUSH HL");
case 0xF1: return format("POP AF");
case 0xC1: return format("POP BC");
case 0xD1: return format("POP DE");
case 0xE1: return format("POP HL");
case 0x80: return format("ADD A, B");
case 0x81: return format("ADD A, C");
case 0x82: return format("ADD A, D");
case 0x83: return format("ADD A, E");
case 0x84: return format("ADD A, H");
case 0x85: return format("ADD A, L");
case 0x86: return format("ADD A, (HL)");
case 0x87: return format("ADD A, A");
case 0xC6: return format("ADD A, %s", read8());
case 0x88: return format("ADC A, B");
case 0x89: return format("ADC A, C");
case 0x8A: return format("ADC A, D");
case 0x8B: return format("ADC A, E");
case 0x8C: return format("ADC A, H");
case 0x8D: return format("ADC A, L");
case 0x8E: return format("ADC A, (HL)");
case 0x8F: return format("ADC A, A");
case 0xCE: return format("ADC A, %s", read8());
case 0x90: return format("SUB A, B");
case 0x91: return format("SUB A, C");
case 0x92: return format("SUB A, D");
case 0x93: return format("SUB A, E");
case 0x94: return format("SUB A, H");
case 0x95: return format("SUB A, L");
case 0x96: return format("SUB A, (HL)");
case 0x97: return format("SUB A, A");
case 0xD6: return format("SUB A, %s", read8());
case 0x98: return format("SBC A, B");
case 0x99: return format("SBC A, C");
case 0x9A: return format("SBC A, D");
case 0x9B: return format("SBC A, E");
case 0x9C: return format("SBC A, H");
case 0x9D: return format("SBC A, L");
case 0x9E: return format("SBC A, (HL)");
case 0x9F: return format("SBC A, A");
case 0xDE: return format("SBC A, %s", read8());
case 0xA0: return format("AND A, B");
case 0xA1: return format("AND A, C");
case 0xA2: return format("AND A, D");
case 0xA3: return format("AND A, E");
case 0xA4: return format("AND A, H");
case 0xA5: return format("AND A, L");
case 0xA6: return format("AND A, (HL)");
case 0xA7: return format("AND A, A");
case 0xE6: return format("AND A, %s", read8());
case 0xB0: return format("OR A, B");
case 0xB1: return format("OR A, C");
case 0xB2: return format("OR A, D");
case 0xB3: return format("OR A, E");
case 0xB4: return format("OR A, H");
case 0xB5: return format("OR A, L");
case 0xB6: return format("OR A, (HL)");
case 0xB7: return format("OR A, A");
case 0xF6: return format("OR A, %s", read8());
case 0xA8: return format("XOR A, B");
case 0xA9: return format("XOR A, C");
case 0xAA: return format("XOR A, D");
case 0xAB: return format("XOR A, E");
case 0xAC: return format("XOR A, H");
case 0xAD: return format("XOR A, L");
case 0xAE: return format("XOR A, (HL)");
case 0xAF: return format("XOR A, A");
case 0xEE: return format("XOR A, %s", read8());
case 0xB8: return format("CP A, B");
case 0xB9: return format("CP A, C");
case 0xBA: return format("CP A, D");
case 0xBB: return format("CP A, E");
case 0xBC: return format("CP A, H");
case 0xBD: return format("CP A, L");
case 0xBE: return format("CP A, (HL)");
case 0xBF: return format("CP A, A");
case 0xFE: return format("CP A, %s", read8());
case 0x04: return format("INC B");
case 0x0C: return format("INC C");
case 0x14: return format("INC D");
case 0x1C: return format("INC E");
case 0x24: return format("INC H");
case 0x2C: return format("INC L");
case 0x34: return format("INC (HL)");
case 0x3C: return format("INC A");
case 0x05: return format("DEC B");
case 0x0D: return format("DEC C");
case 0x15: return format("DEC D");
case 0x1D: return format("DEC E");
case 0x25: return format("DEC H");
case 0x2D: return format("DEC L");
case 0x35: return format("DEC (HL)");
case 0x3D: return format("DEC A");
case 0x09: return format("ADD HL, BC");
case 0x19: return format("ADD HL, DE");
case 0x29: return format("ADD HL, HL");
case 0x39: return format("ADD HL, SP");
case 0xE8: return format("ADD SP, %s", read8());
case 0x03: return format("INC BC");
case 0x13: return format("INC DE");
case 0x23: return format("INC HL");
case 0x33: return format("INC SP");
case 0x0B: return format("DEC BC");
case 0x1B: return format("DEC DE");
case 0x2B: return format("DEC HL");
case 0x3B: return format("DEC SP");
case 0x27: return format("DA A");
case 0x2F: return format("CPL A");
case 0x3F: return format("CCF");
case 0x37: return format("SCF");
case 0x00: return format("NOP");
case 0x76: return format("HALT");
case 0x10: return format("STOP");
case 0xF3: return format("DI");
case 0xFB: return format("EI");
case 0x07: return format("RLC A");
case 0x17: return format("RL A");
case 0x0F: return format("RRC A");
case 0x1F: return format("RR A");
case 0xC3: return format("JP %s", read16());
case 0xC2: return format("JP NZ, %s", read16());
case 0xCA: return format("JP Z, %s", read16());
case 0xD2: return format("JP NC, %s", read16());
case 0xDa: return format("JP C, %s", read16());
case 0xE9: return format("JP (HL)");
case 0x18: return format("JR %s", read8());
case 0x20: return format("JR NZ, %s", read8());
case 0x28: return format("JR Z, %s", read8());
case 0x30: return format("JR NC, %s", read8());
case 0x38: return format("JR C, %s", read8());
case 0xCD: return format("CALL %s", read16());
case 0xC4: return format("CALL NZ, %s", read16());
case 0xCC: return format("CALL Z, %s", read16());
case 0xD4: return format("CALL NC, %s", read16());
case 0xDC: return format("CALL C, %s", read16());
case 0xC7: return format("RST $00");
case 0xCF: return format("RST $08");
case 0xDF: return format("RST $18");
case 0xE7: return format("RST $20");
case 0xEF: return format("RST $28");
case 0xF7: return format("RST $30");
case 0xFF: return format("RST $38");
case 0xC9: return format("RET");
case 0xD9: return format("RETI");
case 0xC0: return format("RET NZ");
case 0xC8: return format("RET Z");
case 0xD0: return format("RET NC");
case 0xD8: return format("RET C");
case 0xCB: return decodeExt(_mmu.read8(_pc++));
default:
return format("???? $%02X", opcode);
}
}
//pragma(inline, true)
private string decodeExt(immutable ubyte opcode) {
switch (opcode) {
case 0x30: return format("SWAP B");
case 0x31: return format("SWAP C");
case 0x32: return format("SWAP D");
case 0x33: return format("SWAP E");
case 0x34: return format("SWAP H");
case 0x35: return format("SWAP L");
case 0x36: return format("SWAP (HL)");
case 0x37: return format("SWAP A");
case 0x00: return format("RLC B");
case 0x01: return format("RLC C");
case 0x02: return format("RLC D");
case 0x03: return format("RLC E");
case 0x04: return format("RLC H");
case 0x05: return format("RLC L");
case 0x06: return format("RLC (HL)");
case 0x07: return format("RLC A");
case 0x10: return format("RL B");
case 0x11: return format("RL C");
case 0x12: return format("RL D");
case 0x13: return format("RL E");
case 0x14: return format("RL H");
case 0x15: return format("RL L");
case 0x16: return format("RL (HL)");
case 0x17: return format("RL A");
case 0x08: return format("RRC B");
case 0x09: return format("RRC C");
case 0x0A: return format("RRC D");
case 0x0B: return format("RRC E");
case 0x0C: return format("RRC H");
case 0x0D: return format("RRC L");
case 0x0E: return format("RRC (HL)");
case 0x0F: return format("RRC A");
case 0x18: return format("RR B");
case 0x19: return format("RR C");
case 0x1A: return format("RR D");
case 0x1B: return format("RR E");
case 0x1C: return format("RR H");
case 0x1D: return format("RR L");
case 0x1E: return format("RR (HL)");
case 0x1F: return format("RR A");
case 0x20: return format("SLA B");
case 0x21: return format("SLA C");
case 0x22: return format("SLA D");
case 0x23: return format("SLA E");
case 0x24: return format("SLA H");
case 0x25: return format("SLA L");
case 0x26: return format("SLA (HL)");
case 0x27: return format("SLA A");
case 0x2F: return format("SRA B");
case 0x28: return format("SRA C");
case 0x29: return format("SRA D");
case 0x2A: return format("SRA E");
case 0x2B: return format("SRA H");
case 0x2C: return format("SRA L");
case 0x2D: return format("SRA (HL)");
case 0x2E: return format("SRA A");
case 0x38: return format("SRL B");
case 0x39: return format("SRL C");
case 0x3A: return format("SRL D");
case 0x3B: return format("SRL E");
case 0x3C: return format("SRL H");
case 0x3D: return format("SRL L");
case 0x3E: return format("SRL (HL)");
case 0x3F: return format("SRL A");
case 0x40: return format("BIT 0, B");
case 0x41: return format("BIT 0, C");
case 0x42: return format("BIT 0, D");
case 0x43: return format("BIT 0, E");
case 0x44: return format("BIT 0, H");
case 0x45: return format("BIT 0, L");
case 0x46: return format("BIT 0, (HL)");
case 0x47: return format("BIT 0, A");
case 0x48: return format("BIT 1, B");
case 0x49: return format("BIT 1, C");
case 0x4A: return format("BIT 1, D");
case 0x4B: return format("BIT 1, E");
case 0x4C: return format("BIT 1, H");
case 0x4D: return format("BIT 1, L");
case 0x4E: return format("BIT 1, (HL)");
case 0x4F: return format("BIT 1, A");
case 0x50: return format("BIT 2, B");
case 0x51: return format("BIT 2, C");
case 0x52: return format("BIT 2, D");
case 0x53: return format("BIT 2, E");
case 0x54: return format("BIT 2, H");
case 0x55: return format("BIT 2, L");
case 0x56: return format("BIT 2, (HL)");
case 0x57: return format("BIT 2, A");
case 0x58: return format("BIT 3, B");
case 0x59: return format("BIT 3, C");
case 0x5A: return format("BIT 3, D");
case 0x5B: return format("BIT 3, E");
case 0x5C: return format("BIT 3, H");
case 0x5D: return format("BIT 3, L");
case 0x5E: return format("BIT 3, (HL)");
case 0x5F: return format("BIT 3, A");
case 0x60: return format("BIT 4, B");
case 0x61: return format("BIT 4, C");
case 0x62: return format("BIT 4, D");
case 0x63: return format("BIT 4, E");
case 0x64: return format("BIT 4, H");
case 0x65: return format("BIT 4, L");
case 0x66: return format("BIT 4, (HL)");
case 0x67: return format("BIT 4, A");
case 0x68: return format("BIT 5, B");
case 0x69: return format("BIT 5, C");
case 0x6A: return format("BIT 5, D");
case 0x6B: return format("BIT 5, E");
case 0x6C: return format("BIT 5, H");
case 0x6D: return format("BIT 5, L");
case 0x6E: return format("BIT 5, (HL)");
case 0x6F: return format("BIT 5, A");
case 0x70: return format("BIT 6, B");
case 0x71: return format("BIT 6, C");
case 0x72: return format("BIT 6, D");
case 0x73: return format("BIT 6, E");
case 0x74: return format("BIT 6, H");
case 0x75: return format("BIT 6, L");
case 0x76: return format("BIT 6, (HL)");
case 0x77: return format("BIT 6, A");
case 0x78: return format("BIT 7, B");
case 0x79: return format("BIT 7, C");
case 0x7A: return format("BIT 7, D");
case 0x7B: return format("BIT 7, E");
case 0x7C: return format("BIT 7, H");
case 0x7D: return format("BIT 7, L");
case 0x7E: return format("BIT 7, (HL)");
case 0x7F: return format("BIT 7, A");
case 0x80: return format("RES 0, B");
case 0x81: return format("RES 0, C");
case 0x82: return format("RES 0, D");
case 0x83: return format("RES 0, E");
case 0x84: return format("RES 0, H");
case 0x85: return format("RES 0, L");
case 0x86: return format("RES 0, (HL)");
case 0x87: return format("RES 0, A");
case 0x88: return format("RES 1, B");
case 0x89: return format("RES 1, C");
case 0x8A: return format("RES 1, D");
case 0x8B: return format("RES 1, E");
case 0x8C: return format("RES 1, H");
case 0x8D: return format("RES 1, L");
case 0x8E: return format("RES 1, (HL)");
case 0x8F: return format("RES 1, A");
case 0x90: return format("RES 2, B");
case 0x91: return format("RES 2, C");
case 0x92: return format("RES 2, D");
case 0x93: return format("RES 2, E");
case 0x94: return format("RES 2, H");
case 0x95: return format("RES 2, L");
case 0x96: return format("RES 2, (HL)");
case 0x97: return format("RES 2, A");
case 0x98: return format("RES 3, B");
case 0x99: return format("RES 3, C");
case 0x9A: return format("RES 3, D");
case 0x9B: return format("RES 3, E");
case 0x9C: return format("RES 3, H");
case 0x9D: return format("RES 3, L");
case 0x9E: return format("RES 3, (HL)");
case 0x9F: return format("RES 3, A");
case 0xA0: return format("RES 4, B");
case 0xA1: return format("RES 4, C");
case 0xA2: return format("RES 4, D");
case 0xA3: return format("RES 4, E");
case 0xA4: return format("RES 4, H");
case 0xA5: return format("RES 4, L");
case 0xA6: return format("RES 4, (HL)");
case 0xA7: return format("RES 4, A");
case 0xA8: return format("RES 5, B");
case 0xA9: return format("RES 5, C");
case 0xAA: return format("RES 5, D");
case 0xAB: return format("RES 5, E");
case 0xAC: return format("RES 5, H");
case 0xAD: return format("RES 5, L");
case 0xAE: return format("RES 5, (HL)");
case 0xAF: return format("RES 5, A");
case 0xB0: return format("RES 6, B");
case 0xB1: return format("RES 6, C");
case 0xB2: return format("RES 6, D");
case 0xB3: return format("RES 6, E");
case 0xB4: return format("RES 6, H");
case 0xB5: return format("RES 6, L");
case 0xB6: return format("RES 6, (HL)");
case 0xB7: return format("RES 6, A");
case 0xB8: return format("RES 7, B");
case 0xB9: return format("RES 7, C");
case 0xBA: return format("RES 7, D");
case 0xBB: return format("RES 7, E");
case 0xBC: return format("RES 7, H");
case 0xBD: return format("RES 7, L");
case 0xBE: return format("RES 7, (HL)");
case 0xBF: return format("RES 7, A");
case 0xC0: return format("SET 0, B");
case 0xC1: return format("SET 0, C");
case 0xC2: return format("SET 0, D");
case 0xC3: return format("SET 0, E");
case 0xC4: return format("SET 0, H");
case 0xC5: return format("SET 0, L");
case 0xC6: return format("SET 0, (HL)");
case 0xC7: return format("SET 0, A");
case 0xC8: return format("SET 1, B");
case 0xC9: return format("SET 1, C");
case 0xCA: return format("SET 1, D");
case 0xCB: return format("SET 1, E");
case 0xCC: return format("SET 1, H");
case 0xCD: return format("SET 1, L");
case 0xCE: return format("SET 1, (HL)");
case 0xCF: return format("SET 1, A");
case 0xD0: return format("SET 2, B");
case 0xD1: return format("SET 2, C");
case 0xD2: return format("SET 2, D");
case 0xD3: return format("SET 2, E");
case 0xD4: return format("SET 2, H");
case 0xD5: return format("SET 2, L");
case 0xD6: return format("SET 2, (HL)");
case 0xD7: return format("SET 2, A");
case 0xD8: return format("SET 3, B");
case 0xD9: return format("SET 3, C");
case 0xDA: return format("SET 3, D");
case 0xDB: return format("SET 3, E");
case 0xDC: return format("SET 3, H");
case 0xDD: return format("SET 3, L");
case 0xDE: return format("SET 3, (HL)");
case 0xDF: return format("SET 3, A");
case 0xE0: return format("SET 4, B");
case 0xE1: return format("SET 4, C");
case 0xE2: return format("SET 4, D");
case 0xE3: return format("SET 4, E");
case 0xE4: return format("SET 4, H");
case 0xE5: return format("SET 4, L");
case 0xE6: return format("SET 4, (HL)");
case 0xE7: return format("SET 4, A");
case 0xE8: return format("SET 5, B");
case 0xE9: return format("SET 5, C");
case 0xEA: return format("SET 5, D");
case 0xEB: return format("SET 5, E");
case 0xEC: return format("SET 5, H");
case 0xED: return format("SET 5, L");
case 0xEE: return format("SET 5, (HL)");
case 0xEF: return format("SET 5, A");
case 0xF0: return format("SET 6, B");
case 0xF1: return format("SET 6, C");
case 0xF2: return format("SET 6, D");
case 0xF3: return format("SET 6, E");
case 0xF4: return format("SET 6, H");
case 0xF5: return format("SET 6, L");
case 0xF6: return format("SET 6, (HL)");
case 0xF7: return format("SET 6, A");
case 0xF8: return format("SET 7, B");
case 0xF9: return format("SET 7, C");
case 0xFA: return format("SET 7, D");
case 0xFB: return format("SET 7, E");
case 0xFC: return format("SET 7, H");
case 0xFD: return format("SET 7, L");
case 0xFE: return format("SET 7, (HL)");
case 0xFF: return format("SET 7, A");
default:
return format("???? 0xCB $%02X", opcode);
}
}
}
|
D
|
INSTANCE Mod_525_SLD_Lee_MT (Npc_Default)
{
// ------ NSC ------
name = "Lee";
guild = GIL_MIL;
id = 525;
voice = 4; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_FRIEND;
// ------ AIVARS ------
aivar[AIV_ToughGuy] = TRUE;
aivar[AIV_ToughGuyNewsOverride] = TRUE;
aivar[AIV_IGNORE_Murder] = TRUE;
aivar[AIV_IGNORE_Theft] = TRUE;
aivar[AIV_IGNORE_Sheepkiller] = TRUE;
// ------ Attribute ------
B_SetAttributesToChapter (self, 6); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_MASTER; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, Lees_Axt);
// ------ 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_Pony", Face_N_Lee, BodyTex_N, ITAR_SLD_H2);
Mdl_ApplyOverlayMds (self, "Humans_Militia.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 70); //Grenzen für Talent-Level liegen bei 30 und 60
// ------ TA anmelden ------
daily_routine = Rtn_Start_525;
};
FUNC VOID Rtn_Start_525 ()
{
TA_Stand_Guarding (08,00,19,00,"NC_DAM2");
TA_Stand_Guarding (19,00,22,00,"NC_DAM2");
TA_Stand_Guarding (22,00,08,00,"NC_DAM2");
};
FUNC VOID Rtn_Gardisten_525 ()
{
TA_Stand_ArmsCrossed (20,50,07,10,"OW_PATH_07_21");
TA_Stand_ArmsCrossed (07,10,20,50,"OW_PATH_07_21");
};
FUNC VOID Rtn_Ueberfall_525 ()
{
TA_Smalltalk_Plaudern (08,00,22,00,"OW_PATH_07_15_CAVE2");
TA_Smalltalk_Plaudern (22,00,08,00,"OW_PATH_07_15_CAVE2");
};
|
D
|
lining of the stomach of a ruminant (especially a bovine) used as food
nonsensical talk or writing
|
D
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/node_def.proto
module tensorflow.node_def;
import google.protobuf;
import tensorflow.attr_value;
enum protocVersion = 3012004;
class NodeDef
{
@Proto(1) string name = protoDefaultValue!(string);
@Proto(2) string op = protoDefaultValue!(string);
@Proto(3) string[] input = protoDefaultValue!(string[]);
@Proto(4) string device = protoDefaultValue!(string);
@Proto(5) AttrValue[string] attr = protoDefaultValue!(AttrValue[string]);
@Proto(6) NodeDef.ExperimentalDebugInfo experimentalDebugInfo = protoDefaultValue!(NodeDef.ExperimentalDebugInfo);
static class ExperimentalDebugInfo
{
@Proto(1) string[] originalNodeNames = protoDefaultValue!(string[]);
@Proto(2) string[] originalFuncNames = protoDefaultValue!(string[]);
}
}
|
D
|
/*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* gtkD 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
/*
* Conversion parameters:
* inFile = GtkRecentChooser.html
* outPack = gtk
* outFile = RecentChooserIF
* strct = GtkRecentChooser
* realStrct=
* ctorStrct=
* clss = RecentChooserT
* interf = RecentChooserIF
* class Code: No
* interface Code: No
* template for:
* extend =
* implements:
* prefixes:
* - gtk_recent_chooser_
* - gtk_
* omit structs:
* omit prefixes:
* omit code:
* omit signals:
* imports:
* - gtkD.glib.Str
* - gtkD.glib.ErrorG
* - gtkD.glib.GException
* - gtkD.gtk.RecentInfo
* - gtkD.gtk.RecentFilter
* - gtkD.glib.ListG
* - gtkD.glib.ListSG
* structWrap:
* - GList* -> ListG
* - GSList* -> ListSG
* - GtkRecentFilter* -> RecentFilter
* - GtkRecentInfo* -> RecentInfo
* module aliases:
* local aliases:
* overrides:
*/
module gtkD.gtk.RecentChooserIF;
public import gtkD.gtkc.gtktypes;
private import gtkD.gtkc.gtk;
private import gtkD.glib.ConstructionException;
private import gtkD.gobject.Signals;
public import gtkD.gtkc.gdktypes;
private import gtkD.glib.Str;
private import gtkD.glib.ErrorG;
private import gtkD.glib.GException;
private import gtkD.gtk.RecentInfo;
private import gtkD.gtk.RecentFilter;
private import gtkD.glib.ListG;
private import gtkD.glib.ListSG;
/**
* Description
* GtkRecentChooser is an interface that can be implemented by widgets
* displaying the list of recently used files. In GTK+, the main objects
* that implement this interface are GtkRecentChooserWidget,
* GtkRecentChooserDialog and GtkRecentChooserMenu.
* Recently used files are supported since GTK+ 2.10.
*/
public interface RecentChooserIF
{
public GtkRecentChooser* getRecentChooserTStruct();
/** the main Gtk struct as a void* */
protected void* getStruct();
/**
*/
void delegate(RecentChooserIF)[] onItemActivatedListeners();
/**
* This signal is emitted when the user "activates" a recent item
* in the recent chooser. This can happen by double-clicking on an item
* in the recently used resources list, or by pressing
* Enter.
* Since 2.10
*/
void addOnItemActivated(void delegate(RecentChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
void delegate(RecentChooserIF)[] onSelectionChangedListeners();
/**
* This signal is emitted when there is a change in the set of
* selected recently used resources. This can happen when a user
* modifies the selection with the mouse or the keyboard, or when
* explicitely calling functions to change the selection.
* Since 2.10
* See Also
* GtkRecentManager, GtkRecentChooserDialog, GtkRecentChooserWidget,
* GtkRecentChooserMenu
*/
void addOnSelectionChanged(void delegate(RecentChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
/**
* Whether to show recently used resources marked registered as private.
* Since 2.10
* Params:
* showPrivate = TRUE to show private items, FALSE otherwise
*/
public void setShowPrivate(int showPrivate);
/**
* Returns whether chooser should display recently used resources
* registered as private.
* Since 2.10
* Returns: TRUE if the recent chooser should show private items, FALSE otherwise.
*/
public int getShowPrivate();
/**
* Sets whether chooser should display the recently used resources that
* it didn't find. This only applies to local resources.
* Since 2.10
* Params:
* showNotFound = whether to show the local items we didn't find
*/
public void setShowNotFound(int showNotFound);
/**
* Retrieves whether chooser should show the recently used resources that
* were not found.
* Since 2.10
* Returns: TRUE if the resources not found should be displayed, and FALSE otheriwse.
*/
public int getShowNotFound();
/**
* Sets whether chooser should show an icon near the resource when
* displaying it.
* Since 2.10
* Params:
* showIcons = whether to show an icon near the resource
*/
public void setShowIcons(int showIcons);
/**
* Retrieves whether chooser should show an icon near the resource.
* Since 2.10
* Returns: TRUE if the icons should be displayed, FALSE otherwise.
*/
public int getShowIcons();
/**
* Sets whether chooser can select multiple items.
* Since 2.10
* Params:
* selectMultiple = TRUE if chooser can select more than one item
*/
public void setSelectMultiple(int selectMultiple);
/**
* Gets whether chooser can select multiple items.
* Since 2.10
* Returns: TRUE if chooser can select more than one item.
*/
public int getSelectMultiple();
/**
* Sets whether only local resources, that is resources using the file:// URI
* scheme, should be shown in the recently used resources selector. If
* local_only is TRUE (the default) then the shown resources are guaranteed
* to be accessible through the operating system native file system.
* Since 2.10
* Params:
* localOnly = TRUE if only local files can be shown
*/
public void setLocalOnly(int localOnly);
/**
* Gets whether only local resources should be shown in the recently used
* resources selector. See gtk_recent_chooser_set_local_only()
* Since 2.10
* Returns: TRUE if only local resources should be shown.
*/
public int getLocalOnly();
/**
* Sets the number of items that should be returned by
* gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().
* Since 2.10
* Params:
* limit = a positive integer, or -1 for all items
*/
public void setLimit(int limit);
/**
* Gets the number of items returned by gtk_recent_chooser_get_items()
* and gtk_recent_chooser_get_uris().
* Since 2.10
* Returns: A positive integer, or -1 meaning that all items are returned.
*/
public int getLimit();
/**
* Sets whether to show a tooltips containing the full path of each
* recently used resource in a GtkRecentChooser widget.
* Since 2.10
* Params:
* showTips = TRUE if tooltips should be shown
*/
public void setShowTips(int showTips);
/**
* Gets whether chooser should display tooltips containing the full path
* of a recently user resource.
* Since 2.10
* Returns: TRUE if the recent chooser should show tooltips, FALSE otherwise.
*/
public int getShowTips();
/**
* Warning
* gtk_recent_chooser_set_show_numbers has been deprecated since version 2.12 and should not be used in newly-written code. Use gtk_recent_chooser_menu_set_show_numbers() instead.
* Whether to show recently used resources prepended by a unique number.
* Since 2.10
* Params:
* showNumbers = TRUE to show numbers, FALSE otherwise
*/
public void setShowNumbers(int showNumbers);
/**
* Warning
* gtk_recent_chooser_get_show_numbers has been deprecated since version 2.12 and should not be used in newly-written code. use gtk_recent_chooser_menu_get_show_numbers() instead.
* Returns whether chooser should display recently used resources
* prepended by a unique number.
* Since 2.10
* Returns: TRUE if the recent chooser should show display numbers, FALSE otherwise.
*/
public int getShowNumbers();
/**
* Changes the sorting order of the recently used resources list displayed by
* chooser.
* Since 2.10
* Params:
* sortType = sort order that the chooser should use
*/
public void setSortType(GtkRecentSortType sortType);
/**
* Gets the value set by gtk_recent_chooser_set_sort_type().
* Since 2.10
* Returns: the sorting order of the chooser.
*/
public GtkRecentSortType getSortType();
/**
* Sets the comparison function used when sorting to be sort_func. If
* the chooser has the sort type set to GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
* To the comparison function will be passed two GtkRecentInfo structs and
* sort_data; sort_func should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* Since 2.10
* Params:
* sortFunc = the comparison function
* sortData = user data to pass to sort_func, or NULL
* dataDestroy = destroy notifier for sort_data, or NULL
*/
public void setSortFunc(GtkRecentSortFunc sortFunc, void* sortData, GDestroyNotify dataDestroy);
/**
* Sets uri as the current URI for chooser.
* Since 2.10
* Params:
* uri = a URI
* Returns: TRUE if the URI was found.
* Throws: GException on failure.
*/
public int setCurrentUri(string uri);
/**
* Gets the URI currently selected by chooser.
* Since 2.10
* Returns: a newly allocated string holding a URI.
*/
public string getCurrentUri();
/**
* Gets the GtkRecentInfo currently selected by chooser.
* Since 2.10
* Returns: a GtkRecentInfo. Use gtk_recent_info_unref() when when you have finished using it.
*/
public RecentInfo getCurrentItem();
/**
* Selects uri inside chooser.
* Since 2.10
* Params:
* uri = a URI
* Returns: TRUE if uri was found.
* Throws: GException on failure.
*/
public int selectUri(string uri);
/**
* Unselects uri inside chooser.
* Since 2.10
* Params:
* uri = a URI
*/
public void unselectUri(string uri);
/**
* Selects all the items inside chooser, if the chooser supports
* multiple selection.
* Since 2.10
*/
public void selectAll();
/**
* Unselects all the items inside chooser.
* Since 2.10
*/
public void unselectAll();
/**
* Gets the list of recently used resources in form of GtkRecentInfo objects.
* The return value of this function is affected by the "sort-type" and
* "limit" properties of chooser.
* Since 2.10
* Returns: A newly allocated list of GtkRecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().
*/
public ListG getItems();
/**
* Gets the URI of the recently used resources.
* The return value of this function is affected by the "sort-type" and "limit"
* properties of chooser.
* Since the returned array is NULL terminated, length may be NULL.
* Since 2.10
* Returns: A newly allocated, NULL terminated array of strings. Use g_strfreev() to free it.
*/
public string[] getUris();
/**
* Adds filter to the list of GtkRecentFilter objects held by chooser.
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* Since 2.10
* Params:
* filter = a GtkRecentFilter
*/
public void addFilter(RecentFilter filter);
/**
* Removes filter from the list of GtkRecentFilter objects held by chooser.
* Since 2.10
* Params:
* filter = a GtkRecentFilter
*/
public void removeFilter(RecentFilter filter);
/**
* Gets the GtkRecentFilter objects held by chooser.
* Since 2.10
* Returns: A singly linked list of GtkRecentFilter objects. You should just free the returned list using g_slist_free().
*/
public ListSG listFilters();
/**
* Sets filter as the current GtkRecentFilter object used by chooser
* to affect the displayed recently used resources.
* Since 2.10
* Params:
* filter = a GtkRecentFilter
*/
public void setFilter(RecentFilter filter);
/**
* Gets the GtkRecentFilter object currently used by chooser to affect
* the display of the recently used resources.
* Since 2.10
* Returns: a GtkRecentFilter object.
*/
public RecentFilter getFilter();
}
|
D
|
/home/uzair/iot_folder/c8p1/target/rls/debug/deps/c8p1-5a6ff3cdbb669410.rmeta: src/main.rs
/home/uzair/iot_folder/c8p1/target/rls/debug/deps/c8p1-5a6ff3cdbb669410.d: src/main.rs
src/main.rs:
|
D
|
// @expect verified
import smack;
int cap(int x) {
int y = x;
if (10 < x) {
y = 10;
}
return y;
}
void main() {
__VERIFIER_assert(cap(2) == 2);
__VERIFIER_assert(cap(15) == 10);
int x = __VERIFIER_nondet_int();
__VERIFIER_assert(cap(x) <= 10);
}
|
D
|
/** Unit testing tools.
Authors: Lars Tandle Kyllingstad
Copyright: Copyright (c) 2009, Lars T. Kyllingstad. All rights reserved.
License: Boost License 1.0
*/
module scid.core.testing;
import std.algorithm: max;
import std.math: abs;
import std.stdio;
import std.string;
import scid.core.meta: Zero;
import scid.types;
/** This function is supposed to be a drop-in replacement for assert()
in unittests. Instead of halting the entire process when a test fails,
it prints an error message to STDERR with the file and line number of
the test that failed.
*/
void check
(string file=__FILE__, int line=__LINE__)
(bool test, lazy string msg = null)
{
if (test) { _checkReport.success++; return; }
_checkReport.fail++;
if (msg == null)
stderr.writefln("check() failed: %s(%s)", file, line);
else
stderr.writefln("check() failed: %s(%s): %s", file, line, msg);
}
/** Returns a report on the tests performed by check(). */
CheckReport checkReport() { return _checkReport; }
/** Data about the tests performed by check. */
struct CheckReport
{
/** The number of succeeding check() calls. */
int success = 0;
/** The number of failing check() calls. */
int fail = 0;
/** The total number of check() calls. */
@property int total() { return success + fail; }
}
// Global instance
private CheckReport _checkReport;
/** This function is used to check a computed value along with
its error estimate. It evaluates to the following:
---
abs(result-expected) <= absError
&& absError <= max(abs(result*relAccuracy), absAccuracy)
---
*/
bool isAccurate(T)(Result!T result, T expected, T relAccuracy,
T absAccuracy=Zero!T)
{
return isAccurate(result.value, result.error, expected, relAccuracy,
absAccuracy);
}
/// ditto
bool isAccurate(T)(T result, T absError, T expected, T relAccuracy,
T absAccuracy=Zero!T)
in
{
assert (absError >= 0.0);
assert (relAccuracy >= 0.0);
assert (absAccuracy >= 0.0);
}
body
{
return abs(result-expected) <= absError
&& absError <= max(abs(result*relAccuracy), absAccuracy);
}
unittest
{
check (isAccurate(2.0000001, 0.000001, 2.0, 0.000001));
}
/** Try to instantiate a template with a given set of parameters.
Compilation fails if one or more of the instantiation attempts
fail.
Based on
$(LINK2 http://www.digitalmars.com/d/archives/digitalmars/D/Unit_test_practices_in_Phobos_95274.html,an idea by Daniel Keep).
Examples:
---
template Foo(T) { T bar = T.nan; }
mixin TestInstantiate!(Foo, float, double, real); // OK
mixin TestInstantiate!(TestFoo, int, long); // FAILS!
---
*/
template TestInstantiate(alias Template, Parameters...)
{
static if (Parameters.length > 0)
{
alias Template!(Parameters[0]) test;
//pragma (msg, "Instantiated "~Template.stringof~" with "
// ~Parameters[0].stringof);
mixin TestInstantiate!(Template, Parameters[1 .. $]);
}
}
version (unittest) template TestFoo(T) { T foo = T.nan; }
unittest
{
mixin TestInstantiate!(TestFoo, float, double, real);
//mixin TestInstantiate!(TestFoo, int, long);
}
/** Checks whether a template is instantiable for a given
set of parameters. This only returns true or false, no
instantiation error is emitted during compilation.
Examples:
---
template Foo(T) { T bar = T.nan; }
static assert (isInstantiable!(Foo, float, double, real));
static assert (!isInstantiable!(Foo, int, long));
---
*/
template isInstantiable(alias Template, Parameters...)
{
static if (Parameters.length == 0)
{
// All instantiations succeeded.
enum bool isInstantiable = true;
}
else static if (is(typeof({ mixin Template!(Parameters[0]); })))
{
enum bool isInstantiable =
isInstantiable!(Template, Parameters[1 .. $]);
}
else enum bool isInstantiable = false;
}
unittest
{
// TestFoo is defined above TestInstantiate's unittest.
static assert (isInstantiable!(TestFoo, float, double, real));
static assert (!isInstantiable!(TestFoo, int, long));
}
|
D
|
module java.lang.interfaces;
import java.lang.String;
interface Cloneable{
}
interface Comparable {
int compareTo(Object o);
}
// is now in java.util.Comparator
//interface Comparator {
// int compare(Object o1, Object o2);
//}
interface CharSequence {
char charAt(int index);
int length();
CharSequence subSequence(int start, int end);
String toString();
}
|
D
|
int main() {
int a;
int b;
int i;
b = 0;
for(i = 1; true; i = i + 1) {
Print("Please enter the #", i, " number:");
a = ReadInteger();
if (a < 0)
break;
b = b + a;
}
Print("Sum of ", i, " items is: ", b);
}
|
D
|
module packets.items.use;
import packets.itemusage;
import packets.item : ItemPosition;
import entities.gameclient;
import data.item;
/**
* Handles the item usage packet.
* Sub-type: equip (use)
* Params:
* client = The game client.
* item = The packet.
*/
void handleUse(GameClient client, ItemUsagePacket item) {
uint uid = item.uid;
auto pos = cast(ItemPosition)item.dwParam1;
auto i = client.inventory.getItemByUID(uid);
if (i !is null) {
if (!i.isMisc()) {
if (client.equipments.equip(i, pos)) {
client.inventory.removeItemByUID(uid);
}
} else {
switch (i.id) {
case 1000000:
case 1000010:
case 1000020:
case 1000030:
case 1002010:
case 1002020:
case 1002050: {
import packets.items.handlers.hppotions;
useHpPotion(client, i);
break;
}
default: {
// can't use ...
break;
}
}
}
}
}
/**
* Handles the item usage packet.
* Sub-type: unequip
* Params:
* client = The game client.
* item = The packet.
*/
void handleUnequip(GameClient client, ItemUsagePacket item) {
auto pos = cast(ItemPosition)item.dwParam1;
client.equipments.unequip(pos);
}
|
D
|
the British cabinet minister responsible for finance
the person who is head of state (in several countries)
the honorary or titular head of a university
|
D
|
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM ROCKTYPE
326.205198 57.2096458 3.70000005 44.7999992 80 100 -36.4000015 149.899994 5723 3.80441035 15.8353042 sediments, redbeds
327.433531 48.5642606 1.89999998 642.900024 80 100 -33.5 151.5 1097 1.81820812 11.6379839 sediments, redbeds
-41.9634396 47.1283348 5 200 35 100 -30.5 139.300003 1165 4.43196392 29.1188412 sediments, redbeds
340 40 5 0 80 100 -33.7999992 150.699997 1768 10 10 intrusives
325 55 5 0 80 100 -33.9000015 151.300003 1766 10 10 intrusives, basalt
330.100006 45.9000015 3.9000001 600 80 100 -33.7999992 150.800003 83 7.5999999 7.5999999 intrusives, breccia
307.200012 48.0999985 3.4000001 228.600006 80 100 -33.7000008 150.800003 82 6.19999981 6.19999981 intrusives, basalts, breccias
342.100006 57.7000008 19.5 40.7999992 80 100 -33.7999992 151.100006 87 35.5999985 35.5999985 intrusives, breccia
322.399994 60.7000008 8.19999981 35.2999992 90 110 -33.7999992 150.899994 85 13.3999996 13.3999996 intrusives, dolerite
317 54 8 63 80 100 -34.5 150.300003 8442 12.3999996 12.8999996 intrusives, dolerite
338.200012 55.2000008 5.9000001 238.800003 80 100 -35.2999992 150.399994 240 10.6000004 10.6000004 intrusives, porphyry
319.399994 59.0999985 2.29999995 300.799988 80 100 -33.7000008 151.100006 238 4.19999981 4.19999981 extrusives
338 55.9000015 6.5 42 90 110 -35.2999992 150.5 766 11.6999998 12.3000002 intrusives, porphyry
335.600006 61 4 0 80 120 -31.1000004 152.5 7562 6.9000001 6.9000001 sediments, sandstones, siltstones
328.799988 50.7000008 8.19999981 0 80 120 -31.5 152.5 7560 15.3999996 15.3999996 extrusives, basalts
342.299988 68.5999985 5.9000001 131.600006 99 146 -30.9652004 142.628098 9341 8.19999981 9.89999962 sediments, sandstones
306.700012 57.4000015 7.69999981 76.0999985 80 100 -33.5999985 149 1106 12.8000002 14.1000004 sediments, extrusives
346 61 9 41.2000008 35 100 -31.3999996 138.600006 1170 13 15 sediments
333 45 9 16.5 35 100 -30.3999996 139.399994 1161 17 18 sediments, tillite
329 58 25 4.0999999 35 100 -30.2000008 139 1166 41.5999985 45.5999985 sediments, sandstone, tillite
223 26 13 14.8000002 35 100 -30.2999992 139.5 1157 26 26 extrusives
318 56 5 47 90 100 -36.2999992 150 1848 9 9 intrusives
269 40 0 0 50 300 -32.5999985 151.5 1868 0 0 extrusives, andesites
102 19.8999996 21.7000008 18.7999992 65 245 -32 116 1944 28.1000004 28.1000004 intrusives
341 49 6.4000001 142 90 105 -33.4000015 115.599998 1932 10 10 extrusives, basalts
324 51 3.29999995 960 65 100 -34 151 1591 6.0999999 6.4000001 intrusives
272 66 4.80000019 191 60 100 -33.7000008 151.100006 1592 5.80000019 7.4000001 intrusives
|
D
|
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.build/Exports.swift.o : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/FutureType.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Worker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Exports.swift /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/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.build/Exports~partial.swiftmodule : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/FutureType.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Worker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Exports.swift /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/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.build/Exports~partial.swiftdoc : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/FutureType.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Worker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/core/Sources/Async/Exports.swift /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/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
|
D
|
/**
* This module implements custom assertions via $(D shouldXXX) functions
* that throw exceptions containing information about why the assertion
* failed.
*/
module unit_threaded.assertions;
import unit_threaded.exception: fail, UnitTestException;
import std.traits; // too many to list
import std.range; // also
/**
* Verify that the condition is `true`.
* Throws: UnitTestException on failure.
*/
void shouldBeTrue(E)(lazy E condition, string file = __FILE__, size_t line = __LINE__)
{
shouldEqual(cast(bool)condition, true, file, line);
}
///
@safe pure unittest
{
shouldBeTrue(true);
}
/**
* Verify that the condition is `false`.
* Throws: UnitTestException on failure.
*/
void shouldBeFalse(E)(lazy E condition, string file = __FILE__, size_t line = __LINE__)
{
shouldEqual(cast(bool)condition, false, file, line);
}
///
@safe pure unittest
{
shouldBeFalse(false);
}
/**
* Verify that two values are the same.
* Throws: UnitTestException on failure
*/
void shouldEqual(V, E)(scope auto ref V value, scope auto ref E expected, string file = __FILE__, size_t line = __LINE__)
{
if (!isEqual(value, expected))
{
const msg = formatValueInItsOwnLine("Expected: ", expected) ~
formatValueInItsOwnLine(" Got: ", value);
throw new UnitTestException(msg, file, line);
}
}
///
@safe pure unittest {
shouldEqual(true, true);
shouldEqual(false, false);
shouldEqual(1, 1) ;
shouldEqual("foo", "foo") ;
shouldEqual([2, 3], [2, 3]) ;
shouldEqual(iota(3), [0, 1, 2]);
shouldEqual([[0, 1], [0, 1, 2]], [[0, 1], [0, 1, 2]]);
shouldEqual([[0, 1], [0, 1, 2]], [iota(2), iota(3)]);
shouldEqual([iota(2), iota(3)], [[0, 1], [0, 1, 2]]);
}
/**
* Verify that two values are not the same.
* Throws: UnitTestException on failure
*/
void shouldNotEqual(V, E)
(scope auto ref V value,
scope auto ref E expected,
string file = __FILE__,
size_t line = __LINE__)
{
if (isEqual(value, expected))
{
const msg = ["Value:",
formatValueInItsOwnLine("", value).join(""),
"is not expected to be equal to:",
formatValueInItsOwnLine("", expected).join("")
];
throw new UnitTestException(msg, file, line);
}
}
///
@safe pure unittest
{
shouldNotEqual(true, false);
shouldNotEqual(1, 2);
shouldNotEqual("f", "b");
shouldNotEqual([2, 3], [2, 3, 4]);
}
///
@safe unittest {
shouldNotEqual(1.0, 2.0);
}
/**
* Verify that the value is null.
* Throws: UnitTestException on failure
*/
void shouldBeNull(T)(const scope auto ref T value, string file = __FILE__, size_t line = __LINE__)
{
if (value !is null)
fail("Value is not null", file, line);
}
///
@safe pure unittest
{
shouldBeNull(null);
}
/**
* Verify that the value is not null.
* Throws: UnitTestException on failure
*/
void shouldNotBeNull(T)(const scope auto ref T value, string file = __FILE__, size_t line = __LINE__)
{
if (value is null)
fail("Value is null", file, line);
}
///
@safe pure unittest
{
class Foo
{
this(int i) { this.i = i; }
override string toString() const
{
import std.conv: to;
return i.to!string;
}
int i;
}
shouldNotBeNull(new Foo(4));
}
enum isLikeAssociativeArray(T, K) = is(typeof({
if(K.init in T) { }
if(K.init !in T) { }
}));
static assert(isLikeAssociativeArray!(string[string], string));
static assert(!isLikeAssociativeArray!(string[string], int));
/**
* Verify that the value is in the container.
* Throws: UnitTestException on failure
*/
void shouldBeIn(T, U)(const scope auto ref T value, const scope auto ref U container, string file = __FILE__, size_t line = __LINE__)
if (isLikeAssociativeArray!(U, T))
{
import std.conv: to;
if (value !in container)
{
fail(formatValueInItsOwnLine("Value ", value) ~ formatValueInItsOwnLine("not in ", container),
file, line);
}
}
///
@safe pure unittest {
5.shouldBeIn([5: "foo"]);
struct AA {
int onlyKey;
bool opBinaryRight(string op)(in int key) const {
return key == onlyKey;
}
}
5.shouldBeIn(AA(5));
}
/**
* Verify that the value is in the container.
* Throws: UnitTestException on failure
*/
void shouldBeIn(T, U)(const scope auto ref T value, U container, string file = __FILE__, size_t line = __LINE__)
if (!isLikeAssociativeArray!(U, T) && isInputRange!U)
{
import std.algorithm: find;
import std.conv: to;
if (find(container, value).empty)
{
fail(formatValueInItsOwnLine("Value ", value) ~ formatValueInItsOwnLine("not in ", container),
file, line);
}
}
///
@safe pure unittest
{
shouldBeIn(4, [1, 2, 4]);
shouldBeIn("foo", ["foo" : 1]);
}
/**
* Verify that the value is not in the container.
* Throws: UnitTestException on failure
*/
void shouldNotBeIn(T, U)(const scope auto ref T value, const scope auto ref U container,
string file = __FILE__, size_t line = __LINE__)
if (isLikeAssociativeArray!(U, T))
{
import std.conv: to;
if (value in container)
{
fail(formatValueInItsOwnLine("Value ", value) ~ formatValueInItsOwnLine("is in ", container),
file, line);
}
}
///
@safe pure unittest {
5.shouldNotBeIn([4: "foo"]);
struct AA {
int onlyKey;
bool opBinaryRight(string op)(in int key) const {
return key == onlyKey;
}
}
5.shouldNotBeIn(AA(4));
}
/**
* Verify that the value is not in the container.
* Throws: UnitTestException on failure
*/
void shouldNotBeIn(T, U)(const scope auto ref T value, U container,
string file = __FILE__, size_t line = __LINE__)
if (!isLikeAssociativeArray!(U, T) && isInputRange!U)
{
import std.algorithm: find;
import std.conv: to;
if (!find(container, value).empty)
{
fail(formatValueInItsOwnLine("Value ", value) ~ formatValueInItsOwnLine("is in ", container),
file, line);
}
}
///
@safe unittest
{
auto arrayRangeWithoutLength(T)(T[] array)
{
struct ArrayRangeWithoutLength(T)
{
private:
T[] array;
public:
T front() const @property
{
return array[0];
}
void popFront()
{
array = array[1 .. $];
}
bool empty() const @property
{
return array.empty;
}
}
return ArrayRangeWithoutLength!T(array);
}
shouldNotBeIn(3.5, [1.1, 2.2, 4.4]);
shouldNotBeIn(1.0, [2.0 : 1, 3.0 : 2]);
shouldNotBeIn(1, arrayRangeWithoutLength([2, 3, 4]));
}
private struct ThrownInfo
{
TypeInfo typeInfo;
string msg;
}
/**
* Verify that expr throws the templated Exception class.
* This succeeds if the expression throws a child class of
* the template parameter.
* Returns: A `ThrownInfo` containing info about the throwable
* Throws: UnitTestException on failure (when expr does not
* throw the expected exception)
*/
auto shouldThrow(T : Throwable = Exception, E)
(lazy E expr, string file = __FILE__, size_t line = __LINE__)
{
import std.conv: text;
// separate in order to not be inside the @trusted
auto callThrew() { return threw!T(expr); }
void wrongThrowableType(scope Throwable t) {
fail(text("Expression threw ", typeid(t), " instead of the expected ", T.stringof, ":\n", t.msg), file, line);
}
void didntThrow() { fail("Expression did not throw", file, line); }
// insert dummy call outside @trusted to correctly infer the attributes of shouldThrow
if (false) {
callThrew();
wrongThrowableType(null);
didntThrow();
}
return () @trusted { // @trusted because of catching Throwable
try {
const result = callThrew();
if (result.threw)
return result.info;
}
catch(Throwable t)
wrongThrowableType(t);
didntThrow();
assert(0);
}();
}
///
@safe pure unittest {
void funcThrows(string msg) { throw new Exception(msg); }
try {
auto exceptionInfo = funcThrows("foo bar").shouldThrow;
assert(exceptionInfo.msg == "foo bar");
} catch(Exception e) {
assert(false, "should not have thrown anything and threw: " ~ e.msg);
}
}
///
@safe pure unittest {
void func() {}
try {
func.shouldThrow;
assert(false, "Should never get here");
} catch(Exception e)
assert(e.msg == "Expression did not throw");
}
///
@safe pure unittest {
void funcAsserts() { assert(false, "Oh noes"); }
try {
funcAsserts.shouldThrow;
assert(false, "Should never get here");
} catch(Exception e)
assert(e.msg ==
"Expression threw core.exception.AssertError instead of the expected Exception:\nOh noes");
}
/**
* Verify that expr throws the templated Exception class.
* This only succeeds if the expression throws an exception of
* the exact type of the template parameter.
* Returns: A `ThrownInfo` containing info about the throwable
* Throws: UnitTestException on failure (when expr does not
* throw the expected exception)
*/
auto shouldThrowExactly(T : Throwable = Exception, E)(lazy E expr,
string file = __FILE__, size_t line = __LINE__)
{
import std.conv: text;
const threw = threw!T(expr);
if (!threw.threw)
fail("Expression did not throw", file, line);
//Object.opEquals is @system and impure
const sameType = () @trusted { return threw.info.typeInfo == typeid(T); }();
if (!sameType)
fail(text("Expression threw wrong type ", threw.info.typeInfo,
"instead of expected type ", typeid(T)), file, line);
return threw.info;
}
/**
* Verify that expr does not throw the templated Exception class.
* Throws: UnitTestException on failure
*/
void shouldNotThrow(T: Throwable = Exception, E)(lazy E expr,
string file = __FILE__, size_t line = __LINE__)
{
if (threw!T(expr).threw)
fail("Expression threw", file, line);
}
/**
* Verify that an exception is thrown with the right message
*/
void shouldThrowWithMessage(T : Throwable = Exception, E)(lazy E expr,
string msg,
string file = __FILE__,
size_t line = __LINE__) {
auto threw = threw!T(expr);
if (!threw.threw)
fail("Expression did not throw", file, line);
threw.info.msg.shouldEqual(msg, file, line);
}
///
@safe pure unittest {
void funcThrows(string msg) { throw new Exception(msg); }
funcThrows("foo bar").shouldThrowWithMessage!Exception("foo bar");
funcThrows("foo bar").shouldThrowWithMessage("foo bar");
}
private auto threw(T : Throwable, E)(lazy E expr)
{
import std.typecons : tuple;
import std.array: array;
import std.conv: text;
import std.traits: isSafe, isUnsafe;
auto ret = tuple!("threw", "info")(false, ThrownInfo.init);
// separate in order to not be inside the @trusted
auto makeRet(scope T e) {
// the message might have to be copied because of lifetime issues
// .msg is sometimes a range, so .array
// but .array sometimes returns dchar[] (autodecoding), so .text
return tuple!("threw", "info")(true, ThrownInfo(typeid(e), e.msg.array.dup.text));
}
static if(isUnsafe!expr)
void callExpr() @system { expr(); }
else
void callExpr() @safe { expr(); }
auto impl() {
try {
callExpr;
return tuple!("threw", "info")(false, ThrownInfo.init);
}
catch(T t) {
return makeRet(t);
}
}
static if(isSafe!callExpr && isSafe!makeRet)
return () @trusted { return impl; }();
else
return impl;
}
// Formats output in different lines
private string[] formatValueInItsOwnLine(T)(in string prefix, scope auto ref T value) {
import std.conv: to;
import std.traits: isSomeString;
import std.range.primitives: isInputRange;
static if(isSomeString!T) {
// isSomeString is true for wstring and dstring,
// so call .to!string anyway
return [ prefix ~ `"` ~ value.to!string ~ `"`];
} else static if(isInputRange!T) {
return formatRange(prefix, value);
} else {
return [prefix ~ convertToString(value)];
}
}
// helper function for non-copyable types
string convertToString(T)(scope auto ref T value) { // std.conv.to sometimes is @system
import std.conv: text, to;
import std.traits: isFloatingPoint, isAssociativeArray;
import std.format: format;
static string text_(scope ref const(T) value) {
static if(isAssociativeArray!T)
return (scope ref const(T) value) @trusted { return value.text; }(value);
else static if(__traits(compiles, value.text))
return text(value);
else static if(__traits(compiles, value.to!string))
return value.to!string;
}
static if(isFloatingPoint!T)
return format!"%.6f"(value);
else static if(__traits(compiles, text_(value)))
return text_(value);
else static if(__traits(compiles, value.toString))
return value.toString;
else
return T.stringof ~ "<cannot print>";
}
private string[] formatRange(T)(in string prefix, scope auto ref T value) {
import std.conv: text;
import std.range: ElementType;
import std.algorithm: map, reduce, max;
//some versions of `text` are @system
auto defaultLines = () @trusted { return [prefix ~ value.text]; }();
static if (!isInputRange!(ElementType!T))
return defaultLines;
else
{
import std.array: array;
const maxElementSize = value.empty ? 0 : value.map!(a => a.array.length).reduce!max;
const tooBigForOneLine = (value.array.length > 5 && maxElementSize > 5) || maxElementSize > 10;
if (!tooBigForOneLine)
return defaultLines;
return [prefix ~ "["] ~
value.map!(a => formatValueInItsOwnLine(" ", a).join("") ~ ",").array ~
" ]";
}
}
private enum isObject(T) = is(T == class) || is(T == interface);
bool isEqual(V, E)(auto ref V value, auto ref E expected)
if (!isObject!V && !isInputRange!V &&
is(typeof(value == expected) == bool))
{
return value == expected;
}
// The reason this overload exists is because for some reason we can't
// compare a mutable AA with a const one so we force both of them to
// be const here, while not forcing users to have a const opEquals
// in their own types
bool isEqual(V, E)(in V value, in E expected)
if (isAssociativeArray!V && isAssociativeArray!E)
{
return value == expected;
}
/**
* Verify that two floating point values are approximately equal
* Params:
* value = the value to check.
* expected = the expected value
* maxRelDiff = the maximum relative difference
* maxAbsDiff = the maximum absolute difference
* Throws: UnitTestException on failure
*/
void shouldApproxEqual(V, E)
(in V value,
in E expected,
double maxRelDiff = 1e-2,
double maxAbsDiff = 1e-5,
string file = __FILE__,
size_t line = __LINE__)
if ((isFloatingPoint!V || isFloatingPoint!E) && is(typeof(value == expected) == bool))
{
static if (__VERSION__ >= 2096)
import std.math: close = isClose;
else
import std.math: close = approxEqual;
if (!close(value, expected, maxRelDiff, maxAbsDiff))
{
const msg =
formatValueInItsOwnLine("Expected approx: ", expected) ~
formatValueInItsOwnLine(" Got : ", value);
throw new UnitTestException(msg, file, line);
}
}
///
@safe unittest {
1.0.shouldApproxEqual(1.0001);
}
bool isEqual(V, E)(scope V value, scope E expected)
if(isInputRange!V && isStaticArray!E)
{
return isEqual(value, expected[]);
}
bool isEqual(V, E)(scope V value, scope E expected)
if (isInputRange!V && isInputRange!E && !isSomeString!V &&
is(typeof(isEqual(value.front, expected.front))))
{
while (!value.empty && !expected.empty) {
if(!isEqual(value.front, expected.front)) return false;
value.popFront;
expected.popFront;
}
return value.empty && expected.empty;
}
bool isEqual(V, E)(scope V value, scope E expected)
if (isSomeString!V && isSomeString!E &&
is(typeof(isEqual(value.front, expected.front))))
{
if(value.length != expected.length) return false;
// prevent auto-decoding
foreach(i; 0 .. value.length)
if(value[i] != expected[i]) return false;
return true;
}
template IsField(A...) if(A.length == 1) {
enum IsField = __traits(compiles, A[0].init);
}
bool isEqual(V, E)(scope V value, scope E expected)
if (isObject!V && isObject!E)
{
import std.meta: staticMap, Filter, staticIndexOf;
static assert(is(typeof(() { string s1 = value.toString; string s2 = expected.toString;})),
"Cannot compare instances of " ~ V.stringof ~
" or " ~ E.stringof ~ " unless toString is overridden for both");
if(value is null && expected !is null) return false;
if(value !is null && expected is null) return false;
if(value is null && expected is null) return true;
// If it has opEquals, use it
static if(staticIndexOf!("opEquals", __traits(derivedMembers, V)) != -1) {
return value.opEquals(expected);
} else {
template IsFieldOf(T, string s) {
static if(__traits(compiles, IsField!(typeof(__traits(getMember, T.init, s)))))
enum IsFieldOf = IsField!(typeof(__traits(getMember, T.init, s)));
else
enum IsFieldOf = false;
}
auto members(T)(T obj) {
import std.typecons: Tuple;
import std.meta: staticMap;
import std.traits: Unqual;
alias Member(string name) = typeof(__traits(getMember, T, name));
alias IsFieldOfT(string s) = IsFieldOf!(T, s);
alias FieldNames = Filter!(IsFieldOfT, __traits(allMembers, T));
alias FieldTypes = staticMap!(Member, FieldNames);
Tuple!(staticMap!(Unqual, FieldTypes)) ret;
foreach(i, name; FieldNames)
ret[i] = __traits(getMember, obj, name);
return ret;
}
static if(is(V == interface))
return false;
else
return members(value) == members(expected);
}
}
/**
* Verify that rng is empty.
* Throws: UnitTestException on failure.
*/
void shouldBeEmpty(R)(const scope auto ref R rng, string file = __FILE__, size_t line = __LINE__)
if (isInputRange!R)
{
import std.conv: text;
if (!rng.empty)
fail(text("Range not empty: ", rng), file, line);
}
/**
* Verify that rng is empty.
* Throws: UnitTestException on failure.
*/
void shouldBeEmpty(R)(auto ref shared(R) rng, string file = __FILE__, size_t line = __LINE__)
if (isInputRange!R)
{
import std.conv: text;
if (!rng.empty)
fail(text("Range not empty: ", rng), file, line);
}
/**
* Verify that aa is empty.
* Throws: UnitTestException on failure.
*/
void shouldBeEmpty(T)(auto ref T aa, string file = __FILE__, size_t line = __LINE__)
if (isAssociativeArray!T)
{
//keys is @system
() @trusted{ if (!aa.keys.empty) fail("AA not empty", file, line); }();
}
///
@safe pure unittest
{
int[] ints;
string[] strings;
string[string] aa;
shouldBeEmpty(ints);
shouldBeEmpty(strings);
shouldBeEmpty(aa);
ints ~= 1;
strings ~= "foo";
aa["foo"] = "bar";
}
/**
* Verify that rng is not empty.
* Throws: UnitTestException on failure.
*/
void shouldNotBeEmpty(R)(R rng, string file = __FILE__, size_t line = __LINE__)
if (isInputRange!R)
{
if (rng.empty)
fail("Range empty", file, line);
}
/**
* Verify that aa is not empty.
* Throws: UnitTestException on failure.
*/
void shouldNotBeEmpty(T)(const scope auto ref T aa, string file = __FILE__, size_t line = __LINE__)
if (isAssociativeArray!T)
{
//keys is @system
() @trusted{ if (aa.keys.empty)
fail("AA empty", file, line); }();
}
///
@safe pure unittest
{
int[] ints;
string[] strings;
string[string] aa;
ints ~= 1;
strings ~= "foo";
aa["foo"] = "bar";
shouldNotBeEmpty(ints);
shouldNotBeEmpty(strings);
shouldNotBeEmpty(aa);
}
/**
* Verify that t is greater than u.
* Throws: UnitTestException on failure.
*/
void shouldBeGreaterThan(T, U)(const scope auto ref T t, const scope auto ref U u,
string file = __FILE__, size_t line = __LINE__)
{
import std.conv: text;
if (t <= u)
fail(text(t, " is not > ", u), file, line);
}
///
@safe pure unittest
{
shouldBeGreaterThan(7, 5);
}
/**
* Verify that t is smaller than u.
* Throws: UnitTestException on failure.
*/
void shouldBeSmallerThan(T, U)(const scope auto ref T t, const scope auto ref U u,
string file = __FILE__, size_t line = __LINE__)
{
import std.conv: text;
if (t >= u)
fail(text(t, " is not < ", u), file, line);
}
///
@safe pure unittest
{
shouldBeSmallerThan(5, 7);
}
/**
* Verify that t and u represent the same set (ordering is not important).
* Throws: UnitTestException on failure.
*/
void shouldBeSameSetAs(V, E)(auto ref V value, auto ref E expected, string file = __FILE__, size_t line = __LINE__)
if (isInputRange!V && isInputRange!E && is(typeof(value.front != expected.front) == bool))
{
import std.algorithm: sort;
import std.array: array;
if (!isSameSet(value, expected))
{
static if(__traits(compiles, sort(expected.array)))
const expPrintRange = sort(expected.array).array;
else
alias expPrintRange = expected;
static if(__traits(compiles, sort(value.array)))
const actPrintRange = sort(value.array).array;
else
alias actPrintRange = value;
const msg = formatValueInItsOwnLine("Expected: ", expPrintRange) ~
formatValueInItsOwnLine(" Got: ", actPrintRange);
throw new UnitTestException(msg, file, line);
}
}
///
@safe pure unittest
{
import std.range: iota;
auto inOrder = iota(4);
auto noOrder = [2, 3, 0, 1];
auto oops = [2, 3, 4, 5];
inOrder.shouldBeSameSetAs(noOrder);
inOrder.shouldBeSameSetAs(oops).shouldThrow!UnitTestException;
struct Struct
{
int i;
}
[Struct(1), Struct(4)].shouldBeSameSetAs([Struct(4), Struct(1)]);
}
private bool isSameSet(T, U)(auto ref T t, auto ref U u) {
import std.algorithm: canFind;
//sort makes the element types have to implement opCmp
//instead, try one by one
auto ta = t.array;
auto ua = u.array;
if (ta.length != ua.length) return false;
foreach(element; ta)
{
if (!ua.canFind(element)) return false;
}
return true;
}
/**
* Verify that value and expected do not represent the same set (ordering is not important).
* Throws: UnitTestException on failure.
*/
void shouldNotBeSameSetAs(V, E)(auto ref V value, auto ref E expected, string file = __FILE__, size_t line = __LINE__)
if (isInputRange!V && isInputRange!E && is(typeof(value.front != expected.front) == bool))
{
if (isSameSet(value, expected))
{
const msg = ["Value:",
formatValueInItsOwnLine("", value).join(""),
"is not expected to be equal to:",
formatValueInItsOwnLine("", expected).join("")
];
throw new UnitTestException(msg, file, line);
}
}
///
@safe pure unittest
{
auto inOrder = iota(4);
auto noOrder = [2, 3, 0, 1];
auto oops = [2, 3, 4, 5];
inOrder.shouldNotBeSameSetAs(oops);
inOrder.shouldNotBeSameSetAs(noOrder).shouldThrow!UnitTestException;
}
/**
If two strings represent the same JSON regardless of formatting
*/
void shouldBeSameJsonAs(in string actual,
in string expected,
string file = __FILE__,
size_t line = __LINE__)
@trusted // not @safe pure due to parseJSON
{
import std.json: parseJSON, JSONException;
auto parse(in string str) {
try
return str.parseJSON;
catch(JSONException ex)
throw new UnitTestException("Error parsing JSON: " ~ ex.msg, file, line);
}
parse(actual).toPrettyString.shouldEqual(parse(expected).toPrettyString, file, line);
}
///
@safe unittest { // not pure because parseJSON isn't pure
`{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo": "bar"}`);
`{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo":"bar"}`);
`{"foo":"bar"}`.shouldBeSameJsonAs(`{"foo": "baz"}`).shouldThrow!UnitTestException;
try
`oops`.shouldBeSameJsonAs(`oops`);
catch(Exception e)
assert(e.msg == "Error parsing JSON: Unexpected character 'o'. (Line 1:1)");
}
auto should(V)(scope auto ref V value){
import std.functional: forward;
struct ShouldNot {
bool opEquals(U)(auto ref U other,
string file = __FILE__,
size_t line = __LINE__)
{
shouldNotEqual(forward!value, other, file, line);
return true;
}
void opBinary(string op, R)(R range,
string file = __FILE__,
size_t line = __LINE__) const if(op == "in") {
shouldNotBeIn(forward!value, range, file, line);
}
void opBinary(string op, R)(R expected,
string file = __FILE__,
size_t line = __LINE__) const
if(op == "~" && isInputRange!R)
{
import std.conv: text;
bool failed;
try
shouldBeSameSetAs(forward!value, expected);
catch(UnitTestException)
failed = true;
if(!failed)
fail(text(value, " should not be the same set as ", expected),
file, line);
}
void opBinary(string op, E)
(in E expected, string file = __FILE__, size_t line = __LINE__)
if (isFloatingPoint!E)
{
import std.conv: text;
bool failed;
try
shouldApproxEqual(forward!value, expected);
catch(UnitTestException)
failed = true;
if(!failed)
fail(text(value, " should not be approximately equal to ", expected),
file, line);
}
}
struct Should {
bool opEquals(U)(auto ref U other,
string file = __FILE__,
size_t line = __LINE__)
{
shouldEqual(forward!value, other, file, line);
return true;
}
void opBinary(string op, R)(R range,
string file = __FILE__,
size_t line = __LINE__) const
if(op == "in")
{
shouldBeIn(forward!value, range, file, line);
}
void opBinary(string op, R)(R range,
string file = __FILE__,
size_t line = __LINE__) const
if(op == "~" && isInputRange!R)
{
shouldBeSameSetAs(forward!value, range, file, line);
}
void opBinary(string op, E)
(in E expected, string file = __FILE__, size_t line = __LINE__)
if (isFloatingPoint!E)
{
shouldApproxEqual(forward!value, expected, 1e-2, 1e-5, file, line);
}
auto not() {
return ShouldNot();
}
}
return Should();
}
T be(T)(T sh) {
return sh;
}
///
@safe pure unittest {
1.should.be == 1;
1.should.not.be == 2;
1.should.be in [1, 2, 3];
4.should.not.be in [1, 2, 3];
}
/**
Asserts that `lowerBound` <= `actual` < `upperBound`
*/
void shouldBeBetween(A, L, U)
(auto ref A actual,
auto ref L lowerBound,
auto ref U upperBound,
string file = __FILE__,
size_t line = __LINE__)
{
import std.conv: text;
if(actual < lowerBound || actual >= upperBound)
fail(text(actual, " is not between ", lowerBound, " and ", upperBound), file, line);
}
|
D
|
#source: load5.s
#as: --32
#ld: -melf_i386
#objdump: -dw
.*: +file format .*
Disassembly of section .text:
#...
[ ]*[a-f0-9]+: c7 c0 ([0-9a-f]{2} ){4} * mov \$0x[a-f0-9]+,%eax
#pass
|
D
|
/mnt/c/Users/zeliwang/hello_world/digital_signature/target/release/build/rand_pcg-cb862b3820a11bde/build_script_build-cb862b3820a11bde: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/rand_pcg-0.1.2/build.rs
/mnt/c/Users/zeliwang/hello_world/digital_signature/target/release/build/rand_pcg-cb862b3820a11bde/build_script_build-cb862b3820a11bde.d: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/rand_pcg-0.1.2/build.rs
/home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/rand_pcg-0.1.2/build.rs:
|
D
|
/*
* objd.d
* Objective-D compiler
*
* Copyright (c) 2010 Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
module parser.objd;
import exceptions;
import hash;
import parser.declarations;
import parser.expressions;
import parser.lexemes;
import parser.statements;
import std.contracts;
import std.conv;
import std.string;
import std.utf;
enum dstring OBJD_METHOD_PREFIX = "msg_";
private dstring[hash_value] knownSelectors;
pure auto selectorToIdentifier (dstring selector, dstring prefix = "_objd_sel_") {
auto ret = new dchar[selector.length];
foreach (i, ch; selector) {
if (ch == ':')
ret[i] = '_';
else
ret[i] = ch;
}
return prefix ~ assumeUnique(ret);
}
pure auto metaClassName (dstring name) {
return "_Meta" ~ name;
}
pure auto classInstanceName (dstring name) {
return "_" ~ name ~ "Inst";
}
pure auto protocolInstanceName (dstring name) {
return "_Protocol" ~ name;
}
immutable(Lexeme) registerSelector (dstring selector) {
auto conv = toUTF8(selector);
hash_value hash = murmur_hash(conv);
for (;;) {
// selector 0 is reserved
if (hash == 0)
hash = 1;
auto entry = hash in knownSelectors;
if (entry is null) {
knownSelectors[hash] = selector;
break;
} else if (*entry == selector)
break;
hash = murmur_hash(conv, hash);
}
return new Lexeme(Token.Number, to!(dstring)(hash) ~ "U"d, null, 0);
}
immutable(Lexeme[]) objdNamespace (dstring moduleName = "runtime") {
return [
newIdentifier("objd"),
newToken("."),
newIdentifier(moduleName),
newToken(".")
];
}
immutable(Lexeme[]) objdCaches () {
immutable(Lexeme)[] output;
if (knownSelectors.length > 0) {
// static this () {
output ~= newIdentifier("static");
output ~= newIdentifier("this");
output ~= newToken("(");
output ~= newToken(")");
output ~= newToken("{");
// enum string[SEL] mapping = [
output ~= newIdentifier("enum");
output ~= newIdentifier("string");
output ~= newToken("[");
output ~= objdNamespace("types");
output ~= newIdentifier("SEL");
output ~= newToken("]");
output ~= newIdentifier("mapping");
output ~= newToken("=");
output ~= newToken("[");
bool first = true;
foreach (sel, name; knownSelectors) {
if (!first)
output ~= newToken(",");
else
first = false;
output ~= new Lexeme(Token.Number, to!(dstring)(sel) ~ "U"d, null, 0);
output ~= newToken(":");
output ~= newString(name);
}
// ];
output ~= newToken("]");
output ~= newToken(";");
// sel_preloadMapping(mapping);
output ~= objdNamespace();
output ~= newIdentifier("sel_preloadMapping");
output ~= newToken("(");
output ~= newIdentifier("mapping");
output ~= newToken(")");
output ~= newToken(";");
// } /* static this */
output ~= newToken("}");
}
return output;
}
immutable(Lexeme[]) parseObjDType (ref immutable(Lexeme)[] lexemes) {
if (lexemes[0].token != Token.LParen)
errorOut(lexemes[0], "expected (");
lexemes = lexemes[1 .. $];
auto type = parseDType(lexemes);
if (lexemes[0].token != Token.RParen)
errorOut(lexemes[0], "expected )");
lexemes = lexemes[1 .. $];
return type;
}
immutable(Parameter) parseParameter (ref immutable(Lexeme)[] lexemes) {
auto type = parseObjDType(lexemes);
auto identifier = lexemes[0];
if (identifier.token != Token.Identifier)
errorOut(identifier, "expected argument name");
lexemes = lexemes[1 .. $];
return Parameter(assumeUnique(type), identifier.content);
}
immutable(Lexeme[]) parseCategory (ref immutable(Lexeme)[] lexemes) {
immutable(Lexeme)[] output;
auto classNameL = lexemes[0];
lexemes = lexemes[1 .. $];
if (classNameL.token != Token.Identifier)
errorOut(classNameL, "expected class name");
dstring categoryName = null;
if (lexemes[0].token == Token.LParen) {
if (lexemes[1].token != Token.Identifier)
errorOut(lexemes[1], "expected category name");
if (lexemes[2].token != Token.RParen)
errorOut(lexemes[2], "expected )");
categoryName = lexemes[1].content;
lexemes = lexemes[3 .. $];
}
auto className = classNameL.content;
auto metaClass = newIdentifier(metaClassName(className));
auto classInstance = newIdentifier(classInstanceName(className));
// includes @end
auto methods = parseMethodDefinitions(lexemes);
// static this () {
output ~= newIdentifier("static");
output ~= newIdentifier("this");
output ~= newToken("(");
output ~= newToken(")");
output ~= newToken("{");
foreach (method; methods) {
// this is inside a module constructor, so we can add methods
// ClassName.
output ~= classNameL;
output ~= newToken(".");
if (method.classMethod) {
// isa.
output ~= newIdentifier("isa");
output ~= newToken(".");
}
// replaceMethod(
output ~= newIdentifier("replaceMethod");
output ~= newToken("(");
// sel_registerName("name")
output ~= registerSelector(method.selector);
// , function return_type (
output ~= newToken(",");
output ~= newIdentifier("function");
output ~= method.returnType;
output ~= newToken("(");
if (method.classMethod)
// MetaClassName
output ~= metaClass;
else
// ClassNameInst
output ~= classInstance;
// self, SEL cmd
output ~= newIdentifier("self");
output ~= newToken(",");
output ~= newIdentifier("SEL");
output ~= newIdentifier("cmd");
foreach (ref param; method.parameters) {
// , parameter_type parameter_name
output ~= newToken(",");
output ~= param.type;
output ~= newIdentifier(param.name);
}
// ) /* function */
output ~= newToken(")");
output ~= method.implementationBody;
// ) /* addMethod */ ;
output ~= newToken(")");
output ~= newToken(";");
}
// } /* static this () */
output ~= newToken("}");
foreach (method; methods) {
// mixin _objDAliasTypeToSelectorReturnType!(method_return_type, "selector:name:", "_objd_sel_methodNameWith__rettype");
output ~= newIdentifier("mixin");
output ~= newIdentifier("_objDAliasTypeToSelectorReturnType");
output ~= newToken("!");
output ~= newToken("(");
output ~= method.returnType;
output ~= newToken(",");
output ~= newString(method.selector);
output ~= newToken(",");
output ~= newString(selectorToIdentifier(method.selector) ~ "_rettype");
output ~= newToken(")");
output ~= newToken(";");
}
return assumeUnique(output);
}
immutable(Lexeme[]) parseProtocol (ref immutable(Lexeme)[] lexemes) {
immutable(Lexeme)[] output;
assert(0);
/+
auto protocolNameL = lexemes[0];
lexemes = lexemes[1 .. $];
if (protocolNameL.token != Token.Identifier)
errorOut(protocolNameL, "expected protocol name");
if (lexemes[0].token == Token.Less) {
// TODO: parse protocol list
}
auto protocolName = protocolNameL.content;
auto protocolInstance = newIdentifier(protocolInstanceName(protocolName));
// includes @end
auto methods = parseMethodDefinitions(lexemes);
// static this () {
output ~= newIdentifier("static");
output ~= newIdentifier("this");
output ~= newToken("(");
output ~= newToken(")");
output ~= newToken("{");
foreach (method; methods) {
// this is inside a module constructor, so we can add methods
// ClassName.
output ~= classNameL;
output ~= newToken(".");
if (method.classMethod) {
// isa.
output ~= newIdentifier("isa");
output ~= newToken(".");
}
// replaceMethod(
output ~= newIdentifier("replaceMethod");
output ~= newToken("(");
// sel_registerName("name")
output ~= registerSelector(method.selector);
// , function return_type (
output ~= newToken(",");
output ~= newIdentifier("function");
output ~= method.returnType;
output ~= newToken("(");
if (method.classMethod)
// MetaClassName
output ~= metaClass;
else
// ClassNameInst
output ~= classInstance;
// self, SEL cmd
output ~= newIdentifier("self");
output ~= newToken(",");
output ~= newIdentifier("SEL");
output ~= newIdentifier("cmd");
foreach (ref param; method.parameters) {
// , parameter_type parameter_name
output ~= newToken(",");
output ~= param.type;
output ~= newIdentifier(param.name);
}
// ) /* function */
output ~= newToken(")");
output ~= method.implementationBody;
// ) /* addMethod */ ;
output ~= newToken(")");
output ~= newToken(";");
}
// } /* static this () */
output ~= newToken("}");
foreach (method; methods) {
// mixin _objDAliasTypeToSelectorReturnType!(method_return_type, "selector:name:", "_objd_sel_methodNameWith__rettype");
output ~= newIdentifier("mixin");
output ~= newIdentifier("_objDAliasTypeToSelectorReturnType");
output ~= newToken("!");
output ~= newToken("(");
output ~= method.returnType;
output ~= newToken(",");
output ~= newString(method.selector);
output ~= newToken(",");
output ~= newString(selectorToIdentifier(method.selector) ~ "_rettype");
output ~= newToken(")");
output ~= newToken(";");
}
return assumeUnique(output);
+/
}
immutable(Lexeme[]) parseClass (ref immutable(Lexeme)[] lexemes) {
immutable(Lexeme)[] output;
auto classNameL = lexemes[0];
lexemes = lexemes[1 .. $];
if (classNameL.token != Token.Identifier)
errorOut(classNameL, "expected class name");
auto className = classNameL.content;
auto metaClass = newIdentifier(metaClassName(className));
auto classInstance = newIdentifier(classInstanceName(className));
// __gshared MetaClassName ClassName;
output ~= newIdentifier("__gshared");
output ~= metaClass;
output ~= classNameL;
output ~= newToken(";");
// class MetaClassName : objd.runtime.Class {
output ~= newIdentifier("class");
output ~= metaClass;
output ~= newToken(":");
output ~= objdNamespace();
output ~= newIdentifier("Class");
output ~= newToken("{");
// this () {
output ~= newIdentifier("this");
output ~= newToken("(");
output ~= newToken(")");
output ~= newToken("{");
auto next = lexemes[0];
immutable(Lexeme)[] inheritsL;
if (next.token == Token.Colon) {
// class inherits from a superclass
lexemes = lexemes[1 .. $];
inheritsL = parsePrimaryExpression(lexemes);
// super("ClassName", SuperclassName);
output ~= newIdentifier("super");
output ~= newToken("(");
output ~= newString(className);
output ~= newToken(",");
output ~= inheritsL;
output ~= newToken(")");
output ~= newToken(";");
} else {
// super("ClassName");
output ~= newIdentifier("super");
output ~= newToken("(");
output ~= newString(className);
output ~= newToken(")");
output ~= newToken(";");
}
// } /* this () */
output ~= newToken("}");
auto vars = parseVariableDefinitions(className, lexemes);
// includes @end
auto methods = parseMethodDefinitions(lexemes);
{
immutable(Lexeme)[] allocMethodBody;
// {
allocMethodBody ~= newToken("{");
// id obj = new ClassNameInst;
allocMethodBody ~= newIdentifier("id");
allocMethodBody ~= newIdentifier("obj");
allocMethodBody ~= newToken("=");
allocMethodBody ~= newIdentifier("new");
allocMethodBody ~= classInstance;
allocMethodBody ~= newToken(";");
// obj.isa = ClassName;
allocMethodBody ~= newIdentifier("obj");
allocMethodBody ~= newToken(".");
allocMethodBody ~= newIdentifier("isa");
allocMethodBody ~= newToken("=");
allocMethodBody ~= classNameL;
allocMethodBody ~= newToken(";");
// return obj;
allocMethodBody ~= newIdentifier("return");
allocMethodBody ~= newIdentifier("obj");
allocMethodBody ~= newToken(";");
// } /* alloc */
allocMethodBody ~= newToken("}");
// add the generated 'alloc' method to the class
methods ~= new Method(true, [ newIdentifier("id") ], "alloc", [], assumeUnique(allocMethodBody));
}
output ~= newIdentifier("public");
output ~= newToken(":");
foreach (method; methods) {
// implement class methods as member functions
if (!method.classMethod)
continue;
// static return_type selector_asIdentifier__ (
output ~= newIdentifier("static");
output ~= method.returnType;
output ~= newIdentifier(selectorToIdentifier(method.selector, OBJD_METHOD_PREFIX));
output ~= newToken("(");
// MetaClassName self, SEL cmd
output ~= metaClass;
output ~= newIdentifier("self");
output ~= newToken(",");
output ~= newIdentifier("SEL");
output ~= newIdentifier("cmd");
foreach (ref param; method.parameters) {
// , parameter_type parameter_name
output ~= newToken(",");
output ~= param.type;
output ~= newIdentifier(param.name);
}
// ) /* method header */
output ~= newToken(")");
output ~= method.implementationBody;
}
// } /* class MetaClassName */
output ~= newToken("}");
// class ClassNameInst :
output ~= newIdentifier("class");
output ~= classInstance;
output ~= newToken(":");
if (inheritsL is null) {
// objd.runtime.Instance
output ~= objdNamespace();
output ~= newIdentifier("Instance");
} else {
// SuperclassInst
if (inheritsL.length > 1)
output ~= inheritsL[0 .. $ - 1];
if (inheritsL[$ - 1].token != Token.Identifier)
errorOut(inheritsL[$ - 1], "expected superclass identifier");
output ~= newIdentifier(classInstanceName(inheritsL[$ - 1].content));
}
// {
output ~= newToken("{");
output ~= vars;
output ~= newIdentifier("public");
output ~= newToken(":");
foreach (method; methods) {
// implement instance methods as member functions
if (method.classMethod)
continue;
// static return_type selector_asIdentifier__ (
output ~= newIdentifier("static");
output ~= method.returnType;
output ~= newIdentifier(selectorToIdentifier(method.selector, OBJD_METHOD_PREFIX));
output ~= newToken("(");
// ClassNameInst self, SEL cmd
output ~= classInstance;
output ~= newIdentifier("self");
output ~= newToken(",");
output ~= newIdentifier("SEL");
output ~= newIdentifier("cmd");
foreach (ref param; method.parameters) {
// , parameter_type parameter_name
output ~= newToken(",");
output ~= param.type;
output ~= newIdentifier(param.name);
}
// ) /* method header */
output ~= newToken(")");
output ~= method.implementationBody;
}
// } /* class ClassNameInst */
output ~= newToken("}");
// static this () {
output ~= newIdentifier("static");
output ~= newIdentifier("this");
output ~= newToken("(");
output ~= newToken(")");
output ~= newToken("{");
// ClassName = new MetaClassName();
output ~= classNameL;
output ~= newToken("=");
output ~= newIdentifier("new");
output ~= metaClass;
output ~= newToken("(");
output ~= newToken(")");
output ~= newToken(";");
foreach (method; methods) {
// this is inside a module constructor, so we can add methods
// ClassName.
output ~= classNameL;
output ~= newToken(".");
if (method.classMethod) {
// isa.
output ~= newIdentifier("isa");
output ~= newToken(".");
}
// addMethod(
output ~= newIdentifier("addMethod");
output ~= newToken("(");
// sel_registerName("name")
output ~= registerSelector(method.selector);
// , &
output ~= newToken(",");
output ~= newToken("&");
if (method.classMethod)
// MetaClassName
output ~= metaClass;
else
// ClassNameInst
output ~= classInstance;
// .selector_asIdentifier__
output ~= newToken(".");
output ~= newIdentifier(selectorToIdentifier(method.selector, OBJD_METHOD_PREFIX));
// ) /* addMethod */ ;
output ~= newToken(")");
output ~= newToken(";");
}
// objd_msgSend!(void)(ClassName, sel_registerName("initialize"));
output ~= objdNamespace();
output ~= newIdentifier("objd_msgSend");
output ~= newToken("!");
output ~= newIdentifier("void");
output ~= newToken("(");
output ~= classNameL;
output ~= newToken(",");
output ~= registerSelector("initialize");
output ~= newToken(")");
output ~= newToken(";");
// } /* static this () */
output ~= newToken("}");
foreach (method; methods) {
// mixin _objDAliasTypeToSelectorReturnType!(method_return_type, "selector:name:", "_objd_sel_methodNameWith__rettype");
output ~= newIdentifier("mixin");
output ~= newIdentifier("_objDAliasTypeToSelectorReturnType");
output ~= newToken("!");
output ~= newToken("(");
output ~= method.returnType;
output ~= newToken(",");
output ~= newString(method.selector);
output ~= newToken(",");
output ~= newString(selectorToIdentifier(method.selector) ~ "_rettype");
output ~= newToken(")");
output ~= newToken(";");
}
return assumeUnique(output);
}
immutable(Lexeme[]) parseObjectiveCClass (ref immutable(Lexeme)[] lexemes) {
immutable(Lexeme)[] output;
auto className = lexemes[0];
if (className.token != Token.Identifier)
errorOut(className, "expected Objective-C class name");
if (lexemes[1].token != Token.Semicolon)
errorOut(lexemes[1], "expected ;");
lexemes = lexemes[2 .. $];
// __gshared objd.objc.Class ClassName;
output ~= newIdentifier("__gshared");
output ~= objdNamespace("objc");
output ~= newIdentifier("Class");
output ~= className;
output ~= newToken(";");
// static this () {
output ~= newIdentifier("static");
output ~= newIdentifier("this");
output ~= newToken("(");
output ~= newToken(")");
output ~= newToken("{");
// ClassName = new objd.objc.Class("ClassName")
output ~= className;
output ~= newToken("=");
output ~= newIdentifier("new");
output ~= objdNamespace("objc");
output ~= newIdentifier("Class");
output ~= newToken("(");
output ~= newString(className.content);
output ~= newToken(")");
output ~= newToken(";");
// } /* static this () */
output ~= newToken("}");
return output;
}
immutable(Lexeme[]) parseVariableDefinitions (dstring className, ref immutable(Lexeme)[] lexemes) {
immutable(Lexeme)[] output;
auto lbrace = lexemes[0];
if (lbrace.token != Token.LBrace)
errorOut(lbrace, "expected {");
lexemes = lexemes[1 .. $];
while (lexemes[0].token != Token.RBrace) {
output ~= lexemes[0];
lexemes = lexemes[1 .. $];
}
lexemes = lexemes[1 .. $];
return assumeUnique(output);
}
immutable(Method)[] parseMethodDefinitions (ref immutable(Lexeme)[] lexemes) {
immutable(Method)[] output;
for (;;) {
auto next = lexemes[0];
lexemes = lexemes[1 .. $];
if (next.token == Token.ObjD_end) {
break;
} else if (next.token == Token.Minus) {
output ~= parseMethod(lexemes, false);
} else if (next.token == Token.Plus) {
output ~= parseMethod(lexemes, true);
} else {
errorOut(next, "expected method definition");
}
}
return output;
}
immutable(Method) parseMethod (ref immutable(Lexeme)[] lexemes, bool classMethod) {
auto returnType = parseObjDType(lexemes);
auto firstWord = lexemes[0];
if (firstWord.token != Token.Identifier)
errorOut(firstWord, "expected method name");
lexemes = lexemes[1 .. $];
auto selector = firstWord.content.idup;
immutable(Parameter)[] parameters;
while (lexemes[0].token != Token.LBrace) {
if (lexemes[0].token == Token.Colon) {
selector ~= ":";
lexemes = lexemes[1 .. $];
parameters ~= parseParameter(lexemes);
} else if (lexemes[0].token == Token.Identifier) {
selector ~= lexemes[0].content;
lexemes = lexemes[1 .. $];
} else
errorOut(lexemes[0], "expected method name");
}
auto impl = parseFunctionBody(lexemes);
return new Method(classMethod, returnType, selector, parameters, impl);
}
immutable(Lexeme[]) parseSelector (ref immutable(Lexeme)[] lexemes) {
auto lparen = lexemes[0];
if (lparen.token != Token.LParen)
errorOut(lparen, "expected (");
auto firstWord = lexemes[1];
if (firstWord.token != Token.Identifier)
errorOut(firstWord, "expected selector name");
auto selector = firstWord.content.idup;
lexemes = lexemes[2 .. $];
for (;;) {
auto next = lexemes[0];
lexemes = lexemes[1 .. $];
if (next.token == Token.RParen)
break;
else if (next.token == Token.Colon)
selector ~= ":";
else if (next.token == Token.Identifier)
selector ~= next.content;
else
errorOut(next, "expected selector name or closing parenthesis");
}
return [ registerSelector(selector) ];
}
immutable(Lexeme[]) parseMessageSend (ref immutable(Lexeme)[] lexemes) {
auto save = lexemes;
// TODO: this will break with associative arrays and some slices
auto lbracket = lexemes[0];
assert(lbracket.token == Token.LBracket);
immutable(Lexeme)[] output;
lexemes = lexemes[1 .. $];
if (lexemes[0].token == Token.RBracket) {
// this is a full slice
output = [ lbracket, lexemes[0] ];
lexemes = lexemes[1 .. $];
return assumeUnique(output);
}
// receiver of the message
immutable(Lexeme)[] receiver = parseAssignExpression(lexemes, true);
bool superSend;
if (receiver.length == 1 && receiver[0].token == Token.Identifier && receiver[0].content == "super") {
superSend = true;
receiver = [ newIdentifier("self") ];
} else
superSend = false;
if (lexemes[0].token != Token.Identifier) {
// this seems to be an array literal of some kind
lexemes = save;
return parseArrayLiteral(lexemes);
}
auto firstWord = lexemes[0];
lexemes = lexemes[1 .. $];
auto selector = firstWord.content.idup;
immutable(Lexeme)[][] arguments;
for (;;) {
auto next = lexemes[0];
lexemes = lexemes[1 .. $];
if (next.token == Token.RBracket)
break;
else if (next.token == Token.Colon) {
selector ~= ":";
auto expr = parseExpression(lexemes);
arguments ~= expr;
} else if (next.token == Token.Identifier) {
selector ~= next.content;
} else
errorOut(next, "expected message name");
}
// objd_msgSend!(
output ~= objdNamespace();
output ~= newIdentifier("objd_msgSend");
output ~= newToken("!");
output ~= newToken("(");
// _objDMethodReturnTypeAlias!("_objd_sel_methodNameWith__rettype")
output ~= newIdentifier("_objDMethodReturnTypeAlias");
output ~= newToken("!");
output ~= newToken("(");
output ~= newString(selectorToIdentifier(selector) ~ "_rettype");
output ~= newToken(")");
if (superSend) {
// , true
output ~= newToken(",");
output ~= newIdentifier("true");
}
// )(receiver,
output ~= newToken(")");
output ~= newToken("(");
output ~= receiver;
output ~= newToken(",");
// sel_registerName("name")
output ~= registerSelector(selector);
foreach (expr; arguments) {
// , argument_data
output ~= newToken(",");
output ~= expr;
}
// ) /* msgSend */
output ~= newToken(")");
return assumeUnique(output);
}
|
D
|
// REQUIRED_ARGS: -O -cov
bool func(T)()
{
return true;
}
void main()
{
assert(func!int() || int.sizeof);
}
|
D
|
$NetBSD$
Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
--- runtime/druntime/src/core/sys/posix/signal.d.orig 2018-08-23 23:29:55.000000000 +0000
+++ runtime/druntime/src/core/sys/posix/signal.d
@@ -423,6 +423,31 @@ else version( DragonFlyBSD )
enum SIGUSR2 = 31;
enum SIGURG = 16;
}
+else version( NetBSD )
+{
+ //SIGABRT (defined in core.stdc.signal)
+ enum SIGALRM = 14;
+ enum SIGBUS = 10;
+ enum SIGCHLD = 20;
+ enum SIGCONT = 19;
+ //SIGFPE (defined in core.stdc.signal)
+ enum SIGHUP = 1;
+ //SIGILL (defined in core.stdc.signal)
+ //SIGINT (defined in core.stdc.signal)
+ enum SIGKILL = 9;
+ enum SIGPIPE = 13;
+ enum SIGQUIT = 3;
+ //SIGSEGV (defined in core.stdc.signal)
+ enum SIGSTOP = 17;
+ //SIGTERM (defined in core.stdc.signal)
+ enum SIGTSTP = 18;
+ enum SIGTTIN = 21;
+ enum SIGTTOU = 22;
+ enum SIGUSR1 = 30;
+ enum SIGUSR2 = 31;
+ enum SIGURG = 16;
+}
+
else version (Solaris)
{
enum SIGALRM = 14;
@@ -494,6 +519,19 @@ else version( DragonFlyBSD )
sigset_t sa_mask;
}
}
+else version( NetBSD )
+{
+ struct sigaction_t
+ {
+ union
+ {
+ sigfn_t sa_handler;
+ sigactfn_t sa_sigaction;
+ }
+ sigset_t sa_mask;
+ int sa_flags;
+ }
+}
else version (Solaris)
{
struct sigaction_t
@@ -960,6 +998,100 @@ else version( DragonFlyBSD )
int sigsuspend(in sigset_t *);
int sigwait(in sigset_t*, int*);
}
+else version( NetBSD )
+{
+ enum SIG_HOLD = cast(sigfn_t2) 3;
+
+ struct sigset_t
+ {
+ uint[4] __bits;
+ }
+
+ enum SA_NOCLDSTOP = 8;
+
+ enum SIG_BLOCK = 1;
+ enum SIG_UNBLOCK = 2;
+ enum SIG_SETMASK = 3;
+
+ union sigval_t {
+ int sival_int;
+ void *sival_ptr;
+ };
+ struct _rt{
+ pid_t _pid;
+ uid_t _uid;
+ sigval_t _value;
+ };
+ struct _child{
+ pid_t _pid;
+ uid_t _uid;
+ int _status;
+ clock_t _utime;
+ clock_t _stime;
+ };
+ struct _fault{
+ void *_addr;
+ int _trap;
+ int _trap2;
+ int _trap3;
+ };
+ struct _poll{
+ long _band;
+ int _fd;
+ };
+ union _reason{
+ _rt rt;
+ _child child;
+ _fault fault;
+ _poll poll;
+ };
+ struct _ksiginfo {
+ int _signo;
+ int _code;
+ int _errno;
+/+#ifdef _LP64
+ /* In _LP64 the union starts on an 8-byte boundary. */
+ int _pad;
+#endif+/
+ _reason reason;
+ };
+
+
+ union siginfo_t
+ {
+ ubyte[128] si_pad;/* Total size; for future expansion */
+ _ksiginfo _info;
+ @property ref c_long si_band() return { return _info.reason.poll._band; }
+ }
+
+ enum SI_USER = 0;
+ enum SI_QUEUE = -1;
+ enum SI_TIMER = -2;
+ enum SI_ASYNCIO = -3;
+ enum SI_MESGQ = -4;
+
+ int kill(pid_t, int);
+ int __sigaction14(int, in sigaction_t*, sigaction_t*);
+ int __sigaddset14(sigset_t*, int);
+ int __sigdelset14(sigset_t*, int);
+ int __sigemptyset14(sigset_t *);
+ int __sigfillset14(sigset_t *);
+ int __sigismember14(in sigset_t *, int);
+ int __sigpending14(sigset_t *);
+ int __sigprocmask14(int, in sigset_t*, sigset_t*);
+ int __sigsuspend14(in sigset_t *);
+ int sigwait(in sigset_t*, int*);
+
+ alias __sigaction14 sigaction;
+ alias __sigaddset14 sigaddset;
+ alias __sigdelset14 sigdelset;
+ alias __sigemptyset14 sigemptyset;
+ alias __sigfillset14 sigfillset;
+ alias __sigismember14 sigismember;
+ alias __sigpending14 sigpending;
+ alias __sigprocmask14 sigprocmask;
+ alias __sigsuspend14 sigsuspend;
+}
else version (Solaris)
{
enum SIG_HOLD = cast(sigfn_t2)2;
@@ -1860,6 +1992,130 @@ else version( DragonFlyBSD )
int sigpause(int);
int sigrelse(int);
}
+else version( NetBSD )
+{
+ // No SIGPOLL on *BSD
+ enum SIGPROF = 27;
+ enum SIGSYS = 12;
+ enum SIGTRAP = 5;
+ enum SIGVTALRM = 26;
+ enum SIGXCPU = 24;
+ enum SIGXFSZ = 25;
+
+ enum
+ {
+ SA_ONSTACK = 0x0001,
+ SA_RESTART = 0x0002,
+ SA_RESETHAND = 0x0004,
+ SA_NODEFER = 0x0010,
+ SA_NOCLDWAIT = 0x0020,
+ SA_SIGINFO = 0x0040,
+ }
+
+ enum
+ {
+ SS_ONSTACK = 0x0001,
+ SS_DISABLE = 0x0004,
+ }
+
+ enum MINSIGSTKSZ = 8192;
+ enum SIGSTKSZ = (MINSIGSTKSZ + 32768);
+;
+ //ucontext_t (defined in core.sys.posix.ucontext)
+ //mcontext_t (defined in core.sys.posix.ucontext)
+
+ struct stack_t
+ {
+ void* ss_sp;
+ size_t ss_size;
+ int ss_flags;
+ }
+
+ struct sigstack
+ {
+ void* ss_sp;
+ int ss_onstack;
+ }
+
+ enum
+ {
+ ILL_ILLOPC = 1,
+ ILL_ILLOPN,
+ ILL_ILLADR,
+ ILL_ILLTRP,
+ ILL_PRVOPC,
+ ILL_PRVREG,
+ ILL_COPROC,
+ ILL_BADSTK,
+ }
+
+ enum
+ {
+ BUS_ADRALN = 1,
+ BUS_ADRERR,
+ BUS_OBJERR,
+ }
+
+ enum
+ {
+ SEGV_MAPERR = 1,
+ SEGV_ACCERR,
+ }
+
+ enum
+ {
+ FPE_INTOVF = 1,
+ FPE_INTDIV,
+ FPE_FLTDIV,
+ FPE_FLTOVF,
+ FPE_FLTUND,
+ FPE_FLTRES,
+ FPE_FLTINV,
+ FPE_FLTSUB,
+ }
+
+ enum
+ {
+ TRAP_BRKPT = 1,
+ TRAP_TRACE,
+ }
+
+ enum
+ {
+ CLD_EXITED = 1,
+ CLD_KILLED,
+ CLD_DUMPED,
+ CLD_TRAPPED,
+ CLD_STOPPED,
+ CLD_CONTINUED,
+ }
+
+ enum
+ {
+ POLL_IN = 1,
+ POLL_OUT,
+ POLL_MSG,
+ POLL_ERR,
+ POLL_PRI,
+ POLL_HUP,
+ }
+
+ //sigfn_t bsd_signal(int sig, sigfn_t func);
+ sigfn_t sigset(int sig, sigfn_t func);
+
+ nothrow:
+ @nogc:
+ //sigfn_t2 bsd_signal(int sig, sigfn_t2 func);
+ sigfn_t2 sigset(int sig, sigfn_t2 func);
+
+ int killpg(pid_t, int);
+ int sigaltstack(in stack_t*, stack_t*);
+ int sighold(int);
+ int sigignore(int);
+ int siginterrupt(int, int);
+ int sigpause(int);
+ int sigrelse(int);
+}
else version (Solaris)
{
enum SIGPOLL = 22;
@@ -2199,6 +2455,14 @@ else version( DragonFlyBSD )
c_long tv_nsec;
}
}
+else version( NetBSD )
+{
+ struct timespec
+ {
+ time_t tv_sec;
+ c_long tv_nsec;
+ }
+}
else version (Solaris)
{
struct timespec
@@ -2321,6 +2585,21 @@ else version( DragonFlyBSD )
int sigtimedwait(in sigset_t*, siginfo_t*, in timespec*);
int sigwaitinfo(in sigset_t*, siginfo_t*);
}
+else version( NetBSD )
+{
+ struct sigevent
+ {
+ int sigev_notify;
+ int sigev_signo;
+ sigval sigev_value;
+ void function(sigval) sigev_notify_function;
+ void /* pthread_attr_t */*sigev_notify_attributes;
+ }
+
+ int sigqueue(pid_t, int, in sigval);
+ int sigtimedwait(in sigset_t*, siginfo_t*, in timespec*);
+ int sigwaitinfo(in sigset_t*, siginfo_t*);
+}
else version (OSX)
{
}
@@ -2398,6 +2677,11 @@ else version( DragonFlyBSD )
{
int pthread_kill(pthread_t, int);
int pthread_sigmask(int, in sigset_t*, sigset_t*);
+}
+else version( NetBSD )
+{
+ int pthread_kill(pthread_t, int);
+ int pthread_sigmask(int, in sigset_t*, sigset_t*);
}
else version (Solaris)
{
|
D
|
module external_libraries;
import derelict.freeimage.freeimage;
import derelict.glfw3.glfw3;
import derelict.opengl3.gl3;
import derelict.util.exception;
import derelict.sdl2.sdl;
import derelict.sdl2.mixer;
import derelict.ogg.ogg;
import derelict.ogg.vorbis;
import derelict.ogg.vorbisfile;
import std.exception;
import log;
version(X86)
{
enum dllPath = "..\\dll\\win32\\";
}
version(X86_64)
{
enum dllPath = "..\\dll\\win64\\";
}
enum GLFW_DLL_PATH = dllPath ~ "glfw3.dll";
enum FREE_IMAGE_DLL_PATH = dllPath ~ "FreeImage.dll";
enum SDL_PATH = dllPath ~ "SDL2.dll";
enum SDL_MIXER_PATH = dllPath ~ "SDL2_mixer.dll";
enum OGG_DLL_PATH = dllPath ~ "libogg-0.dll";
enum VORBIS_DLL_PATH = dllPath ~ "libvorbis-0.dll";
enum VORBISFILE_DLL_PATH = dllPath ~ "libvorbisfile-3.dll";
void init_dlls()
{
Derelict_SetMissingSymbolCallback(&missingSymFunc);
DerelictGL3.load();
DerelictGLFW3.load(GLFW_DLL_PATH);
DerelictFI.load(FREE_IMAGE_DLL_PATH);
DerelictOgg.load(OGG_DLL_PATH);
DerelictVorbis.load(VORBIS_DLL_PATH);
DerelictVorbisFile.load(VORBISFILE_DLL_PATH);
DerelictSDL2.load(SDL_PATH);
DerelictSDL2Mixer.load(SDL_MIXER_PATH);
FreeImage_Initialise();
SDL_Init(SDL_INIT_AUDIO);
Mix_Init(MIX_INIT_OGG);
glfwSetErrorCallback(&glfwError);
auto res = glfwInit();
assert(res, "GLFW did not initialize properly!");
auto logChnl = LogChannel("EXTERNAL_LIBRARIES");
logChnl.info("Setup complete");
}
void shutdown_dlls()
{
FreeImage_DeInitialise();
Mix_Quit();
SDL_Quit();
glfwTerminate();
DerelictGLFW3.unload();
DerelictFI.unload();
DerelictGL3.unload();
DerelictOgg.unload();
DerelictVorbis.unload();
DerelictVorbisFile.unload();
DerelictSDL2.unload();
DerelictSDL2Mixer.unload();
}
bool missingSymFunc(string libName, string symName)
{
auto logChnl = LogChannel("MISSING SYMBOLS");
logChnl.warn(libName," ", symName);
return true;
}
extern(C) static nothrow void glfwError(int type, const(char)* msg)
{
import std.conv;
auto logChnl = LogChannel("GLFW");
logChnl.error("Got error from GLFW : Type", type, " MSG: ", msg.to!string);
}
|
D
|
/*
* stdlib.h compatibility shim
* Public domain
*/
module libressl.compat.stdlib;
private static import core.stdc.config;
public import core.stdc.stdint;
public import core.stdc.stdlib;
public import core.sys.bionic.stdlib;
public import core.sys.darwin.stdlib;
public import core.sys.dragonflybsd.stdlib;
public import core.sys.freebsd.stdlib;
public import core.sys.netbsd.stdlib;
public import core.sys.openbsd.stdlib;
public import core.sys.posix.stdlib;
public import core.sys.solaris.stdlib;
public import libressl.compat.sys.types;
extern (C):
nothrow @nogc:
static if (!__traits(compiles, arc4random)) {
core.stdc.stdint.uint32_t arc4random();
}
static if (!__traits(compiles, arc4random_buf)) {
void arc4random_buf(void* _buf, size_t n);
}
static if (!__traits(compiles, arc4random_uniform)) {
core.stdc.stdint.uint32_t arc4random_uniform(core.stdc.stdint.uint32_t upper_bound);
}
static if (!__traits(compiles, freezero)) {
void freezero(void* ptr_, size_t sz);
}
static if (!__traits(compiles, getprogname)) {
const (char)* getprogname();
}
void* reallocarray(void*, size_t, size_t);
static if (!__traits(compiles, recallocarray)) {
void* recallocarray(void*, size_t, size_t, size_t);
}
static if (!__traits(compiles, strtonum)) {
//core.stdc.config.cpp_longlong strtonum(const (char)* nptr, core.stdc.config.cpp_longlong minval, core.stdc.config.cpp_longlong maxval, const (char)** errstr);
}
|
D
|
take away to an undisclosed location against their will and usually in order to extract a ransom
pull away from the body
|
D
|
module godot.gdfunctionstate;
import std.meta : AliasSeq, staticIndexOf;
import std.traits : Unqual;
import godot.d.meta;
import godot.core;
import godot.c;
import godot.object;
import godot.reference;
@GodotBaseClass struct GDFunctionState
{
static immutable string _GODOT_internal_name = "GDFunctionState";
public:
union { godot_object _godot_object; Reference base; }
alias base this;
alias BaseClasses = AliasSeq!(typeof(base), typeof(base).BaseClasses);
package(godot) void* opCast(T : void*)() const { return cast(void*)_godot_object.ptr; }
godot_object opCast(T : godot_object)() const { return cast(godot_object)_godot_object; }
bool opEquals(in GDFunctionState other) const { return _godot_object.ptr is other._godot_object.ptr; }
GDFunctionState opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
bool opCast(T : bool)() const { return _godot_object.ptr !is null; }
inout(T) opCast(T)() inout if(isGodotBaseClass!T)
{
static assert(staticIndexOf!(GDFunctionState, T.BaseClasses) != -1, "Godot class "~T.stringof~" does not inherit GDFunctionState");
if(_godot_object.ptr is null) return T.init;
String c = String(T._GODOT_internal_name);
if(is_class(c)) return inout(T)(_godot_object);
return T.init;
}
inout(T) opCast(T)() inout if(extendsGodotBaseClass!T)
{
static assert(is(typeof(T.owner) : GDFunctionState) || staticIndexOf!(GDFunctionState, typeof(T.owner).BaseClasses) != -1, "D class "~T.stringof~" does not extend GDFunctionState");
if(_godot_object.ptr is null) return null;
if(has_method(String(`_GDNATIVE_D_typeid`)))
{
Object o = cast(Object)godot_nativescript_get_userdata(opCast!godot_object);
return cast(inout(T))o;
}
return null;
}
static GDFunctionState _new()
{
static godot_class_constructor constructor;
if(constructor is null) constructor = godot_get_class_constructor("GDFunctionState");
if(constructor is null) return typeof(this).init;
return cast(GDFunctionState)(constructor());
}
Variant resume(in Variant arg = Variant.nil)
{
static godot_method_bind* mb = null;
if(mb is null) mb = godot_method_bind_get_method("GDFunctionState", "resume");
Variant _GODOT_ret = Variant.nil;
const(void*)[1] _GODOT_args = [cast(void*)(&arg), ];
godot_method_bind_ptrcall(mb, cast(godot_object)(this), _GODOT_args.ptr, cast(void*)&_GODOT_ret);
return _GODOT_ret;
}
bool is_valid(in bool extended_check = false) const
{
static godot_method_bind* mb = null;
if(mb is null) mb = godot_method_bind_get_method("GDFunctionState", "is_valid");
bool _GODOT_ret = bool.init;
const(void*)[1] _GODOT_args = [cast(void*)(&extended_check), ];
godot_method_bind_ptrcall(mb, cast(godot_object)(this), _GODOT_args.ptr, cast(void*)&_GODOT_ret);
return _GODOT_ret;
}
void _signal_callback(Args...)(Args _GODOT_var_args)
{
Array _GODOT_args = Array.empty_array;
foreach(vai, VA; Args)
{
_GODOT_args.append(_GODOT_var_args[vai]);
}
String _GODOT_method_name = String("_signal_callback");
this.callv(_GODOT_method_name, _GODOT_args);
}
}
|
D
|
/Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Intermediates/FareDeal.build/Debug-iphonesimulator/FareDeal.build/Objects-normal/x86_64/NVActivityIndicatorAnimationDelegate.o : /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/StoreVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/UserDealCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealDetaislVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataManager.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealDetailsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesTVController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FoodCategories.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardOverlayView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/GradientView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDetailController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SavedDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/VenueDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteVenue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataApi.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/InitialScreenVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorShape.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deals.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Restaurant.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScale.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Venue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC2.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/HomeSwipeViewController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessHome.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AuthenticationCalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AppDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardContentView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Constants.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Validation.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Reachability.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/FareDeal-Bridging-Header.h /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTTAttributedLabel.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTCounterLabel.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Dynamic.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealmUtil.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMMigration_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMListBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMResults.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMRealm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMPlatform.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObject.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMMigration.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMCollection.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMArray.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/Realm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/Koloda.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPLayerExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDecayAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPCustomAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPBasicAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimator.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPPropertyAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPSpringAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPGeometry.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationEvent.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationTracer.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimatableProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POP.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/pop-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/SWActionSheet.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetStringPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetLocalePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/DistancePickerView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDistancePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDatePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPickerDelegate.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/AbstractActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker-3.0-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Modules/module.modulemap
/Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Intermediates/FareDeal.build/Debug-iphonesimulator/FareDeal.build/Objects-normal/x86_64/NVActivityIndicatorAnimationDelegate~partial.swiftmodule : /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/StoreVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/UserDealCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealDetaislVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataManager.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealDetailsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesTVController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FoodCategories.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardOverlayView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/GradientView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDetailController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SavedDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/VenueDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteVenue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataApi.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/InitialScreenVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorShape.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deals.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Restaurant.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScale.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Venue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC2.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/HomeSwipeViewController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessHome.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AuthenticationCalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AppDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardContentView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Constants.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Validation.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Reachability.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/FareDeal-Bridging-Header.h /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTTAttributedLabel.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTCounterLabel.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Dynamic.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealmUtil.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMMigration_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMListBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMResults.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMRealm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMPlatform.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObject.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMMigration.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMCollection.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMArray.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/Realm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/Koloda.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPLayerExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDecayAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPCustomAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPBasicAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimator.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPPropertyAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPSpringAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPGeometry.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationEvent.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationTracer.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimatableProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POP.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/pop-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/SWActionSheet.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetStringPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetLocalePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/DistancePickerView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDistancePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDatePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPickerDelegate.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/AbstractActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker-3.0-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Modules/module.modulemap
/Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Intermediates/FareDeal.build/Debug-iphonesimulator/FareDeal.build/Objects-normal/x86_64/NVActivityIndicatorAnimationDelegate~partial.swiftdoc : /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/StoreVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/UserDealCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealDetaislVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataManager.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealDetailsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesTVController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FoodCategories.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardOverlayView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/GradientView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDetailController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SavedDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/VenueDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteVenue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataApi.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/InitialScreenVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorShape.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deals.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Restaurant.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallScale.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Venue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC2.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/HomeSwipeViewController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessHome.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AuthenticationCalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AppDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardContentView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Constants.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Validation.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/NVActivityIndicatorAnimationDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Reachability.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/FareDeal-Bridging-Header.h /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTTAttributedLabel.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTCounterLabel.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Dynamic.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealmUtil.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMMigration_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMListBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMResults.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMRealm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMPlatform.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObject.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMMigration.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMCollection.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMArray.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/Realm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/Koloda.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPLayerExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDecayAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPCustomAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPBasicAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimator.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPPropertyAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPSpringAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPGeometry.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationEvent.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationTracer.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimatableProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POP.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/pop-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/SWActionSheet.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetStringPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetLocalePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/DistancePickerView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDistancePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDatePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPickerDelegate.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/AbstractActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker-3.0-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Modules/module.modulemap
|
D
|
module hunt.framework.websocket.SubProtocolCapable;
/**
* An interface for WebSocket handlers that support sub-protocols as defined in RFC 6455.
*
* @author Rossen Stoyanchev
* @since 4.0
* @see WebSocketHandler
* @see <a href="http://tools.ietf.org/html/rfc6455#section-1.9">RFC-6455 section 1.9</a>
*/
interface SubProtocolCapable {
/**
* Return the list of supported sub-protocols.
*/
string[] getSubProtocols();
}
|
D
|
/home/josh7gas/github.com/Josh7GAS/Oficina/Rust/test/rust_crawler/target/rls/debug/build/crossbeam-utils-fe4de8b72e47f18e/build_script_build-fe4de8b72e47f18e: /home/josh7gas/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.0/build.rs
/home/josh7gas/github.com/Josh7GAS/Oficina/Rust/test/rust_crawler/target/rls/debug/build/crossbeam-utils-fe4de8b72e47f18e/build_script_build-fe4de8b72e47f18e.d: /home/josh7gas/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.0/build.rs
/home/josh7gas/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.0/build.rs:
|
D
|
/**
* Copyright © Novelate 2020
* License: MIT (https://github.com/Novelate/NovelateEngine/blob/master/LICENSE)
* Author: Jacob Jensen (bausshf)
* Website: https://novelate.com/
* ------
* Novelate is a free and open-source visual novel engine and framework written in the D programming language.
* It can be used freely for both personal and commercial projects.
* ------
* Module Description:
* This module handles the global state of the visual novel. Global states are only available internal in the engine and are used to share data between parts that aren\t interacting with each other.
* At some point these states needs to be rewritten so they're used more safely but as of now they function and doesn't require a lot to maintain.
*/
module novelate.state;
import dsfml.graphics : RenderWindow;
import dsfml.window : VideoMode, ContextSettings;
import novelate.layer;
import novelate.core : Screen;
package(novelate):
/// The resolution width.
size_t _width = 800;
/// The resolution height.
size_t _height = 600;
/// The next scene.
string nextScene = null;
/// Boolean determining whether the game has ended or not.
bool endGame = false;
/// boolean determining whether the game should exit or not.
bool exitGame = false;
/// The temp screen to change to.
Screen changeTempScreen = Screen.none;
/// Boolean determining whether the displayed screen is temp or not.
bool _isTempScreen = false;
/// Gets a boolean determining whether the displayed screen is temp or not.
@property bool isTempScreen() { return _isTempScreen; }
/// The current play scene.
string playScene;
/// Boolean determining whether the game is running.
bool running = true;
/// The context settings.
ContextSettings _context;
/// The video mode.
VideoMode _videoMode;
/// The render window.
RenderWindow _window;
/// The fps.
const _fps = 60;
/// The window title.
string _title = "";
/// The layers.
Layer[] _layers;
/// The temp layers.
Layer[] _tempLayers;
/// The selected layers. Usually refers to _layers or _tempLayers.
Layer[] selectedLayers;
/// Boolean determining whether the game is in full-screen or not.
bool fullScreen = false;
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/ice14185.d(12): Error: cannot implicitly convert expression `this` of type `Mutexed` to `Mutexed*`
---
*/
struct Mutexed
{
auto acquire ()
{
return Lock (this);
}
alias acquire this;
struct Lock
{
Mutexed* source;
}
}
void main ()
{
Mutexed x;
}
|
D
|
instance TPL_1439_GorNaDrak(Npc_Default)
{
name[0] = "Gor Na Drak";
npcType = npctype_main;
guild = GIL_TPL;
level = 21;
voice = 9;
id = 1439;
attribute[ATR_STRENGTH] = 100;
attribute[ATR_DEXTERITY] = 80;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 292;
attribute[ATR_HITPOINTS] = 292;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Mage.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",1,1,"Hum_Head_Bald",63,2,tpl_armor_h);
B_Scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_MASTER;
Npc_SetTalentSkill(self,NPC_TALENT_2H,2);
EquipItem(self,ItMw_2H_Sword_Light_04);
CreateInvItem(self,ItFoSoup);
CreateInvItem(self,ItMiJoint_1);
daily_routine = Rtn_start_1439;
};
func void Rtn_start_1439()
{
TA_Smalltalk(6,0,14,0,"PSI_WALK_05");
TA_Smalltalk(14,0,6,0,"OW_OM_ENTRANCE02");
};
func void Rtn_FMTaken_1439()
{
TA_Smalltalk(6,0,14,0,"PSI_WALK_05");
TA_Smalltalk(14,0,6,0,"PSI_WALK_05");
};
|
D
|
/Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate.o : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/MultipartFormData.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Timeline.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Alamofire.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Response.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/TaskDelegate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/SessionDelegate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ParameterEncoding.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Validation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ResponseSerialization.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/SessionManager.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/AFError.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Notifications.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Result.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Request.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate~partial.swiftmodule : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/MultipartFormData.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Timeline.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Alamofire.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Response.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/TaskDelegate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/SessionDelegate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ParameterEncoding.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Validation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ResponseSerialization.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/SessionManager.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/AFError.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Notifications.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Result.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Request.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate~partial.swiftdoc : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/MultipartFormData.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Timeline.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Alamofire.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Response.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/TaskDelegate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/SessionDelegate.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ParameterEncoding.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Validation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ResponseSerialization.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/SessionManager.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/AFError.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Notifications.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Result.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/Request.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
const int z;
static this()
{
z = 3;
}
int main()
{
z = 4;
return 0;
}
|
D
|
// Copyright Michael D. Parker 2018.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
module bindbc.opengl.bind.gl31;
import bindbc.opengl.config;
static if(glSupport >= GLSupport.gl31) {
import bindbc.loader : SharedLib;
import bindbc.opengl.context;
import bindbc.opengl.bind.types;
enum : uint {
GL_SAMPLER_2D_RECT = 0x8B63,
GL_SAMPLER_2D_RECT_SHADOW = 0x8B64,
GL_SAMPLER_BUFFER = 0x8DC2,
GL_INT_SAMPLER_2D_RECT = 0x8DCD,
GL_INT_SAMPLER_BUFFER = 0x8DD0,
GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5,
GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8,
GL_TEXTURE_BUFFER = 0x8C2A,
GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B,
GL_TEXTURE_BINDING_BUFFER = 0x8C2C,
GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D,
GL_TEXTURE_BUFFER_FORMAT = 0x8C2E,
GL_TEXTURE_RECTANGLE = 0x84F5,
GL_TEXTURE_BINDING_RECTANGLE = 0x84F6,
GL_PROXY_TEXTURE_RECTANGLE = 0x84F7,
GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8,
GL_RED_SNORM = 0x8F90,
GL_RG_SNORM = 0x8F91,
GL_RGB_SNORM = 0x8F92,
GL_RGBA_SNORM = 0x8F93,
GL_R8_SNORM = 0x8F94,
GL_RG8_SNORM = 0x8F95,
GL_RGB8_SNORM = 0x8F96,
GL_RGBA8_SNORM = 0x8F97,
GL_R16_SNORM = 0x8F98,
GL_RG16_SNORM = 0x8F99,
GL_RGB16_SNORM = 0x8F9A,
GL_RGBA16_SNORM = 0x8F9B,
GL_SIGNED_NORMALIZED = 0x8F9C,
GL_PRIMITIVE_RESTART = 0x8F9D,
GL_PRIMITIVE_RESTART_INDEX = 0x8F9E,
}
extern(System) @nogc nothrow {
alias pglDrawArraysInstanced = void function(GLenum,GLint,GLsizei,GLsizei);
alias pglDrawElementsInstanced = void function(GLenum,GLsizei,GLenum,const(GLvoid)*,GLsizei);
alias pglTexBuffer = void function(GLenum,GLenum,GLuint);
alias pglPrimitiveRestartIndex = void function(GLuint);
}
__gshared {
pglDrawArraysInstanced glDrawArraysInstanced;
pglDrawElementsInstanced glDrawElementsInstanced;
pglTexBuffer glTexBuffer;
pglPrimitiveRestartIndex glPrimitiveRestartIndex;
}
package(bindbc.opengl) @nogc nothrow
bool loadGL31(SharedLib lib, GLSupport contextVersion)
{
import bindbc.opengl.bind.arb : loadARB31;
if(contextVersion >= GLSupport.gl31) {
lib.bindGLSymbol(cast(void**)&glDrawArraysInstanced, "glDrawArraysInstanced");
lib.bindGLSymbol(cast(void**)&glDrawElementsInstanced, "glDrawElementsInstanced");
lib.bindGLSymbol(cast(void**)&glTexBuffer, "glTexBuffer");
lib.bindGLSymbol(cast(void**)&glPrimitiveRestartIndex, "glPrimitiveRestartIndex");
if(errorCountGL() == 0 && loadARB31(lib, contextVersion)) return true;
}
return false;
}
}
|
D
|
// GNU D Compiler routines for stack backtrace support.
// Copyright (C) 2013-2022 Free Software Foundation, Inc.
// GCC 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, or (at your option) any later
// version.
// GCC 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.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
module gcc.backtrace;
import gcc.libbacktrace;
// Max size per line of the traceback.
private enum MAX_BUFSIZE = 1536;
static if (BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC)
{
import core.stdc.stdint, core.stdc.string, core.stdc.stdio;
private enum MAXFRAMES = 128;
extern(C) int simpleCallback(void* data, uintptr_t pc)
{
auto context = cast(LibBacktrace)data;
if (context.numPCs == MAXFRAMES)
return 1;
context.pcs[context.numPCs++] = pc;
return 0;
}
/*
* Used for backtrace_create_state and backtrace_simple
*/
extern(C) void simpleErrorCallback(void* data, const(char)* msg, int errnum)
{
if (data) // context is not available in backtrace_create_state
{
auto context = cast(LibBacktrace)data;
strncpy(context.errorBuf.ptr, msg, context.errorBuf.length - 1);
context.error = errnum;
}
}
/*
* Used for backtrace_pcinfo
*/
extern(C) int pcinfoCallback(void* data, uintptr_t pc, const(char)* filename,
int lineno, const(char)* func)
{
auto context = cast(SymbolCallbackInfo*)data;
// Try to get the function name via backtrace_syminfo
if (func is null)
{
SymbolCallbackInfo2 info;
info.base = context;
info.filename = filename;
info.lineno = lineno;
if (backtrace_syminfo(context.state, pc, &syminfoCallback2, null, &info) != 0)
{
return context.retval;
}
}
auto sym = SymbolOrError(0, SymbolInfo(func, filename, lineno, cast(void*)pc));
context.retval = context.applyCB(context.num, sym);
context.num++;
return context.retval;
}
/*
* Used for backtrace_pcinfo and backtrace_syminfo
*/
extern(C) void pcinfoErrorCallback(void* data, const(char)* msg, int errnum)
{
auto context = cast(SymbolCallbackInfo*)data;
if (errnum == -1)
{
context.noInfo = true;
return;
}
SymbolOrError symError;
symError.errnum = errnum;
symError.msg = msg;
size_t i = 0;
context.retval = context.applyCB(i, symError);
}
/*
* Used for backtrace_syminfo (in opApply)
*/
extern(C) void syminfoCallback(void* data, uintptr_t pc,
const(char)* symname, uintptr_t symval)
{
auto context = cast(SymbolCallbackInfo*)data;
auto sym = SymbolOrError(0, SymbolInfo(symname, null, 0, cast(void*)pc));
context.retval = context.applyCB(context.num, sym);
context.num++;
}
/*
* This callback is used if backtrace_syminfo is called from the pcinfoCallback
* callback. It merges it's information with the information from pcinfoCallback.
*/
extern(C) void syminfoCallback2(void* data, uintptr_t pc,
const(char)* symname, uintptr_t symval)
{
auto context = cast(SymbolCallbackInfo2*)data;
auto sym = SymbolOrError(0, SymbolInfo(symname, context.filename, context.lineno,
cast(void*)pc));
context.base.retval = context.base.applyCB(context.base.num, sym);
context.base.num++;
}
/*
* The callback type used with the opApply overload which returns a SymbolOrError
*/
private alias int delegate(ref size_t, ref SymbolOrError) ApplyCallback;
/*
* Passed to syminfoCallback, pcinfoCallback and pcinfoErrorCallback
*/
struct SymbolCallbackInfo
{
bool noInfo = false; // True if debug info / symbol table is not available
size_t num = 0; // Counter for opApply
int retval; // Value returned by applyCB
backtrace_state* state;
// info.fileName / funcName / errmsg may become invalid after this delegate returned
ApplyCallback applyCB;
void reset()
{
noInfo = false;
num = 0;
}
}
/*
* Passed to the syminfoCallback2 callback. That function merges it's
* funcName with this information and updates base as all other callbacks do.
*/
struct SymbolCallbackInfo2
{
SymbolCallbackInfo* base;
const(char)* filename;
int lineno;
}
/*
* Contains a valid symbol or an error message if errnum is != 0.
*/
struct SymbolOrError
{
int errnum; // == 0: No error
union
{
SymbolInfo symbol;
const(char)* msg;
}
}
// FIXME: state is never freed as libbacktrace doesn't provide a free function...
public class LibBacktrace : Throwable.TraceInfo
{
static void initLibBacktrace()
{
if (!initialized)
{
state = backtrace_create_state(null, false, &simpleErrorCallback, null);
initialized = true;
}
}
this(int firstFrame)
{
_firstFrame = firstFrame;
initLibBacktrace();
if (state)
{
backtrace_simple(state, _firstFrame, &simpleCallback,
&simpleErrorCallback, cast(void*)this);
}
}
override int opApply(scope int delegate(ref const(char[])) dg) const
{
return opApply(
(ref size_t, ref const(char[]) buf)
{
return dg(buf);
}
);
}
override int opApply(scope int delegate(ref size_t, ref const(char[])) dg) const
{
return opApply(
(ref size_t i, ref SymbolOrError sym)
{
char[MAX_BUFSIZE] buffer = void;
char[] msg;
if (sym.errnum != 0)
{
auto retval = snprintf(buffer.ptr, buffer.length,
"libbacktrace error: '%s' errno: %d", sym.msg, sym.errnum);
if (retval >= buffer.length)
retval = buffer.length - 1; // Ignore zero terminator
if (retval > 0)
msg = buffer[0 .. retval];
return dg(i, msg);
}
else
{
msg = formatLine(sym.symbol, buffer);
int ret = dg(i, msg);
if (!ret && sym.symbol.funcName && strcmp(sym.symbol.funcName, "_Dmain") == 0)
return 1;
return ret;
}
}
);
}
int opApply(scope ApplyCallback dg) const
{
initLibBacktrace();
// If backtrace_simple produced an error report it and exit
if (!state || error != 0)
{
size_t pos = 0;
SymbolOrError symError;
if (!state)
{
symError.msg = "libbacktrace failed to initialize\0";
symError.errnum = 1;
}
else
{
symError.errnum = error;
symError.msg = errorBuf.ptr;
}
return dg(pos, symError);
}
SymbolCallbackInfo cinfo;
cinfo.applyCB = dg;
cinfo.state = cast(backtrace_state*)state;
// Try using debug info first
foreach (i, pc; pcs[0 .. numPCs])
{
// FIXME: We may violate const guarantees here...
if (backtrace_pcinfo(cast(backtrace_state*)state, pc, &pcinfoCallback,
&pcinfoErrorCallback, &cinfo) != 0)
{
break; // User delegate requested abort or no debug info at all
}
}
// If no error or other error which has already been reported via callback
if (!cinfo.noInfo)
return cinfo.retval;
// Try using symbol table
cinfo.reset();
foreach (pc; pcs[0 .. numPCs])
{
if (backtrace_syminfo(cast(backtrace_state*)state, pc, &syminfoCallback,
&pcinfoErrorCallback, &cinfo) == 0)
{
break;
}
}
if (!cinfo.noInfo)
return cinfo.retval;
// No symbol table
foreach (i, pc; pcs[0 .. numPCs])
{
auto sym = SymbolOrError(0, SymbolInfo(null, null, 0, cast(void*)pc));
if (auto ret = dg(i, sym) != 0)
return ret;
}
return 0;
}
override string toString() const
{
string buf;
foreach (i, const(char[]) line; this)
buf ~= i ? "\n" ~ line : line;
return buf;
}
private:
static backtrace_state* state = null;
static bool initialized = false;
size_t numPCs = 0;
uintptr_t[MAXFRAMES] pcs;
int error = 0;
int _firstFrame = 0;
char[128] errorBuf = "\0";
}
}
else
{
/*
* Our fallback backtrace implementation using libgcc's unwind
* and backtrace support. In theory libbacktrace should be available
* everywhere where this code works. We keep it anyway till libbacktrace
* is well-tested.
*/
public class UnwindBacktrace : Throwable.TraceInfo
{
this(int firstFrame)
{
_firstFrame = firstFrame;
_callstack = getBacktrace();
_framelist = getBacktraceSymbols(_callstack);
}
override int opApply(scope int delegate(ref const(char[])) dg) const
{
return opApply(
(ref size_t, ref const(char[]) buf)
{
return dg(buf);
}
);
}
override int opApply(scope int delegate(ref size_t, ref const(char[])) dg) const
{
char[MAX_BUFSIZE] buffer = void;
int ret = 0;
for (int i = _firstFrame; i < _framelist.entries; ++i)
{
auto pos = cast(size_t)(i - _firstFrame);
auto msg = formatLine(_framelist.symbols[i], buffer);
ret = dg(pos, msg);
if (ret)
break;
}
return ret;
}
override string toString() const
{
string buf;
foreach (i, line; this)
buf ~= i ? "\n" ~ line : line;
return buf;
}
private:
BTSymbolData _framelist;
UnwindBacktraceData _callstack;
int _firstFrame = 0;
}
// Implementation details
private:
import gcc.unwind;
version (linux)
import core.sys.linux.dlfcn;
else version (OSX)
import core.sys.darwin.dlfcn;
else version (FreeBSD)
import core.sys.freebsd.dlfcn;
else version (NetBSD)
import core.sys.netbsd.dlfcn;
else version (OpenBSD)
import core.sys.openbsd.dlfcn;
else version (Solaris)
import core.sys.solaris.dlfcn;
else version (Posix)
import core.sys.posix.dlfcn;
private enum MAXFRAMES = 128;
struct UnwindBacktraceData
{
void*[MAXFRAMES] callstack;
int numframes = 0;
}
struct BTSymbolData
{
size_t entries;
SymbolInfo[MAXFRAMES] symbols;
}
static extern (C) _Unwind_Reason_Code unwindCB(_Unwind_Context *ctx, void *d)
{
UnwindBacktraceData* bt = cast(UnwindBacktraceData*)d;
if (bt.numframes >= MAXFRAMES)
return _URC_NO_REASON;
bt.callstack[bt.numframes] = cast(void*)_Unwind_GetIP(ctx);
bt.numframes++;
return _URC_NO_REASON;
}
UnwindBacktraceData getBacktrace()
{
UnwindBacktraceData stackframe;
_Unwind_Backtrace(&unwindCB, &stackframe);
return stackframe;
}
BTSymbolData getBacktraceSymbols(UnwindBacktraceData data)
{
BTSymbolData symData;
for (auto i = 0; i < data.numframes; i++)
{
static if ( __traits(compiles, Dl_info))
{
Dl_info funcInfo;
if (data.callstack[i] !is null && dladdr(data.callstack[i], &funcInfo) != 0)
{
symData.symbols[symData.entries].funcName = funcInfo.dli_sname;
symData.symbols[symData.entries].address = data.callstack[i];
symData.entries++;
}
else
{
symData.symbols[symData.entries].address = data.callstack[i];
symData.entries++;
}
}
else
{
symData.symbols[symData.entries].address = data.callstack[i];
symData.entries++;
}
}
return symData;
}
}
/*
* Struct representing a symbol (function) in the backtrace
*/
struct SymbolInfo
{
const(char)* funcName, fileName;
size_t line;
const(void)* address;
}
/*
* Format one output line for symbol sym.
* Returns a slice of buffer.
*/
char[] formatLine(const SymbolInfo sym, return ref char[MAX_BUFSIZE] buffer)
{
import core.demangle, core.stdc.config;
import core.stdc.stdio : snprintf, printf;
import core.stdc.string : strlen;
size_t bufferLength = 0;
void appendToBuffer(Args...)(const(char)* format, Args args)
{
const count = snprintf(buffer.ptr + bufferLength,
buffer.length - bufferLength,
format, args);
assert(count >= 0);
bufferLength += count;
if (bufferLength >= buffer.length)
bufferLength = buffer.length - 1;
}
if (sym.fileName is null)
appendToBuffer("??:? ");
else
appendToBuffer("%s:%d ", sym.fileName, sym.line);
if (sym.funcName is null)
appendToBuffer("???");
else
{
char[1024] symbol = void;
auto demangled = demangle(sym.funcName[0 .. strlen(sym.funcName)], symbol);
if (demangled.length > 0)
appendToBuffer("%.*s ", cast(int) demangled.length, demangled.ptr);
}
version (D_LP64)
appendToBuffer("[0x%llx]", cast(size_t)sym.address);
else
appendToBuffer("[0x%x]", cast(size_t)sym.address);
return buffer[0 .. bufferLength];
}
unittest
{
char[MAX_BUFSIZE] sbuf = '\0';
char[] result;
string longString;
for (size_t i = 0; i < 60; i++)
longString ~= "abcdefghij";
longString ~= '\0';
auto symbol = SymbolInfo(null, null, 0, null);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo(longString.ptr, null, 0, null);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo("func", "test.d", 0, null);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo("func", longString.ptr, 0, null);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo(longString.ptr, "test.d", 0, null);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo(longString.ptr, longString.ptr, 0, null);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo("func", "test.d", 1000, null);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo(null, (longString[0..500] ~ '\0').ptr, 100000000, null);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo("func", "test.d", 0, cast(void*)0x100000);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo("func", null, 0, cast(void*)0x100000);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo(null, "test.d", 0, cast(void*)0x100000);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
symbol = SymbolInfo(longString.ptr, "test.d", 0, cast(void*)0x100000);
result = formatLine(symbol, sbuf);
assert(result.length < MAX_BUFSIZE && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0');
}
|
D
|
/**
* Implements LSDA (Language Specific Data Area) table generation
* for Dwarf Exception Handling.
*
* Copyright: Copyright (C) 2015-2023 by The D Language Foundation, All Rights Reserved
* Authors: Walter Bright, https://www.digitalmars.com
* 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/backend/dwarfeh.d, backend/dwarfeh.d)
*/
module dmd.backend.dwarfeh;
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.code;
import dmd.backend.code_x86;
import dmd.backend.barray : Barray;
import dmd.backend.dwarf;
import dmd.backend.dwarf2;
import dmd.common.outbuffer;
extern (C++):
nothrow:
struct DwEhTableEntry
{
uint start;
uint end; // 1 past end
uint lpad; // landing pad
uint action; // index into Action Table
block *bcatch; // catch block data
int prev; // index to enclosing entry (-1 for none)
}
alias DwEhTable = Barray!DwEhTableEntry;
package __gshared DwEhTable dwehtable;
/****************************
* Generate .gcc_except_table, aka LS
* Params:
* sfunc = function to generate table for
* seg = .gcc_except_table segment
* et = buffer to insert table into
* scancode = true if there are destructors in the code (i.e. usednteh & EHcleanup)
* startoffset = size of function prolog
* retoffset = offset from start of function to epilog
*/
void genDwarfEh(Funcsym *sfunc, int seg, OutBuffer *et, bool scancode, uint startoffset, uint retoffset, ref DwEhTable deh)
{
/* LPstart = encoding of LPbase
* LPbase = landing pad base (normally omitted)
* TType = encoding of TTbase
* TTbase = offset from next byte to past end of Type Table
* CallSiteFormat = encoding of fields in Call Site Table
* CallSiteTableSize = size in bytes of Call Site Table
* Call Site Table[]:
* CallSiteStart
* CallSiteRange
* LandingPad
* ActionRecordPtr
* Action Table
* TypeFilter
* NextRecordPtr
* Type Table
*/
et.reserve(100);
block *startblock = sfunc.Sfunc.Fstartblock;
//printf("genDwarfEh: func = %s, offset = x%x, startblock.Boffset = x%x, scancode = %d startoffset=x%x, retoffset=x%x\n",
//sfunc.Sident.ptr, cast(int)sfunc.Soffset, cast(int)startblock.Boffset, scancode, startoffset, retoffset);
static if (0)
{
WRfunc("genDwarfEH()", funcsym_p, startblock);
printf("-------------------------\n");
}
uint startsize = cast(uint)et.length();
assert((startsize & 3) == 0); // should be aligned
deh.reset();
OutBuffer atbuf;
OutBuffer cstbuf;
/* Build deh table, and Action Table
*/
int index = -1;
block *bprev = null;
// The first entry encompasses the entire function
{
uint i = cast(uint) deh.length;
DwEhTableEntry *d = deh.push();
d.start = cast(uint)(startblock.Boffset + startoffset);
d.end = cast(uint)(startblock.Boffset + retoffset);
d.lpad = 0; // no cleanup, no catches
index = i;
}
for (block *b = startblock; b; b = b.Bnext)
{
if (index > 0 && b.Btry == bprev)
{
DwEhTableEntry *d = &deh[index];
d.end = cast(uint)b.Boffset;
index = d.prev;
if (bprev)
bprev = bprev.Btry;
}
if (b.BC == BC_try)
{
uint i = cast(uint) deh.length;
DwEhTableEntry *d = deh.push();
d.start = cast(uint)b.Boffset;
block *bf = b.nthSucc(1);
if (bf.BC == BCjcatch)
{
d.lpad = cast(uint)bf.Boffset;
d.bcatch = bf;
uint *pat = bf.actionTable;
uint length = pat[0];
assert(length);
uint offset = -1;
for (uint u = length; u; --u)
{
/* Buy doing depth-first insertion into the Action Table,
* we can combine common tails.
*/
offset = actionTableInsert(&atbuf, pat[u], offset);
}
d.action = offset + 1;
}
else
d.lpad = cast(uint)bf.nthSucc(0).Boffset;
d.prev = index;
index = i;
bprev = b.Btry;
}
if (scancode)
{
uint coffset = cast(uint)b.Boffset;
int n = 0;
for (code *c = b.Bcode; c; c = code_next(c))
{
if (c.Iop == (ESCAPE | ESCdctor))
{
uint i = cast(uint) deh.length;
DwEhTableEntry *d = deh.push();
d.start = coffset;
d.prev = index;
index = i;
++n;
}
if (c.Iop == (ESCAPE | ESCddtor))
{
assert(n > 0);
--n;
DwEhTableEntry *d = &deh[index];
d.end = coffset;
d.lpad = coffset;
index = d.prev;
}
coffset += calccodsize(c);
}
assert(n == 0);
}
}
//printf("deh.dim = %d\n", cast(int)deh.dim);
static if (1)
{
/* Build Call Site Table
* Be sure to not generate empty entries,
* and generate nested ranges reflecting the layout in the code.
*/
assert(deh.length > 0);
uint end = deh[0].start;
foreach (ref DwEhTableEntry d; deh[])
{
if (d.start < d.end)
{
void WRITE(uint v)
{
if (config.objfmt == OBJ_ELF)
cstbuf.writeuLEB128(v);
else
cstbuf.write32(v);
}
uint CallSiteStart = cast(uint)(d.start - startblock.Boffset);
WRITE(CallSiteStart);
uint CallSiteRange = d.end - d.start;
WRITE(CallSiteRange);
uint LandingPad = cast(uint)(d.lpad ? d.lpad - startblock.Boffset : 0);
WRITE(LandingPad);
uint ActionTable = d.action;
cstbuf.writeuLEB128(ActionTable);
//printf("\t%x %x %x %x\n", CallSiteStart, CallSiteRange, LandingPad, ActionTable);
}
}
}
else
{
/* Build Call Site Table
* Be sure to not generate empty entries,
* and generate multiple entries for one DwEhTableEntry if the latter
* is split by nested DwEhTableEntry's. This is based on the (undocumented)
* presumption that there may not
* be overlapping entries in the Call Site Table.
*/
assert(deh.dim);
uint end = deh.index(0).start;
for (uint i = 0; i < deh.dim; ++i)
{
uint j = i;
do
{
DwEhTableEntry *d = deh.index(j);
//printf(" [%d] start=%x end=%x lpad=%x action=%x bcatch=%p prev=%d\n",
// j, d.start, d.end, d.lpad, d.action, d.bcatch, d.prev);
if (d.start <= end && end < d.end)
{
uint start = end;
uint dend = d.end;
if (i + 1 < deh.dim)
{
DwEhTableEntry *dnext = deh.index(i + 1);
if (dnext.start < dend)
dend = dnext.start;
}
if (start < dend)
{
void writeCallSite(void delegate(uint) WRITE)
{
uint CallSiteStart = start - startblock.Boffset;
WRITE(CallSiteStart);
uint CallSiteRange = dend - start;
WRITE(CallSiteRange);
uint LandingPad = d.lpad - startblock.Boffset;
cstbuf.WRITE(LandingPad);
uint ActionTable = d.action;
WRITE(ActionTable);
//printf("\t%x %x %x %x\n", CallSiteStart, CallSiteRange, LandingPad, ActionTable);
}
if (config.objfmt == OBJ_ELF)
writeCallSite((uint a) => cstbuf.writeLEB128(a));
else if (config.objfmt == OBJ_MACH)
writeCallSite((uint a) => cstbuf.write32(a));
else
assert(0);
}
end = dend;
}
} while (j--);
}
}
/* Write LSDT header */
const ubyte LPstart = DW_EH_PE_omit;
et.writeByte(LPstart);
uint LPbase = 0;
if (LPstart != DW_EH_PE_omit)
et.writeuLEB128(LPbase);
const ubyte TType = (config.flags3 & CFG3pic)
? DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4
: DW_EH_PE_absptr | DW_EH_PE_udata4;
et.writeByte(TType);
/* Compute TTbase, which is the sum of:
* 1. CallSiteFormat
* 2. encoding of CallSiteTableSize
* 3. Call Site Table size
* 4. Action Table size
* 5. 4 byte alignment
* 6. Types Table
* Iterate until it converges.
*/
uint TTbase = 1;
uint CallSiteTableSize = cast(uint)cstbuf.length();
uint oldTTbase;
do
{
oldTTbase = TTbase;
uint start = cast(uint)((et.length() - startsize) + uLEB128size(TTbase));
TTbase = cast(uint)(
1 +
uLEB128size(CallSiteTableSize) +
CallSiteTableSize +
atbuf.length());
uint sz = start + TTbase;
TTbase += -sz & 3; // align to 4
TTbase += sfunc.Sfunc.typesTable.length * 4;
} while (TTbase != oldTTbase);
if (TType != DW_EH_PE_omit)
et.writeuLEB128(TTbase);
uint TToffset = cast(uint)(TTbase + et.length() - startsize);
ubyte CallSiteFormat = 0;
if (config.objfmt == OBJ_ELF)
CallSiteFormat = DW_EH_PE_absptr | DW_EH_PE_uleb128;
else if (config.objfmt == OBJ_MACH)
CallSiteFormat = DW_EH_PE_absptr | DW_EH_PE_udata4;
et.writeByte(CallSiteFormat);
et.writeuLEB128(CallSiteTableSize);
/* Insert Call Site Table */
et.write(cstbuf[]);
/* Insert Action Table */
et.write(atbuf[]);
/* Align to 4 */
for (uint n = (-et.length() & 3); n; --n)
et.writeByte(0);
/* Write out Types Table in reverse */
auto typesTable = sfunc.Sfunc.typesTable[];
for (int i = cast(int)typesTable.length; i--; )
{
Symbol *s = typesTable[i];
/* MACHOBJ 64: pcrel 1 length 1 extern 1 RELOC_GOT
* 32: [0] address x004c pcrel 0 length 2 value x224 type 4 RELOC_LOCAL_SECTDIFF
* [1] address x0000 pcrel 0 length 2 value x160 type 1 RELOC_PAIR
*/
if (config.objfmt == OBJ_ELF)
elf_dwarf_reftoident(seg, et.length(), s, 0);
else if (config.objfmt == OBJ_MACH)
mach_dwarf_reftoident(seg, et.length(), s, 0);
}
assert(TToffset == et.length() - startsize);
}
/****************************
* Insert action (ttindex, offset) in Action Table
* if it is not already there.
* Params:
* atbuf = Action Table
* ttindex = Types Table index (1..)
* offset = offset of next action, -1 for none
* Returns:
* offset of inserted action
*/
int actionTableInsert(OutBuffer *atbuf, int ttindex, int nextoffset)
{
//printf("actionTableInsert(%d, %d)\n", ttindex, nextoffset);
auto p = cast(const(ubyte)[]) (*atbuf)[];
while (p.length)
{
int offset = cast(int) (atbuf.length - p.length);
int TypeFilter = sLEB128(p);
int nrpoffset = cast(int) (atbuf.length - p.length);
int NextRecordPtr = sLEB128(p);
if (ttindex == TypeFilter &&
nextoffset == nrpoffset + NextRecordPtr)
return offset;
}
int offset = cast(int)atbuf.length();
atbuf.writesLEB128(ttindex);
if (nextoffset == -1)
nextoffset = 0;
else
nextoffset -= atbuf.length();
atbuf.writesLEB128(nextoffset);
return offset;
}
@("action table insert") unittest
{
OutBuffer atbuf;
static immutable int[3] tt1 = [ 1,2,3 ];
static immutable int[1] tt2 = [ 2 ];
int offset = -1;
for (size_t i = tt1.length; i--; )
{
offset = actionTableInsert(&atbuf, tt1[i], offset);
}
offset = -1;
for (size_t i = tt2.length; i--; )
{
offset = actionTableInsert(&atbuf, tt2[i], offset);
}
static immutable ubyte[8] result = [ 3,0,2,0x7D,1,0x7D,2,0 ];
//for (int i = 0; i < atbuf.length(); ++i) printf(" %02x\n", atbuf.buf[i]);
assert(result.sizeof == atbuf.length());
int r = memcmp(result.ptr, atbuf.buf, atbuf.length());
assert(r == 0);
}
/**
* Consumes and decode an unsigned LEB128.
*
* Params:
* data = reference to a slice holding the LEB128 to decode.
* When this function return, the slice will point past the LEB128.
*
* Returns:
* decoded value
*
* See_Also:
* https://en.wikipedia.org/wiki/LEB128
*/
private extern(D) uint uLEB128(ref const(ubyte)[] data)
{
const(ubyte)* q = data.ptr;
uint result = 0;
uint shift = 0;
while (1)
{
ubyte byte_ = *q++;
result |= (byte_ & 0x7F) << shift;
if ((byte_ & 0x80) == 0)
break;
shift += 7;
}
data = data[q - data.ptr .. $];
return result;
}
/**
* Consumes and decode a signed LEB128.
*
* Params:
* data = reference to a slice holding the LEB128 to decode.
* When this function return, the slice will point past the LEB128.
*
* Returns:
* decoded value
*
* See_Also:
* https://en.wikipedia.org/wiki/LEB128
*/
private extern(D) int sLEB128(ref const(ubyte)[] data)
{
const(ubyte)* q = data.ptr;
ubyte byte_;
int result = 0;
uint shift = 0;
while (1)
{
byte_ = *q++;
result |= (byte_ & 0x7F) << shift;
shift += 7;
if ((byte_ & 0x80) == 0)
break;
}
if (shift < result.sizeof * 8 && (byte_ & 0x40))
result |= -(1 << shift);
data = data[q - data.ptr .. $];
return result;
}
/******************************
* Determine size of Signed LEB128 encoded value.
* Params:
* value = value to be encoded
* Returns:
* length of decoded value
* See_Also:
* https://en.wikipedia.org/wiki/LEB128
*/
uint sLEB128size(int value)
{
uint size = 0;
while (1)
{
++size;
ubyte b = value & 0x40;
value >>= 7; // arithmetic right shift
if (value == 0 && !b ||
value == -1 && b)
{
break;
}
}
return size;
}
/******************************
* Determine size of Unsigned LEB128 encoded value.
* Params:
* value = value to be encoded
* Returns:
* length of decoded value
* See_Also:
* https://en.wikipedia.org/wiki/LEB128
*/
uint uLEB128size(uint value)
{
uint size = 1;
while ((value >>= 7) != 0)
++size;
return size;
}
@("LEB128") unittest
{
OutBuffer buf;
static immutable int[16] values =
[
0, 1, 2, 3, 300, 4000, 50_000, 600_000,
-0, -1, -2, -3, -300, -4000, -50_000, -600_000,
];
foreach (i; 0..values.length)
{
const int value = values[i];
buf.reset();
buf.writeuLEB128(value);
assert(buf.length() == uLEB128size(value));
auto p = cast(const(ubyte)[]) buf[];
int result = uLEB128(p);
assert(!p.length);
assert(result == value);
buf.reset();
buf.writesLEB128(value);
assert(buf.length() == sLEB128size(value));
p = cast(const(ubyte)[]) buf[];
result = sLEB128(p);
assert(!p.length);
assert(result == value);
}
}
|
D
|
# FIXED
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/dma/UDMACC26XX.c
Drivers/UDMA/UDMACC26XX.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stdint.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/std.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stdarg.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stddef.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/std.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/M3.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/targets/std.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/xdc.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types__prologue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/package.defs.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types__epilogue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert__prologue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Main.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IHeap.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error__prologue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Main.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error__epilogue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Memory.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IHeap.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/Memory_HeapProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IHeap.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/Main_Module_GateProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags__prologue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Main.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags__epilogue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert__epilogue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log__prologue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Main.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Text.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log__epilogue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/System.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/ISystemSupport.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/System_SupportProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/ISystemSupport.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/System_Module_GateProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/System_SupportProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/System_Module_GateProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/Hwi.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/Hwi__prologue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/package/package.defs.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/BIOS.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/BIOS__prologue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/package/package.defs.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/package/BIOS_RtsGateProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/BIOS__epilogue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/interfaces/IHwi.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/interfaces/package/package.defs.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/Hwi__epilogue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/dma/UDMACC26XX.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stdbool.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/udma.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_chip_def.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_ints.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_memmap.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_udma.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/debug.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/interrupt.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_nvic.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/cpu.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_cpu_scs.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/rom.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/Power.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/utils/List.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stddef.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/power/PowerCC26XX.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/Hwi.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/Clock.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/package/package.defs.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/interfaces/ITimer.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/Queue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/Swi.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/Queue.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/package/Clock_TimerProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/interfaces/ITimer.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/package/Clock_TimerProxy.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/prcm.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_prcm.h
Drivers/UDMA/UDMACC26XX.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_aon_rtc.h
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/dma/UDMACC26XX.c:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stdint.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/std.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stdarg.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stddef.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/std.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/M3.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/targets/std.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/xdc.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types__prologue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/package.defs.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types__epilogue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert__prologue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Main.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IHeap.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error__prologue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Main.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error__epilogue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Memory.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IHeap.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/Memory_HeapProxy.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IHeap.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/Main_Module_GateProxy.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags__prologue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Main.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags__epilogue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert__epilogue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log__prologue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Main.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Text.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log__epilogue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/System.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/ISystemSupport.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/System_SupportProxy.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/ISystemSupport.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/System_Module_GateProxy.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/System_SupportProxy.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/package/System_Module_GateProxy.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/Hwi.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/Hwi__prologue.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/package/package.defs.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/BIOS.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/BIOS__prologue.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/package/package.defs.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/package/BIOS_RtsGateProxy.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IGateProvider.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/BIOS__epilogue.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/interfaces/IHwi.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/interfaces/package/package.defs.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/Hwi__epilogue.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/dma/UDMACC26XX.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stdbool.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/udma.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_types.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_chip_def.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_ints.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_memmap.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_udma.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/debug.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/interrupt.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_nvic.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/cpu.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_cpu_scs.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/rom.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/Power.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/utils/List.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.3.LTS/include/stddef.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages/ti/drivers/power/PowerCC26XX.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/family/arm/m3/Hwi.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/Clock.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/package/package.defs.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/interfaces/ITimer.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/Queue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/Swi.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Error.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Assert.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Diags.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Log.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/Queue.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IModule.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/package/Clock_TimerProxy.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/Types.h:
C:/ti/xdctools_3_32_00_06_core/packages/xdc/runtime/IInstance.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/interfaces/ITimer.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/bios_6_46_01_38/packages/ti/sysbios/knl/package/Clock_TimerProxy.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/prcm.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_prcm.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_aon_rtc.h:
|
D
|
// This file is generated from text files from GLEW.
// See copyright in src/lib/gl/gl.d (BSD/MIT like).
module lib.gl.ext.exttexturearray;
import lib.gl.types;
import lib.gl.ext.extgeometryshader4;
bool GL_EXT_texture_array;
const GL_TEXTURE_1D_ARRAY_EXT = 0x8C18;
const GL_TEXTURE_2D_ARRAY_EXT = 0x8C1A;
const GL_PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B;
const GL_PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19;
const GL_TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C;
const GL_TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D;
const GL_MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF;
const GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E;
const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4;
const GL_SAMPLER_1D_ARRAY_EXT = 0x8DC0;
const GL_SAMPLER_2D_ARRAY_EXT = 0x8DC1;
const GL_SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3;
const GL_SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4;
extern (System):
// Collides with GL_EXT_geometry_shader4
// void function(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) glFramebufferTextureLayerEXT;
|
D
|
module gametextq;
import base;
//struct GameText {
// string _text;
/+
void displayGameText(in string text) {
g_letterBase.setText(text);
g_letterBase.draw();
}
+/
//}
|
D
|
// Compiler implementation of the D programming language
// Copyright (c) 1999-2015 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
module ddmd.declaration;
import core.stdc.stdio;
import ddmd.aggregate;
import ddmd.arraytypes;
import ddmd.attrib;
import ddmd.cppmangle;
import ddmd.ctfeexpr;
import ddmd.dcast;
import ddmd.dclass;
import ddmd.declaration;
import ddmd.delegatize;
import ddmd.dinterpret;
import ddmd.dmangle;
import ddmd.doc;
import ddmd.dscope;
import ddmd.dstruct;
import ddmd.dsymbol;
import ddmd.dtemplate;
import ddmd.errors;
import ddmd.expression;
import ddmd.func;
import ddmd.globals;
import ddmd.hdrgen;
import ddmd.id;
import ddmd.identifier;
import ddmd.init;
import ddmd.inline;
import ddmd.intrange;
import ddmd.mtype;
import ddmd.opover;
import ddmd.root.outbuffer;
import ddmd.root.rootobject;
import ddmd.statement;
import ddmd.target;
import ddmd.tokens;
import ddmd.visitor;
/************************************
* Check to see the aggregate type is nested and its context pointer is
* accessible from the current scope.
* Returns true if error occurs.
*/
extern (C++) bool checkFrameAccess(Loc loc, Scope* sc, AggregateDeclaration ad, size_t iStart = 0)
{
Dsymbol sparent = ad.toParent2();
Dsymbol s = sc.func;
if (ad.isNested() && s)
{
//printf("ad = %p %s [%s], parent:%p\n", ad, ad.toChars(), ad.loc.toChars(), ad.parent);
//printf("sparent = %p %s [%s], parent: %s\n", sparent, sparent.toChars(), sparent.loc.toChars(), sparent.parent,toChars());
if (checkNestedRef(s, sparent))
{
error(loc, "cannot access frame pointer of %s", ad.toPrettyChars());
return true;
}
}
bool result = false;
for (size_t i = iStart; i < ad.fields.dim; i++)
{
VarDeclaration vd = ad.fields[i];
Type tb = vd.type.baseElemOf();
if (tb.ty == Tstruct)
{
result |= checkFrameAccess(loc, sc, (cast(TypeStruct)tb).sym);
}
}
return result;
}
/******************************************
*/
extern (C++) void ObjectNotFound(Identifier id)
{
Type.error(Loc(), "%s not found. object.d may be incorrectly installed or corrupt.", id.toChars());
fatal();
}
enum STCundefined = 0L;
enum STCstatic = (1L << 0);
enum STCextern = (1L << 1);
enum STCconst = (1L << 2);
enum STCfinal = (1L << 3);
enum STCabstract = (1L << 4);
enum STCparameter = (1L << 5);
enum STCfield = (1L << 6);
enum STCoverride = (1L << 7);
enum STCauto = (1L << 8);
enum STCsynchronized = (1L << 9);
enum STCdeprecated = (1L << 10);
enum STCin = (1L << 11); // in parameter
enum STCout = (1L << 12); // out parameter
enum STClazy = (1L << 13); // lazy parameter
enum STCforeach = (1L << 14); // variable for foreach loop
// (1L << 15)
enum STCvariadic = (1L << 16); // variadic function argument
enum STCctorinit = (1L << 17); // can only be set inside constructor
enum STCtemplateparameter = (1L << 18); // template parameter
enum STCscope = (1L << 19);
enum STCimmutable = (1L << 20);
enum STCref = (1L << 21);
enum STCinit = (1L << 22); // has explicit initializer
enum STCmanifest = (1L << 23); // manifest constant
enum STCnodtor = (1L << 24); // don't run destructor
enum STCnothrow = (1L << 25); // never throws exceptions
enum STCpure = (1L << 26); // pure function
enum STCtls = (1L << 27); // thread local
enum STCalias = (1L << 28); // alias parameter
enum STCshared = (1L << 29); // accessible from multiple threads
enum STCgshared = (1L << 30); // accessible from multiple threads, but not typed as "shared"
enum STCwild = (1L << 31); // for "wild" type constructor
enum STCproperty = (1L << 32);
enum STCsafe = (1L << 33);
enum STCtrusted = (1L << 34);
enum STCsystem = (1L << 35);
enum STCctfe = (1L << 36); // can be used in CTFE, even if it is static
enum STCdisable = (1L << 37); // for functions that are not callable
enum STCresult = (1L << 38); // for result variables passed to out contracts
enum STCnodefaultctor = (1L << 39); // must be set inside constructor
enum STCtemp = (1L << 40); // temporary variable
enum STCrvalue = (1L << 41); // force rvalue for variables
enum STCnogc = (1L << 42); // @nogc
enum STCvolatile = (1L << 43); // destined for volatile in the back end
enum STCreturn = (1L << 44); // 'return ref' for function parameters
enum STCautoref = (1L << 45); // Mark for the already deduced 'auto ref' parameter
enum STCinference = (1L << 46); // do attribute inference
enum STC_TYPECTOR = (STCconst | STCimmutable | STCshared | STCwild);
enum STC_FUNCATTR = (STCref | STCnothrow | STCnogc | STCpure | STCproperty | STCsafe | STCtrusted | STCsystem);
extern (C++) __gshared const(StorageClass) STCStorageClass =
(STCauto | STCscope | STCstatic | STCextern | STCconst | STCfinal | STCabstract | STCsynchronized | STCdeprecated | STCoverride | STClazy | STCalias | STCout | STCin | STCmanifest | STCimmutable | STCshared | STCwild | STCnothrow | STCnogc | STCpure | STCref | STCtls | STCgshared | STCproperty | STCsafe | STCtrusted | STCsystem | STCdisable);
struct Match
{
int count; // number of matches found
MATCH last; // match level of lastf
FuncDeclaration lastf; // last matching function we found
FuncDeclaration nextf; // current matching function
FuncDeclaration anyf; // pick a func, any func, to use for error recovery
}
enum Semantic : int
{
SemanticStart, // semantic has not been run
SemanticIn, // semantic() is in progress
SemanticDone, // semantic() has been run
Semantic2Done, // semantic2() has been run
}
alias SemanticStart = Semantic.SemanticStart;
alias SemanticIn = Semantic.SemanticIn;
alias SemanticDone = Semantic.SemanticDone;
alias Semantic2Done = Semantic.Semantic2Done;
/***********************************************************
*/
extern (C++) class Declaration : Dsymbol
{
public:
Type type;
Type originalType; // before semantic analysis
StorageClass storage_class;
Prot protection;
LINK linkage;
int inuse; // used to detect cycles
// overridden symbol with pragma(mangle, "...")
const(char)* mangleOverride;
Semantic sem;
final extern (D) this(Identifier id)
{
super(id);
storage_class = STCundefined;
protection = Prot(PROTundefined);
linkage = LINKdefault;
sem = SemanticStart;
}
override void semantic(Scope* sc)
{
}
override const(char)* kind() const
{
return "declaration";
}
override final uint size(Loc loc)
{
assert(type);
return cast(uint)type.size();
}
/*************************************
* Check to see if declaration can be modified in this context (sc).
* Issue error if not.
*/
final int checkModify(Loc loc, Scope* sc, Type t, Expression e1, int flag)
{
VarDeclaration v = isVarDeclaration();
if (v && v.canassign)
return 2;
if (isParameter() || isResult())
{
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (scx.func == parent && (scx.flags & SCOPEcontract))
{
const(char)* s = isParameter() && parent.ident != Id.ensure ? "parameter" : "result";
if (!flag)
error(loc, "cannot modify %s '%s' in contract", s, toChars());
return 2; // do not report type related errors
}
}
}
if (v && (isCtorinit() || isField()))
{
// It's only modifiable if inside the right constructor
if ((storage_class & (STCforeach | STCref)) == (STCforeach | STCref))
return 2;
return modifyFieldVar(loc, sc, v, e1) ? 2 : 1;
}
return 1;
}
override final Dsymbol search(Loc loc, Identifier ident, int flags = SearchLocalsOnly)
{
Dsymbol s = Dsymbol.search(loc, ident, flags);
if (!s && type)
{
s = type.toDsymbol(_scope);
if (s)
s = s.search(loc, ident, flags);
}
return s;
}
final bool isStatic()
{
return (storage_class & STCstatic) != 0;
}
bool isDelete()
{
return false;
}
bool isDataseg()
{
return false;
}
bool isThreadlocal()
{
return false;
}
bool isCodeseg()
{
return false;
}
final bool isCtorinit()
{
return (storage_class & STCctorinit) != 0;
}
final bool isFinal()
{
return (storage_class & STCfinal) != 0;
}
final bool isAbstract()
{
return (storage_class & STCabstract) != 0;
}
final bool isConst()
{
return (storage_class & STCconst) != 0;
}
final bool isImmutable()
{
return (storage_class & STCimmutable) != 0;
}
final bool isWild()
{
return (storage_class & STCwild) != 0;
}
final bool isAuto()
{
return (storage_class & STCauto) != 0;
}
final bool isScope()
{
return (storage_class & STCscope) != 0;
}
final bool isSynchronized()
{
return (storage_class & STCsynchronized) != 0;
}
final bool isParameter()
{
return (storage_class & STCparameter) != 0;
}
override final bool isDeprecated()
{
return (storage_class & STCdeprecated) != 0;
}
final bool isOverride()
{
return (storage_class & STCoverride) != 0;
}
final bool isResult()
{
return (storage_class & STCresult) != 0;
}
final bool isField()
{
return (storage_class & STCfield) != 0;
}
final bool isIn()
{
return (storage_class & STCin) != 0;
}
final bool isOut()
{
return (storage_class & STCout) != 0;
}
final bool isRef()
{
return (storage_class & STCref) != 0;
}
override final Prot prot()
{
return protection;
}
override final inout(Declaration) isDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TupleDeclaration : Declaration
{
public:
Objects* objects;
bool isexp; // true: expression tuple
TypeTuple tupletype; // !=null if this is a type tuple
extern (D) this(Loc loc, Identifier id, Objects* objects)
{
super(id);
this.loc = loc;
this.objects = objects;
}
override Dsymbol syntaxCopy(Dsymbol s)
{
assert(0);
}
override const(char)* kind() const
{
return "tuple";
}
override Type getType()
{
/* If this tuple represents a type, return that type
*/
//printf("TupleDeclaration::getType() %s\n", toChars());
if (isexp)
return null;
if (!tupletype)
{
/* It's only a type tuple if all the Object's are types
*/
for (size_t i = 0; i < objects.dim; i++)
{
RootObject o = (*objects)[i];
if (o.dyncast() != DYNCAST_TYPE)
{
//printf("\tnot[%d], %p, %d\n", i, o, o->dyncast());
return null;
}
}
/* We know it's a type tuple, so build the TypeTuple
*/
Types* types = cast(Types*)objects;
auto args = new Parameters();
args.setDim(objects.dim);
OutBuffer buf;
int hasdeco = 1;
for (size_t i = 0; i < types.dim; i++)
{
Type t = (*types)[i];
//printf("type = %s\n", t->toChars());
version (none)
{
buf.printf("_%s_%d", ident.toChars(), i);
char* name = cast(char*)buf.extractData();
auto id = new Identifier(name, TOKidentifier);
auto arg = new Parameter(STCin, t, id, null);
}
else
{
auto arg = new Parameter(0, t, null, null);
}
(*args)[i] = arg;
if (!t.deco)
hasdeco = 0;
}
tupletype = new TypeTuple(args);
if (hasdeco)
return tupletype.semantic(Loc(), null);
}
return tupletype;
}
override Dsymbol toAlias2()
{
//printf("TupleDeclaration::toAlias2() '%s' objects = %s\n", toChars(), objects->toChars());
for (size_t i = 0; i < objects.dim; i++)
{
RootObject o = (*objects)[i];
if (Dsymbol s = isDsymbol(o))
{
s = s.toAlias2();
(*objects)[i] = s;
}
}
return this;
}
override bool needThis()
{
//printf("TupleDeclaration::needThis(%s)\n", toChars());
for (size_t i = 0; i < objects.dim; i++)
{
RootObject o = (*objects)[i];
if (o.dyncast() == DYNCAST_EXPRESSION)
{
Expression e = cast(Expression)o;
if (e.op == TOKdsymbol)
{
DsymbolExp ve = cast(DsymbolExp)e;
Declaration d = ve.s.isDeclaration();
if (d && d.needThis())
{
return true;
}
}
}
}
return false;
}
override inout(TupleDeclaration) isTupleDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class AliasDeclaration : Declaration
{
public:
Dsymbol aliassym;
Dsymbol overnext; // next in overload list
Dsymbol _import; // !=null if unresolved internal alias for selective import
extern (D) this(Loc loc, Identifier id, Type type)
{
super(id);
//printf("AliasDeclaration(id = '%s', type = %p)\n", id->toChars(), type);
//printf("type = '%s'\n", type->toChars());
this.loc = loc;
this.type = type;
assert(type);
}
extern (D) this(Loc loc, Identifier id, Dsymbol s)
{
super(id);
//printf("AliasDeclaration(id = '%s', s = %p)\n", id->toChars(), s);
assert(s != this);
this.loc = loc;
this.aliassym = s;
assert(s);
}
override Dsymbol syntaxCopy(Dsymbol s)
{
//printf("AliasDeclaration::syntaxCopy()\n");
assert(!s);
AliasDeclaration sa = type ? new AliasDeclaration(loc, ident, type.syntaxCopy()) : new AliasDeclaration(loc, ident, aliassym.syntaxCopy(null));
sa.storage_class = storage_class;
return sa;
}
override void semantic(Scope* sc)
{
//printf("AliasDeclaration::semantic() %s\n", toChars());
if (aliassym)
{
auto fd = aliassym.isFuncLiteralDeclaration();
auto td = aliassym.isTemplateDeclaration();
if (fd || td && td.literal)
{
if (fd && fd.semanticRun >= PASSsemanticdone)
return;
Expression e = new FuncExp(loc, aliassym);
e = e.semantic(sc);
if (e.op == TOKfunction)
{
FuncExp fe = cast(FuncExp)e;
aliassym = fe.td ? cast(Dsymbol)fe.td : fe.fd;
}
else
{
aliassym = null;
type = Type.terror;
}
return;
}
if (aliassym.isTemplateInstance())
aliassym.semantic(sc);
return;
}
inuse = 1;
storage_class |= sc.stc & STCdeprecated;
protection = sc.protection;
userAttribDecl = sc.userAttribDecl;
// 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 = 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 (parent && global.gag && !isInstantiated() && !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 = type.toDsymbol(sc);
if (errors != global.errors)
{
s = null;
type = Type.terror;
}
if (s && s == this)
{
error("cannot resolve");
s = null;
type = Type.terror;
}
if (!s || !((s.getType() && type.equals(s.getType())) || s.isEnumMember()))
{
Type t;
Expression e;
Scope* sc2 = sc;
if (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 |= storage_class & (STCref | STCnothrow | STCnogc | STCpure | STCshared | STCdisable);
}
type = type.addSTC(storage_class);
type.resolve(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)
error("cannot alias an expression %s", e.toChars());
t = Type.terror;
}
}
type = t;
}
if (s == this)
{
assert(global.errors);
type = Type.terror;
s = null;
}
if (!s) // it's a type alias
{
//printf("alias %s resolved to type %s\n", toChars(), type.toChars());
type = type.semantic(loc, sc);
aliassym = null;
}
else // it's a symbolic alias
{
//printf("alias %s resolved to %s %s\n", toChars(), s.kind(), s.toChars());
type = null;
aliassym = s;
}
if (global.gag && errors != global.errors)
{
type = oldtype;
aliassym = null;
}
inuse = 0;
semanticRun = PASSsemanticdone;
if (auto sx = overnext)
{
overnext = null;
if (!overloadInsert(sx))
ScopeDsymbol.multiplyDefined(Loc(), sx, this);
}
}
override bool overloadInsert(Dsymbol s)
{
//printf("[%s] AliasDeclaration::overloadInsert('%s') s = %s %s @ [%s]\n",
// loc.toChars(), toChars(), s->kind(), s->toChars(), s->loc.toChars());
/* semantic analysis is already finished, and the aliased entity
* is not overloadable.
*/
if (semanticRun >= PASSsemanticdone)
{
if (type)
return false;
/* When s is added in member scope by static if, mixin("code") or others,
* aliassym is determined already. See the case in: test/compilable/test61.d
*/
auto sa = aliassym.toAlias();
if (auto fd = sa.isFuncDeclaration())
{
aliassym = new FuncAliasDeclaration(ident, fd);
aliassym.parent = parent;
return aliassym.overloadInsert(s);
}
if (auto td = sa.isTemplateDeclaration())
{
aliassym = new OverDeclaration(ident, td);
aliassym.parent = parent;
return aliassym.overloadInsert(s);
}
if (auto od = sa.isOverDeclaration())
{
if (sa.ident != ident || sa.parent != parent)
{
od = new OverDeclaration(ident, od);
od.parent = parent;
aliassym = od;
}
return od.overloadInsert(s);
}
if (auto os = sa.isOverloadSet())
{
if (sa.ident != ident || sa.parent != parent)
{
os = new OverloadSet(ident, os);
os.parent = parent;
aliassym = os;
}
os.push(s);
return true;
}
return false;
}
/* Don't know yet what the aliased symbol is, so assume it can
* be overloaded and check later for correctness.
*/
if (overnext)
return overnext.overloadInsert(s);
if (s is this)
return true;
overnext = s;
return true;
}
override const(char)* kind() const
{
return "alias";
}
override Type getType()
{
if (type)
return type;
return toAlias().getType();
}
override Dsymbol toAlias()
{
//printf("[%s] AliasDeclaration::toAlias('%s', this = %p, aliassym = %p, kind = '%s', inuse = %d)\n",
// loc.toChars(), toChars(), this, aliassym, aliassym ? aliassym.kind() : "", inuse);
assert(this != aliassym);
//static int count; if (++count == 10) *(char*)0=0;
if (inuse == 1 && type && _scope)
{
inuse = 2;
uint olderrors = global.errors;
Dsymbol s = type.toDsymbol(_scope);
//printf("[%s] type = %s, s = %p, this = %p\n", loc.toChars(), type->toChars(), s, this);
if (global.errors != olderrors)
goto Lerr;
if (s)
{
s = s.toAlias();
if (global.errors != olderrors)
goto Lerr;
aliassym = s;
inuse = 0;
}
else
{
Type t = type.semantic(loc, _scope);
if (t.ty == Terror)
goto Lerr;
if (global.errors != olderrors)
goto Lerr;
//printf("t = %s\n", t->toChars());
inuse = 0;
}
}
if (inuse)
{
error("recursive alias declaration");
Lerr:
// Avoid breaking "recursive alias" state during errors gagged
if (global.gag)
return this;
aliassym = new AliasDeclaration(loc, ident, Type.terror);
type = Type.terror;
return aliassym;
}
if (aliassym)
{
// semantic is already done.
// Even if type.deco !is null, "alias T = const int;` needs semantic
// call to take the storage class `const` as type qualifier.
}
else if (_import && _import._scope)
{
/* If this is an internal alias for selective/renamed import,
* resolve it under the correct scope.
*/
_import.semantic(null);
}
else if (_scope)
{
semantic(_scope);
}
inuse = 1;
Dsymbol s = aliassym ? aliassym.toAlias() : this;
inuse = 0;
return s;
}
override Dsymbol toAlias2()
{
if (inuse)
{
error("recursive alias declaration");
return this;
}
inuse = 1;
Dsymbol s = aliassym ? aliassym.toAlias2() : this;
inuse = 0;
return s;
}
override inout(AliasDeclaration) isAliasDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class OverDeclaration : Declaration
{
public:
Dsymbol overnext; // next in overload list
Dsymbol aliassym;
bool hasOverloads;
extern (D) this(Identifier ident, Dsymbol s, bool hasOverloads = true)
{
super(ident);
this.aliassym = s;
this.hasOverloads = hasOverloads;
if (hasOverloads)
{
if (OverDeclaration od = aliassym.isOverDeclaration())
this.hasOverloads = od.hasOverloads;
}
else
{
// for internal use
assert(!aliassym.isOverDeclaration());
}
}
override const(char)* kind() const
{
return "overload alias"; // todo
}
override void semantic(Scope* sc)
{
}
override bool equals(RootObject o)
{
if (this == o)
return true;
Dsymbol s = isDsymbol(o);
if (!s)
return false;
OverDeclaration od1 = this;
if (OverDeclaration od2 = s.isOverDeclaration())
{
return od1.aliassym.equals(od2.aliassym) && od1.hasOverloads == od2.hasOverloads;
}
if (aliassym == s)
{
if (hasOverloads)
return true;
if (FuncDeclaration fd = s.isFuncDeclaration())
{
return fd.isUnique() !is null;
}
if (TemplateDeclaration td = s.isTemplateDeclaration())
{
return td.overnext is null;
}
}
return false;
}
override bool overloadInsert(Dsymbol s)
{
//printf("OverDeclaration::overloadInsert('%s') aliassym = %p, overnext = %p\n", s->toChars(), aliassym, overnext);
if (overnext)
return overnext.overloadInsert(s);
if (s == this)
return true;
overnext = s;
return true;
}
override Dsymbol toAlias()
{
return this;
}
Dsymbol isUnique()
{
if (!hasOverloads)
{
if (aliassym.isFuncDeclaration() ||
aliassym.isTemplateDeclaration())
{
return aliassym;
}
}
Dsymbol result = null;
overloadApply(aliassym, (Dsymbol s)
{
if (result)
{
result = null;
return 1; // ambiguous, done
}
else
{
result = s;
return 0;
}
});
return result;
}
override inout(OverDeclaration) isOverDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) class VarDeclaration : Declaration
{
public:
Initializer _init;
uint offset;
bool noscope; // if scope destruction is disabled
FuncDeclarations nestedrefs; // referenced by these lexically nested functions
bool isargptr; // if parameter that _argptr points to
structalign_t alignment;
bool ctorinit; // it has been initialized in a ctor
// 1: it has been allocated on the stack
// 2: on stack, run destructor anyway
short onstack;
int canassign; // it can be assigned to
bool overlapped; // if it is a field and has overlapping
Dsymbol aliassym; // if redone as alias to another symbol
VarDeclaration lastVar; // Linked list of variables for goto-skips-init detection
// When interpreting, these point to the value (NULL if value not determinable)
// The index of this variable on the CTFE stack, -1 if not allocated
int ctfeAdrOnStack;
// if !=NULL, rundtor is tested at runtime to see
// if the destructor should be run. Used to prevent
// dtor calls on postblitted vars
VarDeclaration rundtor;
Expression edtor; // if !=null, does the destruction of the variable
IntRange* range; // if !=null, the variable is known to be within the range
final extern (D) this(Loc loc, Type type, Identifier id, Initializer _init)
{
super(id);
//printf("VarDeclaration('%s')\n", id->toChars());
assert(id);
debug
{
if (!type && !_init)
{
printf("VarDeclaration('%s')\n", id.toChars());
//*(char*)0=0;
}
}
assert(type || _init);
this.type = type;
this._init = _init;
this.loc = loc;
ctfeAdrOnStack = -1;
}
override Dsymbol syntaxCopy(Dsymbol s)
{
//printf("VarDeclaration::syntaxCopy(%s)\n", toChars());
assert(!s);
auto v = new VarDeclaration(loc, type ? type.syntaxCopy() : null, ident, _init ? _init.syntaxCopy() : null);
v.storage_class = storage_class;
return v;
}
override void semantic(Scope* sc)
{
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 (sem > SemanticStart)
// return;
// sem = SemanticIn;
if (sem >= SemanticDone)
return;
Scope* scx = null;
if (_scope)
{
sc = _scope;
scx = sc;
_scope = null;
}
/* Pick up storage classes from context, but except synchronized,
* override, abstract, and final.
*/
storage_class |= (sc.stc & ~(STCsynchronized | STCoverride | STCabstract | STCfinal));
if (storage_class & STCextern && _init)
error("extern symbols cannot have initializers");
userAttribDecl = sc.userAttribDecl;
AggregateDeclaration ad = isThis();
if (ad)
storage_class |= ad.storage_class & STC_TYPECTOR;
/* If auto type inference, do the inference
*/
int inferred = 0;
if (!type)
{
inuse++;
// Infering the type requires running semantic,
// so mark the scope as ctfe if required
bool needctfe = (storage_class & (STCmanifest | STCstatic)) != 0;
if (needctfe)
sc = sc.startCTFE();
//printf("inferring type for %s with init %s\n", toChars(), init->toChars());
_init = _init.inferType(sc);
type = _init.toExpression().type;
if (needctfe)
sc = sc.endCTFE();
inuse--;
inferred = 1;
/* This is a kludge to support the existing syntax for RAII
* declarations.
*/
storage_class &= ~STCauto;
originalType = type.syntaxCopy();
}
else
{
if (!originalType)
originalType = 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 |= (storage_class & STC_FUNCATTR);
inuse++;
type = type.semantic(loc, sc2);
inuse--;
sc2.pop();
}
//printf(" semantic type = %s\n", type ? type->toChars() : "null");
type.checkDeprecated(loc, sc);
linkage = sc.linkage;
this.parent = sc.parent;
//printf("this = %p, parent = %p, '%s'\n", this, parent, parent->toChars());
protection = sc.protection;
/* If scope's alignment is the default, use the type's alignment,
* otherwise the scope overrrides.
*/
alignment = sc.structalign;
if (alignment == STRUCTALIGN_DEFAULT)
alignment = 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)
type.checkComplexTransition(loc);
// Calculate type size + safety checks
if (sc.func && !sc.intypeof && !isMember())
{
if (storage_class & STCgshared)
{
if (sc.func.setUnsafe())
error("__gshared not allowed in safe functions; use shared");
}
if (_init && _init.isVoidInitializer() && type.hasPointers()) // get type size
{
if (sc.func.setUnsafe())
error("void initializers for pointers not allowed in safe functions");
}
}
Dsymbol parent = toParent();
Type tb = type.toBasetype();
Type tbn = tb.baseElemOf();
if (tb.ty == Tvoid && !(storage_class & STClazy))
{
if (inferred)
{
error("type %s is inferred from initializer %s, and variables cannot be of type void", type.toChars(), _init.toChars());
}
else
error("variables cannot be of type void");
type = Type.terror;
tb = type;
}
if (tb.ty == Tfunction)
{
error("cannot be declared to be a function");
type = Type.terror;
tb = type;
}
if (tb.ty == Tstruct)
{
TypeStruct ts = cast(TypeStruct)tb;
if (!ts.sym.members)
{
error("no definition of struct %s", ts.toChars());
}
}
if ((storage_class & STCauto) && !inferred)
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 = (_init && !_init.isVoidInitializer()) ? _init.toExpression() : null;
if (ie)
ie = ie.semantic(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.semantic(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))
{
Identifier id = Identifier.generateId("__tup");
auto ei = new ExpInitializer(e.loc, e);
auto v = new VarDeclaration(loc, null, id, ei);
v.storage_class = STCtemp | STCctfe | STCref | STCforeach;
auto ve = new VarExp(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.semantic(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(loc, new DeclarationExp(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(_init.loc, iexps);
}
Lnomatch:
if (ie && ie.op == TOKtuple)
{
TupleExp te = cast(TupleExp)ie;
size_t tedim = te.exps.dim;
if (tedim != nelems)
{
.error(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", ident.toChars(), cast(ulong)i);
const(char)* name = buf.extractString();
Identifier id = Identifier.idPool(name);
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 = _init ? _init.syntaxCopy() : null;
auto v = new VarDeclaration(loc, arg.type, id, ti);
v.storage_class |= STCtemp | storage_class;
if (arg.storageClass & STCparameter)
v.storage_class |= arg.storageClass;
//printf("declaring field %s of type %s\n", v->toChars(), v->type->toChars());
v.semantic(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(loc, v);
(*exps)[i] = e;
}
auto v2 = new TupleDeclaration(loc, ident, exps);
v2.parent = this.parent;
v2.isexp = true;
aliassym = v2;
sem = SemanticDone;
return;
}
/* Storage class can modify the type
*/
type = type.addStorageClass(storage_class);
/* Adjust storage class to reflect type
*/
if (type.isConst())
{
storage_class |= STCconst;
if (type.isShared())
storage_class |= STCshared;
}
else if (type.isImmutable())
storage_class |= STCimmutable;
else if (type.isShared())
storage_class |= STCshared;
else if (type.isWild())
storage_class |= STCwild;
if (StorageClass stc = storage_class & (STCsynchronized | STCoverride | STCabstract | STCfinal))
{
if (stc == STCfinal)
error("cannot be final, perhaps you meant const?");
else
{
OutBuffer buf;
stcToBuffer(&buf, stc);
error("cannot be %s", buf.peekString());
}
storage_class &= ~stc; // strip off
}
if (storage_class & (STCstatic | STCextern | STCmanifest | STCtemplateparameter | STCtls | STCgshared | STCctfe))
{
}
else
{
AggregateDeclaration aad = parent.isAggregateDeclaration();
if (aad)
{
if (global.params.vfield && storage_class & (STCconst | STCimmutable) && _init && !_init.isVoidInitializer())
{
const(char)* p = loc.toChars();
const(char)* s = (storage_class & STCimmutable) ? "immutable" : "const";
fprintf(global.stdmsg, "%s: %s.%s is %s field\n", p ? p : "", ad.toPrettyChars(), toChars(), s);
}
storage_class |= STCfield;
if (tbn.ty == Tstruct && (cast(TypeStruct)tbn).sym.noDefaultCtor)
{
if (!isThisDeclaration() && !_init)
aad.noDefaultCtor = true;
}
}
InterfaceDeclaration id = parent.isInterfaceDeclaration();
if (id)
{
error("field not allowed in interface");
}
else if (aad && aad.sizeok == SIZEOKdone)
{
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 && storage_class != STCundefined)
{
error("cannot use template to add field to aggregate '%s'", ad2.toChars());
}
}
}
if ((storage_class & (STCref | STCparameter | STCforeach)) == STCref && ident != Id.This)
{
error("only parameters or foreach declarations can be ref");
}
if (type.hasWild())
{
if (storage_class & (STCstatic | STCextern | STCtls | STCgshared | STCmanifest | STCfield) || isDataseg())
{
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)
{
error("inout variables can only be declared inside inout functions");
}
}
}
if (!(storage_class & (STCctfe | STCref | STCresult)) && tbn.ty == Tstruct && (cast(TypeStruct)tbn).sym.noDefaultCtor)
{
if (!_init)
{
if (isField())
{
/* For fields, we'll check the constructor later to make sure it is initialized
*/
storage_class |= STCnodefaultctor;
}
else if (storage_class & STCparameter)
{
}
else
error("default construction is disabled for type %s", type.toChars());
}
}
FuncDeclaration fd = parent.isFuncDeclaration();
if (type.isscope() && !noscope)
{
if (storage_class & (STCfield | STCout | STCref | STCstatic | STCmanifest | STCtls | STCgshared) || !fd)
{
error("globals, statics, fields, manifest constants, ref and out parameters cannot be scope");
}
if (!(storage_class & STCscope))
{
if (!(storage_class & STCparameter) && ident != Id.withSym)
error("reference to scope class must be scope");
}
}
if (!_init && !fd)
{
// If not mutable, initializable by constructor only
storage_class |= STCctorinit;
}
if (_init)
storage_class |= STCinit; // remember we had an explicit initializer
else if (storage_class & STCmanifest)
error("manifest constants must have initializers");
bool isBlit = false;
if (!_init &&
!sc.inunion &&
!(storage_class & (STCstatic | STCgshared | STCextern)) &&
fd &&
(!(storage_class & (STCfield | STCin | STCforeach | STCparameter | STCresult)) ||
(storage_class & STCout)) &&
type.size() != 0)
{
// Provide a default initializer
//printf("Providing default initializer for '%s'\n", toChars());
Type tv = 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(loc, sc, (cast(TypeStruct)tbn).sym);
Expression e = tv.defaultInitLiteral(loc);
e = new BlitExp(loc, new VarExp(loc, this), e);
e = e.semantic(sc);
_init = new ExpInitializer(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(loc, 0, Type.tint32);
e = new BlitExp(loc, new VarExp(loc, this), e);
e.type = type; // don't type check this, it would fail
_init = new ExpInitializer(loc, e);
goto Ldtor;
}
if (type.baseElemOf().ty == Tvoid)
{
error("%s does not have a default initializer", type.toChars());
}
else if (auto e = type.defaultInit(loc))
{
_init = new ExpInitializer(loc, e);
}
// Default initializer is always a blit
isBlit = true;
}
if (_init)
{
sc = sc.push();
sc.stc &= ~(STC_TYPECTOR | STCpure | STCnothrow | STCnogc | STCref | STCdisable);
ExpInitializer ei = _init.isExpInitializer();
if (ei) // Bugzilla 13424: Preset the required type to fail in FuncLiteralDeclaration::semantic3
ei.exp = inferType(ei.exp, 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 && !(storage_class & (STCmanifest | STCstatic | STCtls | STCgshared | STCextern)) && !_init.isVoidInitializer())
{
//printf("fd = '%s', var = '%s'\n", fd->toChars(), toChars());
if (!ei)
{
ArrayInitializer ai = _init.isArrayInitializer();
Expression e;
if (ai && tb.ty == Taarray)
e = ai.toAssocArrayLiteral();
else
e = _init.toExpression();
if (!e)
{
// Run semantic, but don't need to interpret
_init = _init.semantic(sc, type, INITnointerpret);
e = _init.toExpression();
if (!e)
{
error("is not a static and cannot have static initializer");
return;
}
}
ei = new ExpInitializer(_init.loc, e);
_init = ei;
}
Expression exp = ei.exp;
Expression e1 = new VarExp(loc, this);
if (isBlit)
exp = new BlitExp(loc, e1, exp);
else
exp = new ConstructExp(loc, e1, exp);
canassign++;
exp = exp.semantic(sc);
canassign--;
exp = exp.optimize(WANTvalue);
if (exp.op == TOKerror)
{
_init = new ErrorInitializer();
ei = null;
}
else
ei.exp = exp;
if (ei && 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 (!(ne.newargs && ne.newargs.dim > 1) && type.toBasetype().ty == Tclass)
{
ne.onstack = 1;
onstack = 1;
if (type.isBaseOf(ne.newtype.semantic(loc, sc), null))
onstack = 2;
}
}
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
{
// Bugzilla 14166: Don't run CTFE for the temporary variables inside typeof
_init = _init.semantic(sc, type, sc.intypeof == 1 ? INITnointerpret : INITinterpret);
}
}
else if (parent.isAggregateDeclaration())
{
_scope = scx ? scx : sc.copy();
_scope.setNoFree();
}
else if (storage_class & (STCconst | STCimmutable | STCmanifest) || type.isConst() || 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;
inuse++;
if (ei)
{
Expression exp = ei.exp.syntaxCopy();
bool needctfe = isDataseg() || (storage_class & STCmanifest);
if (needctfe)
sc = sc.startCTFE();
exp = exp.semantic(sc);
exp = resolveProperties(sc, exp);
if (needctfe)
sc = sc.endCTFE();
Type tb2 = 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())
error("of type struct %s uses this(this), which is not allowed in static initialization", tb2.toChars());
}
}
ei.exp = exp;
}
_init = _init.semantic(sc, type, INITinterpret);
inuse--;
if (global.errors > errors)
{
_init = new ErrorInitializer();
type = Type.terror;
}
}
else
{
_scope = scx ? scx : sc.copy();
_scope.setNoFree();
}
}
sc = sc.pop();
}
Ldtor:
/* Build code to execute destruction, if necessary
*/
edtor = callScopeDtor(sc);
if (edtor)
{
if (sc.func && storage_class & (STCstatic | STCgshared))
edtor = edtor.semantic(sc._module._scope);
else
edtor = edtor.semantic(sc);
version (none)
{
// currently disabled because of std.stdio.stdin, stdout and stderr
if (isDataseg() && !(storage_class & STCextern))
error("static storage variables cannot have destructors");
}
}
sem = SemanticDone;
if (type.toBasetype().ty == Terror)
errors = true;
}
override final void setFieldOffset(AggregateDeclaration ad, uint* poffset, bool isunion)
{
//printf("VarDeclaration::setFieldOffset(ad = %s) %s\n", ad->toChars(), toChars());
if (aliassym)
{
// If this variable was really a tuple, set the offsets for the tuple fields
TupleDeclaration v2 = aliassym.isTupleDeclaration();
assert(v2);
for (size_t i = 0; i < v2.objects.dim; i++)
{
RootObject o = (*v2.objects)[i];
assert(o.dyncast() == DYNCAST_EXPRESSION);
Expression e = cast(Expression)o;
assert(e.op == TOKdsymbol);
DsymbolExp se = cast(DsymbolExp)e;
se.s.setFieldOffset(ad, poffset, isunion);
}
return;
}
if (!isField())
return;
assert(!(storage_class & (STCstatic | STCextern | STCparameter | STCtls)));
/* Fields that are tuples appear both as part of TupleDeclarations and
* as members. That means ignore them if they are already a field.
*/
if (offset)
{
// already a field
*poffset = ad.structsize; // Bugzilla 13613
return;
}
for (size_t i = 0; i < ad.fields.dim; i++)
{
if (ad.fields[i] == this)
{
// already a field
*poffset = ad.structsize; // Bugzilla 13613
return;
}
}
// Check for forward referenced types which will fail the size() call
Type t = type.toBasetype();
if (storage_class & STCref)
{
// References are the size of a pointer
t = Type.tvoidptr;
}
if (t.ty == Tstruct || t.ty == Tsarray)
{
Type tv = t.baseElemOf();
if (tv.ty == Tstruct)
{
TypeStruct ts = cast(TypeStruct)tv;
if (ts.sym == ad)
{
const(char)* s = (t.ty == Tsarray) ? "static array of " : "";
ad.error("cannot have field %s with %ssame struct type", toChars(), s);
return;
}
if (ts.sym.sizeok != SIZEOKdone && ts.sym._scope)
ts.sym.semantic(null);
if (ts.sym.sizeok != SIZEOKdone)
{
ad.sizeok = SIZEOKfwd; // cannot finish; flag as forward referenced
return;
}
}
}
if (t.ty == Tident)
{
ad.sizeok = SIZEOKfwd; // cannot finish; flag as forward referenced
return;
}
// List in ad->fields. Even if the type is error, it's necessary to avoid
// pointless error diagnostic "more initializers than fields" on struct literal.
ad.fields.push(this);
if (t.ty == Terror)
return;
uint memsize = cast(uint)t.size(loc); // size of member
uint memalignsize = Target.fieldalign(t); // size of member for alignment purposes
offset = AggregateDeclaration.placeField(poffset, memsize, memalignsize, alignment, &ad.structsize, &ad.alignsize, isunion);
//printf("\t%s: memalignsize = %d\n", toChars(), memalignsize);
//printf(" addField '%s' to '%s' at offset %d, size = %d\n", toChars(), ad->toChars(), offset, memsize);
}
override final void semantic2(Scope* sc)
{
if (sem < SemanticDone && inuse)
return;
//printf("VarDeclaration::semantic2('%s')\n", toChars());
// Inside unions, default to void initializers
if (!_init && sc.inunion && !toParent().isFuncDeclaration())
{
AggregateDeclaration aad = parent.isAggregateDeclaration();
if (aad)
{
if (aad.fields[0] == this)
{
int hasinit = 0;
for (size_t i = 1; i < aad.fields.dim; i++)
{
if (aad.fields[i]._init && !aad.fields[i]._init.isVoidInitializer())
{
hasinit = 1;
break;
}
}
if (!hasinit)
_init = new ExpInitializer(loc, type.defaultInitLiteral(loc));
}
else
_init = new VoidInitializer(loc);
}
}
if (_init && !toParent().isFuncDeclaration())
{
inuse++;
version (none)
{
ExpInitializer ei = _init.isExpInitializer();
if (ei)
{
ei.exp.print();
printf("type = %p\n", ei.exp.type);
}
}
// Bugzilla 14166: Don't run CTFE for the temporary variables inside typeof
_init = _init.semantic(sc, type, sc.intypeof == 1 ? INITnointerpret : INITinterpret);
inuse--;
}
if (storage_class & STCmanifest)
{
version (none)
{
if ((type.ty == Tclass) && type.isMutable())
{
error("is mutable. Only const and immutable class enum are allowed, not %s", type.toChars());
}
else if (type.ty == Tpointer && type.nextOf().ty == Tstruct && type.nextOf().isMutable())
{
ExpInitializer ei = _init.isExpInitializer();
if (ei.exp.op == TOKaddress && (cast(AddrExp)ei.exp).e1.op == TOKstructliteral)
{
error("is a pointer to mutable struct. Only pointers to const or immutable struct enum are allowed, not %s", type.toChars());
}
}
}
else
{
if (type.ty == Tclass && _init)
{
ExpInitializer ei = _init.isExpInitializer();
if (ei.exp.op == TOKclassreference)
error(": Unable to initialize enum with class or pointer to struct. Use static const variable instead.");
}
else if (type.ty == Tpointer && type.nextOf().ty == Tstruct)
{
ExpInitializer ei = _init.isExpInitializer();
if (ei && ei.exp.op == TOKaddress && (cast(AddrExp)ei.exp).e1.op == TOKstructliteral)
{
error(": Unable to initialize enum with class or pointer to struct. Use static const variable instead.");
}
}
}
}
else if (_init && isThreadlocal())
{
if ((type.ty == Tclass) && type.isMutable() && !type.isShared())
{
ExpInitializer ei = _init.isExpInitializer();
if (ei && ei.exp.op == TOKclassreference)
error("is mutable. Only const or immutable class thread local variable are allowed, not %s", type.toChars());
}
else if (type.ty == Tpointer && type.nextOf().ty == Tstruct && type.nextOf().isMutable() && !type.nextOf().isShared())
{
ExpInitializer ei = _init.isExpInitializer();
if (ei && ei.exp.op == TOKaddress && (cast(AddrExp)ei.exp).e1.op == TOKstructliteral)
{
error("is a pointer to mutable struct. Only pointers to const, immutable or shared struct thread local variable are allowed, not %s", type.toChars());
}
}
}
sem = Semantic2Done;
}
override const(char)* kind() const
{
return "variable";
}
override final AggregateDeclaration isThis()
{
AggregateDeclaration ad = null;
if (!(storage_class & (STCstatic | STCextern | STCmanifest | STCtemplateparameter | STCtls | STCgshared | STCctfe)))
{
for (Dsymbol s = this; s; s = s.parent)
{
ad = s.isMember();
if (ad)
break;
if (!s.parent || !s.parent.isTemplateMixin())
break;
}
}
return ad;
}
override final bool needThis()
{
//printf("VarDeclaration::needThis(%s, x%x)\n", toChars(), storage_class);
return isField();
}
override final bool isExport()
{
return protection.kind == PROTexport;
}
override final bool isImportedSymbol()
{
if (protection.kind == PROTexport && !_init && (storage_class & STCstatic || parent.isModule()))
return true;
return false;
}
/*******************************
* Does symbol go into data segment?
* Includes extern variables.
*/
override final bool isDataseg()
{
version (none)
{
printf("VarDeclaration::isDataseg(%p, '%s')\n", this, toChars());
printf("%llx, isModule: %p, isTemplateInstance: %p\n", storage_class & (STCstatic | STCconst), parent.isModule(), parent.isTemplateInstance());
printf("parent = '%s'\n", parent.toChars());
}
if (!canTakeAddressOf())
return false;
Dsymbol parent = toParent();
if (!parent && !(storage_class & STCstatic))
{
error("forward referenced");
type = Type.terror;
return false;
}
return (storage_class & (STCstatic | STCextern | STCtls | STCgshared) || parent.isModule() || parent.isTemplateInstance());
}
/************************************
* Does symbol go into thread local storage?
*/
override final bool isThreadlocal()
{
//printf("VarDeclaration::isThreadlocal(%p, '%s')\n", this, toChars());
/* Data defaults to being thread-local. It is not thread-local
* if it is immutable, const or shared.
*/
bool i = isDataseg() && !(storage_class & (STCimmutable | STCconst | STCshared | STCgshared));
//printf("\treturn %d\n", i);
return i;
}
/********************************************
* Can variable be read and written by CTFE?
*/
final bool isCTFE()
{
return (storage_class & STCctfe) != 0; // || !isDataseg();
}
final bool isOverlappedWith(VarDeclaration v)
{
return ( offset < v.offset + v.type.size() &&
v.offset < offset + type.size());
}
override final bool hasPointers()
{
//printf("VarDeclaration::hasPointers() %s, ty = %d\n", toChars(), type->ty);
return (!isDataseg() && type.hasPointers());
}
/*************************************
* Return true if we can take the address of this variable.
*/
final bool canTakeAddressOf()
{
return !(storage_class & STCmanifest);
}
/******************************************
* Return true if variable needs to call the destructor.
*/
final bool needsScopeDtor()
{
//printf("VarDeclaration::needsScopeDtor() %s\n", toChars());
return edtor && !noscope;
}
/******************************************
* If a variable has a scope destructor call, return call for it.
* Otherwise, return NULL.
*/
final Expression callScopeDtor(Scope* sc)
{
//printf("VarDeclaration::callScopeDtor() %s\n", toChars());
// Destruction of STCfield's is handled by buildDtor()
if (noscope || storage_class & (STCnodtor | STCref | STCout | STCfield))
{
return null;
}
Expression e = null;
// Destructors for structs and arrays of structs
Type tv = type.baseElemOf();
if (tv.ty == Tstruct)
{
StructDeclaration sd = (cast(TypeStruct)tv).sym;
if (!sd.dtor || !type.size())
return null;
if (type.toBasetype().ty == Tstruct)
{
// v.__xdtor()
e = new VarExp(loc, this);
/* This is a hack so we can call destructors on const/immutable objects.
* Need to add things like "const ~this()" and "immutable ~this()" to
* fix properly.
*/
e.type = e.type.mutableOf();
e = new DotVarExp(loc, e, sd.dtor, false);
e = new CallExp(loc, e);
}
else
{
// _ArrayDtor(v[0 .. n])
e = new VarExp(loc, this);
uinteger_t n = type.size() / sd.type.size();
e = new SliceExp(loc, e, new IntegerExp(loc, 0, Type.tsize_t), new IntegerExp(loc, n, Type.tsize_t));
// Prevent redundant bounds check
(cast(SliceExp)e).upperIsInBounds = true;
(cast(SliceExp)e).lowerIsLessThanUpper = true;
// This is a hack so we can call destructors on const/immutable objects.
e.type = sd.type.arrayOf();
e = new CallExp(loc, new IdentifierExp(loc, Id._ArrayDtor), e);
}
return e;
}
// Destructors for classes
if (storage_class & (STCauto | STCscope))
{
for (ClassDeclaration cd = type.isClassHandle(); cd; cd = cd.baseClass)
{
/* We can do better if there's a way with onstack
* classes to determine if there's no way the monitor
* could be set.
*/
//if (cd->isInterfaceDeclaration())
//error("interface %s cannot be scope", cd->toChars());
if (cd.cpp)
{
// Destructors are not supported on extern(C++) classes
break;
}
if (1 || onstack || cd.dtors.dim) // if any destructors
{
// delete this;
Expression ec;
ec = new VarExp(loc, this);
e = new DeleteExp(loc, ec);
e.type = Type.tvoid;
break;
}
}
}
return e;
}
/*******************************************
* If variable has a constant expression initializer, get it.
* Otherwise, return null.
*/
final Expression getConstInitializer(bool needFullType = true)
{
assert(type && _init);
// Ungag errors when not speculative
uint oldgag = global.gag;
if (global.gag)
{
Dsymbol sym = toParent().isAggregateDeclaration();
if (sym && !sym.isSpeculative())
global.gag = 0;
}
if (_scope)
{
inuse++;
_init = _init.semantic(_scope, type, INITinterpret);
_scope = null;
inuse--;
}
Expression e = _init.toExpression(needFullType ? type : null);
global.gag = oldgag;
return e;
}
/*******************************************
* Helper function for the expansion of manifest constant.
*/
final Expression expandInitializer(Loc loc)
{
assert((storage_class & STCmanifest) && _init);
auto e = getConstInitializer();
if (!e)
{
.error(loc, "cannot make expression out of initializer for %s", toChars());
return new ErrorExp();
}
e = e.copy();
e.loc = loc; // for better error message
return e;
}
override final void checkCtorConstInit()
{
version (none)
{
/* doesn't work if more than one static ctor */
if (ctorinit == 0 && isCtorinit() && !isField())
error("missing initializer in static constructor for const variable");
}
}
/************************************
* Check to see if this variable is actually in an enclosing function
* rather than the current one.
* Returns true if error occurs.
*/
final bool checkNestedReference(Scope* sc, Loc loc)
{
//printf("VarDeclaration::checkNestedReference() %s\n", toChars());
if (sc.intypeof == 1 || (sc.flags & SCOPEctfe))
return false;
if (!parent || parent == sc.parent)
return false;
if (isDataseg() || (storage_class & STCmanifest))
return false;
// The current function
FuncDeclaration fdthis = sc.parent.isFuncDeclaration();
if (!fdthis)
return false; // out of function scope
Dsymbol p = toParent2();
// Function literals from fdthis to p must be delegates
checkNestedRef(fdthis, p);
// The function that this variable is in
FuncDeclaration fdv = p.isFuncDeclaration();
if (!fdv || fdv == fdthis)
return false;
// Add fdthis to nestedrefs[] if not already there
for (size_t i = 0; 1; i++)
{
if (i == nestedrefs.dim)
{
nestedrefs.push(fdthis);
break;
}
if (nestedrefs[i] == fdthis)
break;
}
/* __require and __ensure will always get called directly,
* so they never make outer functions closure.
*/
if (fdthis.ident == Id.require || fdthis.ident == Id.ensure)
return false;
//printf("\tfdv = %s\n", fdv.toChars());
//printf("\tfdthis = %s\n", fdthis.toChars());
if (loc.filename)
{
int lv = fdthis.getLevel(loc, sc, fdv);
if (lv == -2) // error
return true;
}
// Add this to fdv.closureVars[] if not already there
for (size_t i = 0; 1; i++)
{
if (i == fdv.closureVars.dim)
{
if (!sc.intypeof && !(sc.flags & SCOPEcompile))
fdv.closureVars.push(this);
break;
}
if (fdv.closureVars[i] == this)
break;
}
//printf("fdthis is %s\n", fdthis.toChars());
//printf("var %s in function %s is nested ref\n", toChars(), fdv.toChars());
// __dollar creates problems because it isn't a real variable Bugzilla 3326
if (ident == Id.dollar)
{
.error(loc, "cannnot use $ inside a function literal");
return true;
}
if (ident == Id.withSym) // Bugzilla 1759
{
ExpInitializer ez = _init.isExpInitializer();
assert(ez);
Expression e = ez.exp;
if (e.op == TOKconstruct || e.op == TOKblit)
e = (cast(AssignExp)e).e2;
return lambdaCheckForNestedRef(e, sc);
}
return false;
}
override final Dsymbol toAlias()
{
//printf("VarDeclaration::toAlias('%s', this = %p, aliassym = %p)\n", toChars(), this, aliassym);
if ((!type || !type.deco) && _scope)
semantic(_scope);
assert(this != aliassym);
Dsymbol s = aliassym ? aliassym.toAlias() : this;
return s;
}
// Eliminate need for dynamic_cast
override final inout(VarDeclaration) isVarDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* This is a shell around a back end symbol
*/
extern (C++) final class SymbolDeclaration : Declaration
{
public:
StructDeclaration dsym;
extern (D) this(Loc loc, StructDeclaration dsym)
{
super(dsym.ident);
this.loc = loc;
this.dsym = dsym;
storage_class |= STCconst;
}
// Eliminate need for dynamic_cast
override inout(SymbolDeclaration) isSymbolDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) class TypeInfoDeclaration : VarDeclaration
{
public:
Type tinfo;
final extern (D) this(Type tinfo, int internal)
{
super(Loc(), Type.dtypeinfo.type, tinfo.getTypeInfoIdent(internal), null);
this.tinfo = tinfo;
storage_class = STCstatic | STCgshared;
protection = Prot(PROTpublic);
linkage = LINKc;
}
final static TypeInfoDeclaration create(Type tinfo, int internal)
{
return new TypeInfoDeclaration(tinfo, internal);
}
override final Dsymbol syntaxCopy(Dsymbol s)
{
assert(0); // should never be produced by syntax
}
override final void semantic(Scope* sc)
{
assert(linkage == LINKc);
}
override final const(char)* toChars()
{
//printf("TypeInfoDeclaration::toChars() tinfo = %s\n", tinfo->toChars());
OutBuffer buf;
buf.writestring("typeid(");
buf.writestring(tinfo.toChars());
buf.writeByte(')');
return buf.extractString();
}
override final inout(TypeInfoDeclaration) isTypeInfoDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoStructDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfostruct)
{
ObjectNotFound(Id.TypeInfo_Struct);
}
type = Type.typeinfostruct.type;
}
static TypeInfoStructDeclaration create(Type tinfo)
{
return new TypeInfoStructDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoClassDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfoclass)
{
ObjectNotFound(Id.TypeInfo_Class);
}
type = Type.typeinfoclass.type;
}
static TypeInfoClassDeclaration create(Type tinfo)
{
return new TypeInfoClassDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoInterfaceDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfointerface)
{
ObjectNotFound(Id.TypeInfo_Interface);
}
type = Type.typeinfointerface.type;
}
static TypeInfoInterfaceDeclaration create(Type tinfo)
{
return new TypeInfoInterfaceDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoPointerDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfopointer)
{
ObjectNotFound(Id.TypeInfo_Pointer);
}
type = Type.typeinfopointer.type;
}
static TypeInfoPointerDeclaration create(Type tinfo)
{
return new TypeInfoPointerDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoArrayDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfoarray)
{
ObjectNotFound(Id.TypeInfo_Array);
}
type = Type.typeinfoarray.type;
}
static TypeInfoArrayDeclaration create(Type tinfo)
{
return new TypeInfoArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoStaticArrayDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfostaticarray)
{
ObjectNotFound(Id.TypeInfo_StaticArray);
}
type = Type.typeinfostaticarray.type;
}
static TypeInfoStaticArrayDeclaration create(Type tinfo)
{
return new TypeInfoStaticArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfoassociativearray)
{
ObjectNotFound(Id.TypeInfo_AssociativeArray);
}
type = Type.typeinfoassociativearray.type;
}
static TypeInfoAssociativeArrayDeclaration create(Type tinfo)
{
return new TypeInfoAssociativeArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoEnumDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfoenum)
{
ObjectNotFound(Id.TypeInfo_Enum);
}
type = Type.typeinfoenum.type;
}
static TypeInfoEnumDeclaration create(Type tinfo)
{
return new TypeInfoEnumDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoFunctionDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfofunction)
{
ObjectNotFound(Id.TypeInfo_Function);
}
type = Type.typeinfofunction.type;
}
static TypeInfoFunctionDeclaration create(Type tinfo)
{
return new TypeInfoFunctionDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoDelegateDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfodelegate)
{
ObjectNotFound(Id.TypeInfo_Delegate);
}
type = Type.typeinfodelegate.type;
}
static TypeInfoDelegateDeclaration create(Type tinfo)
{
return new TypeInfoDelegateDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoTupleDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfotypelist)
{
ObjectNotFound(Id.TypeInfo_Tuple);
}
type = Type.typeinfotypelist.type;
}
static TypeInfoTupleDeclaration create(Type tinfo)
{
return new TypeInfoTupleDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoConstDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfoconst)
{
ObjectNotFound(Id.TypeInfo_Const);
}
type = Type.typeinfoconst.type;
}
static TypeInfoConstDeclaration create(Type tinfo)
{
return new TypeInfoConstDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoInvariantDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfoinvariant)
{
ObjectNotFound(Id.TypeInfo_Invariant);
}
type = Type.typeinfoinvariant.type;
}
static TypeInfoInvariantDeclaration create(Type tinfo)
{
return new TypeInfoInvariantDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoSharedDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfoshared)
{
ObjectNotFound(Id.TypeInfo_Shared);
}
type = Type.typeinfoshared.type;
}
static TypeInfoSharedDeclaration create(Type tinfo)
{
return new TypeInfoSharedDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoWildDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfowild)
{
ObjectNotFound(Id.TypeInfo_Wild);
}
type = Type.typeinfowild.type;
}
static TypeInfoWildDeclaration create(Type tinfo)
{
return new TypeInfoWildDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoVectorDeclaration : TypeInfoDeclaration
{
public:
extern (D) this(Type tinfo)
{
super(tinfo, 0);
if (!Type.typeinfovector)
{
ObjectNotFound(Id.TypeInfo_Vector);
}
type = Type.typeinfovector.type;
}
static TypeInfoVectorDeclaration create(Type tinfo)
{
return new TypeInfoVectorDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* For the "this" parameter to member functions
*/
extern (C++) final class ThisDeclaration : VarDeclaration
{
public:
extern (D) this(Loc loc, Type t)
{
super(loc, t, Id.This, null);
noscope = true;
}
override Dsymbol syntaxCopy(Dsymbol s)
{
assert(0); // should never be produced by syntax
}
override inout(ThisDeclaration) isThisDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
|
D
|
/Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/Mockingjay.build/Objects-normal/x86_64/Builders.o : /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/MockingjayProtocol.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/NSURLSessionConfiguration.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Builders.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Matchers.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/XCTest.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Mockingjay.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macosx/Desktop/TestNetWorkLayer/build/Debug-iphonesimulator/URITemplate/URITemplate.framework/Modules/URITemplate.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macosx/Desktop/TestNetWorkLayer/Pods/Target\ Support\ Files/URITemplate/URITemplate-umbrella.h /Users/macosx/Desktop/TestNetWorkLayer/Pods/Target\ Support\ Files/Mockingjay/Mockingjay-umbrella.h /Users/macosx/Desktop/TestNetWorkLayer/build/Debug-iphonesimulator/URITemplate/URITemplate.framework/Headers/URITemplate-Swift.h /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Mockingjay.h /Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/Mockingjay.build/unextended-module.modulemap /Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/URITemplate.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/Mockingjay.build/Objects-normal/x86_64/Builders~partial.swiftmodule : /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/MockingjayProtocol.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/NSURLSessionConfiguration.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Builders.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Matchers.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/XCTest.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Mockingjay.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macosx/Desktop/TestNetWorkLayer/build/Debug-iphonesimulator/URITemplate/URITemplate.framework/Modules/URITemplate.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macosx/Desktop/TestNetWorkLayer/Pods/Target\ Support\ Files/URITemplate/URITemplate-umbrella.h /Users/macosx/Desktop/TestNetWorkLayer/Pods/Target\ Support\ Files/Mockingjay/Mockingjay-umbrella.h /Users/macosx/Desktop/TestNetWorkLayer/build/Debug-iphonesimulator/URITemplate/URITemplate.framework/Headers/URITemplate-Swift.h /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Mockingjay.h /Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/Mockingjay.build/unextended-module.modulemap /Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/URITemplate.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/Mockingjay.build/Objects-normal/x86_64/Builders~partial.swiftdoc : /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/MockingjayProtocol.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/NSURLSessionConfiguration.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Builders.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Matchers.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/XCTest.swift /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Mockingjay.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macosx/Desktop/TestNetWorkLayer/build/Debug-iphonesimulator/URITemplate/URITemplate.framework/Modules/URITemplate.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macosx/Desktop/TestNetWorkLayer/Pods/Target\ Support\ Files/URITemplate/URITemplate-umbrella.h /Users/macosx/Desktop/TestNetWorkLayer/Pods/Target\ Support\ Files/Mockingjay/Mockingjay-umbrella.h /Users/macosx/Desktop/TestNetWorkLayer/build/Debug-iphonesimulator/URITemplate/URITemplate.framework/Headers/URITemplate-Swift.h /Users/macosx/Desktop/TestNetWorkLayer/Pods/Mockingjay/Sources/Mockingjay/Mockingjay.h /Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/Mockingjay.build/unextended-module.modulemap /Users/macosx/Desktop/TestNetWorkLayer/build/Pods.build/Debug-iphonesimulator/URITemplate.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.