static const char * s_findFileMimeType( HB_FHANDLE fileIn ) { char buf[ 512 ]; int iLen; HB_FOFFSET nPos; nPos = hb_fsSeekLarge( fileIn, 0, FS_RELATIVE ); hb_fsSeek( fileIn, 0, FS_SET ); iLen = hb_fsRead( fileIn, buf, sizeof( buf ) ); if( iLen > 0 ) { hb_fsSeekLarge( fileIn, nPos, FS_SET ); return s_findStringMimeType( buf, iLen ); } return NULL; }
static char *s_findFileMimeType( FHANDLE fileIn ) { char buf[512]; int iLen; ULONG ulPos; ulPos = hb_fsSeek( fileIn, 0, SEEK_CUR ); hb_fsSeek( fileIn, 0, SEEK_SET ); iLen = hb_fsRead( fileIn, ( BYTE * ) buf, 512 ); if ( iLen > 0 ) { hb_fsSeek( fileIn, ulPos, SEEK_SET ); return s_findStringMimeType( buf, iLen ); } return NULL; }