From 5df79c53745fde5d6c3340a2979b1429cd5892c1 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sat, 8 Oct 2011 20:30:28 +0200 Subject: Initial import of htcd system 1.0 Signed-off-by: Henrik Rydberg --- src/mt/cfind.f | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/mt/cfind.f (limited to 'src/mt/cfind.f') 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 @@ +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +c +c HTCd - Copyright (C) 1998-2006 Henrik Rydberg +c +c This program is free software; you can redistribute it and/or modify +c it under the terms of the GNU General Public License as published by +c the Free Software Foundation; either version 2 of the License, or +c (at your option) any later version. +c +c This program is distributed in the hope that it will be useful, +c but WITHOUT ANY WARRANTY; without even the implied warranty of +c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +c GNU General Public License for more details. +c +c You should have received a copy of the GNU General Public License +c along with this program; if not, write to the Free Software +c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +c + + integer function cfind(s,n,c) + character s(0:1),c + integer i,m,n + m=mod(n,16) + do 10 i=0,m-1 + if(s(i).eq.c)go to 100 + 10 continue + do 20 i=m,n-1,16 + if(s(i).eq.c)go to 100 + if(s(i+1).eq.c)go to 101 + if(s(i+2).eq.c)go to 102 + if(s(i+3).eq.c)go to 103 + if(s(i+4).eq.c)go to 104 + if(s(i+5).eq.c)go to 105 + if(s(i+6).eq.c)go to 106 + if(s(i+7).eq.c)go to 107 + if(s(i+8).eq.c)go to 108 + if(s(i+9).eq.c)go to 109 + if(s(i+10).eq.c)go to 110 + if(s(i+11).eq.c)go to 111 + if(s(i+12).eq.c)go to 112 + if(s(i+13).eq.c)go to 113 + if(s(i+14).eq.c)go to 114 + if(s(i+15).eq.c)go to 115 + 20 continue + cfind=-1 + return + 100 cfind=i + return + 101 cfind=i+1 + return + 102 cfind=i+2 + return + 103 cfind=i+3 + return + 104 cfind=i+4 + return + 105 cfind=i+5 + return + 106 cfind=i+6 + return + 107 cfind=i+7 + return + 108 cfind=i+8 + return + 109 cfind=i+9 + return + 110 cfind=i+10 + return + 111 cfind=i+11 + return + 112 cfind=i+12 + return + 113 cfind=i+13 + return + 114 cfind=i+14 + return + 115 cfind=i+15 + return + end + -- cgit v1.2.3