39 lines
890 B
C
39 lines
890 B
C
|
#ifndef USER_GROUP_H_
|
||
|
#define USER_GROUP_H_
|
||
|
|
||
|
#define GNAMESIZE (127 + 1)
|
||
|
#define GDESIZE (127 + 1)
|
||
|
|
||
|
typedef struct usergroup
|
||
|
{
|
||
|
int ID;
|
||
|
char gname[GNAMESIZE];
|
||
|
char gdescription[GDESIZE];
|
||
|
}USERGROUP;
|
||
|
|
||
|
USERGROUP g_group_table[GROUP_INDEX_MAX];
|
||
|
|
||
|
/* 初始化参数 */
|
||
|
int InitUserGroup();
|
||
|
|
||
|
/* 添加元素-新增用户组 */
|
||
|
unsigned short AddGroup(USERGROUP* UG, char* UGNAME, char* UGDES);
|
||
|
|
||
|
/* 获得用户组个数 */
|
||
|
unsigned short getGroupCount(USERGROUP* UG);
|
||
|
|
||
|
/* 查询用户组列表 */
|
||
|
USERGROUP* showUserGroupList(USERGROUP* UG, USERGROUP* UGLIST);
|
||
|
|
||
|
/* 根据用户组名查询用户组 */
|
||
|
USERGROUP* findGroupByName(USERGROUP* UG, char* UGNAME, USERGROUP* UGRES);
|
||
|
|
||
|
/* 根据用户组名查询用户组ID */
|
||
|
unsigned short getGroupIDByGName(USERGROUP* UG, char* UGNAME);
|
||
|
|
||
|
/* 根据用户组名删除用户组 */
|
||
|
unsigned short DelGroupByName(USERGROUP* UG, char* UGNAME);
|
||
|
|
||
|
#endif
|
||
|
|