summaryrefslogtreecommitdiff
path: root/src/mt/scomptab.f
diff options
context:
space:
mode:
Diffstat (limited to 'src/mt/scomptab.f')
-rw-r--r--src/mt/scomptab.f44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/mt/scomptab.f b/src/mt/scomptab.f
new file mode 100644
index 0000000..4a8a286
--- /dev/null
+++ b/src/mt/scomptab.f
@@ -0,0 +1,44 @@
1ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2c
3c HTCd - Copyright (C) 1998-2006 Henrik Rydberg
4c
5c This program is free software; you can redistribute it and/or modify
6c it under the terms of the GNU General Public License as published by
7c the Free Software Foundation; either version 2 of the License, or
8c (at your option) any later version.
9c
10c This program is distributed in the hope that it will be useful,
11c but WITHOUT ANY WARRANTY; without even the implied warranty of
12c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13c GNU General Public License for more details.
14c
15c You should have received a copy of the GNU General Public License
16c along with this program; if not, write to the Free Software
17c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18c
19
20 integer function scomptab(s,c,n,tab)
21 byte s(0:1),c(0:1),tab(0:1)
22 integer i,m,n
23 m=mod(n,4)
24 do 10 i=0,m-1
25 if(tab(s(i)).ne.tab(c(i)))go to 100
26 10 continue
27 do 20 i=m,n-1,4
28 if(tab(s(i)).ne.tab(c(i)))go to 100
29 if(tab(s(i+1)).ne.tab(c(i+1)))go to 101
30 if(tab(s(i+2)).ne.tab(c(i+2)))go to 102
31 if(tab(s(i+3)).ne.tab(c(i+3)))go to 103
32 20 continue
33 scomptab=0
34 return
35 100 scomptab=tab(s(i))-tab(c(i))
36 return
37 101 scomptab=tab(s(i+1))-tab(c(i+1))
38 return
39 102 scomptab=tab(s(i+2))-tab(c(i+2))
40 return
41 103 scomptab=tab(s(i+3))-tab(c(i+3))
42 return
43 end
44