ヘッダーファイル呼び出しの整理
[YACASL2.git] / include / monitor.h
1 #ifndef MONITOR_INCLUDE
2 #define MONITOR_INCLUDE
3
4 #include <stdio.h>
5 #include <string.h>
6 #include <assert.h>
7 #include "hash.h"
8 #include "cmem.h"
9 #include "cerr.h"
10 #include "exec.h"
11 #include "word.h"
12
13 /**
14  * @brief モニター
15  */
16 enum {
17     MONARGSIZE = 3,          /**<モニター引数の最大数 */
18 };
19
20 /**
21  * @brief モニター引数を表すデータ型
22  */
23 typedef struct {
24     int argc;                   /**<オペランド数 */
25     char *argv[MONARGSIZE];      /**<オペランド配列 */
26 } MONARGS;
27
28 /**
29  * @brief モニター命令行を表すデータ型
30  */
31 typedef struct {
32     char *cmd;                  /**<コマンド */
33     MONARGS *args;               /**<引数 */
34 } MONCMDLINE;
35
36 /**
37  * @brief ブレークポイント表を表すデータ型
38  */
39 typedef struct _BPSLIST {
40     struct _BPSLIST *next;        /**<リスト次項目へのポインタ */
41     WORD adr;                   /**<アドレス */
42 } BPSLIST;
43
44 /**
45  * ブレークポイント表のサイズ
46  */
47 enum {
48     BPSTABSIZE = 251,         /**<ブレークポイント表のサイズ */
49 };
50
51 enum {
52     MONINSIZE = 40    /**<モニターの、入力領域 */
53 };
54
55 /**
56  * @brief アドレスのハッシュ値を返す
57  *
58  * @return ハッシュ値
59  *
60  * @param adr アドレス
61  */
62 unsigned adrhash(WORD adr);
63
64 /**
65  * @brief 文字列から、モニターの引数を取得する
66  *
67  * @return モニターの引数
68  *
69  * @param *str 文字列
70  */
71 MONARGS *monargstok(const char *str);
72
73 /**
74  * @brief 行から、モニターの命令と引数を取得する
75  *
76  * @return モニターの命令と引数
77  *
78  * @param *line 行
79  */
80 MONCMDLINE *monlinetok(const char *line);
81
82 /**
83  * @brief ブレークポイント表にアドレスがある場合はtrue、ない場合はfalseを返す
84  *
85  * @return trueまたはfalse
86  *
87  * @param *adr アドレス
88  */
89 bool getbps(WORD adr);
90
91 /**
92  * @brief ブレークポイント表にアドレスを追加する
93  *
94  * @return 追加した場合はtrue、追加しなかった場合はfalse
95  *
96  * @param *adr アドレス
97  */
98 bool addbps(WORD adr);
99
100
101 /**
102  * @brief ブレークポイント表からアドレスを削除する
103  *
104  * @return 削除した場合はtrue、削除しなかった場合はfalse
105  *
106  * @param *adr アドレス
107  */
108 bool delbps(WORD adr);
109
110 /**
111  * @brief ブレークポイント表を解放する
112  *
113  * @return なし
114  */
115 void freebps();
116
117 #endif        /* end of MONITOR_INCLUDE */