buff.c File Reference

#include <stdlib.h>
#include "buff.h"

Include dependency graph for buff.c:

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 Documentation

#define LSB_TO_ONE (  )     ((i) ? ((1UL << (i)) - 1) : 0)

Definition at line 24 of file buff.c.

Referenced by bflush_partiel(), blook(), bread(), and bwrite().

#define LSB_TO_ZERO (  )     (((i) == BUFFSIZE) ? 0 : (((unsigned long) -1) << (i)))


Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

int bread_available ( bread_t  bin  ) 

Definition at line 150 of file buff.c.

References buff::courant, buff::fin, and buff::size.

int bread_bit ( bread_t  bin  ) 

Definition at line 266 of file buff.c.

References bfill(), buff::size, and buff::val.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

unsigned char bread_getchar ( bread_t  bin  ) 

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  ) 

Definition at line 143 of file buff.c.

References buff::courant, buff::size, and buff::val.

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  ) 

Definition at line 134 of file buff.c.

Referenced by dicho_b2cw().

bread_t breadinit ( unsigned char *  message,
int  fin 
)

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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 
)

Definition at line 287 of file buff.c.

References bflush(), buff::size, and buff::val.

Referenced by ajuster(), and dicho().

Here is the call graph for this function:

void bwrite_bits ( unsigned int  x,
int  n,
bwrite_t  bout 
)

Definition at line 295 of file buff.c.

References bflush(), BUFFSIZE, buff::size, and buff::val.

Referenced by ajuster(), and dicho().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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  ) 

Definition at line 165 of file buff.c.

References buff::fin, and buff::lock.

Referenced by dicho().

void bwriteclose ( bwrite_t  bout  ) 

Definition at line 138 of file buff.c.

References bflush_partiel().

Referenced by dicho_cw2b().

Here is the call graph for this function:

bwrite_t bwriteinit ( unsigned char *  message,
int  fin 
)


This work was partially suported by Europian Network of Excellence, ECRYPT; ECRYPT