These pages are written by only Japanese.

Welcom to My Diary.com
最新の日記タイトル一覧カテゴリ別タイトル一覧トップへ戻る〜

こんばんわ♪ 現在は4月24日(水)18時45分。 今日も残業なのでしょうか?


hns - 日記自動生成システム - Version 2.19.5 (色々 Fixed)

先月 2008年03月 来月
01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Namazu for hns による簡易全文検索です。
詳細は 詳細指定/ヘルプをご参照下さい。
検索式:

2008年03月26日(水)

PHP extension のお勉強 (6)

これ の続き
SWF ヘッダ部の実装完了。

テストコード:

$swfdata = file_get_contents("saitama.swf");
$obj = new SWFEditor();
$obj->input($swfdata);
$obj->swfInfo();

実行結果:

magic=FWS  version=4  file_length=2704
frame_size=(0, 0)-(240, 240)
frame_rate=8.0  frame_count=40

欲をかいて tag 分解まで:

swf_tag_t *swf_tag_create(bitstream_t *bs) {
    swf_tag_t *tag = calloc(1, sizeof(*tag));
    int tag_and_length, length;
    tag_and_length = bitstream_getbytesLE(bs, 2);
    tag->tag = tag_and_length >> 6;
    tag->length = tag_and_length & 0x3f;
    tag->length_longformat = 0;
    if (tag->length == 0x3f) {
        tag->length = bitstream_getbytesLE(bs, 4);
        tag->length_longformat = 1;
    }
    tag->data = calloc(tag->length, 1);
    bitstream_getstring(bs, tag->data, tag->length);
    tag->modified = 0;
    return tag;
}
実行結果。
% php yoya_test.php
*** glibc detected *** php: malloc(): memory corruption: 0x09d202e8 ***
======= Backtrace: =========
/lib/libc.so.6[0x2bd14c]
さて、寝よっと…

我慢できず目が覚めた…:


magic=FWS  version=4  file_length=2704
frame_size=(0, 0)-(240, 240)
frame_rate=8.0  frame_count=40
tag=9  length=3
tag=1  length=0
<略>
tag=26  length=7
tag=1  length=0
tag=0  length=0
タグの分解まで出来ちゃった…

プログラム:

bitstream.c がボロボロなので、かなり書き直しました。

これで、1 日分だよ〜。

タイトル一覧
カテゴリ分類
Database
JXTA
Java
XML
awm
bookmark
keyword
memo
news
research
Powered by hns-2.19.5, HyperNikkiSystem Project