libbluray
Data Fields
BD_FILE_H Struct Reference

File access. More...

Data Fields

void * internal
 Reserved for BD_FILE_H implementation use. More...
 
void(* close )(BD_FILE_H *file)
 Close file. More...
 
int64_t(* seek )(BD_FILE_H *file, int64_t offset, int32_t origin)
 Reposition file offset. More...
 
int64_t(* tell )(BD_FILE_H *file)
 Get current read or write position. More...
 
int(* eof )(BD_FILE_H *file)
 Check for end of file. More...
 
int64_t(* read )(BD_FILE_H *file, uint8_t *buf, int64_t size)
 Read from file. More...
 
int64_t(* write )(BD_FILE_H *file, const uint8_t *buf, int64_t size)
 Write to file. More...
 

Detailed Description

File access.

Field Documentation

◆ close

void(* BD_FILE_H::close) (BD_FILE_H *file)

Close file.

Parameters
fileBD_FILE_H object

◆ eof

int(* BD_FILE_H::eof) (BD_FILE_H *file)

Check for end of file.

  • optional, currently not used
Parameters
fileBD_FILE_H object
Returns
1 on EOF, < 0 on error, 0 if not EOF

◆ internal

void* BD_FILE_H::internal

Reserved for BD_FILE_H implementation use.

Implementation can store here ex. file handle, FILE*, ...

◆ read

int64_t(* BD_FILE_H::read) (BD_FILE_H *file, uint8_t *buf, int64_t size)

Read from file.

Parameters
fileBD_FILE_H object
bufbuffer where to store the data
sizebytes to read
Returns
number of bytes read, 0 on EOF, < 0 on error

◆ seek

int64_t(* BD_FILE_H::seek) (BD_FILE_H *file, int64_t offset, int32_t origin)

Reposition file offset.

  • SEEK_SET: seek to 'offset' bytes from file start
  • SEEK_CUR: seek 'offset' bytes from current position
  • SEEK_END: seek 'offset' bytes from file end
Parameters
fileBD_FILE_H object
offsetbyte offset
originSEEK_SET, SEEK_CUR or SEEK_END
Returns
current file offset, < 0 on error

◆ tell

int64_t(* BD_FILE_H::tell) (BD_FILE_H *file)

Get current read or write position.

Parameters
fileBD_FILE_H object
Returns
current file offset, < 0 on error

◆ write

int64_t(* BD_FILE_H::write) (BD_FILE_H *file, const uint8_t *buf, int64_t size)

Write to file.

Writing 0 bytes can be used to flush previous writes and check for errors.

Parameters
fileBD_FILE_H object
bufdata to be written
sizebytes to write
Returns
number of bytes written, < 0 on error

The documentation for this struct was generated from the following file: