erg_compiler 0.6.53

Centimetre: the Erg compiler
Documentation
.AddressFamily: ClassType
.AddressFamily <: Nat
.AF_ALG: .AddressFamily # unix only
.AF_APPLETALK: .AddressFamily
.AF_ASH: .AddressFamily # unix only
.AF_ATMPVC: .AddressFamily # unix only
.AF_ATMSVC: .AddressFamily # unix only
.AF_AX25: .AddressFamily
.AF_BRIDGE: .AddressFamily # unix only
.AF_BLUETOOTH: .AddressFamily
.AF_CAN: .AddressFamily # unix only
.AF_DECnet: .AddressFamily
.AF_ECONET: .AddressFamily # unix only
.AF_INET: .AddressFamily
.AF_INET6: .AddressFamily
.AF_IPX: .AddressFamily
.AF_IRDA: .AddressFamily # unix only
.AF_KEY: .AddressFamily # unix only
.AF_LLC: .AddressFamily # unix only
.AF_NETBEUI: .AddressFamily # unix only
.AF_NETLINK: .AddressFamily # unix only
.AF_NETROM: .AddressFamily
.AF_PACKET: .AddressFamily # unix only
.AF_PPPOX: .AddressFamily # unix only
.AF_QIPCRTR: .AddressFamily # unix only
.AF_RDS: .AddressFamily # unix only
.AF_ROSE: .AddressFamily
.AF_ROUTE: .AddressFamily # unix only
.AF_SECURITY: .AddressFamily # unix only
.AF_SNA: .AddressFamily
.AF_TIPC: .AddressFamily # unix only
.AF_UNIX: .AddressFamily # unix only
.AF_UNSPEC: .AddressFamily
.AF_VSOCK: .AddressFamily # unix only
.AF_WANPIPE: .AddressFamily # unix only
.AF_X25: .AddressFamily

.SO_ACCEPTCONN: Nat
.SO_BINDTODEVICE: Nat
.SO_BROADCAST: Nat
.SO_DEBUG: Nat
.SO_DOMAIN: Nat
.SO_DONTROUTE: Nat
.SO_ERROR: Nat
.SO_INCOMING_CPU: Nat
.SO_J1939_ERRQUEUE: Nat
.SO_J1939_FILTER: Nat
.SO_J1939_PROMISC: Nat
.SO_J1939_SEND_PRIO: Nat
.SO_KEEPALIVE: Nat
.SO_LINGER: Nat
.SO_MARK: Nat
.SO_OOBINLINE: Nat
.SO_PASSCRED: Nat
.SO_PASSSEC: Nat
.SO_PEERCRED: Nat
.SO_PEERSEC: Nat
.SO_PRIORITY: Nat
.SO_PROTOCOL: Nat
.SO_RCVBUF: Nat
.SO_RCVLOWAT: Nat
.SO_RCVTIMEO: Nat
.SO_REUSEADDR: Nat
.SO_REUSEPORT: Nat
.SO_SNDBUF: Nat
.SO_SNDLOWAT: Nat
.SO_SNDTIMEO: Nat
.SO_TYPE: Nat
.SO_VM_SOCKETS_BUFFER_MAX_SIZE: Nat
.SO_VM_SOCKETS_BUFFER_MIN_SIZE: Nat
.SO_VM_SOCKETS_BUFFER_SIZE: Nat

.SocketKind: ClassType
.SocketKind <: Nat
.SOCK_DGRAM: .SocketKind
.SOCK_RAW: .SocketKind
.SOCK_RDM: .SocketKind
.SOCK_SEQPACKET: .SocketKind
.SOCK_STREAM: .SocketKind

.SOL_ALG: Nat
.SOL_CAN_BASE: Nat
.SOL_CAN_RAW: Nat
.SOL_IP: Nat
.SOL_RDS: Nat
.SOL_SOCKET: Nat
.SOL_TCP: Nat
.SOL_TIPC: Nat
.SOL_UDP: Nat

