summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-12-08 00:56:30 +0100
committerHarald Welte <laforge@gnumonks.org>2011-12-08 00:56:30 +0100
commitba0ada720fc0bb838b1d5f05060677cc33c90901 (patch)
tree16b65d21e48fea1fffa8be784d6e25d31757fc59
parent9baab6dbc994e4a26ef2cd5fda5fd90ba44cd612 (diff)
osmo_util: define #pointcode{} record instead of manual 3-tuple
-rw-r--r--include/osmo_util.hrl7
-rw-r--r--src/osmo_util.erl4
2 files changed, 9 insertions, 2 deletions
diff --git a/include/osmo_util.hrl b/include/osmo_util.hrl
index ba37dd4..34f7e06 100644
--- a/include/osmo_util.hrl
+++ b/include/osmo_util.hrl
@@ -8,3 +8,10 @@
spec_name :: prim_spec_name(),
parameters
}).
+
+-type pointcode_repr() :: 'itu' | 'ansi' | 'ttc'.
+
+-record(pointcode, {
+ repr :: pointcode_repr(),
+ value
+}).
diff --git a/src/osmo_util.erl b/src/osmo_util.erl
index 19729f0..ed6dfad 100644
--- a/src/osmo_util.erl
+++ b/src/osmo_util.erl
@@ -143,8 +143,8 @@ make_prim(Subsys, GenName, SpecName, Param) ->
spec_name = SpecName, parameters = Param}.
% parse a 3-tuple pointcode into a raw integer
-pointcode2int({pointcode, Std, Param}) ->
- pointcode2int(Std, Param);
+pointcode2int(#pointcode{repr=Type, value=Value}) ->
+ pointcode2int(Type, Value);
pointcode2int({Std, Param}) ->
pointcode2int(Std, Param).