Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
958 B

  1. //
  2. // infmacro.h
  3. //
  4. #define INPUT_EOF() (context->input_curpos >= context->end_input_buffer)
  5. // dump n bits from the bit buffer (n can be up to 16)
  6. // in assertion: there must be at least n valid bits in the buffer
  7. #define DUMPBITS(n) \
  8. bitbuf >>= n; \
  9. bitcount -= n;
  10. // return the next n bits in the bit buffer (n <= 16), then dump these bits
  11. // in assertion: there must be at least n valid bits in the buffer
  12. #define GETBITS(result, n) \
  13. bitcount -= n; \
  14. result = (bitbuf & g_BitMask[n]); \
  15. bitbuf >>= n; \
  16. //
  17. // Load bit buffer variables from context into local variables
  18. //
  19. #define LOAD_BITBUF_VARS() \
  20. bitbuf = context->bitbuf; \
  21. bitcount = context->bitcount; \
  22. input_ptr = context->input_curpos;
  23. //
  24. // Save bit buffer variables from local variables into context
  25. //
  26. #define SAVE_BITBUF_VARS() \
  27. context->bitbuf = bitbuf; \
  28. context->bitcount = bitcount; \
  29. context->input_curpos = input_ptr;