1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 21:19:24 +00:00

When the option -k is not given, the default key positions are now computed

depending on the set of keywords.
This commit is contained in:
Bruno Haible
2003-02-11 11:09:27 +00:00
parent 6202aaadb1
commit 810fef43ae
18 changed files with 583 additions and 123 deletions

View File

@@ -32,18 +32,37 @@ Positions::Positions ()
}
INLINE
Positions::Positions (int key1)
Positions::Positions (int pos1)
: _size (1)
{
_positions[0] = key1;
_positions[0] = pos1;
}
INLINE
Positions::Positions (int key1, int key2)
Positions::Positions (int pos1, int pos2)
: _size (2)
{
_positions[0] = key1;
_positions[1] = key2;
_positions[0] = pos1;
_positions[1] = pos2;
}
/* Copy constructor. */
INLINE
Positions::Positions (const Positions& src)
: _size (src._size)
{
memcpy (_positions, src._positions, _size * sizeof (_positions[0]));
}
/* Assignment operator. */
INLINE Positions&
Positions::operator= (const Positions& src)
{
_size = src._size;
memcpy (_positions, src._positions, _size * sizeof (_positions[0]));
return *this;
}
/* Accessors. */
@@ -238,17 +257,9 @@ Options::get_delimiters () const
}
/* Returns key positions.
Only to be called if !options[ALLCHARS]. */
Only to be used if !options[ALLCHARS]. */
INLINE const Positions&
Options::get_key_positions () const
{
return _key_positions;
}
/* Returns total distinct key positions.
Only to be called if !options[ALLCHARS]. */
INLINE int
Options::get_max_keysig_size () const
{
return _key_positions.get_size();
}