main.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /** \file main.h
  2. * \brief Header: this is a main module header
  3. */
  4. #ifndef MC__MAIN_H
  5. #define MC__MAIN_H
  6. #include "lib/global.h"
  7. /*** typedefs(not structures) and defined constants **********************************************/
  8. #define MAX_MACRO_LENGTH 1024
  9. /*** enums ***************************************************************************************/
  10. /* run mode and params */
  11. enum cd_enum
  12. {
  13. cd_parse_command,
  14. cd_exact
  15. };
  16. /*** structures declarations (and typedefs of structures)*****************************************/
  17. typedef struct macro_action_t
  18. {
  19. unsigned long action;
  20. int ch;
  21. } macro_action_t;
  22. typedef struct macros_t
  23. {
  24. int hotkey;
  25. GArray *macro;
  26. } macros_t;
  27. struct mc_fhl_struct;
  28. /*** global variables defined in .c file *********************************************************/
  29. /*
  30. * MC_RUN_FULL: dir for left panel
  31. * MC_RUN_EDITOR: file to edit
  32. * MC_RUN_VIEWER: file to view
  33. * MC_RUN_DIFFVIEWER: first file to compare
  34. */
  35. extern char *mc_run_param0;
  36. /*
  37. * MC_RUN_FULL: dir for right panel
  38. * MC_RUN_EDITOR: unused
  39. * MC_RUN_VIEWER: unused
  40. * MC_RUN_DIFFVIEWER: second file to compare
  41. */
  42. extern char *mc_run_param1;
  43. extern int quit;
  44. /* Set to TRUE to suppress printing the last directory */
  45. extern gboolean print_last_revert;
  46. /* If set, then print to the given file the last directory we were at */
  47. extern char *last_wd_string;
  48. extern struct mc_fhl_struct *mc_filehighlight;
  49. extern int use_internal_view;
  50. extern int use_internal_edit;
  51. #ifdef HAVE_CHARSET
  52. extern int default_source_codepage;
  53. extern char *autodetect_codeset;
  54. extern gboolean is_autodetect_codeset_enabled;
  55. #endif /* !HAVE_CHARSET */
  56. extern char *shell;
  57. extern const char *mc_prompt;
  58. /* index to record_macro_buf[], -1 if not recording a macro */
  59. extern int macro_index;
  60. /* macro stuff */
  61. extern struct macro_action_t record_macro_buf[MAX_MACRO_LENGTH];
  62. extern GArray *macros_list;
  63. /*** declarations of public functions ************************************************************/
  64. #ifdef HAVE_SUBSHELL_SUPPORT
  65. int load_prompt (int fd, void *unused);
  66. #endif
  67. int do_cd (const char *new_dir, enum cd_enum cd_type);
  68. void update_xterm_title_path (void);
  69. /*** inline functions ****************************************************************************/
  70. #endif /* MC__MAIN_H */