ncurses-interface.h 995 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <curses.h>
  2. #include <form.h>
  3. #include <menu.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
  7. #define ITEMSELECTEDTEXT "Item selected is :"
  8. #define ELIF else if
  9. #define MAXBUF 128
  10. static const char ENTRY_HIGHMODE[] = "Start HighHeadMode";
  11. static const char ENTRY_REGEXPMODE[] = "Start RegExpMode";
  12. static const char ENTRY_SEARCHBYTEXTMODE[] = "Start SearchByText";
  13. static const char ENTRY_EXIT[] = "Exit";
  14. enum Mode { HighHead, SearchByText, RegExp, Exit };
  15. struct OptionBox {
  16. unsigned int countOfThreads;
  17. Mode engine;
  18. char searchtext[MAXBUF];
  19. };
  20. static bool stopprogram = false;
  21. static const char *choices[] = {
  22. ENTRY_HIGHMODE, ENTRY_REGEXPMODE, ENTRY_SEARCHBYTEXTMODE,
  23. ENTRY_EXIT, (char *)NULL,
  24. };
  25. static void on_enter(const char *entry);
  26. void start_menu(void);
  27. OptionBox getOption(void);
  28. /*
  29. static void on_highmode_selected(void);
  30. static void on_regexpmode_selected(void);
  31. static void on_searchbytext_selected(void);*/