home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / KERNEL-S / V1.2 / LINUX-1.2 / LINUX-1 / linux / drivers / char / selection.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-22  |  1.8 KB  |  67 lines

  1. /*
  2.  * selection.h
  3.  *
  4.  * Interface between console.c, tty_io.c, vt.c, vc_screen.c and selection.c
  5.  */
  6. extern int sel_cons;
  7.  
  8. extern void clear_selection(void);
  9. extern int set_selection(const unsigned long arg, struct tty_struct *tty);
  10. extern int paste_selection(struct tty_struct *tty);
  11. extern int sel_loadlut(const unsigned long arg);
  12. extern int mouse_reporting(void);
  13. extern void mouse_report(struct tty_struct * tty, int butt, int mrx, int mry);
  14.  
  15. extern unsigned long video_num_columns;
  16. extern unsigned long video_num_lines;
  17. extern unsigned long video_size_row;
  18.  
  19. extern void do_unblank_screen(void);
  20. extern unsigned short *screen_pos(int currcons, int w_offset, int viewed);
  21. extern unsigned short screen_word(int currcons, int offset, int viewed);
  22. extern void complement_pos(int currcons, int offset);
  23. extern void invert_screen(int currcons, int offset, int count, int shift);
  24.  
  25. #define reverse_video_char(a)    (((a) & 0x88) | ((((a) >> 4) | ((a) << 4)) & 0x77))
  26. #define reverse_video_short(a)    (((a) & 0x88ff) | \
  27.     (((a) & 0x7000) >> 4) | (((a) & 0x0700) << 4))
  28. /* this latter line used to have masks 0xf000 and 0x0f00, but selection
  29.    requires a self-inverse operation; moreover, the old version looks wrong */
  30.  
  31. extern void getconsxy(int currcons, char *p);
  32. extern void putconsxy(int currcons, char *p);
  33.  
  34. /* how to access screen memory */
  35. #ifdef __alpha__
  36.  
  37. #include <asm/io.h> 
  38.  
  39. static inline void scr_writew(unsigned short val, unsigned short * addr)
  40. {
  41.     if ((long) addr < 0)
  42.         *addr = val;
  43.     else
  44.         writew(val, (unsigned long) addr);
  45. }
  46.  
  47. static inline unsigned short scr_readw(unsigned short * addr)
  48. {
  49.     if ((long) addr < 0)
  50.         return *addr;
  51.     return readw((unsigned long) addr);
  52. }
  53.  
  54. #else
  55.  
  56. static inline void scr_writew(unsigned short val, unsigned short * addr)
  57. {
  58.     *addr = val;
  59. }
  60.  
  61. static inline unsigned short scr_readw(unsigned short * addr)
  62. {
  63.     return *addr;
  64. }
  65.  
  66. #endif
  67.