home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / Editors / emacs / Emacs-1.14b1-sources / sources / mac-emacs-src / term.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-04  |  3.3 KB  |  92 lines  |  [TEXT/EMAC]

  1. #include "stdio.h"
  2.  
  3. /* This is functionally the same as the original term.c with regard to execution
  4.    on the Macintosh.  Most of the code in the original term.c was never used.
  5.    15K was saved off the final program size when all the dead code was removed.. */
  6.  
  7. /* Terminal charateristics that higher levels want to look at.
  8.    These are all extern'd in termchar.h */
  9.  
  10. int screen_width;        /* Number of usable columns */
  11. int screen_height;        /* Number of lines */
  12. int must_write_spaces;        /* Nonzero means spaces in the text
  13.                    must actually be output; can't just skip
  14.                    over some columns to leave them blank.  */
  15. int min_padding_speed;        /* Speed below which no padding necessary */
  16.  
  17. int line_ins_del_ok;        /* Terminal can insert and delete lines */
  18. int char_ins_del_ok;        /* Terminal can insert and delete chars */
  19. int scroll_region_ok;        /* Terminal supports setting the scroll window */
  20. int memory_below_screen;    /* Terminal remembers lines scrolled off bottom */
  21. int fast_clear_end_of_line;    /* Terminal has a `ce' string */
  22.  
  23. int dont_calculate_costs;    /* Nonzero means don't bother computing */
  24.                 /* various cost tables; we won't use them.  */
  25.  
  26. /* Nonzero means no need to redraw the entire screen on resuming
  27.    a suspended Emacs.  This is useful on terminals with multiple pages,
  28.    where one page is used for Emacs and another for all else. */
  29. int no_redraw_on_reenter;
  30.  
  31. // This is never used, because dont_calculate_costs is set true,
  32. // and ins_del_chars_ok is set false.  But the program won't link without it.
  33. int *DC_ICcost;
  34.  
  35. int (*move_cursor_hook) ();
  36. int (*raw_move_cursor_hook) ();
  37. int (*clear_to_end_hook) ();
  38. int (*clear_screen_hook) ();
  39. int (*clear_end_of_line_hook) ();
  40. int (*ins_del_lines_hook) ();
  41. int (*change_line_highlight_hook) ();
  42. int (*reassert_line_highlight_hook) ();
  43. int (*insert_chars_hook) ();
  44. int (*output_chars_hook) ();
  45. int (*delete_chars_hook) ();
  46. int (*ring_bell_hook) ();
  47. int (*reset_terminal_modes_hook) ();
  48. int (*set_terminal_modes_hook) ();
  49. int (*update_begin_hook) ();
  50. int (*update_end_hook) ();
  51. int (*set_terminal_window_hook) ();
  52. int (*read_socket_hook) ();
  53. int (*fix_screen_hook) ();
  54. int (*calculate_costs_hook) ();
  55.  
  56. term_init() { }
  57. ring_bell() { (*ring_bell_hook)(); }
  58. update_end() { (*update_end_hook)(); }
  59. insert_chars() { }
  60. delete_chars() { }
  61.  
  62. clear_to_end() { (*clear_to_end_hook)(); }
  63. clear_screen() { (*clear_screen_hook)(); }
  64. update_begin() { (*update_begin_hook)(); }
  65. set_terminal_modes() { }
  66. move_cursor(row,col) { (*move_cursor_hook)(row,col); }
  67.  
  68. ins_del_lines(vpos,n) { (*ins_del_lines_hook)(vpos,n); }
  69. reset_terminal_modes() { }
  70. raw_move_cursor(row,col) { (*raw_move_cursor_hook)(row,col); }
  71. set_terminal_window(size) { (*set_terminal_window_hook)(size); }
  72. output_chars(char *string,int len) { (*output_chars_hook)(string,len); }
  73.  
  74. clear_end_of_line(first_unused_hpos) { clear_end_of_line_raw(first_unused_hpos); }
  75. reassert_line_highlight(highlight,vpos) { (*reassert_line_highlight_hook)(highlight,vpos); }
  76. clear_end_of_line_raw(first_unused_hpos) { (*clear_end_of_line_hook)(first_unused_hpos); }
  77. change_line_highlight(new_highlight,vpos,first_unused_hpos) { (*change_line_highlight_hook)(new_highlight, vpos, first_unused_hpos); }
  78.  
  79. calculate_costs()
  80. {
  81.     CalcIDCosts(0,0,0,0,0,0);
  82. }
  83.  
  84. fatal(str,arg1,arg2)
  85.     char *str;
  86. {
  87.   fprintf(stderr, "emacs: ");
  88.   fprintf(stderr, str, arg1, arg2);
  89.   fflush(stderr);
  90.   exit(1);
  91. }
  92.