8000 Make the form design documents agree with how jetdb reads forms and with the test data by dominion525 · Pull Request #164 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/form-design.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ DirData はフォーム表示名と内部ストレージ番号("0", "1", ...
繰り返し:
0x04 マーカーバイト
<1バイト> ペイロード長(バイト数)
<UTF-16LE 文字列> フォーム表示名 + ストレージ番号
<UTF-16LE 文字列> フォーム表示名
<u16 LE> ストレージ番号
0x0000 終端
終端4バイト: 0x00
```

ストレージ番号はペイロードの末尾 2 バイト(UTF-16LE の 1 文字)として格納される。
ストレージ番号は、終端の 0x0000 の直前の u16(Little-Endian)である。jetdb はこれを `"5"` のような 10 進の文字列にして、フォームのストレージの名前とする。

例:
- ストレージ "0" → F_クライアント情報
Expand Down Expand Up @@ -156,7 +158,7 @@ TypeInfo はフォーム内の全コントロールの名前と型コードの
フォームデザインの本体バイナリ。ControlSource、イベントプロシージャ、RecordSource 等の構造情報を含む。

- サイズ: 918B(シンプル)〜 52KB+(複雑なフォーム)
- 先頭バイト: `15 00 14 00 00 00 00 00`(全フォーム共通のヘッダ)
- 先頭バイト: `14 00 14 00 00 00 00 00` か `15 00 14 00 00 00 00 00`。先頭の 1 バイトは SaveAsText の出力の `Version`(`Version =20` か `Version =21`)
- バイナリフォーマットの公開仕様なし。以下はリバースエンジニアリングによる解析結果

### Blob 全体レイアウト
Expand All @@ -165,7 +167,7 @@ Blob は、Access 2000 形式の Blob と同じく([Access 2000 形式の Blob

```
Blob ヘッダー 8 バイト + 6 バイト + フォームやレポート自体のまとまり + 要素の並び
ヘッダー version(u16) = 0x0015, flags(u16) = 0x0014, reserved(u32) = 0
ヘッダー version(u16) = 0x0014 か 0x0015, flags(u16) = 0x0014, reserved(u32) = 0
まとまり プロパティエントリの列。trailer が 253・254・255 のエントリで終わる
並び trailer が 253 なら要素なし、254 なら 1 つ、255 なら数(u16)とその数の要素
要素 種類(u16) + 4 バイト + まとまり + その中の要素の並び
Expand Down
8000 12 changes: 7 additions & 5 deletions docs/form-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ First 4 bytes: Padding (0x00)
Repeated:
0x04 Marker byte
<1 byte> Payload length (in bytes)
<UTF-16LE string> Form display name + storage number
<UTF-16LE string> Form display name
<u16 LE> Storage number
0x0000 Terminator
Trailing 4 bytes: 0x00
```

The storage number is stored as the last 2 bytes of the payload (a single UTF-16LE character).
The storage number is the u16 (Little-Endian) before the closing 0x0000. jetdb turns it into a decimal string, such as `"5"`, and takes that as the name of the storage of the form.

Examples:
- Storage "0" → F_クライアント情報
Expand Down Expand Up @@ -93,7 +95,7 @@ Each entry:
With parentheses → actual control name
```

The names are in the code page of the Access that saved the form, which the file does not keep. jetdb reads them in the code page, of that in the header of the database and then those of Windows (874, 932, 936, 949, 950 and 1250 to 1258), in which the most names that are not ASCII are among the names of the controls in the Blob, which are UTF-16, regardless of case; in that of the header when none is. The Russian names of `Strings.mdb` are in 1251, while its header has 1252.
The names are in the code page of the Access that saved the form, which the file does not keep. jetdb reads them in the code page, of that in the header of the database and then those of Windows (874, 932, 936, 949, 950 and 1250 to 1258), in which the most names that are not ASCII are among the names of the controls in the Blob, which are UTF-16, regardless of case; in the one tried first, that of the header being first, when more than one have as many; in that of the header when none is. The Russian names of `Strings.mdb` are in 1251, while its header has 1252.

Example controls included:
- Buttons: `Btn_クライアント一覧`
Expand Down Expand Up @@ -156,7 +158,7 @@ Note: Counts are aggregated from all controls across 81 forms/reports in a datab
The main binary body of the form design. Contains structural information including ControlSource, event procedures, RecordSource, etc.

- Size: 918B (simple) to 52KB+ (complex forms)
- Leading bytes: `15 00 14 00 00 00 00 00` (common header across all forms)
- Leading bytes: `14 00 14 00 00 00 00 00` or `15 00 14 00 00 00 00 00`, the first byte being the `Version` of its SaveAsText output (`Version =20` or `Version =21`)
- No public specification for the binary format. The following is based on reverse engineering analysis.

### Blob Overall Layout
Expand All @@ -165,7 +167,7 @@ The Blob keeps the design as a tree, as the Blob of the Access 2000 format does

```
Blob 8 bytes of header + 6 bytes + the group of the form or report itself + nodes
Header version(u16) = 0x0015, flags(u16) = 0x0014, reserved(u32) = 0
Header version(u16) = 0x0014 or 0x0015, flags(u16) = 0x0014, reserved(u32) = 0
Group property entries, through the one whose trailer is 253, 254 or 255
Nodes none after a trailer of 253, one after 254, and a count (u16) and that many after 255
Node type (u16) + 4 bytes + a group + the nodes in it
Expand Down
Loading
0