From ba0ada720fc0bb838b1d5f05060677cc33c90901 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 8 Dec 2011 00:56:30 +0100 Subject: osmo_util: define #pointcode{} record instead of manual 3-tuple --- include/osmo_util.hrl | 7 +++++++ src/osmo_util.erl | 4 ++-- 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). -- cgit v1.2.3