25 FILE *fp = (FILE *)handle->
opaque;
28 fseek( fp, 0, SEEK_SET );
30 switch( handle->
encod )
33 if( fread( &bom, 3, 1, fp ) != 1 )
36 res = (bom == 0x00BFBBEF);
40 if( fread( &bom,
sizeof(
UTF_16 ), 1, fp ) != 1 )
44 res = (bom == 0x0000FEFF);
49 if( fread( &bom,
sizeof(
UTF_32 ), 1, fp ) != 1 )
53 res = (bom == 0x0000FEFF);
61 fseek( fp, 0, SEEK_END );
69 FILE *fp = (FILE *)handle->
opaque;
71 switch( handle->
encod )
75 if( fwrite( &bom, 3, 1, fp ) != 1 )
82 if( fwrite( &bom,
sizeof(
UTF_16 ), 1, fp ) != 1 )
89 if( fwrite( &bom,
sizeof(
UTF_32 ), 1, fp ) != 1 )
113 fname = (
char*) alloca(fname_len + 1);
114 memcpy(fname, filename, fname_len);
115 fname[fname_len] = 0;
123 switch( handle->
mode )
146 if( (fp = fopen( fname, openmask )) ==
NULL )
160 switch( handle->
mode )
184 if( handle->
size == -1 )