osmo_util: define #pointcode{} record instead of manual 3-tuple

This commit is contained in:
Harald Welte 2011-12-08 00:56:30 +01:00
parent 9baab6dbc9
commit ba0ada720f
2 changed files with 9 additions and 2 deletions

View File

@ -8,3 +8,10 @@
spec_name :: prim_spec_name(), spec_name :: prim_spec_name(),
parameters parameters
}). }).
-type pointcode_repr() :: 'itu' | 'ansi' | 'ttc'.
-record(pointcode, {
repr :: pointcode_repr(),
value
}).

View File

@ -143,8 +143,8 @@ make_prim(Subsys, GenName, SpecName, Param) ->
spec_name = SpecName, parameters = Param}. spec_name = SpecName, parameters = Param}.
% parse a 3-tuple pointcode into a raw integer % parse a 3-tuple pointcode into a raw integer
pointcode2int({pointcode, Std, Param}) -> pointcode2int(#pointcode{repr=Type, value=Value}) ->
pointcode2int(Std, Param); pointcode2int(Type, Value);
pointcode2int({Std, Param}) -> pointcode2int({Std, Param}) ->
pointcode2int(Std, Param). pointcode2int(Std, Param).