summaryrefslogtreecommitdiff
path: root/src/mt/srfind.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/srfind.f
Initial import of htcd system 1.0
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/mt/srfind.f')
-rw-r--r--src/mt/srfind.f40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/mt/srfind.f b/src/mt/srfind.f
new file mode 100644
index 0000000..24f4fb4
--- /dev/null
+++ b/src/mt/srfind.f
@@ -0,0 +1,40 @@
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 srfind(s,sn,c,cn)
21 character s(0:1),c(0:1)
22 integer i,j,m,sn,cn
23 m=mod(cn,4)
24 do 10 i=sn-1,0,-1
25 do 20 j=0,m-1
26 if(s(i+j).ne.c(j))go to 50
27 20 continue
28 do 30 j=m,cn-1,4
29 if(s(i+j).ne.c(j))go to 50
30 if(s(i+j+1).ne.c(j+1))go to 50
31 if(s(i+j+2).ne.c(j+2))go to 50
32 if(s(i+j+3).ne.c(j+3))go to 50
33 30 continue
34 50 if(j.eq.cn)go to 100
35 10 continue
36 srfind=-1
37 return
38 100 srfind=i
39 return
40 end