1
0
Fork 0
forked from AbleOS/ableos
ableos/sysdata/libraries/stn/src/buffer.hb
2024-09-17 09:47:53 -05:00

22 lines
551 B
Plaintext

string := @use("rel:string.hb")
receive_message := fn(buffer_id: int, memory_map_location: ^u8, length: int): ^u8 {
return @eca(^u8, 4, buffer_id, memory_map_location, length)
}
send_message := fn(msg: ^u8, buffer_id: int, length: int): void {
return @eca(void, 3, buffer_id, msg, length)
}
create := fn(msg: ^u8): int {
msg_length := @inline(string.length, msg);
*msg = 0
return @eca(int, 3, 0, msg, msg_length)
}
search := fn(msg: ^u8): int {
msg_length := @inline(string.length, msg);
*msg = 3
return @eca(int, 3, 0, msg, msg_length)
}