Created
November 27, 2024 20:42
-
-
Save folkertdev/2d0399e92c88340a30109e55b1430961 to your computer and use it in GitHub Desktop.
Revisions
-
folkertdev created this gist
Nov 27, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ typedef unsigned char Bool; typedef unsigned char UChar; typedef int Int32; typedef unsigned int UInt32; #define True ((Bool)1) #define BZ_X_MAGIC_1 10 typedef struct { char *next_in; } bz_stream; typedef struct { bz_stream* strm; Int32 state; UInt32 bsBuff; Int32 bsLive; } DState; #define GET_BITS(lll,vvv,nnn) \ case lll: s->state = lll; \ while (True) { \ if (s->bsLive >= nnn) { \ break; \ } \ s->bsBuff \ = (s->bsBuff << 8) | \ ((UInt32) \ (*((UChar*)(s->strm->next_in)))); \ } #define GET_UCHAR(lll,uuu) \ GET_BITS(lll,uuu,8) Int32 BZ2_decompress ( DState* s ) { Int32 retVal; Int32 i; Int32 alphaSize; Int32 nSelectors; Int32 EOB; Int32 nextSym; switch (s->state) { GET_UCHAR(BZ_X_MAGIC_1, uc); for (i = 0; i < nSelectors; i++) { for (i = 0; i < alphaSize; i++) { } } while (True) { if (nextSym == EOB) break; } } save_state_and_return: return retVal; }