2024-09-16 14:11:01 +02:00
|
|
|
#ifndef USER_H_
|
|
|
|
#define USER_H_
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
typedef struct user {
|
2024-09-24 20:05:49 +02:00
|
|
|
uint8_t name[MAX_NAME];
|
2024-09-16 14:11:01 +02:00
|
|
|
int color;
|
|
|
|
} user;
|
|
|
|
|
|
|
|
typedef struct ArrayList {
|
|
|
|
size_t length;
|
|
|
|
size_t capacity;
|
|
|
|
user *items;
|
|
|
|
} ArrayList;
|
|
|
|
|
|
|
|
ArrayList *arraylist_init(size_t capacity);
|
|
|
|
void arraylist_free(ArrayList *list);
|
2024-09-18 09:37:02 +02:00
|
|
|
long arraylist_search(ArrayList *list, uint8_t *username);
|
2024-09-16 14:11:01 +02:00
|
|
|
void arraylist_remove(ArrayList *list, long index);
|
2024-09-24 20:05:49 +02:00
|
|
|
void arraylist_add(ArrayList *list, uint8_t *username, int color, bool marked, bool force);
|
|
|
|
int get_user_color(ArrayList *list, uint8_t *username);
|
2024-09-16 14:11:01 +02:00
|
|
|
|
|
|
|
#endif
|