Skip to content

Instantly share code, notes, and snippets.

@betawaffle
Created August 13, 2010 22:44
Show Gist options
  • Save betawaffle/523660 to your computer and use it in GitHub Desktop.
Save betawaffle/523660 to your computer and use it in GitHub Desktop.
#define X(a,b) typedef a b;
#define u unsigned
#define sT struct
#define R return
X(char,ch)X(void,V)X(ch const*,S)X(u char,C)X(u long,L)X(sT SN{C mO;L mL;C*mP;s\
T SN**mN;}*,N)V nfo(N t,L i,C d){}N nfi(N t,S aS){N no;L s,e,i,n;C r,l,c,d;s=t-\
>mO;e=t->mO+t->mL;i=s/8,r=s%8;n=e/8,l=e%8,l=8-l;for(c=aS[i]&0xFF>>r;i<=n;c=aS[+\
+i]){if(i==n)c>>=l,c<<=l;if(d=c^t->mP[i])nfo(t,i,d),e=t->mO+t->mL,n=e/8,l=e%8,l\
=8-l;}if(c=aS[n],c=='\0')R t;R nfi(t->mN[c>>l-1&0x01],aS+n);}int main(){R 0;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment