The front end of the Users sub-system. Contains the declarations of the support functions for working with users as used in the Mediator Pattern. More...
Go to the source code of this file.
Macros | |
#define | __MEDIATOR_USERS_H__ |
Enumerations | |
enum | UserErrorCode { UserErrorCode_No_Error = 0 , UserErrorCode_Null_Argument = 1 , UserErrorCode_User_Does_Not_Exist = 2 , UserErrorCode_No_Memory = 3 } |
Represents error codes that can be returned from the User functions used in the Mediator Pattern. More... | |
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. | |
The front end of the Users sub-system. Contains the declarations of the support functions for working with users as used in the Mediator Pattern.
Definition in file Mediator_Users.h.
#define __MEDIATOR_USERS_H__ |
Definition at line 8 of file Mediator_Users.h.
enum UserErrorCode |
Represents error codes that can be returned from the User functions used in the Mediator Pattern.
Definition at line 18 of file Mediator_Users.h.
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().