diff options
| author | bhgv <bhgv.empire@gmail.com> | 2018-03-01 16:54:45 +0200 |
|---|---|---|
| committer | bhgv <bhgv.empire@gmail.com> | 2018-03-01 16:54:45 +0200 |
| commit | b786f20bbab5a59046aa78a2c6c2a11536497202 (patch) | |
| tree | 0851ecdec889eb9b7ba3751cc04d4f0b474e4a9e /module/convcs.m | |
inferno-os tree was separated from the inferno-os-android (separated from the Android driver)
Diffstat (limited to 'module/convcs.m')
| -rw-r--r-- | module/convcs.m | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/module/convcs.m b/module/convcs.m new file mode 100644 index 0000000..b139351 --- /dev/null +++ b/module/convcs.m @@ -0,0 +1,29 @@ +# +# Copyright © 2001 Vita Nuova Limited +# +Btos: module { + init: fn(arg: string): string; + btos: fn(s: Convcs->State, b: array of byte, nchars: int) : (Convcs->State, string, int); +}; + +Stob: module { + init: fn(arg: string): string; + stob: fn(s: Convcs->State, str: string): (Convcs->State, array of byte); +}; + +Convcs: module { + PATH: con "/dis/lib/convcs/convcs.dis"; + CHARSETS: con "/lib/charsets"; + + BTOS, STOB: con 1 << iota; # enumcs() mode values + BOTH: con BTOS | STOB; + + State: type string; + Startstate: con ""; + + init: fn(csfile: string): string; + getbtos: fn(cs: string): (Btos, string); + getstob: fn(cs: string): (Stob, string); + enumcs: fn(): list of (string, string, int); # (cs, description, mode) + aliases: fn(cs : string): (string, list of string); +}; |
