mirror of
https://github.com/zap-proto/erlang.git
synced 2026-10-30 15:05:14 +00:00
Mechanical, byte-balanced rename across the full tree (1648 ins / 1648 del): - ecapnp -> ezap, capnpc-erl -> zapc-erl, *_capnp.erl -> *_zap.erl - .capnp schemas -> .zap (schema, rpc, c++, test, addressbook, calculator) - "Cap'n Proto" prose -> "Zap" in docs and module @doc comments - 58 renamed/modified source, header, schema, sample and test files Brand-neutrality (canonical zap-proto): - README + overview.edoc project URLs -> zap-proto.io / github.com/zap-proto/erlang - doc links -> zap-proto.dev (encoding, otherlang, sdks/erlang) - generator banner (ezap_compiler) + all 6 generated modules -> https://github.com/zap-proto/erlang - Makefile dep_zap_test -> https://github.com/zap-proto/zap_test.git Build hygiene: - modernize git:// -> https:// for dep_eunit_formatters (git:// is dead on GitHub) Upstream license/author attribution headers (Andreas Stenius) preserved. Tests unchanged: proper_SUITE / ezap_props property tests + eunit suite.
82 lines
1.8 KiB
Erlang
82 lines
1.8 KiB
Erlang
%% ezap schema records
|
|
%%
|
|
%% Bump version number on ANY change in ANY of the records in this file.
|
|
%% Must have the same version in both ezap runtime libs and compiled schemas.
|
|
-ezap_schema_version(4).
|
|
|
|
%% Common record for all schema nodes
|
|
-record(schema_node, {
|
|
module :: atom(),
|
|
name :: ezap:type_name(),
|
|
id = 0 :: ezap:type_id(),
|
|
src = <<>> :: ezap:text(),
|
|
kind = file :: ezap:schema_kind(),
|
|
annotations = [] :: list(),
|
|
nodes = [] :: ezap:schema_nodes(),
|
|
scope = 0 :: ezap:type_id()
|
|
}).
|
|
|
|
%% Struct node
|
|
-record(struct, {
|
|
dsize = 0 :: ezap:word_count(),
|
|
psize = 0 :: ezap:ptr_count(),
|
|
esize = inlineComposite :: ezap:element_size(),
|
|
union_field = none :: none | ezap:field_type(),
|
|
fields = [] :: ezap:struct_fields()
|
|
}).
|
|
|
|
%% Enum node
|
|
-record(enum, {
|
|
values = [] :: ezap:enum_values()
|
|
}).
|
|
|
|
%% Interface node
|
|
-record(interface, {
|
|
extends = [] :: list(),
|
|
methods = [] :: list()
|
|
}).
|
|
|
|
%% Const node
|
|
-record(const, {
|
|
field
|
|
}).
|
|
|
|
%% Annotation node
|
|
-record(annotation, {
|
|
type,
|
|
targets = [] :: list(atom())
|
|
}).
|
|
|
|
%% Struct field
|
|
-record(field, {
|
|
id,
|
|
name,
|
|
kind,
|
|
annotations = []
|
|
}).
|
|
|
|
%% Schema Field types
|
|
-record(ptr, {
|
|
type :: term(),
|
|
idx = 0 :: ezap:ptr_index(),
|
|
default = <<0:64/integer-little>> :: ezap:value()
|
|
}).
|
|
|
|
-record(data, {
|
|
type :: term(),
|
|
align = 0 :: ezap:bit_count(),
|
|
default :: ezap:value()
|
|
}).
|
|
|
|
-record(group, {
|
|
id = 0 :: ezap:type_id()
|
|
}).
|
|
|
|
%% Interface methods
|
|
-record(method, {
|
|
id,
|
|
name,
|
|
paramType,
|
|
resultType
|
|
}).
|