The Modula-3 support is very basic and highly experimental! Many features are still not designed satisfyingly and I need more discussion about the odds and ends. The Modula-3 generator was already useful for interfacing to the PLPlot library.
| Modula-3 specific options | |
|---|---|
| -generateconst <file> | Disable generation of interfaces and wrappers. Instead generate code for computing numeric values of constants. |
| -generaterename <file> | Disable generation of interfaces and wrappers. Instead generate suggestions for %rename. |
| -generatetypemap <file> | Disable generation of interfaces and wrappers. Instead generate templates for some basic typemaps. |
(* %relabel m3wrapinmode m3wrapinname m3wrapintype m3wrapindefault *)
PROCEDURE Name (READONLY str : TEXT := "" )
(* m3wrapoutcheck:throws *)
: NameResult RAISES {E} =
VAR
arg0 : C.char_star; (* m3wrapretvar *)
arg1 : C.char_star; (* m3wrapargvar *)
arg2 : C.int;
result : RECORD
(*m3wrapretname m3wraprettype*)
unixPath : TEXT;
(*m3wrapoutname m3wrapouttype*)
checksum : CARDINAL;
END;
BEGIN
TRY
arg1 := M3toC.SharedTtoS(str); (* m3wrapinconv *)
IF Text.Length(arg1) > 10 THEN (* m3wrapincheck *)
RAISE E("str too long");
END;
(* m3wrapretraw m3wrapargraw *)
arg0 := MessyToUnix (arg1, arg2);
result.unixPath := M3toC.CopyStoT(arg0); (* m3wrapretconv *)
result.checksum := arg2; (* m3wrapoutconv *)
IF result.checksum = 0 THEN (* m3wrapoutcheck *)
RAISE E("invalid checksum");
END;
FINALLY
M3toC.FreeSharedS(str,arg1); (* m3wrapfreearg *)
END;
END Name;