cat-v (mirror)
Lib - Limbo Library
Lib: module
{
PATH: con "$Lib";
# Lock structure
# Pid is valid when lock is held - other data is hidden
#
Lock: protected adt
{
pid: int;
};
# Semaphore structure
# Value is very volatile - other data is hidden
#
Sem: protected adt
{
value: int;
limit: int;
};
# An interned string and a hash [0, 2^31)
#
Name: protected adt
{
name: string;
hash: int;
};
byte2char: fn(buf: array of byte, n: int): (int, int, int);
char2byte: fn(c: int, buf: array of byte, n: int): int;
strtok: fn(s, delim: string, a: array of string): int;
tokenize: fn(s, delim: string): (int, list of string);
utfbytes: fn(buf: array of byte, n: int): int;
quote: fn(s: string, delim: string): string;
quotel: fn(l: list of string, delim: string): string;
unquote: fn(s: string): string;
unquotel: fn(s, delim: string): (int, list of string);
intern: fn(s: string): string;
name: fn(s: string): ref Name;
newlock: fn(): ref Lock;
lock: fn(l: ref Lock);
rlock: fn(l: ref Lock);
canlock: fn(l: ref Lock): int;
canrlock: fn(l: ref Lock): int;
unlock: fn(l: ref Lock);
semnew: fn(n: int): ref Sem;
semacquire: fn(s: ref Sem);
semcanacq: fn(s: ref Sem): int;
semrelease: fn(s: ref Sem);
ASET,
ACLEAR,
AMIN,
AMAX: con iota;
alarm: fn(c: chan of int, ms: int, flag: int);
memmapi: fn(a: array of byte, n: int): array of int;
memmapb: fn(a: array of byte, n: int): array of big;
memmapr: fn(a: array of byte, n: int): array of real;
};
{
PATH: con "$Lib";
# Lock structure
# Pid is valid when lock is held - other data is hidden
#
Lock: protected adt
{
pid: int;
};
# Semaphore structure
# Value is very volatile - other data is hidden
#
Sem: protected adt
{
value: int;
limit: int;
};
# An interned string and a hash [0, 2^31)
#
Name: protected adt
{
name: string;
hash: int;
};
byte2char: fn(buf: array of byte, n: int): (int, int, int);
char2byte: fn(c: int, buf: array of byte, n: int): int;
strtok: fn(s, delim: string, a: array of string): int;
tokenize: fn(s, delim: string): (int, list of string);
utfbytes: fn(buf: array of byte, n: int): int;
quote: fn(s: string, delim: string): string;
quotel: fn(l: list of string, delim: string): string;
unquote: fn(s: string): string;
unquotel: fn(s, delim: string): (int, list of string);
intern: fn(s: string): string;
name: fn(s: string): ref Name;
newlock: fn(): ref Lock;
lock: fn(l: ref Lock);
rlock: fn(l: ref Lock);
canlock: fn(l: ref Lock): int;
canrlock: fn(l: ref Lock): int;
unlock: fn(l: ref Lock);
semnew: fn(n: int): ref Sem;
semacquire: fn(s: ref Sem);
semcanacq: fn(s: ref Sem): int;
semrelease: fn(s: ref Sem);
ASET,
ACLEAR,
AMIN,
AMAX: con iota;
alarm: fn(c: chan of int, ms: int, flag: int);
memmapi: fn(a: array of byte, n: int): array of int;
memmapb: fn(a: array of byte, n: int): array of big;
memmapr: fn(a: array of byte, n: int): array of real;
};