A parse transform which provides attributes for compiling record and type definitions into encode/decode functions for the MS RPC DCE format.
This parse transform defines serveral new attributes:
-rpce(msrpce_compiler:options()) |
Sets compiler options. See msrpce_compiler:options() . These
affect all other attributes following
it until the next -rpce() attribute. |
-rpce_struct(Name :: record_name()). |
Generates:
|
-rpce_stream(Name :: atom(), [record_name()]). |
Generates:
|
The records named in these attributes must be fully type-annotated, with
types taken from the msrpce
module (e.g.
msrpce:uint32()
or msrpce:pointer(msrpce:string())
).
The header file include/types.hrl
also adds local type
definitions and shortcuts which make this more readable.
-include_lib("msrpce/include/types.hrl").
-record(foobar, {
field_a :: ulong(),
field_b :: pointer(str())
}).
-rpce_struct(foobar).
do_something() ->
Bin = encode_foobar(#foobar{field_a = 123, field_b = "hello"}),
...
parse_transform/2 | |
parse_transform_info/0 |
parse_transform(Forms::[erl_parse:abstract_form()], Options::[compile:option()]) -> [erl_parse:abstract_form()]
parse_transform_info() -> #{error_location => column | line}
Generated by EDoc