update tp-huffman

This commit is contained in:
2024-10-24 16:29:20 +02:00
parent a65075b162
commit af83ce0117
34 changed files with 1745 additions and 0 deletions

19
tp-huffman/alloc.c Normal file
View File

@@ -0,0 +1,19 @@
/**
* @file alloc.c
* @brief Fonctions d'allocation mémoire.
*/
#include "alloc.h"
void check_null(const char *function, char *file, int line, int n, ...) {
va_list ap;
char *s;
va_start(ap, n);
for (int i = 0; i < n; i++) {
void *p = va_arg(ap, void *);
s = va_arg(ap, char *);
if (p == NULL)
PRINT_ERROR(KO, "CRITICAL", function, file, line, "%s is NULL.", s);
}
}