}
int
-swf_action_print(swf_action_t *act) {
+swf_action_print(swf_action_t *act, int indent_depth) {
swf_action_info_t *act_info = get_swf_action_info(act->action_id);
if (act_info && act_info->name) {
+ print_indent(indent_depth);
printf("%s", act_info->name);
} else {
+ print_indent(indent_depth);
printf("0x%02x", act->action_id);
}
if (act->action_has_length) {
d = act->action_data;
n = GetUShortLE(act->action_data); d += 2;
printf(":\n");
+ print_indent(indent_depth);
for (i=0 ; i < n ; i++) {
printf("\t\t[%d]'", i);
d += printf("%s", d) + 1;
}
void
-swf_action_list_print(swf_action_list_t *action_list) {
+swf_action_list_print(swf_action_list_t *action_list, int indent_depth) {
if (action_list) {
swf_action_t *action = action_list->head;
+ print_indent(indent_depth);
+ printf("action list:\n");
while(action) {
- printf("\t");
- swf_action_print(action);
+ swf_action_print(action, indent_depth);
action = action->next;
}
}
extern int swf_action_parse(bitstream_t *bs, swf_action_t *act);
extern int swf_action_build(bitstream_t *bs, swf_action_t *act);
-extern int swf_action_print(swf_action_t *act);
+extern int swf_action_print(swf_action_t *act, int indent_depth);
extern swf_action_list_t *swf_action_list_create(bitstream_t *bs);
extern unsigned char *swf_action_list_output(swf_action_list_t *list,
unsigned long *length);
extern void swf_action_list_destroy(swf_action_list_t *act_list);
-extern void swf_action_list_print(swf_action_list_t *act_list);
+extern void swf_action_list_print(swf_action_list_t *act_list,
+ int indent_depth);
extern int swf_action_data_print(unsigned char *action_data,
unsigned short action_data_len);
}
int
-swf_argb_print(swf_argb_t *color) {
+swf_argb_print(swf_argb_t *color, int indent_depth) {
+ print_indent(indent_depth);
printf("alpha=0x%02x red=0x%02x green=0x%02X blue=0x%02x\n",
color->alpha, color->red, color->green, color->blue);
return 0;
extern int swf_argb_parse(bitstream_t *bs, swf_argb_t *color);
extern int swf_argb_build(bitstream_t *bs, swf_argb_t *color);
-extern int swf_argb_print(swf_argb_t *color);
+extern int swf_argb_print(swf_argb_t *color, int indent_depth);
#endif /* __SWF_ARGB_H__ */
#define SWF_FILE_LENGTH_SIZE 4
#define SWF_HEADER_SIZE 8
+#define INDENT_UNIT 4
+
+#define print_indent(depth) printf("%*s", INDENT_UNIT*depth, " ")
+
+
extern int swf_debug;
extern void malloc_debug_start(void);
#define NumOfTable(t) (sizeof(t) / sizeof(*t))
-
#define GV2B(a,b) ((a << 8) + b)
#define GV4B(a,b,c,d) GV2B(GV2B(GV2B(a,b),c),d)
#define GV8B(a,b,c,d,e,f,g,h) GV2B(GV2B(GV2B(GV2B(GV2B(GV2B(GV2B(a,b),c),d),e),f),g),h)
#define GetDoubleIEEE(data) ((double) GV8B(data[4], data[5], data[6], data[7], data[0], data[1], data[2], data[3]))
#endif /* __SWF_DEFINE__H__ */
-
extern int swf_fill_style_parse(bitstream_t *bs, swf_fill_style_t *color);
extern int swf_fill_style_build(bitstream_t *bs, swf_fill_style_t *color);
-extern int swf_fill_style_print(swf_fill_style_t *color);
+extern int swf_fill_style_print(swf_fill_style_t *color, int indent_depth);
#endif /* __SWF_FILL_STYLE_H__ */
extern int swf_fill_style_array_parse(bitstream_t *bs, swf_fill_style_array_t *color);
extern int swf_fill_style_array_build(bitstream_t *bs, swf_fill_style_array_t *color);
-extern int swf_fill_style_array_print(swf_fill_style_array_t *color);
+extern int swf_fill_style_array_print(swf_fill_style_array_t *color, int indent_depth);
#endif /* __SWF_FILL_STYLE_ARRAY_H__ */
extern int swf_fill_style_bitmap_parse(bitstream_t *bs, swf_fill_style_bitmap_t *color);
extern int swf_fill_style_bitmap_build(bitstream_t *bs, swf_fill_style_bitmap_t *color);
-extern int swf_fill_style_bitmap_print(swf_fill_style_bitmap_t *color);
+extern int swf_fill_style_bitmap_print(swf_fill_style_bitmap_t *color, int indent_depth);
#endif /* __SWF_FILL_STYLE_BITMAP_H__ */
extern int swf_fill_style_gradient_parse(bitstream_t *bs, swf_fill_style_gradient_t *color);
extern int swf_fill_style_gradient_build(bitstream_t *bs, swf_fill_style_gradient_t *color);
-extern int swf_fill_style_gradient_print(swf_fill_style_gradient_t *color);
+extern int swf_fill_style_gradient_print(swf_fill_style_gradient_t *color, int indent_depth);
#endif /* __SWF_FILL_STYLE_GRADIENT_H__ */
extern int swf_fill_style_solid_parse(bitstream_t *bs, swf_fill_style_solid_t *color);
extern int swf_fill_style_solid_build(bitstream_t *bs, swf_fill_style_solid_t *color);
-extern int swf_fill_style_solid_print(swf_fill_style_solid_t *color);
+extern int swf_fill_style_solid_print(swf_fill_style_solid_t *color, int indent_depth);
#endif /* __SWF_FILL_STYLE_SOLID_H__ */
extern int swf_gradient_parse(bitstream_t *bs, swf_gradient_t *color);
extern int swf_gradient_build(bitstream_t *bs, swf_gradient_t *color);
-extern int swf_gradient_print(swf_gradient_t *color);
+extern int swf_gradient_print(swf_gradient_t *color, int indent_depth);
#endif /* __SWF_GRADIENT_H__ */
extern int swf_gradient_record_parse(bitstream_t *bs, swf_gradient_record_t *color);
extern int swf_gradient_record_build(bitstream_t *bs, swf_gradient_record_t *color);
-extern int swf_gradient_record_print(swf_gradient_record_t *color);
+extern int swf_gradient_record_print(swf_gradient_record_t *color, int indent_depth);
#endif /* __SWF_GRADIENT_RECORD_H__ */
}
int swf_header_movie_print(swf_header_movie_t *header_movie) {
- swf_rect_print(&header_movie->frame_size);
+ swf_rect_print(&header_movie->frame_size, 0);
printf("frame_rate=%d.%d frame_count=%d\n",
header_movie->frame_rate_integral,
header_movie->frame_rate_decimal,
extern int swf_line_style_parse(bitstream_t *bs, swf_line_style_t *color);
extern int swf_line_style_build(bitstream_t *bs, swf_line_style_t *color);
-extern int swf_line_style_print(swf_line_style_t *color);
+extern int swf_line_style_print(swf_line_style_t *color, int indent_depth);
#endif /* __SWF_LINE_STYLE_H__ */
extern int swf_line_style_array_parse(bitstream_t *bs, swf_line_style_array_t *color);
extern int swf_line_style_array_build(bitstream_t *bs, swf_line_style_array_t *color);
-extern int swf_line_style_array_print(swf_line_style_array_t *color);
+extern int swf_line_style_array_print(swf_line_style_array_t *color, int indent_depth);
#endif /* __SWF_LINE_STYLE_ARRAY_H__ */
extern int swf_matrix_parse(bitstream_t *bs, swf_matrix_t *color);
extern int swf_matrix_build(bitstream_t *bs, swf_matrix_t *color);
-extern int swf_matrix_print(swf_matrix_t *color);
+extern int swf_matrix_print(swf_matrix_t *color, int indent_depth);
#endif /* __SWF_MATRIX_H__ */
extern int swf_morph_shape_with_style_parse(bitstream_t *bs, swf_morph_shape_with_style_t *color);
extern int swf_morph_shape_with_style_build(bitstream_t *bs, swf_morph_shape_with_style_t *color);
-extern int swf_morph_shape_with_style_print(swf_morph_shape_with_style_t *color);
+extern int swf_morph_shape_with_style_print(swf_morph_shape_with_style_t *color, int indent_depth);
#endif /* __SWF_MORPH_SHAPE_WITH_STYLE_H__ */
tag = swf->tag;
for (i=0 ; tag ; i++) {
printf("[%d] ", i);
- swf_tag_print(tag, swf);
+ swf_tag_print(tag, swf, 0);
if (tag->tag == 0) { // END Tag
break;
}
}
int
-swf_rect_print(swf_rect_t *rect) {
+swf_rect_print(swf_rect_t *rect, int indent_depth) {
+ print_indent(indent_depth);
printf("rect=(%d, %d)-(%d, %d) (f_size=%d)\n",
rect->x_min / SWF_TWIPS,
rect->y_min / SWF_TWIPS,
extern int swf_rect_parse(bitstream_t *bs, swf_rect_t *rect);
extern int swf_rect_build(bitstream_t *bs, swf_rect_t *rect);
-extern int swf_rect_print(swf_rect_t *rect);
+extern int swf_rect_print(swf_rect_t *rect, int indent_depth);
#endif /* __SWF_RECT_H__ */
}
int
-swf_rgb_print(swf_rgb_t *color) {
+swf_rgb_print(swf_rgb_t *color, int indent_depth) {
+ print_indent(indent_depth);
printf("red=0x%02x green=0x%02X blue=0x%02x\n",
color->red, color->green, color->blue);
return 0;
extern int swf_rgb_parse(bitstream_t *bs, swf_rgb_t *color);
extern int swf_rgb_build(bitstream_t *bs, swf_rgb_t *color);
-extern int swf_rgb_print(swf_rgb_t *color);
+extern int swf_rgb_print(swf_rgb_t *color, int indent_depth);
#endif /* __SWF_RGB_H__ */
}
int
-swf_rgba_print(swf_rgba_t *color) {
+swf_rgba_print(swf_rgba_t *color, int indent_depth) {
+ print_indent(indent_depth);
printf("red=0x%02x green=0x%02X blue=0x%02x alpha=0x%02x\n",
color->red, color->green, color->blue, color->alpha);
return 0;
extern int swf_rgba_parse(bitstream_t *bs, swf_rgba_t *color);
extern int swf_rgba_build(bitstream_t *bs, swf_rgba_t *color);
-extern int swf_rgba_print(swf_rgba_t *color);
+extern int swf_rgba_print(swf_rgba_t *color, int indent_depth);
#endif /* __SWF_RGBA_H__ */
extern int swf_shape_record_parse(bitstream_t *bs, swf_shape_record_t *color);
extern int swf_shape_record_build(bitstream_t *bs, swf_shape_record_t *color);
-extern int swf_shape_record_print(swf_shape_record_t *color);
+extern int swf_shape_record_print(swf_shape_record_t *color, int indent_depth);
#endif /* __SWF_SHAPE_RECORD_H__ */
extern int swf_shape_record_edge_parse(bitstream_t *bs, swf_shape_record_edge_t *color);
extern int swf_shape_record_edge_build(bitstream_t *bs, swf_shape_record_edge_t *color);
-extern int swf_shape_record_edge_print(swf_shape_record_edge_t *color);
+extern int swf_shape_record_edge_print(swf_shape_record_edge_t *color, int indent_depth);
#endif /* __SWF_SHAPE_RECORD_EDGE_H__ */
extern int swf_shape_record_end_parse(bitstream_t *bs, swf_shape_record_end_t *color);
extern int swf_shape_record_end_build(bitstream_t *bs, swf_shape_record_end_t *color);
-extern int swf_shape_record_end_print(swf_shape_record_end_t *color);
+extern int swf_shape_record_end_print(swf_shape_record_end_t *color, int indent_deptha);
#endif /* __SWF_SHAPE_RECORD_END_H__ */
extern int swf_shape_record_setup_parse(bitstream_t *bs, swf_shape_record_setup_t *color);
extern int swf_shape_record_setup_build(bitstream_t *bs, swf_shape_record_setup_t *color);
-extern int swf_shape_record_setup_print(swf_shape_record_setup_t *color);
+extern int swf_shape_record_setup_print(swf_shape_record_setup_t *color, int indent_depth);
#endif /* __SWF_SHAPE_RECORD_SETUP_H__ */
extern int swf_shape_with_style_parse(bitstream_t *bs, swf_shape_with_style_t *color);
extern int swf_shape_with_style_build(bitstream_t *bs, swf_shape_with_style_t *color);
-extern int swf_shape_with_style_print(swf_shape_with_style_t *color);
+extern int swf_shape_with_style_print(swf_shape_with_style_t *color, int indent_depth);
#endif /* __SWF_SHAPE_WITH_STYLE_H__ */
extern int swf_styles_parse(bitstream_t *bs, swf_styles_t *color);
extern int swf_styles_build(bitstream_t *bs, swf_styles_t *color);
-extern int swf_styles_print(swf_styles_t *color);
+extern int swf_styles_print(swf_styles_t *color, int indent_depth);
#endif /* __SWF_STYLES_H__ */
extern int swf_styles_count_parse(bitstream_t *bs, swf_styles_count_t *color);
extern int swf_styles_count_build(bitstream_t *bs, swf_styles_count_t *color);
-extern int swf_styles_count_print(swf_styles_count_t *color);
+extern int swf_styles_count_print(swf_styles_count_t *color, int indent_depth);
#endif /* __SWF_STYLES_COUNT_H__ */
}
void
-swf_tag_print(swf_tag_t *tag, struct swf_object_ *swf) {
+swf_tag_print(swf_tag_t *tag, struct swf_object_ *swf, int indent_depth) {
swf_tag_info_t *tag_info;
const char *tag_name;
if (tag == NULL) {
}
tag_info = get_swf_tag_info(tag->tag);
tag_name = (tag_info)?tag_info->name:"Unknown";
+// print_indent(indent_depth);
printf("tag=%s(%d)", tag_name, tag->tag);
if (tag->length > 0) {
printf(" length=%lu", tag->length);
}
swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler();
if (detail_handler->print) {
- detail_handler->print(tag, swf);
+ detail_handler->print(tag, swf, indent_depth + 1);
}
}
}
int (*identity) (swf_tag_t *tag, int id);
unsigned char * (*output) (swf_tag_t *tag, unsigned long *length,
struct swf_object_ *swf);
- void (*print) (swf_tag_t *tag, struct swf_object_ *swf);
+ void (*print) (swf_tag_t *tag, struct swf_object_ *swf,
+ int indent_depth);
void (*destroy) (swf_tag_t *tag);
} swf_tag_detail_handler_t;
extern swf_tag_t *swf_tag_create(bitstream_t *bs);
extern void swf_tag_destroy(swf_tag_t *tag);
extern int swf_tag_build(bitstream_t *bs, swf_tag_t *tag, struct swf_object_ *swf);
-extern void swf_tag_print(swf_tag_t *tag, struct swf_object_ *swf);
+extern void swf_tag_print(swf_tag_t *tag, struct swf_object_ *swf, int indent_depth);
/* image */
void
swf_tag_action_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf) {
+ struct swf_object_ *swf, int indent_depth) {
bitstream_t *bs;
swf_action_list_t *action_list;
swf_tag_action_detail_t *swf_tag_action = (swf_tag_action_detail_t *) tag->detail;
(void) swf;
+ print_indent(indent_depth);
if (tag->tag == 59) { // DoInitAction
printf("action_sprite=%d ", swf_tag_action->action_sprite);
}
swf_tag_action->action_record_len);
action_list = swf_action_list_create(bs);
bitstream_close(bs);
- swf_action_list_print(action_list);
+ swf_action_list_print(action_list, indent_depth + 1);
swf_action_list_destroy(action_list);
return ;
}
unsigned long *length,
struct swf_object_ *swf);
extern void swf_tag_action_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf);
+ struct swf_object_ *swf,
+ int indent_depth);
extern void swf_tag_action_destroy_detail(swf_tag_t *tag);
#endif /* __SWF_TAG_ACTION__H__ */
void
swf_tag_edit_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf) {
+ struct swf_object_ *swf, int indent_depth) {
swf_tag_edit_detail_t *swf_tag_edit = (swf_tag_edit_detail_t *) tag->detail;
(void) tag;
- printf("\tedit_id=%d\n", swf_tag_edit->edit_id);
- printf("\t");
- swf_rect_print(&swf_tag_edit->rect);
- printf("\ttext=%d wwrap=%d multi=%d pass=%d ro=%d col=%d maxlen=%d font=%d\n",
+ print_indent(indent_depth);
+ printf("edit_id=%d\n", swf_tag_edit->edit_id);
+ swf_rect_print(&swf_tag_edit->rect, indent_depth + 1);
+ print_indent(indent_depth);
+ printf("text=%d wwrap=%d multi=%d pass=%d ro=%d col=%d maxlen=%d font=%d\n",
swf_tag_edit->edit_has_text?1:0,
swf_tag_edit->edit_word_wrap?1:0,
swf_tag_edit->edit_multiline?1:0,
swf_tag_edit->edit_has_max_length?1:0,
swf_tag_edit->edit_has_font?1:0);
if (swf->header.version >= 6) {
- printf("\tauto_size=%d\n", swf_tag_edit->edit_auto_size);
+ print_indent(indent_depth);
+ printf("auto_size=%d\n", swf_tag_edit->edit_auto_size);
}
- printf("\tlayout=%d no_sel=%d border=%d\n",
+ print_indent(indent_depth);
+ printf("layout=%d no_sel=%d border=%d\n",
swf_tag_edit->edit_has_layout?1:0,
swf_tag_edit->edit_no_select?1:0,
swf_tag_edit->edit_border?1:0);
if (swf_tag_edit->edit_has_font) {
- printf("\tfont_id=%d font_height=%d\n",
+ print_indent(indent_depth);
+ printf("font_id=%d font_height=%d\n",
swf_tag_edit->edit_font_id_ref,
swf_tag_edit->edit_font_height / SWF_TWIPS);
}
if (swf_tag_edit->edit_has_color) {
- printf("\t");
- swf_rgba_print(&swf_tag_edit->edit_color);
+ swf_rgba_print(&swf_tag_edit->edit_color, indent_depth + 1);
}
if (swf_tag_edit->edit_has_max_length) {
- printf("\tmax_length=%d\n",
+ print_indent(indent_depth);
+ printf("max_length=%d\n",
swf_tag_edit->edit_max_length);
}
if (swf_tag_edit->edit_has_layout) {
- printf("\talign=%d (left,right)_margine=(%d,%d) indent=%d leading=%d\n",
+ print_indent(indent_depth);
+ printf("align=%d (left,right)_margine=(%d,%d) indent=%d leading=%d\n",
swf_tag_edit->edit_align,
swf_tag_edit->edit_left_margine,
swf_tag_edit->edit_right_margine,
swf_tag_edit->edit_leading);
}
if (swf_tag_edit->edit_variable_name) {
- printf("\tvariable_name=%s\n",
+ print_indent(indent_depth);
+ printf("variable_name=%s\n",
swf_tag_edit->edit_variable_name);
}
if (swf_tag_edit->edit_initial_text) {
- printf("\tinitial_text=%s\n",
+ print_indent(indent_depth);
+ printf("initial_text=%s\n",
swf_tag_edit->edit_initial_text);
}
return ;
unsigned long *length,
struct swf_object_ *swf);
extern void swf_tag_edit_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf);
+ struct swf_object_ *swf,
+ int indent_depth);
extern void swf_tag_edit_destroy_detail(swf_tag_t *tag);
extern char *swf_tag_edit_get_string(void *detail,
void
swf_tag_jpeg_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf) {
+ struct swf_object_ *swf, int indent_depth) {
swf_tag_jpeg_detail_t *swf_tag_jpeg = (swf_tag_jpeg_detail_t *) tag->detail;
jpeg_segment_t *jpeg_seg;
jpeg_segment_node_t *node;
fprintf(stderr, "swf_tag_jpeg_print_detail: swf_tag_jpeg == NULL\n");
return ;
}
- printf("\timage_id=%d jpeg_data_size=%lu\n",
+ print_indent(indent_depth);
+ printf("image_id=%d jpeg_data_size=%lu\n",
swf_tag_jpeg->image_id, swf_tag_jpeg->jpeg_data_len);
jpeg_seg = jpeg_segment_parse(swf_tag_jpeg->jpeg_data,
swf_tag_jpeg->jpeg_data_len);
if (jpeg_seg) {
for (node=jpeg_seg->head ; node ; node=node->next) {
char *name = jpeg_segment_get_marker_name(node->marker);
- printf("\t\t%s(0x%02X): len=%lu\n", name?name:"Unknwon",
+ print_indent(indent_depth + 1);
+ printf("%s(0x%02X): len=%lu\n", name?name:"Unknwon",
node->marker, node->data_len);
}
jpeg_segment_destroy(jpeg_seg);
} else {
- printf("\t\t(invalid jpeg data)\n");
+ print_indent(indent_depth + 1);
+ printf("(invalid jpeg data)\n");
}
if (swf_tag_jpeg->alpha_data) {
- printf(" alpha_data_size=%lu\n",
+ print_indent(indent_depth);
+ printf("alpha_data_size=%lu\n",
swf_tag_jpeg->alpha_data_len);
}
}
unsigned long *length,
struct swf_object_ *swf);
extern void swf_tag_jpeg_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf);
+ struct swf_object_ *swf,
+ int indent_depth);
extern void swf_tag_jpeg_destroy_detail(swf_tag_t *tag);
extern unsigned char *swf_tag_jpeg_get_jpeg_data(void *detail,
void
swf_tag_lossless_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf) {
+ struct swf_object_ *swf, int indent_depth) {
swf_tag_lossless_detail_t *swf_tag_lossless = (swf_tag_lossless_detail_t *) tag->detail;
(void) swf;
if (swf_tag_lossless == NULL) {
fprintf(stderr, "swf_tag_lossless_print_detail: swf_tag_lossless == NULL\n");
return ;
}
- printf("\timage_id=%d format=%d width=%u height=%u\n",
+ print_indent(indent_depth);
+ printf("image_id=%d format=%d width=%u height=%u\n",
swf_tag_lossless->image_id, swf_tag_lossless->format,
swf_tag_lossless->width, swf_tag_lossless->height);
if (swf_tag_lossless->colormap ||
swf_tag_lossless->colormap2) {
- printf("\tcolormap_count=%d",
+ print_indent(indent_depth);
+ printf("colormap_count=%d",
swf_tag_lossless->colormap_count);
if (swf_tag_lossless->colormap) {
printf(" rgb colormap exists");
printf("\n");
}
if (swf_tag_lossless->bitmap) {
- printf("\txrgb bitmap exists\n");
+ print_indent(indent_depth);
+ printf("xrgb bitmap exists\n");
}
if (swf_tag_lossless->bitmap2) {
- printf("\targb bitmap exists\n");
+ print_indent(indent_depth);
+ printf("argb bitmap exists\n");
}
}
unsigned long *length,
struct swf_object_ *swf);
extern void swf_tag_lossless_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf);
+ struct swf_object_ *swf,
+ int indent_depth);
extern void swf_tag_lossless2_print_detail(swf_tag_t *tag,
struct swf_object_ *swf);
extern void swf_tag_lossless_destroy_detail(swf_tag_t *tag);
void
swf_tag_shape_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf) {
+ struct swf_object_ *swf, int indent_depth) {
swf_tag_shape_detail_t *swf_tag_shape = (swf_tag_shape_detail_t *) tag->detail;
int i;
swf_tag_t *_tag;
+ print_indent(indent_depth);
printf("\tshape_id=%d\n", swf_tag_shape->shape_id);
return ;
}
unsigned long *length,
struct swf_object_ *swf);
extern void swf_tag_shape_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf);
+ struct swf_object_ *swf,
+ int indent_depth);
extern void swf_tag_shape_destroy_detail(swf_tag_t *tag);
#endif /* __SWF_TAG_SHAPE__H__ */
void
swf_tag_sound_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf) {
+ struct swf_object_ *swf, int indent_depth) {
swf_tag_sound_detail_t *swf_tag_sound = (swf_tag_sound_detail_t *) tag->detail;
char *format_name = "Unknown";
(void) swf;
break;
}
- printf("\tsound_id=%d\n", swf_tag_sound->sound_id);
-
- printf("\tformat=%u(%s) rate=%u is_16bits=%u is_stereo=%u samples_count=%lu\n",
+ print_indent(indent_depth);
+ printf("sound_id=%d\n", swf_tag_sound->sound_id);
+ print_indent(indent_depth);
+ printf("format=%u(%s) rate=%u is_16bits=%u is_stereo=%u samples_count=%lu\n",
swf_tag_sound->sound_format & 0x0f, format_name,
swf_tag_sound->sound_rate & 0x03,
swf_tag_sound->sound_is_16bits?1:0,
swf_tag_sound->sound_is_stereo?1:0,
swf_tag_sound->sound_samples_count);
- printf("\tsound_data(length=%lu)\n",
+ print_indent(indent_depth);
+ printf("sound_data(length=%lu)\n",
swf_tag_sound->sound_data_len);
return ;
}
unsigned long *length,
struct swf_object_ *swf);
extern void swf_tag_sound_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf);
+ struct swf_object_ *swf,
+ int indent_depth);
extern void swf_tag_sound_destroy_detail(swf_tag_t *tag);
extern unsigned char *swf_tag_sound_get_sound_data(void *detail, unsigned long *length,
void
swf_tag_sprite_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf) {
+ struct swf_object_ *swf,
+ int indent_depth) {
swf_tag_sprite_detail_t *swf_tag_sprite = (swf_tag_sprite_detail_t *) tag->detail;
int i;
swf_tag_t *_tag;
- printf("\tsprite_id=%d\n", swf_tag_sprite->sprite_id);
- printf("\tframe_count=%d\n", swf_tag_sprite->frame_count);
+ print_indent(indent_depth);
+ printf("sprite_id=%d\n", swf_tag_sprite->sprite_id);
+ print_indent(indent_depth);
+ printf("frame_count=%d\n", swf_tag_sprite->frame_count);
_tag = swf_tag_sprite->tag;
- printf("---- start sprite_id=%d ----\n", swf_tag_sprite->sprite_id);
for (i=0 ; _tag ; i++) {
+ print_indent(indent_depth);
printf(" [%d] ", i);
- swf_tag_print(_tag, swf);
+ swf_tag_print(_tag, swf, indent_depth + 1);
if (_tag->tag == 0) { // END Tag
break;
}
_tag = _tag->next;
}
- printf("---- end sprite_id=%d ----\n", swf_tag_sprite->sprite_id);
return ;
}
unsigned long *length,
struct swf_object_ *swf);
extern void swf_tag_sprite_print_detail(swf_tag_t *tag,
- struct swf_object_ *swf);
+ struct swf_object_ *swf,
+ int indent_depth);
extern void swf_tag_sprite_destroy_detail(swf_tag_t *tag);
#endif /* __SWF_TAG_SPRITE__H__ */