diameter_make
Module
diameter_make
Module Summary
Diameter dictionary compilation.
Since
Module diameter_make was introduced in OTP R14B03.
Description
 The function codec/2 is used to compile a diameter dictionary file into Erlang source. The resulting source implements the interface diameter requires to encode and decode the dictionary's messages and AVPs.
 The utility diameterc(1) provides an alternate compilation interface.
Exports
| codec(File :: iolist() | binary(), [Opt]) -> ok | {ok, [Out]} | {error, Reason} | OTP R15B | 
 Compile a single dictionary file. The input File can be either a path or a literal dictionary, the occurrence of newline (ascii NL) or carriage return (ascii CR) identifying the latter. Opt determines the format of the results and whether they are written to file or returned, and can have the following types.
- parse | forms | erl | hrl
-  Specifies an output format. Whether the output is returned or written to file depends on whether or not option returnis specified. When written to file, the resulting file(s) will have extensions.D,.F,.erl, and.hrlrespectively, basenames defaulting todictionaryif the input dictionary is literal and does not specify@nameerlandhrl(in this order) if unspecified.The parseformat is an internal representation that can be passed toflatten/1andformat/1, while theformsformat can be passed tocompile:forms/2. Theerlandhrlformats are returned as iolists.
- {include, string()}
-  Prepend the specified directory to the code path. Use to point at beam files compiled from inherited dictionaries, @inheritsMultiple includeoptions can be specified.
- {outdir, string()}
-  Write generated source to the specified directory. Defaults to the current working directory. Has no effect if option returnis specified.
- return
-  Return results in a {ok, [Out]}tuple instead of writing to file and returningok.
- {name|prefix, string()}
-  Transform the input dictionary before compilation, setting @name@prefix
- {inherits, string()}
-  Transform the input dictionary before compilation, appending @inheritsTwo forms have special meaning: {inherits, "-"} {inherits, "Prev/Mod"}The first has the effect of clearing any previous inherits, the second of replacing a previous inherits of Prevto one ofMod. This allows the semantics of the input dictionary to be changed without modifying the file itself.Multiple inheritsoptions can be specified.
 Note that a dictionary's @nameoutdir option, determine the output paths when the return option is not specified. The @namedictionary.
 A returned error reason can be converted into a readable string using format_error/1.
| format(Parsed) -> iolist() | OTP R16B03 | 
 Turns a parsed dictionary, as returned by codec/2, back into the dictionary format.
| flatten(Parsed) -> term() | OTP R16B03 | 
 Reconstitute a parsed dictionary, as returned by codec/2, without using @inherits
| format_error(Reason) -> string() | OTP 17.0 | 
 Turn an error reason returned by codec/2 into a readable string.
Bugs
Unrecognized options are silently ignored.
See also
    © 2010–2020 Ericsson AB
Licensed under the Apache License, Version 2.0.