2.0 KiB
2.0 KiB
Manual
local syscalls = require("syscalls")
Events
syscalls.Event.<EventName>
Redraw
Button
Key
Desktop
Mouse
Network
IPC
Debug
Graphic
Text encoding
syscalls.Encoding.<value>
cp866
cp866_8x16
utf8
utf16
Text sizes
syscalls.textSize.<value>
6x9
(cp866 only)8x16
12x18
(cp866 only)16x32
18x27
(cp866 only)24x36
(cp866 only)24x48
30x45
(cp866 only)32x64
36x54
(cp866 only)40x80
42x63
(cp866 only)48x72
(cp866 only)48x96
56x112
64x128
DrawText(text, xPos, yPos, textColor, textScale, textLen, backgroundColor, encoding)
DrawTextFixSize(text, xPos, yPos, textColor, textSize, textLen, backgroundColor, encoding)
Draw text.
textSize, textLen, backgroundColor, encoding are optional.
DrawLine(x1, y1, x2, y2)
DrawRectangle(x, y, w, h color)
ReadPoint(x, y)
return color
Sockets
OpenSocket(domain, type, protocol)
local socket, err = syscalls.OpenSocket(
syscalls.SOCK.STREAM,
syscalls.AF.INET,
syscalls.IPPROTO.IP
)
if err then
print("Error", err)
else
print("Ok")
end
CloseSocket(socket)
PairSocket()
local first, second = PairSocket()
if first then
print("OK")
else
print("Error:", second)
end
Bind(socket, address)
Listen(socket, backlog)
Connect(socket, address)
Accept(socket, , flags)
Receive(socket, , flags)
SetSocketOption(socket, opt)
GetSocketOption(socket, opt)
Socket types
syscalls.SOCK.<Value>
STREAM
RAW
DGRAM
Address families
syscalls.AF.<Value>
UNSPEC
LOCAL
INET
INET4
INET6
IP options
syscalls.IP.<Value>
TTL
IP protocols
syscalls.IPPROTO.<Value>
IP
ICMP
TCP
UDP
RAW
Socket options
syscalls.SO.<Value>
BINDTODEVICE
NONBLOCK