static char *
search_thread (const char *nm, int l, char *t, p4cell wl_flag )
{
auto char upper[UPPERMAX];
if (l > NFACNTMAX)
return NULL;
# if P4_LOG
if (p4_LogMask & P4_LOG_DEBUG)
if (t && !((char*)PFE.dict <= t && t <= (char*)PFE.dictlimit))
{
P4_fail3 ("hashlink pointer invalid %p in search for '%.*s'" ,
t, l, nm);
}
# endif
if( LOWER_CASE && (wl_flag & WORDL_NOCASE) )
{
while (t)
{
if ( !(*_FFA(t) & P4xSMUDGED) && NFACNT(*t) == l)
{
if (!p4_strncmpi (nm, t+1, l)) break;
}
t = *p4_name_to_link (t);
}
if (t && (wl_flag & WORDL_UPPER_CASE) && memcmp (nm, t+1, l))
{
UPPERCOPY (upper, nm, l);
if (memcmp (upper, t+1, l))
{
# if defined _K12_SOURCE && defined VXWORKS
p4_outf ("(warning: input '%.*s' hits '%.*s': bad spelling?)" ,
l, nm, l, t+1);
# endif
P4_warn4 ("oops, input '%.*s' hits '%.*s': bad spelling?" ,
l, nm, l, t+1);
P4_info4 ("- the input word '%.*s' might not match '%.*s'"
"in the future - please fix it now." , l, nm, l, t+1);
}
}
}else if( UPPER_CASE && (wl_flag & WORDL_UPPER_CASE) )
{
UPPERCOPY (upper, nm, l);
while (t)
{
if ( !(*_FFA(t) & P4xSMUDGED) && NFACNT(*t) == l)
{
if (!memcmp (nm, t+1, l)) break;
if (!memcmp (upper, t+1, l)) break;
}
t = *p4_name_to_link (t);
}
}else{
while (t)
{
if ( !(*_FFA(t) & P4xSMUDGED) && NFACNT(*t) == l)
{
if (!memcmp (nm, t+1, l)) break;
}
t = *p4_name_to_link (t);
}
}
return t;
} |