22 #include FT_INTERNAL_DEBUG_H 26 #include FT_INTERNAL_OBJECTS_H 38 #ifdef MUNMAP_USES_VOIDP 39 #define MUNMAP_ARG_CAST void * 41 #define MUNMAP_ARG_CAST char * 44 #ifdef NEED_MUNMAP_DECL 55 #define MUNMAP_ARG_CAST char * 60 #include <sys/types.h> 134 return realloc( block, new_size );
175 #define FT_COMPONENT trace_io 179 #define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer ) 198 stream->descriptor.pointer =
NULL;
208 const char* filepathname )
211 struct stat stat_buf;
215 return FT_Err_Invalid_Stream_Handle;
218 file =
open( filepathname, O_RDONLY );
222 FT_ERROR((
" could not open `%s'\n", filepathname ));
223 return FT_Err_Cannot_Open_Resource;
226 if ( fstat( file, &stat_buf ) < 0 )
229 FT_ERROR((
" could not `fstat' file `%s'\n", filepathname ));
233 stream->size = stat_buf.st_size;
237 FT_ERROR((
" opened `%s' but zero-sized\n", filepathname ));
249 if ( (
long)
stream->base == -1 )
252 FT_ERROR((
" could not `mmap' file `%s'\n", filepathname ));
259 stream->pathname.pointer = (
char*)filepathname;
265 FT_TRACE1((
" opened `%s' (%d bytes) successfully\n",
266 filepathname,
stream->size ));
277 return FT_Err_Cannot_Open_Stream;
281 #ifdef FT_DEBUG_MEMORY 307 #ifdef FT_DEBUG_MEMORY 308 ft_mem_debug_init( memory );
321 #ifdef FT_DEBUG_MEMORY 322 ft_mem_debug_done( memory );
324 memory->free( memory, memory );
ft_close_stream(FT_Stream stream)
#define FT_TRACE1(varformat)
#define FT_ERROR(varformat)
FT_Stream_Open(FT_Stream stream, const char *filepathname)
GLenum const GLvoid * addr
#define FT_CALLBACK_DEF(x)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
ft_free(FT_Memory memory, void *block)
int open(const char *name, int flags, int mode)
ft_alloc(FT_Memory memory, long size)
FT_Done_Memory(FT_Memory memory)
ft_realloc(FT_Memory memory, long cur_size, long new_size, void *block)