X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=src%2Fcomet2.c;h=7fa8d2987ba463152946006eff5427a8b03e3f87;hp=bfe1634a7d8c91ad0305c25be73d7ab9d7a13a71;hb=ed3225328d7bc0d718fc97dd0b05692b7287667b;hpb=097530326dc9a0047de74a4b3e7d7436629de3c1 diff --git a/src/comet2.c b/src/comet2.c index bfe1634..7fa8d29 100644 --- a/src/comet2.c +++ b/src/comet2.c @@ -3,6 +3,7 @@ #define _GNU_SOURCE #include +/* comet2コマンドのオプション */ static struct option longopts[] = { {"trace", no_argument, NULL, 't'}, {"tracearithmetic", no_argument, NULL, 't'}, @@ -14,6 +15,7 @@ static struct option longopts[] = { {0, 0, 0, 0} }; +/* 実行モード: trace, logical, dump */ EXECMODE execmode = {false, false, false}; /* エラー番号とエラーメッセージ */ @@ -29,7 +31,7 @@ CERRARRAY cerr[] = { }; /* 指定されたファイルからアセンブル結果を読込 */ -bool inassemble(char *file) { +bool loadassemble(char *file) { FILE *fp; reset(); if((fp = fopen(file, "r")) == NULL) { @@ -50,14 +52,14 @@ int main(int argc, char *argv[]) while((opt = getopt_long(argc, argv, "tTdM:C:h", longopts, NULL)) != -1) { switch(opt) { case 't': - (&execmode)->tracemode = true; + (&execmode)->trace = true; break; case 'T': - (&execmode)->tracemode = true; - (&execmode)->logicalmode = true; + (&execmode)->trace = true; + (&execmode)->logical = true; break; case 'd': - (&execmode)->dumpmode = true; + (&execmode)->dump = true; break; case 'M': memsize = atoi(optarg); @@ -73,7 +75,7 @@ int main(int argc, char *argv[]) exit(-1); } } - if(inassemble(argv[optind]) == true) { + if(loadassemble(argv[optind]) == true) { exec(); /* プログラム実行 */ } if(cerrno > 0) {