Refactor header inclusions and add main.h; implement searchPersonByUUID and addTimeEvent functions in users.c
This commit is contained in:
+17
-2
@@ -1,3 +1,5 @@
|
||||
#include "main.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
@@ -15,7 +17,9 @@ typedef struct person
|
||||
uint32_t department;
|
||||
|
||||
time_t last_time_event;
|
||||
uint32_t total;
|
||||
time_t total;
|
||||
|
||||
BYTE available;
|
||||
|
||||
pthread_mutex_t lock;
|
||||
} person_t;
|
||||
@@ -40,7 +44,18 @@ uint16_t generateUUID(node_t *_head);
|
||||
|
||||
uint16_t searchUUIDByName(node_t *_head);
|
||||
|
||||
node_t *searchPersonByUUID(node_t *_head);
|
||||
/**
|
||||
* @brief Searches for a person in a linked list by their UUID.
|
||||
*
|
||||
* This function traverses a linked list starting from the given head node
|
||||
* and searches for a node that matches the specified UUID.
|
||||
*
|
||||
* @param _head Pointer to the head node of the linked list.
|
||||
* @param _uuid The UUID of the person to search for.
|
||||
* @return Pointer to the node containing the person with the matching UUID,
|
||||
* or NULL if no such person is found.
|
||||
*/
|
||||
node_t *searchPersonByUUID(node_t *_head, uint16_t _uuid);
|
||||
|
||||
/**
|
||||
* @brief Adds a new person to the linked list.
|
||||
|
||||
Reference in New Issue
Block a user