Loading...
Searching...
No Matches
filesystem.h
Go to the documentation of this file.
/*
* This file is part of libbluray
* Copyright (C) 2009-2010 Obliter0n
* Copyright (C) 2009-2010 John Stebbins
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef BD_FILESYSTEM_H_
#define BD_FILESYSTEM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifdef BLURAY_API_EXPORT
#include "util/attributes.h"
#elif !defined(BD_PUBLIC)
#define BD_PUBLIC
#endif
typedef struct bd_file_s BD_FILE_H;
struct bd_file_s
{
void* internal;
void (*close) (BD_FILE_H *file);
int64_t (*seek) (BD_FILE_H *file, int64_t offset, int32_t origin);
int64_t (*tell) (BD_FILE_H *file);
int (*eof) (BD_FILE_H *file);
int64_t (*read) (BD_FILE_H *file, uint8_t *buf, int64_t size);
int64_t (*write) (BD_FILE_H *file, const uint8_t *buf, int64_t size);
};
typedef struct
{
char d_name[256];
} BD_DIRENT;
typedef struct bd_dir_s BD_DIR_H;
struct bd_dir_s
{
void* internal;
void (*close)(BD_DIR_H *dir);
int (*read)(BD_DIR_H *dir, BD_DIRENT *entry);
};
typedef BD_FILE_H* (*BD_FILE_OPEN)(const char* filename, const char *mode);
typedef BD_DIR_H* (*BD_DIR_OPEN) (const char* dirname);
BD_PUBLIC BD_FILE_OPEN bd_register_file(BD_FILE_OPEN p);
BD_PUBLIC BD_DIR_OPEN bd_register_dir(BD_DIR_OPEN p);
#ifdef __cplusplus
}
#endif
#endif /* BD_FILESYSTEM_H_ */
bd_register_file
BD_PUBLIC BD_FILE_OPEN bd_register_file(BD_FILE_OPEN p)
Register function pointer that will be used to open a file.
bd_register_dir
BD_PUBLIC BD_DIR_OPEN bd_register_dir(BD_DIR_OPEN p)
Register function pointer that will be used to open a directory.
BD_FILE_OPEN
BD_FILE_H *(* BD_FILE_OPEN)(const char *filename, const char *mode)
Open a file.
Definition filesystem.h:161
BD_DIR_OPEN
BD_DIR_H *(* BD_DIR_OPEN)(const char *dirname)
Open a directory.
Definition filesystem.h:171
BD_DIRENT
Directory entry.
Definition filesystem.h:122
BD_DIRENT::d_name
char d_name[256]
Null-terminated filename.
Definition filesystem.h:123
bd_dir_s
Directory access.
Definition filesystem.h:132
bd_dir_s::close
void(* close)(BD_DIR_H *dir)
Close directory stream.
Definition filesystem.h:140
bd_dir_s::read
int(* read)(BD_DIR_H *dir, BD_DIRENT *entry)
Read next directory entry.
Definition filesystem.h:149
bd_dir_s::internal
void * internal
reserved for BD_DIR_H implementation use
Definition filesystem.h:133
bd_file_s
File access.
Definition filesystem.h:49
bd_file_s::tell
int64_t(* tell)(BD_FILE_H *file)
Get current read or write position.
Definition filesystem.h:82
bd_file_s::internal
void * internal
Reserved for BD_FILE_H implementation use.
Definition filesystem.h:53
bd_file_s::close
void(* close)(BD_FILE_H *file)
Close file.
Definition filesystem.h:60
bd_file_s::read
int64_t(* read)(BD_FILE_H *file, uint8_t *buf, int64_t size)
Read from file.
Definition filesystem.h:102
bd_file_s::eof
int(* eof)(BD_FILE_H *file)
Check for end of file.
Definition filesystem.h:92
bd_file_s::seek
int64_t(* seek)(BD_FILE_H *file, int64_t offset, int32_t origin)
Reposition file offset.
Definition filesystem.h:74
bd_file_s::write
int64_t(* write)(BD_FILE_H *file, const uint8_t *buf, int64_t size)
Write to file.
Definition filesystem.h:114