1#ifndef __GROUP_H__
2#define __GROUP_H__
3
4#include "user.h"
5
6typedef struct grp_list{
7	char	name[FSH_MaxGroupLen+1];		// name of group
8	int		nAccess;					// access right : 5=read only 7=r/w
9	struct	grp_list *pNext;			// pNext group
10}grp_list;
11
12typedef struct grp_share{
13	char	name[FSH_MaxGroupLen+1];		// name of  group
14	int		nShares;					// number of shares the group can access
15	char	**ppShare;					// shares the user can access
16	int		nAccess[FSH_MaxShare];		// access right to the shares of the user
17}grp_share;
18
19typedef struct group_list{
20	char		name[FSH_MaxGroupLen+1];	// name of  group
21	int			nGid;					// id of the group;
22	grp_user	*pUser;					// user info of the group
23	grp_share	*pShare;				// share info of the group
24	struct group_list *pNext;
25}group_list;
26
27typedef struct sh_group{
28	char		name[FSH_MaxShareLen+1];	// name of share
29	grp_list	*pGroup;				// groups that can access the share
30}sh_group;
31
32int AddGroup (char *name);
33int DelGroup (char *name);
34int DelAllGroup (void);
35int RenameGroup (char *pOld, char *pNew);
36int GroupExist (char *name);
37int GetNumOfGrps(void);
38int GetGrpNameList(grp_list **ppList);
39int GetAllGroup (group_list **ppList);
40void FreeGrpList (group_list *pList);
41void FreeGrpNameList(grp_list *pList);
42void FreeGrpShareInfo(grp_share * pSh);
43void FreeShareGrpInfo(sh_group * pList);
44#endif
45