00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef BOX_MANAGER_H_
00032 # define BOX_MANAGER_H_
00033
00034 #include "byte_manager.h"
00035
00037 typedef struct box_param{
00038 int fd;
00039 OPJ_OFF_T offset;
00040 Byte_t headlen;
00041 Byte8_t length;
00042 char type[4];
00043 struct box_param *next;
00044 } box_param_t;
00045
00046
00048 typedef struct boxlist_param{
00049 box_param_t *first;
00050 box_param_t *last;
00051 } boxlist_param_t;
00052
00053
00059 boxlist_param_t * gene_boxlist(void);
00060
00069 boxlist_param_t * get_boxstructure( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
00070
00071
00079 box_param_t * gene_boxbyOffset( int fd, OPJ_OFF_T offset);
00080
00081
00089 box_param_t * gene_boxbyOffinStream( Byte_t *stream, OPJ_OFF_T offset);
00090
00100 box_param_t * gene_boxbyType( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length, const char TBox[]);
00101
00111 box_param_t * gene_boxbyTypeinStream( Byte_t *stream, OPJ_OFF_T offset, OPJ_SIZE_T length, const char TBox[]);
00112
00120 box_param_t * gene_childboxbyOffset( box_param_t *superbox, OPJ_OFF_T offset);
00121
00130 box_param_t * gene_childboxbyType( box_param_t *superbox, OPJ_OFF_T offset, const char TBox[]);
00131
00138 OPJ_OFF_T get_DBoxoff( box_param_t *box);
00139
00140
00147 OPJ_SIZE_T get_DBoxlen( box_param_t *box);
00148
00149
00156 Byte_t * fetch_headbytes( box_param_t *box);
00157
00158
00167 Byte_t * fetch_DBoxbytes( box_param_t *box, OPJ_OFF_T offset, OPJ_SIZE_T size);
00168
00176 Byte_t fetch_DBox1byte( box_param_t *box, OPJ_OFF_T offset);
00177
00185 Byte2_t fetch_DBox2bytebigendian( box_param_t *box, OPJ_OFF_T offset);
00186
00194 Byte4_t fetch_DBox4bytebigendian( box_param_t *box, OPJ_OFF_T offset);
00195
00203 Byte8_t fetch_DBox8bytebigendian( box_param_t *box, OPJ_OFF_T offset);
00204
00205
00213 box_param_t * search_box( const char type[], boxlist_param_t *boxlist);
00214
00220 void print_box( box_param_t *box);
00221
00222
00228 void print_allbox( boxlist_param_t *boxlist);
00229
00236 void delete_box_in_list( box_param_t **box, boxlist_param_t *boxlist);
00237
00238
00245 void delete_box_in_list_by_type( const char type[], boxlist_param_t *boxlist);
00246
00247
00253 void delete_boxlist( boxlist_param_t **boxlist);
00254
00255
00262 void insert_box_into_list( box_param_t *box, boxlist_param_t *boxlist);
00263
00264 #endif