typedef errr (*parse_info_txt_func)(char *buf, angband_header *head);
struct angband_header {
- byte v_major; /* Version -- major */
- byte v_minor; /* Version -- minor */
- byte v_patch; /* Version -- patch */
- byte checksum; /* Version -- extra */
+ byte v_major; //!< Major version
+ byte v_minor; //!< Minor version
+ byte v_patch; //!< Patch version
+ byte checksum; //!< Checksum of "info" records
- u16b info_num; /* Number of "info" records */
- int info_len; /* Size of each "info" record */
- u16b head_size; /* Size of the "header" in bytes */
+ u16b info_num; //!< このinfoのデータ数
+ int info_len; //!< このinfoの総サイズ
+ u16b head_size; //!< このinfoのヘッダサイズ
- STR_OFFSET info_size; /* Size of the "info" array in bytes */
- STR_OFFSET name_size; /* Size of the "name" array in bytes */
- STR_OFFSET text_size; /* Size of the "text" array in bytes */
- STR_OFFSET tag_size; /* Size of the "tag" array in bytes */
+ STR_OFFSET info_size; //!< info配列サイズ
+ STR_OFFSET name_size; //!< 名前文字列群サイズ(総文字長)
+ STR_OFFSET text_size; //!< フレーバー文字列群サイズ(総文字長)
+ STR_OFFSET tag_size; //!< タグ文字列群サイズ(総文字長)
- void *info_ptr;
- char *name_ptr;
- char *text_ptr;
- char *tag_ptr;
+ void *info_ptr; //!< info配列へのポインタ
+ char *name_ptr; //!< 名前文字列群へのポインタ
+ char *text_ptr; //!< フレーバー文字列群へのポインタ
+ char *tag_ptr; //!< タグ文字列群へのポインタ
- parse_info_txt_func parse_info_txt;
+ parse_info_txt_func parse_info_txt; //!< Pointer to parser callback function
- void (*retouch)(angband_header *head);
+ void (*retouch)(angband_header *head); //!< 設定再読み込み用?
+
+ byte v_extra; ///< Extra version for Alpha, Beta
+ byte v_savefile; ///< Savefile version
};
extern angband_header f_head;
static errr init_info_raw(int fd, angband_header *head)
{
angband_header test;
- if (fd_read(fd, (char *)(&test), sizeof(angband_header)) || (test.v_major != head->v_major) || (test.v_minor != head->v_minor)
- || (test.v_patch != head->v_patch) || (test.info_num != head->info_num) || (test.info_len != head->info_len) || (test.head_size != head->head_size)
- || (test.info_size != head->info_size)) {
+ if (fd_read(fd, (char *)(&test), sizeof(angband_header))
+ || (test.v_major != head->v_major) || (test.v_minor != head->v_minor) || (test.v_patch != head->v_patch)
+ || (test.v_extra != head->v_extra) || (test.v_savefile != head->v_savefile)
+ || (test.head_size != head->head_size) || (test.info_size != head->info_size)
+ || (test.info_num != head->info_num) || (test.info_len != head->info_len))
return -1;
- }
*head = test;
C_MAKE(head->info_ptr, head->info_size, char);
head->head_size = sizeof(angband_header);
head->info_size = head->info_num * head->info_len;
+
+ head->v_extra = FAKE_VER_EXTRA;
+ head->v_savefile = SAVEFILE_VERSION;
}
/*!