Diameter dictionary compilation.

The function codec/2 is used to compile a diameter dictionary into Erlang source. The resulting source implements the interface diameter required to encode and decode the dictionary's messages and AVP's.

The utility diameterc(1) provides an alternate compilation interface.


codec(Path::string(), [Opt]) -> ok | {error, Reason}

Compile a single dictionary file to Erlang source. Opt can have the following types.

{include, Dir::string()}

Prepend the specified directory to the code path. Use to point at beam files compiled from inherited dictionaries, @inherits in a dictionary file creating a beam dependency, not an erl/hrl dependency.

Multiple include options can be specified.

{outdir, Dir::string()}

Write generated source to the specified directory. Defaults to the current working directory.

{name|prefix, string()}

Set @name or @prefix to the specified string. Overrides any setting in the file itself.

{inherits, Mod::string()}

Append @inherits of the specified module. Specifying "-" has the effect of discarding clearing any previous inherits, both in the dictionary file and on the options list.

Multiple inherits options can be specified.


All options are string-valued. In particular, it is not currently possible to an @inherits module as an atom() or a path as a file:name()