X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=input.h;h=19315e54ab3c357ceaf1f16f96f310caace75b76;hb=cc0c0e56d8269e91f23739b57faf67d5b5cc0794;hp=aa4c337ca8304c6b40ba13367b00ccfd8c6b0ea7;hpb=516dec3abb3f9e3de96e750d615b123e12d498ff;p=fjl diff --git a/input.h b/input.h index aa4c337..19315e5 100644 --- a/input.h +++ b/input.h @@ -87,4 +87,10 @@ static inline unsigned read_bits(struct bit_source* source, unsigned num_bits) return ret; } +static inline unsigned peek_bits(struct bit_source* source, unsigned num_bits) +{ + assert(source->bits_available >= num_bits); + return (source->bits >> (BITRESERVOIR_SIZE - num_bits)); +} + #endif /* !defined(_INPUT_H) */