You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
3.8 KiB

/*****************************************************************************
27 years ago
* rsc_files.h: resources files manipulation functions
* (c)1999 VideoLAN
*****************************************************************************
27 years ago
* This library describe a general format used to store 'resources'. Resources
* can be anything, including pictures, audio streams, and so on.
*****************************************************************************
27 years ago
* Requires:
* config.h
* common.h
*****************************************************************************/
27 years ago
/*****************************************************************************
27 years ago
* Constants
*****************************************************************************/
27 years ago
/* Maximum length of a resource name (not including the final '\0') - this
27 years ago
* constant should not be changed without extreme care */
#define RESOURCE_MAX_NAME 32
/*****************************************************************************
27 years ago
* resource_descriptor_t: resource descriptor
*****************************************************************************
27 years ago
* This type describe an entry in the resource table.
*****************************************************************************/
27 years ago
typedef struct
{
char psz_name[RESOURCE_MAX_NAME + 1]; /* name */
u16 i_type; /* type */
u64 i_offset; /* data offset */
u64 i_size; /* data size */
27 years ago
} resource_descriptor_t;
/* Resources types */
#define EMPTY_RESOURCE 0 /* empty place in table */
#define PICTURE_RESOURCE 10 /* native video picture */
27 years ago
/*****************************************************************************
27 years ago
* resource_file_t: resource file descriptor
*****************************************************************************
27 years ago
* This type describes a resource file and store it's resources table. It can
* be used through the *Resource functions, or directly with the i_file field.
*****************************************************************************/
27 years ago
typedef struct
{
/* File informations */
int i_file; /* file descriptor */
int i_type; /* file type */
boolean_t b_up_to_date; /* is file up to date ? */
boolean_t b_read_only; /* read-only mode */
27 years ago
/* Resources table */
int i_size; /* table size */
resource_descriptor_t * p_resource; /* resources table */
27 years ago
} resource_file_t;
/* Resources files types */
#define VLC_RESOURCE_FILE 0 /* VideoLAN Client resource file */
27 years ago
/*****************************************************************************
27 years ago
* Prototypes
*****************************************************************************/
27 years ago
resource_file_t * CreateResourceFile ( char *psz_filename, int i_type, int i_size, int i_mode );
resource_file_t * OpenResourceFile ( char *psz_filename, int i_type, int i_flags );
int UpdateResourceFile ( resource_file_t *p_file );
int CloseResourceFile ( resource_file_t *p_file );
int SeekResource ( resource_file_t *p_file, char *psz_name, int i_type );
int ReadResource ( resource_file_t *p_file, char *psz_name, int i_type,
size_t max_size, byte_t *p_data );
int WriteResource ( resource_file_t *p_file, char *psz_name, int i_type,
27 years ago
size_t size, byte_t *p_data );