zsm/include/zen/user.h

27 lines
600 B
C
Raw Normal View History

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