2.19.3. ModifySet

[<<<] [>>>]

@c Modify a joker set

This function can be used to modify a joker set. The first argument pMS points to the joker set collection. The second argument JokerCharacter specifies the joker character for which the set has to be modified.

The argument nChars and pch give the characters that are to be modified in the set. nChars is the number of characters in the character array pointed by pch.

The last argument fAction specifies what to do. The following constants can be used in logical OR.

TO_HEADER:

#define MATCH_ADDC 0x0001 //add characters to the set #define MATCH_REMC 0x0002 //remove characters from the set #define MATCH_INVC 0x0004 //invert the character #define MATCH_SNOJ 0x0008 //set becomes no-joker #define MATCH_SSIJ 0x0010 //set becomes single joker #define MATCH_SMUJ 0x0020 //set becomes multiple joker #define MATCH_NULS 0x0040 //nullify the set #define MATCH_FULS 0x0080 //fullify the set

*/

The function first checks if it has to modify the state of the joker character. If any of the bits MATCH_SNOJ, MATCH_SSIJ or MATCH_SMUJ is set in the field fAction the type of the set is modified.

If more than one bit of these is set then result is undefined. Current implementation checks these bits in a specific order, but later versions may change.

If the bit MATCH_NULS is set all the characters are removed from the set. If the bit MATCH_FULS is set all characters are put into the set.

If more than one bit of these is set then result is undefined. Current implementation checks these bits in a specific order, but later versions may change.

MATCH_NULS or MATCH_FULS can be used in a single call to initialize the set before adding or removing the specific characters.

The bits MATCH_ADDC, MATCH_REMC and MATCH_INVC can be used to add characters to the set, remove characters from the set or to invert character membership. The characters are taken from the character array pointed by the function argument pch.

If more than one bit of these is set then result is undefined. Current implementation checks these bits in a specific order, but later versions may change.

If none of these bits is set the value of the pointer pch is ignored.

It is no problem if a character is already in the set and is added or if it is not member of the set and is removed. Although it has no practical importance the array pointed by pch may contain a character many times.

void match_ModifySet(pMatchSets pMS,
                     char JokerCharacter,
                     int nChars,
                     unsigned char *pch,
                     int fAction
  ){

[<<<] [>>>]