Mercurial > emacs
comparison src/dosfns.c @ 45331:425d5cebd73c
Fix whitespace.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 17 May 2002 12:02:50 +0000 |
parents | f92c4d87863a |
children | 40db0673e6f0 |
comparison
equal
deleted
inserted
replaced
45330:28c55da68de5 | 45331:425d5cebd73c |
---|---|
17 | 17 |
18 You should have received a copy of the GNU General Public License | 18 You should have received a copy of the GNU General Public License |
19 along with GNU Emacs; see the file COPYING. If not, write to | 19 along with GNU Emacs; see the file COPYING. If not, write to |
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
21 Boston, MA 02111-1307, USA. */ | 21 Boston, MA 02111-1307, USA. */ |
22 | |
23 | 22 |
24 #include <config.h> | 23 #include <config.h> |
25 | 24 |
26 #ifdef MSDOS | 25 #ifdef MSDOS |
27 /* The entire file is within this conditional */ | 26 /* The entire file is within this conditional */ |
66 Lisp_Object val; | 65 Lisp_Object val; |
67 | 66 |
68 CHECK_NUMBER (interrupt); | 67 CHECK_NUMBER (interrupt); |
69 no = (unsigned long) XINT (interrupt); | 68 no = (unsigned long) XINT (interrupt); |
70 CHECK_VECTOR (registers); | 69 CHECK_VECTOR (registers); |
71 if (no < 0 || no > 0xff || XVECTOR (registers)-> size != 8) | 70 if (no < 0 || no > 0xff || XVECTOR (registers)-> size != 8) |
72 return Qnil; | 71 return Qnil; |
73 for (i = 0; i < 8; i++) | 72 for (i = 0; i < 8; i++) |
74 CHECK_NUMBER (XVECTOR (registers)->contents[i]); | 73 CHECK_NUMBER (XVECTOR (registers)->contents[i]); |
75 | 74 |
76 inregs.x.ax = (unsigned long) XFASTINT (XVECTOR (registers)->contents[0]); | 75 inregs.x.ax = (unsigned long) XFASTINT (XVECTOR (registers)->contents[0]); |
109 | 108 |
110 CHECK_NUMBER (address); | 109 CHECK_NUMBER (address); |
111 offs = (unsigned long) XINT (address); | 110 offs = (unsigned long) XINT (address); |
112 CHECK_VECTOR (vector); | 111 CHECK_VECTOR (vector); |
113 len = XVECTOR (vector)-> size; | 112 len = XVECTOR (vector)-> size; |
114 if (len < 1 || len > 2048 || address < 0 || address > 0xfffff - len) | 113 if (len < 1 || len > 2048 || address < 0 || address > 0xfffff - len) |
115 return Qnil; | 114 return Qnil; |
116 buf = alloca (len); | 115 buf = alloca (len); |
117 dosmemget (offs, len, buf); | 116 dosmemget (offs, len, buf); |
118 | 117 |
119 for (i = 0; i < len; i++) | 118 for (i = 0; i < len; i++) |
120 XVECTOR (vector)->contents[i] = make_number (buf[i]); | 119 XVECTOR (vector)->contents[i] = make_number (buf[i]); |
121 | 120 |
122 return vector; | 121 return vector; |
123 } | 122 } |
134 | 133 |
135 CHECK_NUMBER (address); | 134 CHECK_NUMBER (address); |
136 offs = (unsigned long) XINT (address); | 135 offs = (unsigned long) XINT (address); |
137 CHECK_VECTOR (vector); | 136 CHECK_VECTOR (vector); |
138 len = XVECTOR (vector)-> size; | 137 len = XVECTOR (vector)-> size; |
139 if (len < 1 || len > 2048 || address < 0 || address > 0xfffff - len) | 138 if (len < 1 || len > 2048 || address < 0 || address > 0xfffff - len) |
140 return Qnil; | 139 return Qnil; |
141 buf = alloca (len); | 140 buf = alloca (len); |
142 | 141 |
143 for (i = 0; i < len; i++) | 142 for (i = 0; i < len; i++) |
144 { | 143 { |
177 else | 176 else |
178 return Qnil; | 177 return Qnil; |
179 } | 178 } |
180 #endif | 179 #endif |
181 | 180 |
182 | |
183 DEFUN ("msdos-mouse-init", Fmsdos_mouse_init, Smsdos_mouse_init, 0, 0, "", | 181 DEFUN ("msdos-mouse-init", Fmsdos_mouse_init, Smsdos_mouse_init, 0, 0, "", |
184 doc: /* Initialize and enable mouse if available. */) | 182 doc: /* Initialize and enable mouse if available. */) |
185 () | 183 () |
186 { | 184 { |
187 if (have_mouse) | 185 if (have_mouse) |
218 doc: /* Insert copy of screen contents prior to starting emacs. | 216 doc: /* Insert copy of screen contents prior to starting emacs. |
219 Return nil if startup screen is not available. */) | 217 Return nil if startup screen is not available. */) |
220 () | 218 () |
221 { | 219 { |
222 char *s; | 220 char *s; |
223 int rows, cols; | 221 int rows, cols, i, j; |
224 int i, j; | 222 |
225 | |
226 if (!dos_get_saved_screen (&s, &rows, &cols)) | 223 if (!dos_get_saved_screen (&s, &rows, &cols)) |
227 return Qnil; | 224 return Qnil; |
228 | 225 |
229 for (i = 0; i < rows; i++) | 226 for (i = 0; i < rows; i++) |
230 { | 227 { |
231 for (j = 0; j < cols; j++) | 228 for (j = 0; j < cols; j++) |
232 { | 229 { |
233 insert_char (*s); | 230 insert_char (*s); |
283 if ((dos_windows_version & 0xff) >= 4 && parent_vm_title[0]) | 280 if ((dos_windows_version & 0xff) >= 4 && parent_vm_title[0]) |
284 w95_set_virtual_machine_title (parent_vm_title); | 281 w95_set_virtual_machine_title (parent_vm_title); |
285 delay (50); | 282 delay (50); |
286 } | 283 } |
287 #endif /* !HAVE_X_WINDOWS */ | 284 #endif /* !HAVE_X_WINDOWS */ |
288 | 285 |
289 void | 286 void |
290 init_dosfns () | 287 init_dosfns () |
291 { | 288 { |
292 union REGS regs; | 289 union REGS regs; |
293 _go32_dpmi_registers dpmiregs; | 290 _go32_dpmi_registers dpmiregs; |
322 | 319 |
323 regs.x.ax = 0x6601; | 320 regs.x.ax = 0x6601; |
324 intdos (®s, ®s); | 321 intdos (®s, ®s); |
325 if (regs.x.cflag) | 322 if (regs.x.cflag) |
326 /* Estimate code page from country code */ | 323 /* Estimate code page from country code */ |
327 switch (dos_country_code) | 324 switch (dos_country_code) |
328 { | 325 { |
329 case 45: /* Denmark */ | 326 case 45: /* Denmark */ |
330 case 47: /* Norway */ | 327 case 47: /* Norway */ |
331 dos_codepage = 865; | 328 dos_codepage = 865; |
332 break; | 329 break; |
588 865 Norway/Denmark */); | 585 865 Norway/Denmark */); |
589 | 586 |
590 DEFVAR_INT ("dos-timezone-offset", &dos_timezone_offset, | 587 DEFVAR_INT ("dos-timezone-offset", &dos_timezone_offset, |
591 doc: /* The current timezone offset to UTC in minutes. | 588 doc: /* The current timezone offset to UTC in minutes. |
592 Implicitly modified when the TZ variable is changed. */); | 589 Implicitly modified when the TZ variable is changed. */); |
593 | 590 |
594 DEFVAR_LISP ("dos-version", &Vdos_version, | 591 DEFVAR_LISP ("dos-version", &Vdos_version, |
595 doc: /* The (MAJOR . MINOR) Dos version (subject to modification with setver). */); | 592 doc: /* The (MAJOR . MINOR) Dos version (subject to modification with setver). */); |
596 | 593 |
597 #ifndef HAVE_X_WINDOWS | 594 #ifndef HAVE_X_WINDOWS |
598 DEFVAR_LISP ("dos-windows-version", &Vdos_windows_version, | 595 DEFVAR_LISP ("dos-windows-version", &Vdos_windows_version, |
604 When non-nil, the keyboard scan-codes are displayed at the bottom right | 601 When non-nil, the keyboard scan-codes are displayed at the bottom right |
605 corner of the display (typically at the end of the mode line). | 602 corner of the display (typically at the end of the mode line). |
606 The output format is: scan code:char code*modifiers. */); | 603 The output format is: scan code:char code*modifiers. */); |
607 | 604 |
608 Vdos_display_scancodes = Qnil; | 605 Vdos_display_scancodes = Qnil; |
609 | 606 |
610 DEFVAR_INT ("dos-hyper-key", &dos_hyper_key, | 607 DEFVAR_INT ("dos-hyper-key", &dos_hyper_key, |
611 doc: /* *If set to 1, use right ALT key as hyper key. | 608 doc: /* *If set to 1, use right ALT key as hyper key. |
612 If set to 2, use right CTRL key as hyper key. */); | 609 If set to 2, use right CTRL key as hyper key. */); |
613 dos_hyper_key = 0; | 610 dos_hyper_key = 0; |
614 | 611 |
615 DEFVAR_INT ("dos-super-key", &dos_super_key, | 612 DEFVAR_INT ("dos-super-key", &dos_super_key, |
616 doc: /* *If set to 1, use right ALT key as super key. | 613 doc: /* *If set to 1, use right ALT key as super key. |
617 If set to 2, use right CTRL key as super key. */); | 614 If set to 2, use right CTRL key as super key. */); |
618 dos_super_key = 0; | 615 dos_super_key = 0; |
619 | 616 |
620 DEFVAR_INT ("dos-keypad-mode", &dos_keypad_mode, | 617 DEFVAR_INT ("dos-keypad-mode", &dos_keypad_mode, |
621 doc: /* *Controls what key code is returned by a key in the numeric keypad. | 618 doc: /* *Controls what key code is returned by a key in the numeric keypad. |
622 The `numlock ON' action is only taken if no modifier keys are pressed. | 619 The `numlock ON' action is only taken if no modifier keys are pressed. |
623 The value is an integer constructed by adding the following bits together: | 620 The value is an integer constructed by adding the following bits together: |
624 | 621 |
638 0x00 Grey key returns char (if numlock OFF) | 635 0x00 Grey key returns char (if numlock OFF) |
639 0x40 Grey key returns kp-key (if numlock OFF) | 636 0x40 Grey key returns kp-key (if numlock OFF) |
640 | 637 |
641 0x200 ALT-0..ALT-9 in top-row produces shifted codes. */); | 638 0x200 ALT-0..ALT-9 in top-row produces shifted codes. */); |
642 dos_keypad_mode = 0x75; | 639 dos_keypad_mode = 0x75; |
643 | 640 |
644 DEFVAR_INT ("dos-keyboard-layout", &dos_keyboard_layout, | 641 DEFVAR_INT ("dos-keyboard-layout", &dos_keyboard_layout, |
645 doc: /* Contains the country code for the current keyboard layout. | 642 doc: /* Contains the country code for the current keyboard layout. |
646 Use msdos-set-keyboard to select another keyboard layout. */); | 643 Use msdos-set-keyboard to select another keyboard layout. */); |
647 dos_keyboard_layout = 1; /* US */ | 644 dos_keyboard_layout = 1; /* US */ |
648 | 645 |
649 DEFVAR_INT ("dos-decimal-point", &dos_decimal_point, | 646 DEFVAR_INT ("dos-decimal-point", &dos_decimal_point, |
650 doc: /* The character to produce when kp-decimal key is pressed. | 647 doc: /* The character to produce when kp-decimal key is pressed. |
651 If non-zero, this variable contains the character to be returned when the | 648 If non-zero, this variable contains the character to be returned when the |
652 decimal point key in the numeric keypad is pressed when Num Lock is on. | 649 decimal point key in the numeric keypad is pressed when Num Lock is on. |
653 If zero, the decimal point key returns the country code specific value. */); | 650 If zero, the decimal point key returns the country code specific value. */); |