1. Си / Говнокод #10540

    +142

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    if (!menu) error(E_NOMEM);    /* add titles and items */
      if ((mn_addtitle(menu, "file",     0, 0,           0) != 0)
      ||  (mn_additem (menu, "load",     1, mcb_load,    0) != 0)
      ||  (mn_additem (menu, "save",     0, mcb_save,    0) != 0)
      ||  (mn_additem (menu, "mpost",    0, mcb_mpost,   0) != 0)
      ||  (mn_additem (menu, NULL,       0, 0,           0) != 0)
      ||  (mn_additem (menu, "quit",     0, mcb_quit,    0) != 0)
      ||  (mn_addtitle(menu, "actions",  0, 0,           0) != 0)
      ||  (mn_additem (menu, "init",     0, mcb_init,    0) != 0)
      ||  (mn_additem (menu, "start",    2, mcb_start,   0) != 0)
      ||  (mn_additem (menu, "stop",     4, mcb_start,   0) != 0)
      ||  (mn_additem (menu, NULL,       0, 0,           0) != 0)
      ||  (mn_additem (menu, "view",     0, mcb_view,    0) != 0)
      ||  (mn_additem (menu, "redraw",   0, mcb_redraw,  0) != 0)
      ||  (mn_addtitle(menu, "settings", 0, 0,           0) != 0)
      ||  (mn_additem (menu, "grid",     1, mcb_grid,    0) != 0)
      ||  (mn_additem (menu, "params",   0, mcb_params,  0) != 0)
      ||  (mn_addtitle(menu, "help",     0, 0,           0) != 0)
      ||  (mn_additem (menu, "about",    0, mcb_about,   0) != 0)
      ||  (mn_addtitle(menu, NULL,       0, 0,           0) != 0))
        error(E_WIDGET);
      mn_resize (menu, INITXEXT);   /* set width of menu bar */
      mn_visible(menu, MN_ITEMS, 3);/* show/hide      menu items */
      mn_enable (menu, MN_ITEMS, 3);/* enable/disable menu items */

    Кусок кода из программы http://www.borgelt.net/doc/somd/somd.html для визуализации SOM. Эпичная проверка условий!

    Запостил: betastat, 04 Июня 2012

    Комментарии (3) RSS

    Добавить комментарий