diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
| commit | 46439007cf417cbd9ac8049bb4122c890097a0fa (patch) | |
| tree | 6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/convcs.m | |
| parent | 37da2899f40661e3e9631e497da8dc59b971cbd0 (diff) | |
20060303-partial
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 00000000..b139351e --- /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); +}; |
