Helper functions in GSM_Tyes and Osmocom_Types
Change-Id: Ibd8f215a7cd4564126503c3552bbcceb6d31c779
diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn
index 713acc9..a6d5c82 100644
--- a/library/Osmocom_Types.ttcn
+++ b/library/Osmocom_Types.ttcn
@@ -99,5 +99,24 @@
self.stop;
}
+type record of integer IntegerRecord;
+
+function int2bool(integer int) return boolean {
+ if (int != 0) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+function f_array_contains(IntegerRecord arr, integer key) return boolean {
+ for (var integer i:= 0; i< sizeof(arr); i := i + 1) {
+ if (arr[i] == key) {
+ return true;
+ }
+ }
+ return false;
+}
+
} with { encode "RAW"; variant "FIELDORDER(msb)" }