+char *bs_finalblock(char *data, Uint32 len, Uint32 *new_size)
+{
+ Uint32 size=0, i, j;
+ char *out = NULL;
+ unsigned char tmp;
+
+ for(i=0; i < len; i++) {
+ if (data[i] == ESCAPE_CHARACTER) {
+ i++;
+ if (data[i] == 0xF) {
+ /* Solo tengo que dejar el ESCAPE_CHARACTER */
+ size++;
+ out = (char *)realloc(out, size*sizeof(char));
+ out[size-1] = data[i];
+ /* Salteo ese caracter */
+ } else {
+ /* Va una palabra!! */
+ tmp = data[i];
+ size += dic[(size_t)tmp].len;
+ out = (char *)realloc(out, size*sizeof(char));
+ for(j=0; j<dic[(size_t)tmp].len; j++) {
+ out[size-dic[(size_t)tmp].len+j] = dic[(size_t)tmp].word[j];
+ }
+ /* Salteo el caracter siguiente al de escape */
+ }
+ } else {
+ size++;
+ out = (char *)realloc(out, size*sizeof(char));
+ out[size-1] = data[i];
+ }
+ }
+
+ (*new_size) = size;
+ return out;
+}
+