15 if (groupList != NULL)
28 if (groupList != NULL)
30 for (
size_t index = 0; index < groupList->
groups_count; index++)
46 if (groupList != NULL && group != NULL)
48 Group** new_list = NULL;
49 if (groupList->
groups == NULL)
51 new_list = calloc(1,
sizeof(
Group*));
56 new_list = groupList->
groups;
61 new_list = realloc(groupList->
groups, new_count *
sizeof(
Group*));
66 groupList->
groups = new_list;
82 if (groupList != NULL && groupName != NULL)
84 for (
size_t index = 0; index < groupList->
groups_count; index++)
86 if (strcmp(groupName, groupList->
groups[index]->
Name) == 0)
88 foundIndex = (int)index;
102 if (groupList != NULL && groupList->
groups != NULL)
104 if (removeIndex >= 0 && (
size_t)removeIndex < groupList->groups_count)
107 for (
size_t groupIndex = removeIndex; groupIndex < groupList->
allocated_count - 1; groupIndex++)
109 groupList->
groups[groupIndex] = groupList->
groups[groupIndex + 1];
Represents a single group. A group has a name and zero or more users. Users are tracked by name.
const char * Name
Name of this group.
Represents a list of groups. Call GroupList_Initialize() to start and GroupList_Clear() to release al...
size_t groups_count
Number of pointers in the groups list.
Group ** groups
Array of pointers to Group objects.
size_t allocated_count
Size of the allocated groups list.