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,
00101 const char TBox[]);
00102
00112 box_param_t * gene_boxbyTypeinStream(Byte_t *stream, OPJ_OFF_T offset,
00113 OPJ_SIZE_T length, const char TBox[]);
00114
00122 box_param_t * gene_childboxbyOffset(box_param_t *superbox, OPJ_OFF_T offset);
00123
00132 box_param_t * gene_childboxbyType(box_param_t *superbox, OPJ_OFF_T offset,
00133 const char TBox[]);
00134
00141 OPJ_OFF_T get_DBoxoff(box_param_t *box);
00142
00143
00150 OPJ_SIZE_T get_DBoxlen(box_param_t *box);
00151
00152
00159 Byte_t * fetch_headbytes(box_param_t *box);
00160
00161
00170 Byte_t * fetch_DBoxbytes(box_param_t *box, OPJ_OFF_T offset, OPJ_SIZE_T size);
00171
00179 Byte_t fetch_DBox1byte(box_param_t *box, OPJ_OFF_T offset);
00180
00188 Byte2_t fetch_DBox2bytebigendian(box_param_t *box, OPJ_OFF_T offset);
00189
00197 Byte4_t fetch_DBox4bytebigendian(box_param_t *box, OPJ_OFF_T offset);
00198
00206 Byte8_t fetch_DBox8bytebigendian(box_param_t *box, OPJ_OFF_T offset);
00207
00208
00216 box_param_t * search_box(const char type[], boxlist_param_t *boxlist);
00217
00223 void print_box(box_param_t *box);
00224
00225
00231 void print_allbox(boxlist_param_t *boxlist);
00232
00239 void delete_box_in_list(box_param_t **box, boxlist_param_t *boxlist);
00240
00241
00248 void delete_box_in_list_by_type(const char type[], boxlist_param_t *boxlist);
00249
00250
00256 void delete_boxlist(boxlist_param_t **boxlist);
00257
00258
00265 void insert_box_into_list(box_param_t *box, boxlist_param_t *boxlist);
00266
00267 #endif