diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2003-02-04 02:43:27 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2011-07-11 20:03:30 +0100 |
commit | dc3c6714df7b14b9ee4c723744d43fedc2f595ec (patch) | |
tree | 9c849876a3e7ad2418448a350adb37fa1c820a7c /src/glut/dos/PC_HW | |
parent | 58c03aeddf605cdc79b1828851ffabd41ea9256b (diff) | |
download | glut-dc3c6714df7b14b9ee4c723744d43fedc2f595ec.tar.gz |
DOS updates (Daniel Borca)
Diffstat (limited to 'src/glut/dos/PC_HW')
-rw-r--r-- | src/glut/dos/PC_HW/pc_hw.c | 15 | ||||
-rw-r--r-- | src/glut/dos/PC_HW/pc_hw.h | 7 | ||||
-rw-r--r-- | src/glut/dos/PC_HW/pc_keyb.c | 7 | ||||
-rw-r--r-- | src/glut/dos/PC_HW/pc_mouse.c | 17 | ||||
-rw-r--r-- | src/glut/dos/PC_HW/pc_timer.c | 4 |
5 files changed, 19 insertions, 31 deletions
diff --git a/src/glut/dos/PC_HW/pc_hw.c b/src/glut/dos/PC_HW/pc_hw.c index d5597dd..b1fd84b 100644 --- a/src/glut/dos/PC_HW/pc_hw.c +++ b/src/glut/dos/PC_HW/pc_hw.c @@ -73,9 +73,6 @@ void *pc_malloc (size_t size) /* * standard redirection */ -#define STDOUT 1 -#define STDERR 2 - static char outname[L_tmpnam]; static int h_out, h_outbak; static char errname[L_tmpnam]; @@ -86,9 +83,9 @@ int pc_open_stdout (void) tmpnam(outname); if ((h_out=open(outname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { - h_outbak = dup(STDOUT); + h_outbak = dup(STDOUT_FILENO); fflush(stdout); - dup2(h_out, STDOUT); + dup2(h_out, STDOUT_FILENO); } return h_out; @@ -100,7 +97,7 @@ void pc_close_stdout (void) char *line = alloca(512); if (h_out > 0) { - dup2(h_outbak, STDOUT); + dup2(h_outbak, STDOUT_FILENO); close(h_out); close(h_outbak); @@ -119,9 +116,9 @@ int pc_open_stderr (void) tmpnam(errname); if ((h_err=open(errname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { - h_errbak = dup(STDERR); + h_errbak = dup(STDERR_FILENO); fflush(stderr); - dup2(h_err, STDERR); + dup2(h_err, STDERR_FILENO); } return h_err; @@ -133,7 +130,7 @@ void pc_close_stderr (void) char *line = alloca(512); if (h_err > 0) { - dup2(h_errbak, STDERR); + dup2(h_errbak, STDERR_FILENO); close(h_err); close(h_errbak); diff --git a/src/glut/dos/PC_HW/pc_hw.h b/src/glut/dos/PC_HW/pc_hw.h index 464ad11..ae8855e 100644 --- a/src/glut/dos/PC_HW/pc_hw.h +++ b/src/glut/dos/PC_HW/pc_hw.h @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.2 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -39,6 +39,7 @@ int pc_clexit (VFUNC f); #define ENDOFUNC(x) static void x##_end() { } #define LOCKFUNC(x) _go32_dpmi_lock_code((void *)x, (long)x##_end - (long)x) #define LOCKDATA(x) _go32_dpmi_lock_data((void *)&x, sizeof(x)) +#define LOCKBUFF(x, l) _go32_dpmi_lock_data((void *)x, l) void *pc_malloc (size_t size); @@ -194,6 +195,7 @@ void pc_remove_keyb (void); int pc_keypressed (void); int pc_readkey (void); int pc_keydown (int code); +int pc_keyshifts (void); /* * timer @@ -210,9 +212,6 @@ MFUNC pc_install_mouse_handler (MFUNC handler); void pc_mouse_area (int x1, int y1, int x2, int y2); void pc_mouse_speed (int xspeed, int yspeed); int pc_query_mouse (int *x, int *y); -void pc_show_mouse (void); -void pc_scare_mouse (void); -void pc_unscare_mouse (void); /* * standard redirection diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c index 5651531..0bc657a 100644 --- a/src/glut/dos/PC_HW/pc_keyb.c +++ b/src/glut/dos/PC_HW/pc_keyb.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.1 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -445,6 +445,11 @@ int pc_keydown (int code) return pc_key[code]; } +int pc_keyshifts (void) +{ + return key_shifts; +} + void pc_remove_keyb (void) { if (keyboard_installed) { diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c index 0cfd0af..0ea6d57 100644 --- a/src/glut/dos/PC_HW/pc_mouse.c +++ b/src/glut/dos/PC_HW/pc_mouse.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.2 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -212,22 +212,9 @@ int pc_query_mouse (int *x, int *y) return pc_mouse_b; } -void pc_show_mouse (void) -{ - /* not implemented */ -} -void pc_scare_mouse (void) -{ - /* not implemented */ -} -void pc_unscare_mouse (void) -{ - /* not implemented */ -} - __asm("\n\ .text \n\ - .balign 4 \n\ + .p2align 5,,31 \n\ .global _mouse_wrapper \n\ _mouse_wrapper: \n\ cld \n\ diff --git a/src/glut/dos/PC_HW/pc_timer.c b/src/glut/dos/PC_HW/pc_timer.c index 9143740..bf39bd0 100644 --- a/src/glut/dos/PC_HW/pc_timer.c +++ b/src/glut/dos/PC_HW/pc_timer.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.0 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -27,7 +27,7 @@ typedef struct { volatile void *parm; } TIMER; -TIMER timer_main, timer_func[MAX_TIMERS]; +static TIMER timer_main, timer_func[MAX_TIMERS]; static int timer () { |