JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... _OPT = 0, RW_OPT, NAME_OPT }; char *const token[] = { [RO_OPT] = "ro", [RW_OPT] = "rw", [NAME_OPT] = "name", NULL }; char *subopts; char *value; int opt; int readonly = 0; int readwrite = 0; char *name = NULL; int errfnd = 0; while ((opt = getopt(argc, ... argv, "o:")) != -1) { switch (opt) { case 'o': subopts = optarg; while (*subopts != '\0' && !errfnd) { switch (getsubopt(&subopts, token, &value)) { case RO_OPT: readonly = 1; b ... token[RW_OPT]); errfnd = 1; } break; default: errfnd = 1; } } if (errfnd || argc == 1) { fprintf(stderr, "\nUsage: %s -o <suboptstring>\n", argv[0]); fprintf(stderr, "suboptions are 'ro', 'rw', " "and 'name=<value>'\n"); exit(EXIT_FAILURE); } /* Remain ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。