#include <limits.h>
#include <tcl.h>

#ifndef __LFSR_H__
#define __LFSR_H__

typedef unsigned long t_POLY;

#define POLY_MSB ((unsigned long)LONG_MAX + 1)

unsigned long LFSR_Next(const t_POLY, const unsigned long);
unsigned long LFSR_Prev(const t_POLY, const unsigned long);
t_POLY LFSR_Reverse(const t_POLY);
char* LFSR_PrintPoly(const t_POLY);
void LFSR_ReadPolys(FILE*);
const t_POLY LFSR_GetPrimPoly(int);
const int LFSR_GetWidth(const t_POLY);

void LFSR_TclRegister(Tcl_Interp* tcl);

#endif