.Socket! = 'socket': ClassType
.Socket!.
    new!: (family := Int, type := Int, proto := Int, fileno: Int or NoneType := NoneType) => .Socket!
    __call__!: (family := Int, type := Int, proto := Int, fileno: Int or NoneType := NoneType) => .Socket!
    accept!: (self: RefMut(.Socket!)) => (.Socket!, (Str, Int))
    bind!: (self: RefMut(.Socket!), address: (Str, Int)) => NoneType
    close!: (self: RefMut(.Socket!)) => NoneType
    connect!: (self: RefMut(.Socket!), address: (Str, Int)) => NoneType
    connect_ex!: (self: RefMut(.Socket!), address: (Str, Int)) => Int
    detach!: (self: RefMut(.Socket!)) => Int
    dup!: (self: RefMut(.Socket!)) => .Socket!
    fileno!: (self: RefMut(.Socket!)) => Int
    get_inheritable!: (self: RefMut(.Socket!)) => Bool
    getpeername!: (self: RefMut(.Socket!)) => (Str, Int)
    getsockname!: (self: RefMut(.Socket!)) => (Str, Int)
    getsockopt!: (self: RefMut(.Socket!), level: Int, option: Int, buffersize: Int) => Str or Int
    getblocking!: (self: RefMut(.Socket!)) => Bool
    gettimeout!: (self: RefMut(.Socket!)) => Float or NoneType
    listen!: (self: RefMut(.Socket!), backlog: Int) => NoneType
    recv!: (self: RefMut(.Socket!), bufsize: Int, flags := Int) => Str
    recvfrom!: (self: RefMut(.Socket!), bufsize: Int, flags := Int) => (Str, (Str, Int))
    recvmsg!: (self: RefMut(.Socket!), bufsize: Int, ancbufsize := Int, flags := Int) => (Str, (Str, Int), Int)
    recvmsg_into!: (self: RefMut(.Socket!), buffers: Iterable(Writable!), ancbufsize := Int, flags := Int) => (Str, (Str, Int), Int)
    recvfrom_into!: (self: RefMut(.Socket!), buffer: Writable!, flags := Int) => (Str, (Str, Int))
    recv_into!: (self: RefMut(.Socket!), buffer: Writable!, nbytes := Int, flags := Int) => Nat
    send!: (self: RefMut(.Socket!), data: Bytes, flags := Int) => Int
    sendall!: (self: RefMut(.Socket!), data: Bytes, flags := Int) => NoneType
    sendto!: (self: RefMut(.Socket!), data: Bytes, address: (Str, Int), flags := Int) => Int
    sendmsg!: (
        self: RefMut(.Socket!),
        buffers: Iterable(Bytes),
        ancdata: Iterable(Bytes),
        flags := Int,
        address: (Str, Int) or NoneType := NoneType
    ) => Int

.socketpair!: (
    family := Int,
    type := Int,
    proto := Int,
    fileno: Int or NoneType := NoneType
) => (.Socket!, .Socket!)
.create_connection!: (
    address: (Str, Int),
    timeout: Int or NoneType := NoneType,
    source_address: (Str, Int) or NoneType := NoneType
) => .Socket!
.create_server!: (
    address: (Str, Int),
    family: Int or NoneType := NoneType,
    backlog: Int or NoneType := NoneType,
    reuse_port := Bool
) => .Socket!
.has_dualstack_ipv6: () -> Bool
.fromfd!: (fd: Int, family: Int, type: Int, proto: Int) => .Socket!

.close!: (fd: .Socket!) => NoneType
.getaddrinfo!: (
    host: Str,
    port: Int or NoneType,
    family: Int or NoneType := NoneType,
    type: Int or NoneType := NoneType,
    proto: Int or NoneType := NoneType,
    flags: Int or NoneType := NoneType,
) => (Int, Int, Int, Str, (Str, Int))
.gethostbyname!: (hostname: Str) => Str
.gethostbyname_ex!: (hostname: Str) => (Str, [Str; _], [Str; _])
.gethostname!: () => Str
.gethostbyaddr!: (ip: Str) => (Str, [Str; _], [Str; _])
.getnameinfo!: (sockaddr: (Str, Int), flags: Int or NoneType := NoneType) => (Str, Str)