Under each yyyy/dir there is a file of the form '*.orig.c' containing the original source code, or as close as we can get to the original source code.
31 lines
1.3 KiB
C
31 lines
1.3 KiB
C
#include <locale.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <wchar.h>
|
|
|
|
#define P 9<<23^1
|
|
#define A 1;O-L;L=0<L[o]?L[K][k]=L
|
|
#define N for(O=l[k];l-O;O=O[k])for(L=O
|
|
#define G 1+c[C];c[C]-I;I=0<(l=I[o])?
|
|
#define R(A,M) wcschr(1+M,A)
|
|
|
|
static int C[97],d,k[98^P],O,l=1,o[98^P],L,K[98^P],v[97],V[98],c;
|
|
static void y(){l[V][v]=l[v][V]=l;N-A,L[k][K]=L,++L[o][o],L-1:L[k]);}
|
|
static void b(){N+A[k],L[k][K]=L[K],--L[o][o],L+1:L[K]);l[V][v]=l[v];l[v][V]=l[V];}
|
|
static wchar_t s[P],*w=1+s,*p[P],z[99],**q=p,*W=1+s,*Z;
|
|
int main(int I,char**j){if(l<I){wint_t S;setlocale(LC_CTYPE,"");
|
|
for(mbstowcs(l+z,l[j],97);l[z];++l)V[l[v]=l+1]=l[K]=l[k]=l;
|
|
for(v[*V=l-(*v=1)]=L;WEOF-(S=getwchar())&&P>W-s;++W)if(33>(*W=S)){
|
|
for(*W=L,Z=w;*Z;++Z)if(R(*Z,Z)||!R(*Z,z)){W=w-1;goto M;}
|
|
for(I=L;I[w];++I)++o[O=R(I[w],z)-z],k[K[l[o+I+1]=O]=k[l[K+I+1]=O[K]]=l+I+1]=O;
|
|
*q++=w;l[k]=l+I;o[l+=I+1]=p-q;l[K]=l-I;M:w=1+W;}
|
|
*j="Dictionary too long\n";if(WEOF-S)H:return fputs(*j,stderr),**j/36;
|
|
d=2[j]?atoi(2[j]):97;while(P){if(I=*v){for(O=P;I;I=I[v])O>I[o]?l=I,O=I[o]:P;
|
|
b();c[C]=l[k];T:if(l-c[C]){for(I=G b(),I+1:I[K]);if(d>c++)continue;}else y();
|
|
}else{for(;I-c;++I){for(O=I[C];0>~O[o];++O);printf(!I+" %ls",p[~O[o]]);}
|
|
putchar(10);fflush(stdout);}
|
|
if(!c--)return 0;
|
|
for(I=-G y(),I-1:I[k]);
|
|
l=c[C][o];c[C]=c[C][k];goto T;}}
|
|
*j="Need an argument or two\n";goto H;}
|