1 /*****************************************************************************
2 * rsc_files.h: resources files manipulation functions
4 *****************************************************************************
5 * This library describe a general format used to store 'resources'. Resources
6 * can be anything, including pictures, audio streams, and so on.
7 *****************************************************************************
11 *****************************************************************************/
13 /*****************************************************************************
15 *****************************************************************************/
17 /* Maximum length of a resource name (not including the final '\0') - this
18 * constant should not be changed without extreme care */
19 #define RESOURCE_MAX_NAME 32
21 /*****************************************************************************
22 * resource_descriptor_t: resource descriptor
23 *****************************************************************************
24 * This type describe an entry in the resource table.
25 *****************************************************************************/
28 char psz_name[RESOURCE_MAX_NAME + 1]; /* name */
29 u16 i_type; /* type */
30 u64 i_offset; /* data offset */
31 u64 i_size; /* data size */
32 } resource_descriptor_t;
35 #define EMPTY_RESOURCE 0 /* empty place in table */
36 #define PICTURE_RESOURCE 10 /* native video picture */
38 /*****************************************************************************
39 * resource_file_t: resource file descriptor
40 *****************************************************************************
41 * This type describes a resource file and store it's resources table. It can
42 * be used through the *Resource functions, or directly with the i_file field.
43 *****************************************************************************/
46 /* File informations */
47 int i_file; /* file descriptor */
48 int i_type; /* file type */
49 boolean_t b_up_to_date; /* is file up to date ? */
50 boolean_t b_read_only; /* read-only mode */
53 int i_size; /* table size */
54 resource_descriptor_t * p_resource; /* resources table */
57 /* Resources files types */
58 #define VLC_RESOURCE_FILE 0 /* VideoLAN Client resource file */
60 /*****************************************************************************
62 *****************************************************************************/
63 resource_file_t * CreateResourceFile ( char *psz_filename, int i_type, int i_size, int i_mode );
64 resource_file_t * OpenResourceFile ( char *psz_filename, int i_type, int i_flags );
65 int UpdateResourceFile ( resource_file_t *p_file );
66 int CloseResourceFile ( resource_file_t *p_file );
68 int SeekResource ( resource_file_t *p_file, char *psz_name, int i_type );
69 int ReadResource ( resource_file_t *p_file, char *psz_name, int i_type,
70 size_t max_size, byte_t *p_data );
71 int WriteResource ( resource_file_t *p_file, char *psz_name, int i_type,
72 size_t size, byte_t *p_data );