Add files.h and optimisation of QAM
This commit is contained in:
21
files/files.h
Normal file
21
files/files.h
Normal file
@ -0,0 +1,21 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
// Conteneur de bits (0/1 stockés dans uint8_t)
|
||||
typedef struct {
|
||||
uint8_t *bits; // tableau de 0/1
|
||||
size_t nb_bits; // nombre total de bits
|
||||
} bit_array;
|
||||
|
||||
// Lire un fichier binaire et le transformer en tableau de bits (0/1)
|
||||
bit_array file_to_bits(const char *filename);
|
||||
|
||||
// Transformer un tableau de bits (0/1) en fichier binaire
|
||||
int bits_to_file(const char *filename, const bit_array *arr);
|
||||
|
||||
// Génère un nom du type "output.<ext>" où <ext> est l'extension du fichier d'entrée
|
||||
char* make_output_filename(const char *input_filename);
|
||||
|
||||
// Libérer la mémoire du bit_array
|
||||
void free_bit_array(bit_array *arr);
|
||||
Reference in New Issue
Block a user