unsigned char pnd_pnd_seek_pxml ( FILE *f ) {
char *b; // buffer
char *match; // match within buffer
- unsigned int len; // length of file (not suporting 'big files' 2GB..)
- unsigned int pos; // current tape head
+ off_t len; // length of file (supporting 'big files' 2GB+)
+ off_t pos; // current tape head
unsigned int readable; // amount to read (for small files/chunks)
b = malloc ( PND_PXML_WINDOW_SIZE + 1 );
memset ( b, '\0', PND_PXML_WINDOW_SIZE + 1 );
// determine length of file
- fseek ( f, 0, SEEK_END );
- len = ftell ( f );
- fseek ( f, 0, SEEK_SET );
+ fseeko ( f, 0, SEEK_END );
+ len = ftello ( f );
+ fseeko ( f, 0, SEEK_SET );
/* ready to scan through the file, backwards
*/
//printf ( "find pxml; pos %u readable %u\n", pos, readable );
// seek into this blocks position
- fseek ( f, pos, SEEK_SET );
+ fseeko ( f, pos, SEEK_SET );
// read
fread ( b, 1, readable, f );
// strings within an arbitrary buffer. Thats needs to be done. This is the worst
// performing brute force strategy here.
if ( ( match = pnd_match_binbuf ( b, readable, PXML_TAGHEAD ) ) ) {
- fseek ( f, pos + ( match - b ), SEEK_SET );
+ fseeko ( f, pos + ( match - b ), SEEK_SET );
//printf ( " match found at %u\n", pos + ( match - b ) );
free ( b );
return ( 1 );