1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

more work on the d binding

This commit is contained in:
Marenz 2011-06-12 13:13:17 +02:00
parent 6b8a18e707
commit c0cfadf55a
3 changed files with 40 additions and 3 deletions

View file

@ -66,11 +66,14 @@ enum ListType
LIST_BINARY = 2,
}
/+
struct String
{
size_t length;
ubyte *ptr;
}
}+/
alias char[] String;
struct MatchVar
{

View file

@ -8,6 +8,8 @@ import psyc.common;
import psyc.syntax;
extern (C):
/** Modifier flags. */
enum ModifierFlag
{
@ -46,11 +48,40 @@ enum PacketFlag
/** Structure for a modifier. */
struct Modifier
{
char oper;
char operator;
String name;
String value;
ModifierFlag flag;
} ;
static Modifier opCall ( char op, char[] nam, char[] val )
{
Modifier v;
with (v)
{
operator = op;
name = nam;
value = val;
}
return v;
}
bool opEquals ( ref Modifier n )
{
return operator == n.operator &&
value == n.value &&
name == n.name;
}
Modifier dup ( )
{
auto v = M(operator, name.dup, value.dup);
return v;
}
};
alias Modifier M;
/** Structure for an entity or routing header. */
struct Header

View file

@ -2,6 +2,9 @@ module psyc.render;
import psyc.packet;
extern (C):
/*
* All rendering functions and the definitions they use are defined here.
*/