f1-basic-queue #16
2 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
@ -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");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue