OSDN Git Service

[Refactor] #38844 Removed inclusion of monster-race.h in angband.h
[hengband/hengband.git] / src / info-reader / info-reader-util.h
1 #pragma once
2
3 #include "system/angband.h"
4
5 /*
6  * Size of memory reserved for initialization of some arrays
7  */
8 #define FAKE_NAME_SIZE 40 * 1024L /*!< ゲーム情報の種別毎に用意される名前用バッファの容量 */
9 #define FAKE_TEXT_SIZE 150 * 1024L /*!< ゲーム情報の種別毎に用意されるテキスト用バッファの容量 */
10 #define FAKE_TAG_SIZE 10 * 1024L /*!< ゲーム情報の種別毎に用意されるタグ用バッファの容量 */
11
12 /*!
13  * @brief 各初期データ用ヘッダ構造体 / Template file header information (see "init.c").
14  */
15 typedef struct angband_header angband_header;
16 typedef errr (*parse_info_txt_func)(char *buf, angband_header *head);
17
18 struct angband_header {
19     byte v_major; /* Version -- major */
20     byte v_minor; /* Version -- minor */
21     byte v_patch; /* Version -- patch */
22     byte v_extra; /* Version -- extra */
23
24     u16b info_num; /* Number of "info" records */
25     int info_len; /* Size of each "info" record */
26     u16b head_size; /* Size of the "header" in bytes */
27
28     STR_OFFSET info_size; /* Size of the "info" array in bytes */
29     STR_OFFSET name_size; /* Size of the "name" array in bytes */
30     STR_OFFSET text_size; /* Size of the "text" array in bytes */
31     STR_OFFSET tag_size; /* Size of the "tag" array in bytes */
32
33     void *info_ptr;
34     char *name_ptr;
35     char *text_ptr;
36     char *tag_ptr;
37
38     parse_info_txt_func parse_info_txt;
39
40     void (*retouch)(angband_header *head);
41 };
42
43 extern int error_idx;
44 extern int error_line;
45
46 bool add_text(u32b *offset, angband_header *head, concptr buf, bool normal_text);
47 bool add_name(u32b *offset, angband_header *head, concptr buf);
48 bool add_tag(STR_OFFSET *offset, angband_header *head, concptr buf);
49 errr grab_one_flag(u32b *flags, concptr names[], concptr what);
50 byte grab_one_activation_flag(concptr what);