summaryrefslogtreecommitdiff
path: root/src/mt/find_of.f
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-10-08 20:30:28 +0200
committerHenrik Rydberg <rydberg@euromail.se>2011-10-08 20:30:28 +0200
commit5df79c53745fde5d6c3340a2979b1429cd5892c1 (patch)
tree1a81af141708b826e9c61e8a04019994fcca8298 /src/mt/find_of.f
Initial import of htcd system 1.0
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/mt/find_of.f')
-rw-r--r--src/mt/find_of.f80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/mt/find_of.f b/src/mt/find_of.f
new file mode 100644
index 0000000..81cd99d
--- /dev/null
+++ b/src/mt/find_of.f
@@ -0,0 +1,80 @@
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 find_of(s,n,c)
21 byte s(0:1),c(0:1)
22 integer i,m,n
23 m=mod(n,16)
24 do 10 i=0,m-1
25 if(c(s(i)).ne.0)go to 100
26 10 continue
27 do 20 i=m,n-1,16
28 if(c(s(i)).ne.0)go to 100
29 if(c(s(i+1)).ne.0)go to 101
30 if(c(s(i+2)).ne.0)go to 102
31 if(c(s(i+3)).ne.0)go to 103
32 if(c(s(i+4)).ne.0)go to 104
33 if(c(s(i+5)).ne.0)go to 105
34 if(c(s(i+6)).ne.0)go to 106
35 if(c(s(i+7)).ne.0)go to 107
36 if(c(s(i+8)).ne.0)go to 108
37 if(c(s(i+9)).ne.0)go to 109
38 if(c(s(i+10)).ne.0)go to 110
39 if(c(s(i+11)).ne.0)go to 111
40 if(c(s(i+12)).ne.0)go to 112
41 if(c(s(i+13)).ne.0)go to 113
42 if(c(s(i+14)).ne.0)go to 114
43 if(c(s(i+15)).ne.0)go to 115
44 20 continue
45 find_of=-1
46 return
47 100 find_of=i
48 return
49 101 find_of=i+1
50 return
51 102 find_of=i+2
52 return
53 103 find_of=i+3
54 return
55 104 find_of=i+4
56 return
57 105 find_of=i+5
58 return
59 106 find_of=i+6
60 return
61 107 find_of=i+7
62 return
63 108 find_of=i+8
64 return
65 109 find_of=i+9
66 return
67 110 find_of=i+10
68 return
69 111 find_of=i+11
70 return
71 112 find_of=i+12
72 return
73 113 find_of=i+13
74 return
75 114 find_of=i+14
76 return
77 115 find_of=i+15
78 return
79 end
80