/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2003-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#include "vchdr.h"
/* Generalized block-move parsing of a pair of strings.
**
** Written by Kiem-Phong Vo (kpv@research.att.com)
*/
typedef struct _pair_s
} Pair_t;
typedef struct _obj_s
} Obj_t;
typedef struct _hash_s
} Hash_t;
#if __STD_C
#else
#endif
/* compute size to allocate */
;
/* hashing polynomial data */
return hs;
}
#if __STD_C
#else
#endif
{ int k;
return ky;
}
#if __STD_C
#else
#endif
{ int k;
return ky;
}
/* extend to match nearby segments */
#if __STD_C
#else
int type;
#endif
{
/* amounts of matches required and unmatches allowed */
}
else
mbeg = 0;
}
/* bounds of matchable data */
type &= VCLZ_REVERSE;
{ /* count unmatches */
for(m = n; m < em; ++m)
break;
if((u -= (m-n)) <= 0)
goto done;
/* count matches */
for(n = m, m = n+1; m < en; ++m)
break;
if((m-n) < mmin) /* not big enough */
{ if((u += m-n) >= umax)
goto done;
n = m;
}
goto done;
else
n = m;
break;
}
}
}
}
#if __STD_C
#else
#endif
{
/* initialize hash table */
return -1;
if((m += 1) >= endo)
break;
}
}
/* forward: matching twice for plain and mapped data */
{ if(tp == 0) /* plain matching */
else if(!cmap)
continue;
if(prune > 0) /* prune target data outside of search window */
else { p = m; m = m->next; }
}
}
}
else /* possible source match */
}
continue;
if(tp == 0) /* match without mapping */
continue;
break;
}
else /* match with mapping */
continue;
break;
}
{ fpos = m;
flen = n;
}
}
}
{ n = 0;
n += 1;
}
}
/* reverse matching */
{ if(tp == 0)
else if(!cmap)
continue;
if(prune > 0) /* prune target data outside of search window */
else { p = m; m = m->next; }
}
}
continue;
}
else /* possible source match */
}
continue;
if(tp == 0) /* match without cmapping */
continue;
break;
}
else /* match with cmapping */
continue;
break;
}
rlen = n;
}
}
}
{ n = 0;
n += 1;
}
}
goto done;
else if(n == 0) /* treat everything as unmatched */
goto nope;
break;
break;
}
}
else
break;
}
}
}
return n >= 0 ? 0 : -1;
}
#if __STD_C
#else
#endif
{
/* catenate source and target strings into a superstring */
}
}
else
return -1;
}
goto done;
lz += 1;
break;
}
}
rz += 1;
break;
}
}
p += 1; /* improve! go again */
continue;
}
{ p += 1; /* not a bad short, go again */
continue;
}
}
if(savlz > 0) /* no more improvement, use current best */
}
{ r = 0;
if(ad < p)
r += 1;
}
goto done;
else if(r == 0)
goto nope;
else ad += r; /* advance by amount processed */
}
else
}
if(ad < p)
goto done;
}
rv = 0; /* if got here, data successfully parsed */
if(sfx)
return rv;
}
#if __STD_C
#else
#endif
{
/* error conditions */
return -1;
return -1;
return -1;
return 0;
return -1;
else return 0;
}
}