#include #include #include #define BUFSIZE 0x1000000 #define BUFLOW 0x400 static int infile = -1; static unsigned char nblock[ BUFSIZE + 16 ]; static unsigned char*inblock = nblock + 16; static unsigned long inblockoffs = 0; static unsigned long infilesize = 0; static unsigned long infileoffs = 0; static unsigned char to_lower[]; static unsigned char run = 1; static void buffer_lowwatermark( void ) { int i; if( infilesize - infileoffs < BUFSIZE ) return; memmove( inblock, inblock + inblockoffs, BUFSIZE - inblockoffs ); read( infile, inblock + (BUFSIZE - inblockoffs), inblockoffs); for ( i = BUFSIZE - inblockoffs; i BUFSIZE - BUFLOW ) buffer_lowwatermark(); if( infilesize <= infileoffs + inblockoffs) return 0; if( !(mycount++ & 255) ) printf( "%cSo far: %010.6f%% (%010lu / %010lu)", 13, 100.00 * (double)(infileoffs+inblockoffs) / (double)infilesize, infileoffs+inblockoffs, infilesize ); // Fall through case 1 : use = (1< 1 ) ) { if( !fd[ b | (a*256) ][currrow] ) nowfd = fd[ b | (a*256) ][currrow] = makefile( currrow, a, b); else nowfd = fd[ b | (a*256) ][currrow]; *(unsigned long*)(inblock+inblockoffs-4) = infileoffs + inblockoffs - 1 - inrow; inblock[inblockoffs] = inrow++; write( nowfd, inblock+inblockoffs-4, 16); inblock[inblockoffs] = b; break; } } } return 0; }