X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=src%2Fdumpword.c;h=0bc9a472c93344720e5833628cf37db3be2f7896;hp=5ce0ec40c494bd92d285e12f43881e3af0d26f23;hb=7f7bde5dd1305cfc598fe09030c69aad0dc01368;hpb=650f92bf8dfdd0095db993f71f9e3867e7119acc diff --git a/src/dumpword.c b/src/dumpword.c index 5ce0ec4..0bc9a47 100644 --- a/src/dumpword.c +++ b/src/dumpword.c @@ -1,7 +1,13 @@ -#include "casl2.h" #define _GNU_SOURCE +#include +#include #include +#include "word.h" +#include "cerr.h" +/** + * dumpwordコマンドのオプション + */ static struct option longopts[] = { { "arithmetic", no_argument, NULL, 'a' }, { "logical", no_argument, NULL, 'l' }, @@ -9,14 +15,17 @@ static struct option longopts[] = { { 0, 0, 0, 0 }, }; +/** + * dumpwordコマンドのメイン + */ int main(int argc, char *argv[]) { - bool logicalmode = false; /* レジストリの内容を論理値(0〜65535)で表示する場合はtrue */ + bool logicalmode = false; /* レジストリの内容を論理値(0から65535)で表示する場合はtrue */ int opt; WORD word; const char *usage = "Usage: %s [-alh] WORD\n"; - cerr = malloc_chk(sizeof(CERR), "cerr"); + cerr_init(); while((opt = getopt_long(argc, argv, "alh", longopts, NULL)) != -1) { switch(opt) { case 'l':