--- parser3/src/main/pa_dictionary.C 2001/08/01 12:08:40 1.1 +++ parser3/src/main/pa_dictionary.C 2001/08/06 16:18:26 1.3 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: pa_dictionary.C,v 1.1 2001/08/01 12:08:40 parser Exp $"; +static const char *RCSId="$Id: pa_dictionary.C,v 1.3 2001/08/06 16:18:26 parser Exp $"; #include "pa_dictionary.h" @@ -17,20 +17,21 @@ static void add_first(Array::Item *value Dictionary::Dictionary(Table& atable) : Pooled(atable.pool()), table(atable) { // clear firsts - memset(first, sizeof(first), 0); + memset(first, 0, sizeof(first)); // grab first letters of first column of a table table.for_each(add_first, this); } -static bool starts(Array::Item *value, const void *info) { +static void *starts(Array::Item *value, const void *info) { Array *row=static_cast(value); const char *src=static_cast(info); int partial; row->get_string(0)->cmp(partial, src); - return + return ( partial==0 || // full match - partial==1; // typo left column starts 'src' + partial==1) // typo left column starts 'src' + ?value:0; } void* Dictionary::first_that_starts(const char *src) const {