version 1.1, 2000/01/09 17:01:14 |
version 1.1.1.2, 2000/01/22 14:16:26 |
Line 80 TERM_PUBLIC void LINUX_linetype __PROTO((int linetype) |
|
Line 80 TERM_PUBLIC void LINUX_linetype __PROTO((int linetype) |
|
TERM_PUBLIC void LINUX_move __PROTO((unsigned int x, unsigned int y)); |
TERM_PUBLIC void LINUX_move __PROTO((unsigned int x, unsigned int y)); |
TERM_PUBLIC void LINUX_vector __PROTO((unsigned int x, unsigned int y)); |
TERM_PUBLIC void LINUX_vector __PROTO((unsigned int x, unsigned int y)); |
TERM_PUBLIC int LINUX_text_angle __PROTO((int ang)); |
TERM_PUBLIC int LINUX_text_angle __PROTO((int ang)); |
TERM_PUBLIC void LINUX_put_text __PROTO((unsigned int x, unsigned int y, char *str)); |
TERM_PUBLIC void LINUX_put_text __PROTO((unsigned int x, unsigned int y, const char *str)); |
TERM_PUBLIC void LINUX_suspend __PROTO((void)); |
TERM_PUBLIC void LINUX_suspend __PROTO((void)); |
TERM_PUBLIC void LINUX_resume __PROTO((void)); |
TERM_PUBLIC void LINUX_resume __PROTO((void)); |
|
|
Line 98 vga_modeinfo *modeinfo; |
|
Line 98 vga_modeinfo *modeinfo; |
|
static int linux_startx, linux_starty, linux_lasty; |
static int linux_startx, linux_starty, linux_lasty; |
static int linux_angle; |
static int linux_angle; |
int LINUX_graphics_allowed; |
int LINUX_graphics_allowed; |
|
extern void drop_privilege(); |
|
extern void take_privilege(); |
|
|
typedef (*linux_line_func_ptr) __PROTO((int x1, int y1, int x2, int y2)); |
typedef (*linux_line_func_ptr) __PROTO((int x1, int y1, int x2, int y2)); |
|
|
Line 109 static void LINUX_putc __PROTO((unsigned int x, unsign |
|
Line 111 static void LINUX_putc __PROTO((unsigned int x, unsign |
|
* /dev/console and /dev/tty\d are considered graphic terminals, all other |
* /dev/console and /dev/tty\d are considered graphic terminals, all other |
* don't support the linux terminal */ |
* don't support the linux terminal */ |
|
|
void LINUX_setup(void) |
void |
|
LINUX_setup(void) |
{ |
{ |
char line[256]; |
char line[256]; |
FILE *pipe; |
FILE *pipe; |
Line 129 void LINUX_setup(void) |
|
Line 132 void LINUX_setup(void) |
|
LINUX_graphics_allowed = TRUE; |
LINUX_graphics_allowed = TRUE; |
} |
} |
if (LINUX_graphics_allowed) { |
if (LINUX_graphics_allowed) { |
|
take_privilege(); |
vga_init(); |
vga_init(); |
|
drop_privilege(); |
} else { |
} else { |
/* err - shouldn't we give up root uid whatever happens ? |
/* err - shouldn't we give up root uid whatever happens ? |
* or perhaps vga_init() does it ? |
* or perhaps vga_init() does it ? |
Line 138 void LINUX_setup(void) |
|
Line 143 void LINUX_setup(void) |
|
} |
} |
} |
} |
|
|
TERM_PUBLIC void LINUX_options() |
TERM_PUBLIC |
|
void LINUX_options() |
{ |
{ |
if (!LINUX_graphics_allowed) { |
if (!LINUX_graphics_allowed) { |
int_error("Linux terminal driver not available", NO_CARET); |
int_error("Linux terminal driver not available",NO_CARET); |
} |
} |
fprintf(stderr, "%s\n", vga_getmodename(linux_vmode)); |
fprintf(stderr, "%s\n", vga_getmodename(linux_vmode)); |
} |
} |
|
|
TERM_PUBLIC void LINUX_init() |
TERM_PUBLIC |
|
void LINUX_init() |
{ |
{ |
/* vga_init () has been moved to immediately after main () for security */ |
/* vga_init () has been moved to immediately after main () for security */ |
if (vga_getdefaultmode() != -1) |
if (vga_getdefaultmode() != -1) |
Line 165 TERM_PUBLIC void LINUX_init() |
|
Line 172 TERM_PUBLIC void LINUX_init() |
|
linux_lasty = modeinfo->height - 1; |
linux_lasty = modeinfo->height - 1; |
} |
} |
|
|
TERM_PUBLIC void LINUX_reset() |
TERM_PUBLIC void |
|
LINUX_reset() |
{ |
{ |
if (graphics_on) { |
if (graphics_on) { |
vga_setmode(TEXT); |
vga_setmode(TEXT); |
Line 173 TERM_PUBLIC void LINUX_reset() |
|
Line 181 TERM_PUBLIC void LINUX_reset() |
|
} |
} |
} |
} |
|
|
TERM_PUBLIC void LINUX_text() |
TERM_PUBLIC void |
|
LINUX_text() |
{ |
{ |
if (graphics_on) { |
if (graphics_on) { |
vga_getch(); |
vga_getch(); |
Line 182 TERM_PUBLIC void LINUX_text() |
|
Line 191 TERM_PUBLIC void LINUX_text() |
|
} |
} |
} |
} |
|
|
TERM_PUBLIC void LINUX_graphics() |
TERM_PUBLIC void |
|
LINUX_graphics() |
{ |
{ |
if (!graphics_on) { |
if (!graphics_on) { |
vga_setmode(linux_vmode); |
vga_setmode(linux_vmode); |
Line 190 TERM_PUBLIC void LINUX_graphics() |
|
Line 200 TERM_PUBLIC void LINUX_graphics() |
|
} |
} |
} |
} |
|
|
TERM_PUBLIC void LINUX_suspend() |
TERM_PUBLIC void |
|
LINUX_suspend() |
{ |
{ |
vga_flip(); |
vga_flip(); |
} |
} |
|
|
TERM_PUBLIC void LINUX_resume() |
TERM_PUBLIC void |
|
LINUX_resume() |
{ |
{ |
vga_flip(); |
vga_flip(); |
} |
} |
|
|
TERM_PUBLIC void LINUX_linetype(linetype) |
TERM_PUBLIC void |
|
LINUX_linetype(linetype) |
int linetype; |
int linetype; |
{ |
{ |
if (linetype >= 13) |
if (linetype >= 13) |
|
|
vga_setcolor(vgacolor[linetype + 2]); |
vga_setcolor(vgacolor[linetype + 2]); |
} |
} |
|
|
TERM_PUBLIC void LINUX_move(x, y) |
TERM_PUBLIC void |
|
LINUX_move(x, y) |
unsigned int x; |
unsigned int x; |
unsigned int y; |
unsigned int y; |
{ |
{ |
|
|
linux_starty = y; |
linux_starty = y; |
} |
} |
|
|
TERM_PUBLIC void LINUX_vector(x, y) |
TERM_PUBLIC void |
|
LINUX_vector(x, y) |
unsigned int x; |
unsigned int x; |
unsigned int y; |
unsigned int y; |
{ |
{ |
|
|
linux_starty = y; |
linux_starty = y; |
} |
} |
|
|
TERM_PUBLIC int LINUX_text_angle(ang) |
TERM_PUBLIC int |
|
LINUX_text_angle(ang) |
int ang; |
int ang; |
{ |
{ |
linux_angle = ang; |
linux_angle = ang; |
return TRUE; |
return TRUE; |
} |
} |
|
|
static void LINUX_putc(x, y, c, ang, line_func) |
static void |
|
LINUX_putc(x, y, c, ang, line_func) |
unsigned int x, y; |
unsigned int x, y; |
int c; |
int c; |
int ang; |
int ang; |
Line 258 linux_line_func_ptr line_func; |
|
Line 275 linux_line_func_ptr line_func; |
|
} |
} |
} |
} |
|
|
TERM_PUBLIC void LINUX_put_text(x, y, str) |
TERM_PUBLIC void |
|
LINUX_put_text(x, y, str) |
unsigned int x, y; |
unsigned int x, y; |
char *str; |
const char *str; |
{ |
{ |
int i; |
int i; |
switch (linux_angle) { |
switch (linux_angle) { |