-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.h
47 lines (35 loc) · 917 Bytes
/
file.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef FILE_H
#define FILE_H
#include <stdlib.h>
#include <stdio.h>
#include "arbre.h"
#define BLOCK_SIZE 4096
typedef struct {
FILE * file;
char mode;
unsigned char record [BLOCK_SIZE];
int record_length;
int i_record;
char octet[8];
int i_octet;
int nb_octets;
} Bin_file;
typedef struct entree_t
{
unsigned char c;
unsigned char *seqBits;
int len;
} entree ;
typedef entree *dico;
void close_file(Bin_file * input);
void open_file_read(Bin_file *input, char *name);
void open_file_write(Bin_file * input, char * name);
char lecture(Bin_file * input);
void chartobin(Bin_file * input, int c);
// Transforme une chaine de 8 car en char
unsigned char bitToCar(unsigned char *tab);
// Compresse in dans out par l'arbre a
void ecriture(Bin_file *in, Bin_file *out, dico d);
// Compresse in dans out par l'arbre a
void ecrire_2(Bin_file *output, char bit);
#endif