1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2024-11-13 23:43:13 +01:00

feat: add terminal_print_array_list

This commit is contained in:
Théo LUDWIG 2023-07-31 23:51:37 +02:00
parent 368c07c57a
commit 9717cff35a
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
2 changed files with 14 additions and 0 deletions

View File

@ -111,3 +111,7 @@ void terminal_print_hash_map(struct hash_map* hash_map, void (*print_element)(vo
} }
printf("}\n"); printf("}\n");
} }
void terminal_print_array_list(struct array_list* list, void (*print_element)(void*)) {
terminal_print_array(list->data, list->size, sizeof(void*), print_element);
}

View File

@ -6,6 +6,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "array_list.h"
#include "character.h" #include "character.h"
#include "hash_map.h" #include "hash_map.h"
#include "linked_list.h" #include "linked_list.h"
@ -106,4 +107,13 @@ void terminal_print_linked_list(struct linked_list* linked_list, void (*print_el
*/ */
void terminal_print_hash_map(struct hash_map* hash_map, void (*print_element)(void*)); void terminal_print_hash_map(struct hash_map* hash_map, void (*print_element)(void*));
/**
* @brief Print an array list.
*
* @param array_list
* @param print_element
* @since v2.1.0
*/
void terminal_print_array_list(struct array_list* list, void (*print_element)(void*));
#endif #endif