-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add proxy types for ip and other network classes
- Loading branch information
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace ishtar; | ||
|
||
public readonly unsafe struct Vein_ClosureDelegate(IshtarObject* o) | ||
{ | ||
public readonly IshtarObject* Object = o; | ||
|
||
public IshtarObject* Scope => ((IshtarObject*)Object->vtable[Object->clazz->Field["_scope"]->vtable_offset]); | ||
|
||
public rawval* Function => ((rawval*)Object->vtable[Object->clazz->Field["_fn"]->vtable_offset]); | ||
|
||
public bool IsVolatile => Scope is null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace ishtar; | ||
|
||
using ishtar.__builtin.networks; | ||
|
||
public readonly unsafe struct Vein_IpEndpoint(IshtarObject* o) | ||
{ | ||
public readonly IshtarObject* Object = o; | ||
|
||
|
||
public ushort port | ||
{ | ||
get => ((IshtarObject*)Object->vtable[Object->clazz->Field["port"]->vtable_offset])->GetUInt16(); | ||
set => ((IshtarObject*)Object->vtable[Object->clazz->Field["port"]->vtable_offset])->SetUInt16(value); | ||
} | ||
|
||
public Vein_Ipv4Addr address | ||
{ | ||
get => new((IshtarObject*)Object->vtable[Object->clazz->Field["address"]->vtable_offset]); | ||
set => Object->vtable[Object->clazz->Field["address"]->vtable_offset] = value.Object; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace ishtar; | ||
|
||
public readonly unsafe struct Vein_Ipv4Addr(IshtarObject* o) | ||
{ | ||
public readonly IshtarObject* Object = o; | ||
|
||
public byte first | ||
{ | ||
get => ((IshtarObject*)Object->vtable[Object->clazz->Field["first"]->vtable_offset])->GetUInt8(); | ||
set => ((IshtarObject*)Object->vtable[Object->clazz->Field["first"]->vtable_offset])->SetUInt8(value); | ||
} | ||
public byte second | ||
{ | ||
get => ((IshtarObject*)Object->vtable[Object->clazz->Field["second"]->vtable_offset])->GetUInt8(); | ||
set => ((IshtarObject*)Object->vtable[Object->clazz->Field["second"]->vtable_offset])->SetUInt8(value); | ||
} | ||
public byte third | ||
{ | ||
get => ((IshtarObject*)Object->vtable[Object->clazz->Field["third"]->vtable_offset])->GetUInt8(); | ||
set => ((IshtarObject*)Object->vtable[Object->clazz->Field["third"]->vtable_offset])->SetUInt8(value); | ||
} | ||
public byte fourth | ||
{ | ||
get => ((IshtarObject*)Object->vtable[Object->clazz->Field["fourth"]->vtable_offset])->GetUInt8(); | ||
set => ((IshtarObject*)Object->vtable[Object->clazz->Field["fourth"]->vtable_offset])->SetUInt8(value); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace ishtar; | ||
|
||
using static libuv.LibUV; | ||
|
||
public readonly unsafe struct Vein_SocketHandle(IshtarObject* o) | ||
{ | ||
public uv_tcp_t* server_handle | ||
{ | ||
get => (uv_tcp_t*)o->vtable[o->clazz->Field["server_handle"]->vtable_offset]; | ||
set => o->vtable[o->clazz->Field["server_handle"]->vtable_offset] = value; | ||
} | ||
} | ||
|