/*
** mg_bit.h for  in 
** 
** Made by vianney rancurel
** Login   <vianney@epita.fr>
** 
** Started on  Wed Aug 25 12:07:50 1999 vianney rancurel
** Last update Thu Oct 28 20:18:17 1999 
*/
#ifndef MG_BIT_H
#define MG_BIT_H		1

#include "mg.h"

#define BIT_SET(u,n)		((u) |= (1 << (n)))
#define BIT_ISSET(u,n)		((u) & (1 << (n)))

typedef struct		s_bit_field
{
  int			from;
  int			to;
} t_bit_field;

/* PROTO mg_bit.c */
/* mg_bit.c */
void bit_field_u8_get P((t_u8 *valp, t_u8 *retvalp, int from, int to));
void bit_field_u16_get P((t_u16 *valp, t_u16 *retvalp, int from, int to));
void bit_field_u32_get P((t_u32 *valp, t_u32 *retvalp, int from, int to));
void bit_field_u8_set P((t_u8 *valp, int from, int to, int value));
void bit_field_u16_set P((t_u16 *valp, int from, int to, int value));
void bit_field_u32_set P((t_u32 *valp, int from, int to, int value));
#endif
