From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/plio/plleq.x | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sys/plio/plleq.x (limited to 'sys/plio/plleq.x') diff --git a/sys/plio/plleq.x b/sys/plio/plleq.x new file mode 100644 index 00000000..d74ae370 --- /dev/null +++ b/sys/plio/plleq.x @@ -0,0 +1,44 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include + +# PLL_EQUAL -- Compare two line lists for equality. + +bool procedure pll_equal (l1, l2) + +short l1[ARB] #I line list 1 +short l2[ARB] #I line list 2 + +int i, off +int l1_len, l1_first +int l2_len, l2_first + +begin + # Support old format line lists. + if (LL_OLDFORMAT(l1)) { + l1_len = OLL_LEN(l1) + l1_first = OLL_FIRST + } else { + l1_len = LL_LEN(l1) + l1_first = LL_FIRST(l1) + } + + # Support old format line lists. + if (LL_OLDFORMAT(l2)) { + l2_len = OLL_LEN(l2) + l2_first = OLL_FIRST + } else { + l2_len = LL_LEN(l2) + l2_first = LL_FIRST(l2) + } + + if (l1_len != l2_len) + return (false) + + off = l2_first - l1_first + do i = l1_first, l1_len + if (l1[i] != l2[i+off]) + return (false) + + return (true) +end -- cgit