1 /*---------------------------------------------------
2     Victor 'mgl' Anikeev, mgl@pisem.net
3 ---------------------------------------------------*/
4 
5 #ifndef __MGLGROUPS_H__
6 #define __MGLGROUPS_H__
7 
8 #include "fidoconf.h"
9 
10 /*---------------------------------------------------
11  Returns number of groups in string. Groups must be
12  separated with symbols, defined in delms string. The
13  function doesn't check duplicates and skips
14  empty groups.
15  Expamples:
16  2 == ("windows,;,,,,linux", ",;"))
17  3 == ("quake quake quake", " "));
18 ---------------------------------------------------*/
19 int getGroupSetSize(char *str, register char *delms);
20 
21 
22 /*--------------------------------------------------
23  Returns 1 if one set of groups (sub) is
24  sub set of other set (groups). Groups must be
25  separated with symbols, defined in delms string.
26  Expamples:
27  1 == ("quake doom", "doom wolf quake", " ")
28  1 == ("quake doom", "quake doom"...
29  1 == ("quake", "quake doom"...
30  1 == ("", "quake doom"...
31  0 == ("quake doom", "wolf quake"...
32  0 == ("quake", "doom"...
33  0 == ("quake", ""...
34 --------------------------------------------------*/
35 int isSubSetOfGroups(char *sub, char *groups, register char *delms);
36 
37 
38 /*--------------------------------------------------
39  Returns 1 if group sets grp1 and grp2 have common
40  groups or both sets are empty. Groups must be
41  separated with symbols, defined in delms string.
42  Expamples:
43  0 == ("quake", "doom")
44  0 == ("quake", "")
45  1 == ("quake", "quake")
46  1 == ("quake doom", "doom wolf")
47 --------------------------------------------------*/
48 int areCrossGroupSets(char *grp1, char *grp2, register char *delms);
49 
50 /*----------------------------------------------------
51  Returns 1 if two group sets are equal. Groups must be
52  separated with symbols, defined in delms string.
53 ----------------------------------------------------*/
54 int areEqualGroupSets(char *grp1, char *grp2, register char *delms);
55 
56 #endif
57