#include <stdlib.h>
#include "buff.h"
Go to the source code of this file.
Defines | |
#define | LSB_TO_ONE(i) ((i) ? ((1UL << (i)) - 1) : 0) |
#define | LSB_TO_ZERO(i) (((i) == BUFFSIZE) ? 0 : (((unsigned long) -1) << (i))) |
Functions | |
unsigned char | bread_getchar (bread_t bin) |
void | bwrite_putchar (unsigned char c, bwrite_t bout) |
bread_t | breadinit (unsigned char *message, int fin) |
bwrite_t | bwriteinit (unsigned char *message, int fin) |
void | bfill (bread_t bin) |
void | bflush (bwrite_t bout) |
void | bflush_partiel (bwrite_t bout) |
void | breadclose (bread_t bin) |
void | bwriteclose (bwrite_t bout) |
void | bread_retour (bread_t bin) |
int | bread_available (bread_t bin) |
int | bwrite_available (bwrite_t bout) |
int | bread_unlocked (bread_t bin) |
int | bwrite_unlocked (bwrite_t bout) |
int | bread_position (bread_t bin) |
void | bread_changer_position (bread_t bin, int i) |
void | bread_decaler_fin (bread_t bin, int i) |
void | bwrite_changer_position (bwrite_t bout, int i) |
void | bwrite_decaler_fin (bwrite_t bout, int i) |
unsigned | bread (int i, bread_t bin) |
void | bread_lock (int i, bread_t bin) |
void | bwrite_lock (int i, bwrite_t bout) |
unsigned | blook (int i, bread_t bin) |
void | bstep (int i, bread_t bin) |
int | bread_bit (bread_t bin) |
void | bwrite (unsigned int x, int i, bwrite_t bout) |
void | bwrite_bit (unsigned int x, bwrite_t bout) |
void | bwrite_bits (unsigned int x, int n, bwrite_t bout) |
#define LSB_TO_ONE | ( | i | ) | ((i) ? ((1UL << (i)) - 1) : 0) |
#define LSB_TO_ZERO | ( | i | ) | (((i) == BUFFSIZE) ? 0 : (((unsigned long) -1) << (i))) |
Definition at line 25 of file buff.c.
Referenced by bflush_partiel(), bread_decaler_fin(), breadinit(), bwrite_changer_position(), bwrite_decaler_fin(), and bwriteinit().
void bfill | ( | bread_t | bin | ) |
Definition at line 87 of file buff.c.
References bread_getchar(), BUFFSIZE, buff::size, and buff::val.
Referenced by bread(), bread_bit(), and bstep().
void bflush | ( | bwrite_t | bout | ) |
Definition at line 98 of file buff.c.
References BUFFSIZE, bwrite_putchar(), buff::size, and buff::val.
Referenced by bwrite(), bwrite_bit(), and bwrite_bits().
void bflush_partiel | ( | bwrite_t | bout | ) |
Definition at line 107 of file buff.c.
References bread_getchar(), BUFFSIZE, bwrite_putchar(), buff::courant, LSB_TO_ONE, LSB_TO_ZERO, buff::size, and buff::val.
Referenced by bwrite_changer_position(), and bwriteclose().
unsigned blook | ( | int | i, | |
bread_t | bin | |||
) |
Definition at line 244 of file buff.c.
References bread_getchar(), LSB_TO_ONE, buff::size, and buff::val.
Referenced by decoder(), and decoder_uniforme().
unsigned bread | ( | int | i, | |
bread_t | bin | |||
) |
Definition at line 219 of file buff.c.
References bfill(), LSB_TO_ONE, buff::size, and buff::val.
Referenced by dicho_b2cw(), and dichoinv().
int bread_available | ( | bread_t | bin | ) |
int bread_bit | ( | bread_t | bin | ) |
Definition at line 266 of file buff.c.
References bfill(), buff::size, and buff::val.
void bread_changer_position | ( | bread_t | bin, | |
int | i | |||
) |
Definition at line 173 of file buff.c.
References bread_getchar(), buff::courant, buff::size, and buff::val.
Referenced by bread_decaler_fin(), dicho_b2cw(), and dichoinv().
void bread_decaler_fin | ( | bread_t | bin, | |
int | i | |||
) |
Definition at line 183 of file buff.c.
References bread_changer_position(), bread_position(), buff::dernier, buff::fin, LSB_TO_ZERO, and buff::masque_dernier.
Referenced by dichoinv().
unsigned char bread_getchar | ( | bread_t | bin | ) |
Definition at line 27 of file buff.c.
References buff::courant, buff::dernier, buff::masque_dernier, and buff::message.
Referenced by bfill(), bflush_partiel(), blook(), and bread_changer_position().
void bread_lock | ( | int | i, | |
bread_t | bin | |||
) |
Definition at line 234 of file buff.c.
References buff::courant, buff::lock, and buff::size.
Referenced by decoder(), and decoder_uniforme().
int bread_position | ( | bread_t | bin | ) |
Definition at line 169 of file buff.c.
References buff::courant, and buff::size.
Referenced by bread_decaler_fin().
void bread_retour | ( | bread_t | bin | ) |
int bread_unlocked | ( | bread_t | bin | ) |
Definition at line 160 of file buff.c.
References buff::fin, and buff::lock.
Referenced by dichoinv().
void breadclose | ( | bread_t | bin | ) |
bread_t breadinit | ( | unsigned char * | message, | |
int | fin | |||
) |
Definition at line 46 of file buff.c.
References buff::courant, buff::dernier, buff::fin, buff::lock, LSB_TO_ZERO, buff::masque_dernier, buff::message, buff::size, and buff::val.
Referenced by dicho_b2cw().
void bstep | ( | int | i, | |
bread_t | bin | |||
) |
Definition at line 258 of file buff.c.
References bfill(), and buff::size.
Referenced by decoder(), and decoder_uniforme().
void bwrite | ( | unsigned int | x, | |
int | i, | |||
bwrite_t | bout | |||
) |
Definition at line 274 of file buff.c.
References bflush(), LSB_TO_ONE, buff::size, and buff::val.
Referenced by ajuster(), dicho(), and dicho_cw2b().
int bwrite_available | ( | bwrite_t | bout | ) |
Definition at line 155 of file buff.c.
References BUFFSIZE, buff::courant, buff::fin, and buff::size.
void bwrite_bit | ( | unsigned int | x, | |
bwrite_t | bout | |||
) |
void bwrite_bits | ( | unsigned int | x, | |
int | n, | |||
bwrite_t | bout | |||
) |
void bwrite_changer_position | ( | bwrite_t | bout, | |
int | i | |||
) |
Definition at line 190 of file buff.c.
References bflush_partiel(), BUFFSIZE, buff::courant, LSB_TO_ZERO, buff::message, buff::size, and buff::val.
Referenced by dicho(), and dicho_cw2b().
void bwrite_decaler_fin | ( | bwrite_t | bout, | |
int | i | |||
) |
Definition at line 212 of file buff.c.
References buff::dernier, buff::fin, LSB_TO_ZERO, and buff::masque_dernier.
Referenced by dicho().
void bwrite_lock | ( | int | i, | |
bwrite_t | bout | |||
) |
Definition at line 238 of file buff.c.
References BUFFSIZE, buff::courant, buff::lock, and buff::size.
Referenced by coder(), and coder_uniforme().
void bwrite_putchar | ( | unsigned char | c, | |
bwrite_t | bout | |||
) |
Definition at line 36 of file buff.c.
References buff::courant, buff::dernier, buff::masque_dernier, and buff::message.
Referenced by bflush(), and bflush_partiel().
int bwrite_unlocked | ( | bwrite_t | bout | ) |
void bwriteclose | ( | bwrite_t | bout | ) |
Definition at line 138 of file buff.c.
References bflush_partiel().
Referenced by dicho_cw2b().
bwrite_t bwriteinit | ( | unsigned char * | message, | |
int | fin | |||
) |
Definition at line 66 of file buff.c.
References BUFFSIZE, buff::courant, buff::dernier, buff::fin, buff::lock, LSB_TO_ZERO, buff::masque_dernier, buff::message, buff::size, and buff::val.
Referenced by dicho_cw2b().