#ifndef USER_H_ #define USER_H_ #include #include "user_group.h" #define UNAMESIZE (127 + 1) #define UDESIZE (127 + 1) #define UPWDSIZE (63 + 1) #define UTIME 20 #define ADD_FAIL_NOGROUP 1 #define ADD_FAIL_NAMELEN 2 #define ADD_FAIL_NAMESPE 3 #define ADD_FAIL_NAMEDUP 4 #define ADD_FAIL_USERFULL 5 #define ADD_SUCCESS 0 typedef struct user { unsigned short ID; //用户id unsigned short multi_valid; //多人登陆、永久有效 int GID; //用户组ID char uname[UNAMESIZE]; //用户名 char udescription[UDESIZE]; //用户描述 char passwd[UPWDSIZE]; //密码 time_t valid_begin_time; //有效期开始时间 time_t valid_end_time; //有效期结束时间 }USERACCOUNT; typedef struct result_user_add { int result; int userID; }USERADD; /*初始化参数*/ int init_user(); /*添加元素-新增用户*/ void usermanager_add_user(char* UNAME, char* UGNAME, USERADD* UADDRES); #endif