/* bwtReverse - Reverse Burrows Wheeler Transform of a text file.. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "options.h" #include "obscure.h" void usage() /* Explain usage and exit. */ { errAbort( "bwtReverse - Reverse Burrows Wheeler Transform of a text file.\n" "usage:\n" " bwtReverse XXX\n" "options:\n" " -xxx=XXX\n" ); } static struct optionSpec options[] = { {NULL, 0}, }; void unbwt(UBYTE *in, UBYTE *out, bits32 size) /* Reverse Burrows Wheeler transform of string. */ { /* Empty case is easy here (and a pain if we have to deal with it later) */ if (size == 0) return; /* Make array that will store the count of occurences of each character up to a given position. */ bits32 *occ; AllocArray(occ, size); /* Count up occurences of all characters into offset array. */ bits32 i, counts[256], offsets[256]; for (i=0; i<256; ++i) counts[i] = 0; for (i=0; i