f1-basic-queue #16

Merged
Mineplay merged 6 commits from f1-basic-queue into main 2025-04-22 16:02:39 -05:00
2 changed files with 6 additions and 0 deletions
Showing only changes of commit c7892da31b - Show all commits

View file

@ -42,4 +42,6 @@ FledastyError fledasty_queue_push(FledastyQueue *current_queue, void *value);
void *fledasty_queue_peek(FledastyQueue *current_queue); void *fledasty_queue_peek(FledastyQueue *current_queue);
void *fledasty_queue_pop(FledastyQueue *current_queue); void *fledasty_queue_pop(FledastyQueue *current_queue);
static inline size_t fledasty_queue_is_empty(FledastyQueue *current_queue) { return current_queue->size == 0; }
#endif #endif

View file

@ -38,6 +38,10 @@ int main() {
printf("Popped: %d\n", *popped_data); printf("Popped: %d\n", *popped_data);
} }
if (fledasty_queue_is_empty(&test_queue)) {
printf("Queue is empty\n");
}
fledasty_queue_destroy(&test_queue); fledasty_queue_destroy(&test_queue);
printf("Done\n"); printf("Done\n");