mconf.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. /*
  2. * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
  3. * Released under the terms of the GNU GPL v2.0.
  4. *
  5. * Introduced single menu mode (show all sub-menus in one large tree).
  6. * 2002-11-06 Petr Baudis <pasky@ucw.cz>
  7. */
  8. #include <sys/ioctl.h>
  9. #include <sys/wait.h>
  10. #include <sys/termios.h>
  11. #include <ctype.h>
  12. #include <errno.h>
  13. #include <fcntl.h>
  14. #include <limits.h>
  15. #include <signal.h>
  16. #include <stdarg.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <termios.h>
  20. #include <unistd.h>
  21. #define LKC_DIRECT_LINK
  22. #include "lkc.h"
  23. static char menu_backtitle[128];
  24. static const char menu_instructions[] =
  25. "Arrow keys navigate the menu. "
  26. "<Enter> selects submenus --->. "
  27. "Highlighted letters are hotkeys. "
  28. "Pressing <Y> selectes a feature, while <N> will exclude a feature. "
  29. "Press <Esc><Esc> to exit, <?> for Help. "
  30. "Legend: [*] feature is selected [ ] feature is excluded",
  31. radiolist_instructions[] =
  32. "Use the arrow keys to navigate this window or "
  33. "press the hotkey of the item you wish to select "
  34. "followed by the <SPACE BAR>. "
  35. "Press <?> for additional information about this option.",
  36. inputbox_instructions_int[] =
  37. "Please enter a decimal value. "
  38. "Fractions will not be accepted. "
  39. "Use the <TAB> key to move from the input field to the buttons below it.",
  40. inputbox_instructions_hex[] =
  41. "Please enter a hexadecimal value. "
  42. "Use the <TAB> key to move from the input field to the buttons below it.",
  43. inputbox_instructions_string[] =
  44. "Please enter a string value. "
  45. "Use the <TAB> key to move from the input field to the buttons below it.",
  46. setmod_text[] =
  47. "This feature depends on another which has been configured as a module.\n"
  48. "As a result, this feature will be built as a module.",
  49. nohelp_text[] =
  50. "There is no help available for this option.\n",
  51. load_config_text[] =
  52. "Enter the name of the configuration file you wish to load. "
  53. "Accept the name shown to restore the configuration you "
  54. "last retrieved. Leave blank to abort.",
  55. load_config_help[] =
  56. "\n"
  57. "For various reasons, one may wish to keep several different uClibc\n"
  58. "configurations available on a single machine.\n"
  59. "\n"
  60. "If you have saved a previous configuration in a file other than the\n"
  61. "uClibc's default, entering the name of the file here will allow you\n"
  62. "to modify that configuration.\n"
  63. "\n"
  64. "If you are uncertain, then you have probably never used alternate\n"
  65. "configuration files. You should therefor leave this blank to abort.\n",
  66. save_config_text[] =
  67. "Enter a filename to which this configuration should be saved "
  68. "as an alternate. Leave blank to abort.",
  69. save_config_help[] =
  70. "\n"
  71. "For various reasons, one may wish to keep different uClibc\n"
  72. "configurations available on a single machine.\n"
  73. "\n"
  74. "Entering a file name here will allow you to later retrieve, modify\n"
  75. "and use the current configuration as an alternate to whatever\n"
  76. "configuration options you have selected at that time.\n"
  77. "\n"
  78. "If you are uncertain what all this means then you should probably\n"
  79. "leave this blank.\n"
  80. ;
  81. static char buf[4096], *bufptr = buf;
  82. static char input_buf[4096];
  83. static char filename[PATH_MAX+1] = ".config";
  84. static char *args[1024], **argptr = args;
  85. static int indent = 0;
  86. static struct termios ios_org;
  87. static int rows, cols;
  88. static struct menu *current_menu;
  89. static int child_count;
  90. static int do_resize;
  91. static int single_menu_mode;
  92. static void conf(struct menu *menu);
  93. static void conf_choice(struct menu *menu);
  94. static void conf_string(struct menu *menu);
  95. static void conf_load(void);
  96. static void conf_save(void);
  97. static void show_textbox(const char *title, const char *text, int r, int c);
  98. static void show_helptext(const char *title, const char *text);
  99. static void show_help(struct menu *menu);
  100. static void show_readme(void);
  101. static void cprint_init(void);
  102. static int cprint1(const char *fmt, ...);
  103. static void cprint_done(void);
  104. static int cprint(const char *fmt, ...);
  105. static void init_wsize(void)
  106. {
  107. struct winsize ws;
  108. if (ioctl(1, TIOCGWINSZ, &ws) == -1) {
  109. rows = 24;
  110. cols = 80;
  111. } else {
  112. rows = ws.ws_row;
  113. cols = ws.ws_col;
  114. }
  115. if (rows < 19 || cols < 80) {
  116. fprintf(stderr, "Your display is too small to run Menuconfig!\n");
  117. fprintf(stderr, "It must be at least 19 lines by 80 columns.\n");
  118. exit(1);
  119. }
  120. rows -= 4;
  121. cols -= 5;
  122. }
  123. static void cprint_init(void)
  124. {
  125. bufptr = buf;
  126. argptr = args;
  127. memset(args, 0, sizeof(args));
  128. indent = 0;
  129. child_count = 0;
  130. cprint("./extra/config/lxdialog/lxdialog");
  131. cprint("--backtitle");
  132. cprint(menu_backtitle);
  133. }
  134. static int cprint1(const char *fmt, ...)
  135. {
  136. va_list ap;
  137. int res;
  138. if (!*argptr)
  139. *argptr = bufptr;
  140. va_start(ap, fmt);
  141. res = vsprintf(bufptr, fmt, ap);
  142. va_end(ap);
  143. bufptr += res;
  144. return res;
  145. }
  146. static void cprint_done(void)
  147. {
  148. *bufptr++ = 0;
  149. argptr++;
  150. }
  151. static int cprint(const char *fmt, ...)
  152. {
  153. va_list ap;
  154. int res;
  155. *argptr++ = bufptr;
  156. va_start(ap, fmt);
  157. res = vsprintf(bufptr, fmt, ap);
  158. va_end(ap);
  159. bufptr += res;
  160. *bufptr++ = 0;
  161. return res;
  162. }
  163. pid_t pid;
  164. static void winch_handler(int sig)
  165. {
  166. if (!do_resize) {
  167. kill(pid, SIGINT);
  168. do_resize = 1;
  169. }
  170. }
  171. static int exec_conf(void)
  172. {
  173. int pipefd[2], stat, size;
  174. struct sigaction sa;
  175. sigset_t sset, osset;
  176. sigemptyset(&sset);
  177. sigaddset(&sset, SIGINT);
  178. sigprocmask(SIG_BLOCK, &sset, &osset);
  179. signal(SIGINT, SIG_DFL);
  180. sa.sa_handler = winch_handler;
  181. sigemptyset(&sa.sa_mask);
  182. sa.sa_flags = SA_RESTART;
  183. sigaction(SIGWINCH, &sa, NULL);
  184. *argptr++ = NULL;
  185. pipe(pipefd);
  186. pid = fork();
  187. if (pid == 0) {
  188. sigprocmask(SIG_SETMASK, &osset, NULL);
  189. dup2(pipefd[1], 2);
  190. close(pipefd[0]);
  191. close(pipefd[1]);
  192. execv(args[0], args);
  193. _exit(EXIT_FAILURE);
  194. }
  195. close(pipefd[1]);
  196. bufptr = input_buf;
  197. while (1) {
  198. size = input_buf + sizeof(input_buf) - bufptr;
  199. size = read(pipefd[0], bufptr, size);
  200. if (size <= 0) {
  201. if (size < 0) {
  202. if (errno == EINTR || errno == EAGAIN)
  203. continue;
  204. perror("read");
  205. }
  206. break;
  207. }
  208. bufptr += size;
  209. }
  210. *bufptr++ = 0;
  211. close(pipefd[0]);
  212. waitpid(pid, &stat, 0);
  213. if (do_resize) {
  214. init_wsize();
  215. do_resize = 0;
  216. sigprocmask(SIG_SETMASK, &osset, NULL);
  217. return -1;
  218. }
  219. if (WIFSIGNALED(stat)) {
  220. printf("\finterrupted(%d)\n", WTERMSIG(stat));
  221. exit(1);
  222. }
  223. #if 0
  224. printf("\fexit state: %d\nexit data: '%s'\n", WEXITSTATUS(stat), input_buf);
  225. sleep(1);
  226. #endif
  227. sigpending(&sset);
  228. if (sigismember(&sset, SIGINT)) {
  229. printf("\finterrupted\n");
  230. exit(1);
  231. }
  232. sigprocmask(SIG_SETMASK, &osset, NULL);
  233. return WEXITSTATUS(stat);
  234. }
  235. static void build_conf(struct menu *menu)
  236. {
  237. struct symbol *sym;
  238. struct property *prop;
  239. struct menu *child;
  240. int type, tmp, doint = 2;
  241. tristate val;
  242. char ch;
  243. if (!menu_is_visible(menu))
  244. return;
  245. sym = menu->sym;
  246. prop = menu->prompt;
  247. if (!sym) {
  248. if (prop && menu != current_menu) {
  249. const char *prompt = menu_get_prompt(menu);
  250. switch (prop->type) {
  251. case P_MENU:
  252. child_count++;
  253. cprint("m%p", menu);
  254. if (single_menu_mode) {
  255. cprint1("%s%*c%s",
  256. menu->data ? "-->" : "++>",
  257. indent + 1, ' ', prompt);
  258. } else {
  259. if (menu->parent != &rootmenu)
  260. cprint1(" %*c", indent + 1, ' ');
  261. cprint1("%s --->", prompt);
  262. }
  263. cprint_done();
  264. if (single_menu_mode && menu->data)
  265. goto conf_childs;
  266. return;
  267. default:
  268. if (prompt) {
  269. child_count++;
  270. cprint(":%p", menu);
  271. cprint("---%*c%s", indent + 1, ' ', prompt);
  272. }
  273. }
  274. } else
  275. doint = 0;
  276. goto conf_childs;
  277. }
  278. type = sym_get_type(sym);
  279. if (sym_is_choice(sym)) {
  280. struct symbol *def_sym = sym_get_choice_value(sym);
  281. struct menu *def_menu = NULL;
  282. child_count++;
  283. for (child = menu->list; child; child = child->next) {
  284. if (menu_is_visible(child) && child->sym == def_sym)
  285. def_menu = child;
  286. }
  287. val = sym_get_tristate_value(sym);
  288. if (sym_is_changable(sym)) {
  289. cprint("t%p", menu);
  290. switch (type) {
  291. case S_BOOLEAN:
  292. cprint1("[%c]", val == no ? ' ' : '*');
  293. break;
  294. case S_TRISTATE:
  295. switch (val) {
  296. case yes: ch = '*'; break;
  297. case mod: ch = 'M'; break;
  298. default: ch = ' '; break;
  299. }
  300. cprint1("<%c>", ch);
  301. break;
  302. }
  303. } else {
  304. cprint("%c%p", def_menu ? 't' : ':', menu);
  305. cprint1(" ");
  306. }
  307. cprint1("%*c%s", indent + 1, ' ', menu_get_prompt(menu));
  308. if (val == yes) {
  309. if (def_menu) {
  310. cprint1(" (%s)", menu_get_prompt(def_menu));
  311. cprint1(" --->");
  312. cprint_done();
  313. if (def_menu->list) {
  314. indent += 2;
  315. build_conf(def_menu);
  316. indent -= 2;
  317. }
  318. } else
  319. cprint_done();
  320. return;
  321. }
  322. cprint_done();
  323. } else {
  324. child_count++;
  325. val = sym_get_tristate_value(sym);
  326. if (sym_is_choice_value(sym) && val == yes) {
  327. cprint(":%p", menu);
  328. cprint1(" ");
  329. } else {
  330. switch (type) {
  331. case S_BOOLEAN:
  332. cprint("t%p", menu);
  333. cprint1("[%c]", val == no ? ' ' : '*');
  334. break;
  335. case S_TRISTATE:
  336. cprint("t%p", menu);
  337. switch (val) {
  338. case yes: ch = '*'; break;
  339. case mod: ch = 'M'; break;
  340. default: ch = ' '; break;
  341. }
  342. cprint1("<%c>", ch);
  343. break;
  344. default:
  345. cprint("s%p", menu);
  346. tmp = cprint1("(%s)", sym_get_string_value(sym));
  347. tmp = indent - tmp + 4;
  348. if (tmp < 0)
  349. tmp = 0;
  350. cprint1("%*c%s%s", tmp, ' ', menu_get_prompt(menu),
  351. sym_has_value(sym) ? "" : " (NEW)");
  352. cprint_done();
  353. goto conf_childs;
  354. }
  355. }
  356. cprint1("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
  357. sym_has_value(sym) ? "" : " (NEW)");
  358. cprint_done();
  359. }
  360. conf_childs:
  361. indent += doint;
  362. for (child = menu->list; child; child = child->next)
  363. build_conf(child);
  364. indent -= doint;
  365. }
  366. static void conf(struct menu *menu)
  367. {
  368. struct menu *submenu;
  369. const char *prompt = menu_get_prompt(menu);
  370. struct symbol *sym;
  371. char active_entry[40];
  372. int stat, type, i;
  373. unlink("lxdialog.scrltmp");
  374. active_entry[0] = 0;
  375. while (1) {
  376. cprint_init();
  377. cprint("--title");
  378. cprint("%s", prompt ? prompt : "Main Menu");
  379. cprint("--menu");
  380. cprint(menu_instructions);
  381. cprint("%d", rows);
  382. cprint("%d", cols);
  383. cprint("%d", rows - 10);
  384. cprint("%s", active_entry);
  385. current_menu = menu;
  386. build_conf(menu);
  387. if (!child_count)
  388. break;
  389. if (menu == &rootmenu) {
  390. cprint(":");
  391. cprint("--- ");
  392. cprint("L");
  393. cprint("Load an Alternate Configuration File");
  394. cprint("S");
  395. cprint("Save Configuration to an Alternate File");
  396. }
  397. stat = exec_conf();
  398. if (stat < 0)
  399. continue;
  400. if (stat == 1 || stat == 255)
  401. break;
  402. type = input_buf[0];
  403. if (!type)
  404. continue;
  405. for (i = 0; input_buf[i] && !isspace((int)input_buf[i]); i++)
  406. ;
  407. if (i >= sizeof(active_entry))
  408. i = sizeof(active_entry) - 1;
  409. input_buf[i] = 0;
  410. strcpy(active_entry, input_buf);
  411. sym = NULL;
  412. submenu = NULL;
  413. if (sscanf(input_buf + 1, "%p", &submenu) == 1)
  414. sym = submenu->sym;
  415. switch (stat) {
  416. case 0:
  417. switch (type) {
  418. case 'm':
  419. if (single_menu_mode)
  420. submenu->data = (submenu->data)? NULL : (void *)1;
  421. else
  422. conf(submenu);
  423. break;
  424. case 't':
  425. if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)
  426. conf_choice(submenu);
  427. break;
  428. case 's':
  429. conf_string(submenu);
  430. break;
  431. case 'L':
  432. conf_load();
  433. break;
  434. case 'S':
  435. conf_save();
  436. break;
  437. }
  438. break;
  439. case 2:
  440. if (sym)
  441. show_help(submenu);
  442. else
  443. show_readme();
  444. break;
  445. case 3:
  446. if (type == 't') {
  447. if (sym_set_tristate_value(sym, yes))
  448. break;
  449. if (sym_set_tristate_value(sym, mod))
  450. show_textbox(NULL, setmod_text, 6, 74);
  451. }
  452. break;
  453. case 4:
  454. if (type == 't')
  455. sym_set_tristate_value(sym, no);
  456. break;
  457. case 5:
  458. if (type == 't')
  459. sym_set_tristate_value(sym, mod);
  460. break;
  461. case 6:
  462. if (type == 't')
  463. sym_toggle_tristate_value(sym);
  464. else if (type == 'm')
  465. conf(submenu);
  466. break;
  467. }
  468. }
  469. }
  470. static void show_textbox(const char *title, const char *text, int r, int c)
  471. {
  472. int fd;
  473. fd = creat(".help.tmp", 0777);
  474. write(fd, text, strlen(text));
  475. close(fd);
  476. do {
  477. cprint_init();
  478. if (title) {
  479. cprint("--title");
  480. cprint("%s", title);
  481. }
  482. cprint("--textbox");
  483. cprint(".help.tmp");
  484. cprint("%d", r);
  485. cprint("%d", c);
  486. } while (exec_conf() < 0);
  487. unlink(".help.tmp");
  488. }
  489. static void show_helptext(const char *title, const char *text)
  490. {
  491. show_textbox(title, text, rows, cols);
  492. }
  493. static void show_help(struct menu *menu)
  494. {
  495. const char *help;
  496. char *helptext;
  497. struct symbol *sym = menu->sym;
  498. help = sym->help;
  499. if (!help)
  500. help = nohelp_text;
  501. if (sym->name) {
  502. helptext = malloc(strlen(sym->name) + strlen(help) + 16);
  503. sprintf(helptext, "%s:\n\n%s", sym->name, help);
  504. show_helptext(menu_get_prompt(menu), helptext);
  505. free(helptext);
  506. } else
  507. show_helptext(menu_get_prompt(menu), help);
  508. }
  509. static void show_readme(void)
  510. {
  511. do {
  512. cprint_init();
  513. cprint("--textbox");
  514. cprint("scripts/README.Menuconfig");
  515. cprint("%d", rows);
  516. cprint("%d", cols);
  517. } while (exec_conf() == -1);
  518. }
  519. static void conf_choice(struct menu *menu)
  520. {
  521. const char *prompt = menu_get_prompt(menu);
  522. struct menu *child;
  523. struct symbol *active;
  524. int stat;
  525. while (1) {
  526. cprint_init();
  527. cprint("--title");
  528. cprint("%s", prompt ? prompt : "Main Menu");
  529. cprint("--radiolist");
  530. cprint(radiolist_instructions);
  531. cprint("15");
  532. cprint("70");
  533. cprint("6");
  534. current_menu = menu;
  535. active = sym_get_choice_value(menu->sym);
  536. for (child = menu->list; child; child = child->next) {
  537. if (!menu_is_visible(child))
  538. continue;
  539. cprint("%p", child);
  540. cprint("%s", menu_get_prompt(child));
  541. cprint(child->sym == active ? "ON" : "OFF");
  542. }
  543. stat = exec_conf();
  544. switch (stat) {
  545. case 0:
  546. if (sscanf(input_buf, "%p", &menu) != 1)
  547. break;
  548. sym_set_tristate_value(menu->sym, yes);
  549. return;
  550. case 1:
  551. show_help(menu);
  552. break;
  553. case 255:
  554. return;
  555. }
  556. }
  557. }
  558. static void conf_string(struct menu *menu)
  559. {
  560. const char *prompt = menu_get_prompt(menu);
  561. int stat;
  562. while (1) {
  563. cprint_init();
  564. cprint("--title");
  565. cprint("%s", prompt ? prompt : "Main Menu");
  566. cprint("--inputbox");
  567. switch (sym_get_type(menu->sym)) {
  568. case S_INT:
  569. cprint(inputbox_instructions_int);
  570. break;
  571. case S_HEX:
  572. cprint(inputbox_instructions_hex);
  573. break;
  574. case S_STRING:
  575. cprint(inputbox_instructions_string);
  576. break;
  577. default:
  578. /* panic? */;
  579. }
  580. cprint("10");
  581. cprint("75");
  582. cprint("%s", sym_get_string_value(menu->sym));
  583. stat = exec_conf();
  584. switch (stat) {
  585. case 0:
  586. if (sym_set_string_value(menu->sym, input_buf))
  587. return;
  588. show_textbox(NULL, "You have made an invalid entry.", 5, 43);
  589. break;
  590. case 1:
  591. show_help(menu);
  592. break;
  593. case 255:
  594. return;
  595. }
  596. }
  597. }
  598. static void conf_load(void)
  599. {
  600. int stat;
  601. while (1) {
  602. cprint_init();
  603. cprint("--inputbox");
  604. cprint(load_config_text);
  605. cprint("11");
  606. cprint("55");
  607. cprint("%s", filename);
  608. stat = exec_conf();
  609. switch(stat) {
  610. case 0:
  611. if (!input_buf[0])
  612. return;
  613. if (!conf_read(input_buf))
  614. return;
  615. show_textbox(NULL, "File does not exist!", 5, 38);
  616. break;
  617. case 1:
  618. show_helptext("Load Alternate Configuration", load_config_help);
  619. break;
  620. case 255:
  621. return;
  622. }
  623. }
  624. }
  625. static void conf_save(void)
  626. {
  627. int stat;
  628. while (1) {
  629. cprint_init();
  630. cprint("--inputbox");
  631. cprint(save_config_text);
  632. cprint("11");
  633. cprint("55");
  634. cprint("%s", filename);
  635. stat = exec_conf();
  636. switch(stat) {
  637. case 0:
  638. if (!input_buf[0])
  639. return;
  640. if (!conf_write(input_buf))
  641. return;
  642. show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60);
  643. break;
  644. case 1:
  645. show_helptext("Save Alternate Configuration", save_config_help);
  646. break;
  647. case 255:
  648. return;
  649. }
  650. }
  651. }
  652. static void conf_cleanup(void)
  653. {
  654. tcsetattr(1, TCSAFLUSH, &ios_org);
  655. unlink(".help.tmp");
  656. unlink("lxdialog.scrltmp");
  657. }
  658. int main(int ac, char **av)
  659. {
  660. struct symbol *sym;
  661. char *mode;
  662. int stat;
  663. conf_parse(av[1]);
  664. conf_read(NULL);
  665. sym = sym_lookup("VERSION", 0);
  666. sym_calc_value(sym);
  667. sprintf(menu_backtitle, "uClibc v%s Configuration",
  668. sym_get_string_value(sym));
  669. mode = getenv("MENUCONFIG_MODE");
  670. if (mode) {
  671. if (!strcasecmp(mode, "single_menu"))
  672. single_menu_mode = 1;
  673. }
  674. tcgetattr(1, &ios_org);
  675. atexit(conf_cleanup);
  676. init_wsize();
  677. conf(&rootmenu);
  678. do {
  679. cprint_init();
  680. cprint("--yesno");
  681. cprint("Do you wish to save your new uClibc configuration?");
  682. cprint("5");
  683. cprint("60");
  684. stat = exec_conf();
  685. } while (stat < 0);
  686. if (stat == 0) {
  687. conf_write(NULL);
  688. printf("\n\n"
  689. "*** End of uClibc configuration.\n"
  690. "*** Check the top-level Makefile for additional configuration options.\n\n");
  691. } else
  692. printf("\n\nYour uClibc configuration changes were NOT saved.\n\n");
  693. return 0;
  694. }