The front end of the Users sub-system. Contains the implementation of the support functions for working with users as used in the Mediator Pattern. More...
Go to the source code of this file.
Functions | |
void | Users_Clear (void) |
Release all memory associated with the list of users. | |
UserErrorCode | Users_AddUser (const char *userName) |
Add a user to the list of users. | |
UserErrorCode | Users_RemoveUser (const char *userName) |
Remove a user from the list of users. | |
User * | Users_FindUser (const char *userName) |
Find a user from the list of users given the user's name. | |
UserErrorCode | Users_GetAllUsers (StringList *userNames) |
Retrieve a list of all users. | |
Variables | |
static UserList | _users = { 0 } |
The list of users. | |
The front end of the Users sub-system. Contains the implementation of the support functions for working with users as used in the Mediator Pattern.
Definition in file Mediator_Users.c.
UserErrorCode Users_AddUser | ( | const char * | userName | ) |
Add a user to the list of users.
userName | Name of the user to add. |
UserErrorCode_No_Error | indicates success. |
UserErrorCode_Null_Argument | indicates the user parameter is NULL. |
UserErrorCode_User_Does_Not_Exist | indicates the user does not exist. |
UserErrorCode_No_Memory | indicates an out of memory condition. |
Definition at line 27 of file Mediator_Users.c.
References _users, User_Create(), UserErrorCode_No_Error, UserErrorCode_No_Memory, UserErrorCode_Null_Argument, and UserList_AddUser().
Referenced by Mediator_AddUser().
void Users_Clear | ( | void | ) |
Release all memory associated with the list of users.
Definition at line 19 of file Mediator_Users.c.
References _users, and UserList_Clear().
Referenced by Mediator_ClearAll().
User * Users_FindUser | ( | const char * | userName | ) |
Find a user from the list of users given the user's name.
userName | Name of the user to search for. |
Definition at line 71 of file Mediator_Users.c.
References _users, UserList_FindUser(), and UserList::users.
Referenced by Mediator_RemoveUserFromAllGroups().
UserErrorCode Users_GetAllUsers | ( | StringList * | userNames | ) |
Retrieve a list of all users.
userNames | A StringList object to be populated with all user names. |
UserErrorCode_No_Error | indicates success. |
UserErrorCode_Null_Argument | indicates the userName parameter is NULL. |
UserErrorCode_No_Memory | indicates an out of memory condition. |
Definition at line 91 of file Mediator_Users.c.
References _users, User::Name, StringList_AddString(), UserErrorCode_No_Memory, UserErrorCode_Null_Argument, UserList::users, and UserList::users_count.
Referenced by Mediator_GetAllUsers().
UserErrorCode Users_RemoveUser | ( | const char * | userName | ) |
Remove a user from the list of users.
userName | Name of the user to remove. |
UserErrorCode_No_Error | indicates success. |
UserErrorCode_Null_Argument | indicates the user parameter is NULL. |
UserErrorCode_User_Does_Not_Exist | indicates the user does not exist. |
Definition at line 50 of file Mediator_Users.c.
References _users, UserErrorCode_No_Error, UserErrorCode_Null_Argument, UserErrorCode_User_Does_Not_Exist, UserList_FindUser(), and UserList_RemoveUser().
Referenced by Mediator_RemoveUser().
|
static |
The list of users.
Definition at line 12 of file Mediator_Users.c.
Referenced by Users_AddUser(), Users_Clear(), Users_FindUser(), Users_GetAllUsers(), and Users_RemoveUser().