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