diff options
| author | Karoly Lorentey | 2006-01-06 16:13:05 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-01-06 16:13:05 +0000 |
| commit | a8bf7299ee74781dd485c33c5eac20aee0f0ebef (patch) | |
| tree | d2bc1c0d3d7a64a19945b5bb5d175cae37088bca /src | |
| parent | e079ecf45241cc5d2904db7ede9592f9861bb9aa (diff) | |
| parent | 600bc46cd52fbdedf592158c6b03ccfca88dbade (diff) | |
| download | emacs-a8bf7299ee74781dd485c33c5eac20aee0f0ebef.tar.gz emacs-a8bf7299ee74781dd485c33c5eac20aee0f0ebef.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 683-684)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-683
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-684
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-493
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 52 | ||||
| -rw-r--r-- | src/ChangeLog | 99 | ||||
| -rw-r--r-- | src/callproc.c | 6 | ||||
| -rw-r--r-- | src/emacs.c | 4 | ||||
| -rw-r--r-- | src/gtkutil.c | 58 | ||||
| -rw-r--r-- | src/keymap.c | 4 | ||||
| -rw-r--r-- | src/mac.c | 221 | ||||
| -rw-r--r-- | src/macfns.c | 31 | ||||
| -rw-r--r-- | src/process.c | 162 | ||||
| -rw-r--r-- | src/window.h | 3 |
10 files changed, 412 insertions, 228 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 4120b1e10bf..3c77720a49a 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -765,21 +765,39 @@ show environment TERM | |||
| 765 | #set args -geometry 80x40+0+0 | 765 | #set args -geometry 80x40+0+0 |
| 766 | 766 | ||
| 767 | # People get bothered when they see messages about non-existent functions... | 767 | # People get bothered when they see messages about non-existent functions... |
| 768 | echo \n | 768 | xgetptr Vsystem_type |
| 769 | echo If you see messages below about functions not being defined,\n | 769 | set $tem = (struct Lisp_Symbol *) $ptr |
| 770 | echo don\'t worry about them. Nothing is wrong.\n | 770 | xgetptr $tem->xname |
| 771 | echo \n | 771 | set $tem = (struct Lisp_String *) $ptr |
| 772 | 772 | set $tem = (char *) $tem->data | |
| 773 | # Don't let abort actually run, as it will make | 773 | |
| 774 | # stdio stop working and therefore the `pr' command above as well. | 774 | # Don't let abort actually run, as it will make stdio stop working and |
| 775 | break abort | 775 | # therefore the `pr' command above as well. |
| 776 | 776 | if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd' | |
| 777 | # The MS-Windows build replaces abort with its own function. | 777 | # The windows-nt build replaces abort with its own function. |
| 778 | break w32_abort | 778 | break w32_abort |
| 779 | 779 | else | |
| 780 | # If we are running in synchronous mode, we want a chance to look around | 780 | break abort |
| 781 | # before Emacs exits. Perhaps we should put the break somewhere else | 781 | end |
| 782 | # instead... | 782 | |
| 783 | break x_error_quitter | 783 | # x_error_quitter is defined only on X. But window-system is set up |
| 784 | 784 | # only at run time, during Emacs startup, so we need to defer setting | |
| 785 | # the breakpoint. init_sys_modes is the first function called on | ||
| 786 | # every platform after init_display, where window-system is set. | ||
| 787 | tbreak init_sys_modes | ||
| 788 | commands | ||
| 789 | silent | ||
| 790 | xgetptr Vwindow_system | ||
| 791 | set $tem = (struct Lisp_Symbol *) $ptr | ||
| 792 | xgetptr $tem->xname | ||
| 793 | set $tem = (struct Lisp_String *) $ptr | ||
| 794 | set $tem = (char *) $tem->data | ||
| 795 | # If we are running in synchronous mode, we want a chance to look | ||
| 796 | # around before Emacs exits. Perhaps we should put the break | ||
| 797 | # somewhere else instead... | ||
| 798 | if $tem[0] == 'x' && $tem[1] == '\0' | ||
| 799 | break x_error_quitter | ||
| 800 | end | ||
| 801 | continue | ||
| 802 | end | ||
| 785 | # arch-tag: 12f34321-7bfa-4240-b77a-3cd3a1696dfe | 803 | # arch-tag: 12f34321-7bfa-4240-b77a-3cd3a1696dfe |
diff --git a/src/ChangeLog b/src/ChangeLog index 6ad7c939bce..54c41d66413 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,74 @@ | |||
| 1 | 2006-01-06 Nick Roberts <nickrob@snap.net.nz> | ||
| 2 | |||
| 3 | * .gdbinit: Fix typo. | ||
| 4 | |||
| 5 | 2006-01-05 Eli Zaretskii <eliz@gnu.org> | ||
| 6 | |||
| 7 | * .gdbinit: Fix last change. | ||
| 8 | |||
| 9 | 2006-01-05 Kim F. Storm <storm@cua.dk> | ||
| 10 | |||
| 11 | * process.c (Fmake_network_process): Use AF_INET instead of | ||
| 12 | AF_UNSPEC when AF_INET6 is not defined. | ||
| 13 | |||
| 14 | 2006-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 15 | |||
| 16 | * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc): | ||
| 17 | Don't check that the other type is known file-related one. | ||
| 18 | |||
| 19 | * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor, | ||
| 20 | gestaltSystemVersionMinor, and gestaltSystemVersionBugFix on Mac | ||
| 21 | OS X 10.4 and later. | ||
| 22 | |||
| 23 | 2006-01-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 24 | |||
| 25 | * gtkutil.c (xg_get_image_for_pixmap): If the image is from a file, | ||
| 26 | let GTK do all image processing. Importing Emacs own pixmaps to GTK | ||
| 27 | looks bad for inactive tool bar items with some Gnome themes. | ||
| 28 | |||
| 29 | 2006-01-04 Eli Zaretskii <eliz@gnu.org> | ||
| 30 | |||
| 31 | * .gdbinit: Avoid a warning message when x_error_quitter is not | ||
| 32 | compiled in. | ||
| 33 | |||
| 34 | * process.c [WINDOWSNT]: Undef AF_INET6 to disable IPv6 support | ||
| 35 | for w32. | ||
| 36 | |||
| 37 | 2006-01-04 Kim F. Storm <storm@cua.dk> | ||
| 38 | |||
| 39 | * process.c: Add IPv6 support. | ||
| 40 | (Qipv4, Qipv6): New vars. | ||
| 41 | (syms_of_process): Intern and staticpro them. | ||
| 42 | (Fformat_network_address): Handle 9 or 8 element vector as IPv6 address | ||
| 43 | with or without port number. Handle 4 element vector as IPv4 address | ||
| 44 | without port number. | ||
| 45 | (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size) | ||
| 46 | (conv_lisp_to_sockaddr): Handle IPv6 addresses. | ||
| 47 | (Fmake_network_process): Use :family 'ipv4 and 'ipv6 to explicitly | ||
| 48 | request that address family only. :family nil or omitted means to | ||
| 49 | determine address family from the specified :host and :service. | ||
| 50 | (ifflag_table): Add missing OpenBSD IFF_ flags. | ||
| 51 | (server_accept_connection): Handle IPv6 addresses. | ||
| 52 | (init_process): Add (:family ipv4) and (:family ipv6) sub-features. | ||
| 53 | |||
| 54 | * .gdbinit: Undo last change. Instead, look at Vsystem_type to | ||
| 55 | determine which breakpoints to set. | ||
| 56 | |||
| 57 | 2006-01-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 58 | |||
| 59 | * keymap.c (describe_map_compare): Yet another int/Lisp_Object mixup. | ||
| 60 | |||
| 61 | * window.h (Fwindow_minibuffer_p): Declare (for use in minibuf.c). | ||
| 62 | |||
| 63 | 2006-01-03 Romain Francoise <romain@orebokech.com> | ||
| 64 | |||
| 65 | * emacs.c (main): Update copyright year. | ||
| 66 | |||
| 67 | 2006-01-03 Ken Raeburn <raeburn@gnu.org> | ||
| 68 | |||
| 69 | * callproc.c (delete_temp_file): Bind file-name-handler-alist to | ||
| 70 | nil for the call to internal_delete_file. | ||
| 71 | |||
| 1 | 2006-01-01 Ken Raeburn <raeburn@gnu.org> | 72 | 2006-01-01 Ken Raeburn <raeburn@gnu.org> |
| 2 | 73 | ||
| 3 | * callproc.c (Fcall_process_region): Bind file-name-handler-alist | 74 | * callproc.c (Fcall_process_region): Bind file-name-handler-alist |
| @@ -48,7 +119,7 @@ | |||
| 48 | 119 | ||
| 49 | 2005-12-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 120 | 2005-12-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 50 | 121 | ||
| 51 | * gtkutil.c (xg_get_file_with_chooser): Changed message shown | 122 | * gtkutil.c (xg_get_file_with_chooser): Change message shown |
| 52 | in file chooser. | 123 | in file chooser. |
| 53 | 124 | ||
| 54 | 2005-12-27 Richard M. Stallman <rms@gnu.org> | 125 | 2005-12-27 Richard M. Stallman <rms@gnu.org> |
| @@ -122,8 +193,8 @@ | |||
| 122 | * macterm.h (TYPE_FILE_NAME): New define. | 193 | * macterm.h (TYPE_FILE_NAME): New define. |
| 123 | (posix_pathname_to_fsspec, fsspec_to_posix_pathname): Remove externs. | 194 | (posix_pathname_to_fsspec, fsspec_to_posix_pathname): Remove externs. |
| 124 | 195 | ||
| 125 | * mac.c (posix_pathname_to_fsspec, fsspec_to_posix_pathname): Add | 196 | * mac.c (posix_pathname_to_fsspec, fsspec_to_posix_pathname): |
| 126 | prototypes. Make static. | 197 | Add prototypes. Make static. |
| 127 | (mac_aedesc_to_lisp): Initialize err to noErr. | 198 | (mac_aedesc_to_lisp): Initialize err to noErr. |
| 128 | (mac_coerce_file_name_ptr, mac_coerce_file_name_desc) | 199 | (mac_coerce_file_name_ptr, mac_coerce_file_name_desc) |
| 129 | (init_coercion_handler): New functions. | 200 | (init_coercion_handler): New functions. |
| @@ -167,8 +238,8 @@ | |||
| 167 | * macgui.h (XCharStruct): Remove member `valid_p'. | 238 | * macgui.h (XCharStruct): Remove member `valid_p'. |
| 168 | (STORE_XCHARSTRUCT): Don't set member `valid_p'. | 239 | (STORE_XCHARSTRUCT): Don't set member `valid_p'. |
| 169 | (XCharStructRow): New typedef. | 240 | (XCharStructRow): New typedef. |
| 170 | (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID): New | 241 | (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID): |
| 171 | macros. | 242 | New macros. |
| 172 | (struct MacFontStruct): Add member `bounds'. Remove member | 243 | (struct MacFontStruct): Add member `bounds'. Remove member |
| 173 | `per_char'. All uses for QuichDraw Text fonts are changed to | 244 | `per_char'. All uses for QuichDraw Text fonts are changed to |
| 174 | `bounds.per_char'. ATSUI font bounds are represented as an array | 245 | `bounds.per_char'. ATSUI font bounds are represented as an array |
| @@ -180,8 +251,8 @@ | |||
| 180 | (mac_query_char_extents): New function. | 251 | (mac_query_char_extents): New function. |
| 181 | (x_per_char_metric): Use it. | 252 | (x_per_char_metric): Use it. |
| 182 | (XLoadQueryFont): Likewise. Consolidate min/max_bounds calculations. | 253 | (XLoadQueryFont): Likewise. Consolidate min/max_bounds calculations. |
| 183 | [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Use | 254 | [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): |
| 184 | mac_per_char_metric instead of x_per_char_metric. | 255 | Use mac_per_char_metric instead of x_per_char_metric. |
| 185 | (mac_text_extents_16): New function. | 256 | (mac_text_extents_16): New function. |
| 186 | (mac_compute_glyph_string_overhangs): Use it. | 257 | (mac_compute_glyph_string_overhangs): Use it. |
| 187 | (mac_unload_font): Free member `bounds' in struct MacFontStruct. | 258 | (mac_unload_font): Free member `bounds' in struct MacFontStruct. |
| @@ -435,11 +506,11 @@ | |||
| 435 | [MAC_OS8] (main): Call init_apple_event_handler instead of | 506 | [MAC_OS8] (main): Call init_apple_event_handler instead of |
| 436 | init_required_apple_events. | 507 | init_required_apple_events. |
| 437 | (mac_initialize) [MAC_OSX]: Likewise. | 508 | (mac_initialize) [MAC_OSX]: Likewise. |
| 438 | [!USE_CARBON_EVENTS] (mac_wait_next_event): Use | 509 | [!USE_CARBON_EVENTS] (mac_wait_next_event): |
| 439 | mac_ready_for_apple_events instead of Qmac_ready_for_drag_n_drop. | 510 | Use mac_ready_for_apple_events instead of Qmac_ready_for_drag_n_drop. |
| 440 | 511 | ||
| 441 | * macterm.h (mac_make_lispy_event_code, mac_aedesc_to_lisp): Add | 512 | * macterm.h (mac_make_lispy_event_code, mac_aedesc_to_lisp): |
| 442 | externs. | 513 | Add externs. |
| 443 | (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]: Likewise. | 514 | (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]: Likewise. |
| 444 | (Fmac_get_preference): Add EXFUN. | 515 | (Fmac_get_preference): Add EXFUN. |
| 445 | 516 | ||
| @@ -479,11 +550,9 @@ | |||
| 479 | 550 | ||
| 480 | 2005-12-06 Ken Raeburn <raeburn@gnu.org> | 551 | 2005-12-06 Ken Raeburn <raeburn@gnu.org> |
| 481 | 552 | ||
| 482 | * buffer.c (Fkill_buffer): Avoid dangerous side effects in NILP | 553 | * buffer.c (Fkill_buffer): Avoid dangerous side effects in NILP args. |
| 483 | argument. | ||
| 484 | * bytecode.c (Fbyte_code): Likewise. | 554 | * bytecode.c (Fbyte_code): Likewise. |
| 485 | * fileio.c (internal_delete_file, Fread_file_name_internal): | 555 | * fileio.c (internal_delete_file, Fread_file_name_internal): Likewise. |
| 486 | Likewise. | ||
| 487 | * minibuf.c (Fminibuffer_complete_and_exit): Likewise. | 556 | * minibuf.c (Fminibuffer_complete_and_exit): Likewise. |
| 488 | * undo.c (truncate_undo_list): Likewise. | 557 | * undo.c (truncate_undo_list): Likewise. |
| 489 | 558 | ||
diff --git a/src/callproc.c b/src/callproc.c index c7804b485c7..eebbabb2739 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -1020,9 +1020,11 @@ static Lisp_Object | |||
| 1020 | delete_temp_file (name) | 1020 | delete_temp_file (name) |
| 1021 | Lisp_Object name; | 1021 | Lisp_Object name; |
| 1022 | { | 1022 | { |
| 1023 | /* Use Fdelete_file (indirectly) because that runs a file name handler. | 1023 | /* Suppress jka-compr handling, etc. */ |
| 1024 | We did that when writing the file, so we should do so when deleting. */ | 1024 | int count = SPECPDL_INDEX (); |
| 1025 | specbind (intern ("file-name-handler-alist"), Qnil); | ||
| 1025 | internal_delete_file (name); | 1026 | internal_delete_file (name); |
| 1027 | unbind_to (count, Qnil); | ||
| 1026 | return Qnil; | 1028 | return Qnil; |
| 1027 | } | 1029 | } |
| 1028 | 1030 | ||
diff --git a/src/emacs.c b/src/emacs.c index d38cf4379bf..e9fb4e3cb85 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Fully extensible Emacs, running on Unix, intended for GNU. | 1 | /* Fully extensible Emacs, running on Unix, intended for GNU. |
| 2 | Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, | 2 | Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, |
| 3 | 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | 3 | 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -900,7 +900,7 @@ main (argc, argv | |||
| 900 | else | 900 | else |
| 901 | { | 901 | { |
| 902 | printf ("GNU Emacs %s\n", SDATA (tem)); | 902 | printf ("GNU Emacs %s\n", SDATA (tem)); |
| 903 | printf ("Copyright (C) 2005 Free Software Foundation, Inc.\n"); | 903 | printf ("Copyright (C) 2006 Free Software Foundation, Inc.\n"); |
| 904 | printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); | 904 | printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); |
| 905 | printf ("You may redistribute copies of Emacs\n"); | 905 | printf ("You may redistribute copies of Emacs\n"); |
| 906 | printf ("under the terms of the GNU General Public License.\n"); | 906 | printf ("under the terms of the GNU General Public License.\n"); |
diff --git a/src/gtkutil.c b/src/gtkutil.c index cb8e5a21860..ce66c5de35e 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -322,43 +322,43 @@ xg_get_image_for_pixmap (f, img, widget, old_widget) | |||
| 322 | GdkPixmap *gmask; | 322 | GdkPixmap *gmask; |
| 323 | GdkDisplay *gdpy; | 323 | GdkDisplay *gdpy; |
| 324 | 324 | ||
| 325 | /* If we are on a one bit display, let GTK do all the image handling. | 325 | /* If we have a file, let GTK do all the image handling. |
| 326 | This seems to be the only way to make insensitive and activated icons | 326 | This seems to be the only way to make insensitive and activated icons |
| 327 | look good. */ | 327 | look good in all cases. */ |
| 328 | if (x_screen_planes (f) == 1) | 328 | Lisp_Object specified_file = Qnil; |
| 329 | { | 329 | Lisp_Object tail; |
| 330 | Lisp_Object specified_file = Qnil; | 330 | extern Lisp_Object QCfile; |
| 331 | Lisp_Object tail; | ||
| 332 | extern Lisp_Object QCfile; | ||
| 333 | |||
| 334 | for (tail = XCDR (img->spec); | ||
| 335 | NILP (specified_file) && CONSP (tail) && CONSP (XCDR (tail)); | ||
| 336 | tail = XCDR (XCDR (tail))) | ||
| 337 | if (EQ (XCAR (tail), QCfile)) | ||
| 338 | specified_file = XCAR (XCDR (tail)); | ||
| 339 | 331 | ||
| 340 | if (STRINGP (specified_file)) | 332 | for (tail = XCDR (img->spec); |
| 341 | { | 333 | NILP (specified_file) && CONSP (tail) && CONSP (XCDR (tail)); |
| 334 | tail = XCDR (XCDR (tail))) | ||
| 335 | if (EQ (XCAR (tail), QCfile)) | ||
| 336 | specified_file = XCAR (XCDR (tail)); | ||
| 342 | 337 | ||
| 343 | Lisp_Object file = Qnil; | 338 | if (STRINGP (specified_file)) |
| 344 | struct gcpro gcpro1; | 339 | { |
| 345 | GCPRO1 (file); | 340 | Lisp_Object file = Qnil; |
| 341 | struct gcpro gcpro1; | ||
| 342 | GCPRO1 (file); | ||
| 346 | 343 | ||
| 347 | file = x_find_image_file (specified_file); | 344 | file = x_find_image_file (specified_file); |
| 348 | /* We already loaded the image once before calling this | 345 | /* We already loaded the image once before calling this |
| 349 | function, so this should not fail. */ | 346 | function, so this should not fail. */ |
| 350 | xassert (STRINGP (file) != 0); | 347 | xassert (STRINGP (file) != 0); |
| 351 | 348 | ||
| 352 | if (! old_widget) | 349 | if (! old_widget) |
| 353 | old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file))); | 350 | old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file))); |
| 354 | else | 351 | else |
| 355 | gtk_image_set_from_file (old_widget, SSDATA (file)); | 352 | gtk_image_set_from_file (old_widget, SSDATA (file)); |
| 356 | 353 | ||
| 357 | UNGCPRO; | 354 | UNGCPRO; |
| 358 | return GTK_WIDGET (old_widget); | 355 | return GTK_WIDGET (old_widget); |
| 359 | } | ||
| 360 | } | 356 | } |
| 361 | 357 | ||
| 358 | /* No file, do the image handling ourselves. This will look very bad | ||
| 359 | on a monochrome display, and sometimes bad on all displays with | ||
| 360 | certain themes. */ | ||
| 361 | |||
| 362 | gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); | 362 | gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); |
| 363 | gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap); | 363 | gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap); |
| 364 | gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0; | 364 | gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0; |
diff --git a/src/keymap.c b/src/keymap.c index 64069ca4deb..b09358dbbcb 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -3189,8 +3189,8 @@ describe_map_compare (aa, bb) | |||
| 3189 | if (INTEGERP (a->event) && !INTEGERP (b->event)) | 3189 | if (INTEGERP (a->event) && !INTEGERP (b->event)) |
| 3190 | return -1; | 3190 | return -1; |
| 3191 | if (SYMBOLP (a->event) && SYMBOLP (b->event)) | 3191 | if (SYMBOLP (a->event) && SYMBOLP (b->event)) |
| 3192 | return (Fstring_lessp (a->event, b->event) ? -1 | 3192 | return (!NILP (Fstring_lessp (a->event, b->event)) ? -1 |
| 3193 | : Fstring_lessp (b->event, a->event) ? 1 | 3193 | : !NILP (Fstring_lessp (b->event, a->event)) ? 1 |
| 3194 | : 0); | 3194 | : 0); |
| 3195 | return 0; | 3195 | return 0; |
| 3196 | } | 3196 | } |
| @@ -411,91 +411,73 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, | |||
| 411 | { | 411 | { |
| 412 | OSErr err; | 412 | OSErr err; |
| 413 | 413 | ||
| 414 | if (type_code == TYPE_FILE_NAME) | 414 | if (type_code == typeNull) |
| 415 | err = errAECoercionFail; | ||
| 416 | else if (type_code == to_type || to_type == typeWildCard) | ||
| 417 | err = AECreateDesc (TYPE_FILE_NAME, data_ptr, data_size, result); | ||
| 418 | else if (type_code == TYPE_FILE_NAME) | ||
| 415 | /* Coercion from undecoded file name. */ | 419 | /* Coercion from undecoded file name. */ |
| 416 | switch (to_type) | 420 | { |
| 417 | { | ||
| 418 | case typeAlias: | ||
| 419 | case typeFSS: | ||
| 420 | case typeFSRef: | ||
| 421 | #ifdef MAC_OSX | ||
| 422 | case typeFileURL: | ||
| 423 | #endif | ||
| 424 | { | ||
| 425 | #ifdef MAC_OSX | 421 | #ifdef MAC_OSX |
| 426 | CFStringRef str; | 422 | CFStringRef str; |
| 427 | CFURLRef url = NULL; | 423 | CFURLRef url = NULL; |
| 428 | CFDataRef data = NULL; | 424 | CFDataRef data = NULL; |
| 429 | 425 | ||
| 430 | str = CFStringCreateWithBytes (NULL, data_ptr, data_size, | 426 | str = CFStringCreateWithBytes (NULL, data_ptr, data_size, |
| 431 | kCFStringEncodingUTF8, false); | 427 | kCFStringEncodingUTF8, false); |
| 432 | if (str) | 428 | if (str) |
| 433 | { | 429 | { |
| 434 | url = CFURLCreateWithFileSystemPath (NULL, str, | 430 | url = CFURLCreateWithFileSystemPath (NULL, str, |
| 435 | kCFURLPOSIXPathStyle, false); | 431 | kCFURLPOSIXPathStyle, false); |
| 436 | CFRelease (str); | 432 | CFRelease (str); |
| 437 | } | 433 | } |
| 438 | if (url) | 434 | if (url) |
| 439 | { | 435 | { |
| 440 | data = CFURLCreateData (NULL, url, kCFStringEncodingUTF8, true); | 436 | data = CFURLCreateData (NULL, url, kCFStringEncodingUTF8, true); |
| 441 | CFRelease (url); | 437 | CFRelease (url); |
| 442 | } | 438 | } |
| 443 | if (data) | 439 | if (data) |
| 444 | { | 440 | { |
| 445 | err = AECoercePtr (typeFileURL, CFDataGetBytePtr (data), | 441 | err = AECoercePtr (typeFileURL, CFDataGetBytePtr (data), |
| 446 | CFDataGetLength (data), to_type, result); | 442 | CFDataGetLength (data), to_type, result); |
| 447 | CFRelease (data); | 443 | CFRelease (data); |
| 448 | } | 444 | } |
| 449 | else | 445 | else |
| 450 | err = memFullErr; | 446 | err = memFullErr; |
| 451 | #else | 447 | #else |
| 452 | FSSpec fs; | 448 | FSSpec fs; |
| 453 | char *buf; | 449 | char *buf; |
| 454 | 450 | ||
| 455 | buf = xmalloc (data_size + 1); | 451 | buf = xmalloc (data_size + 1); |
| 456 | if (buf) | 452 | if (buf) |
| 457 | { | 453 | { |
| 458 | memcpy (buf, data_ptr, data_size); | 454 | memcpy (buf, data_ptr, data_size); |
| 459 | buf[data_size] = '\0'; | 455 | buf[data_size] = '\0'; |
| 460 | err = posix_pathname_to_fsspec (buf, &fs); | 456 | err = posix_pathname_to_fsspec (buf, &fs); |
| 461 | xfree (buf); | 457 | xfree (buf); |
| 462 | } | ||
| 463 | else | ||
| 464 | err = memFullErr; | ||
| 465 | if (err == noErr) | ||
| 466 | err = AECoercePtr (typeFSS, &fs, sizeof (FSSpec), | ||
| 467 | to_type, result); | ||
| 468 | #endif | ||
| 469 | } | 458 | } |
| 470 | break; | 459 | else |
| 471 | 460 | err = memFullErr; | |
| 472 | case TYPE_FILE_NAME: | 461 | if (err == noErr) |
| 473 | case typeWildCard: | 462 | err = AECoercePtr (typeFSS, &fs, sizeof (FSSpec), to_type, result); |
| 474 | err = AECreateDesc (TYPE_FILE_NAME, data_ptr, data_size, result); | 463 | #endif |
| 475 | break; | 464 | } |
| 476 | |||
| 477 | default: | ||
| 478 | err = errAECoercionFail; | ||
| 479 | break; | ||
| 480 | } | ||
| 481 | else if (to_type == TYPE_FILE_NAME) | 465 | else if (to_type == TYPE_FILE_NAME) |
| 482 | /* Coercion to undecoded file name. */ | 466 | /* Coercion to undecoded file name. */ |
| 483 | switch (type_code) | 467 | { |
| 484 | { | ||
| 485 | case typeAlias: | ||
| 486 | case typeFSS: | ||
| 487 | case typeFSRef: | ||
| 488 | #ifdef MAC_OSX | 468 | #ifdef MAC_OSX |
| 489 | case typeFileURL: | 469 | CFURLRef url = NULL; |
| 490 | #endif | 470 | CFStringRef str = NULL; |
| 471 | CFDataRef data = NULL; | ||
| 472 | |||
| 473 | if (type_code == typeFileURL) | ||
| 474 | url = CFURLCreateWithBytes (NULL, data_ptr, data_size, | ||
| 475 | kCFStringEncodingUTF8, NULL); | ||
| 476 | else | ||
| 491 | { | 477 | { |
| 492 | AEDesc desc; | 478 | AEDesc desc; |
| 493 | #ifdef MAC_OSX | ||
| 494 | Size size; | 479 | Size size; |
| 495 | char *buf; | 480 | char *buf; |
| 496 | CFURLRef url = NULL; | ||
| 497 | CFStringRef str = NULL; | ||
| 498 | CFDataRef data = NULL; | ||
| 499 | 481 | ||
| 500 | err = AECoercePtr (type_code, data_ptr, data_size, | 482 | err = AECoercePtr (type_code, data_ptr, data_size, |
| 501 | typeFileURL, &desc); | 483 | typeFileURL, &desc); |
| @@ -513,33 +495,37 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, | |||
| 513 | } | 495 | } |
| 514 | AEDisposeDesc (&desc); | 496 | AEDisposeDesc (&desc); |
| 515 | } | 497 | } |
| 516 | if (url) | 498 | } |
| 517 | { | 499 | if (url) |
| 518 | str = CFURLCopyFileSystemPath (url, kCFURLPOSIXPathStyle); | 500 | { |
| 519 | CFRelease (url); | 501 | str = CFURLCopyFileSystemPath (url, kCFURLPOSIXPathStyle); |
| 520 | } | 502 | CFRelease (url); |
| 521 | if (str) | 503 | } |
| 522 | { | 504 | if (str) |
| 523 | data = | 505 | { |
| 524 | CFStringCreateExternalRepresentation (NULL, str, | 506 | data = CFStringCreateExternalRepresentation (NULL, str, |
| 525 | kCFStringEncodingUTF8, | 507 | kCFStringEncodingUTF8, |
| 526 | '\0'); | 508 | '\0'); |
| 527 | CFRelease (str); | 509 | CFRelease (str); |
| 528 | } | 510 | } |
| 529 | if (data) | 511 | if (data) |
| 530 | { | 512 | { |
| 531 | err = AECreateDesc (TYPE_FILE_NAME, CFDataGetBytePtr (data), | 513 | err = AECreateDesc (TYPE_FILE_NAME, CFDataGetBytePtr (data), |
| 532 | CFDataGetLength (data), result); | 514 | CFDataGetLength (data), result); |
| 533 | CFRelease (data); | 515 | CFRelease (data); |
| 534 | } | 516 | } |
| 535 | else | ||
| 536 | err = memFullErr; | ||
| 537 | #else | 517 | #else |
| 518 | char file_name[MAXPATHLEN]; | ||
| 519 | |||
| 520 | if (type_code == typeFSS && data_size == sizeof (FSSpec)) | ||
| 521 | err = fsspec_to_posix_pathname (data_ptr, file_name, | ||
| 522 | sizeof (file_name) - 1); | ||
| 523 | else | ||
| 524 | { | ||
| 525 | AEDesc desc; | ||
| 538 | FSSpec fs; | 526 | FSSpec fs; |
| 539 | char file_name[MAXPATHLEN]; | ||
| 540 | 527 | ||
| 541 | err = AECoercePtr (type_code, data_ptr, data_size, | 528 | err = AECoercePtr (type_code, data_ptr, data_size, typeFSS, &desc); |
| 542 | typeFSS, &desc); | ||
| 543 | if (err == noErr) | 529 | if (err == noErr) |
| 544 | { | 530 | { |
| 545 | #if TARGET_API_MAC_CARBON | 531 | #if TARGET_API_MAC_CARBON |
| @@ -550,19 +536,14 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, | |||
| 550 | if (err == noErr) | 536 | if (err == noErr) |
| 551 | err = fsspec_to_posix_pathname (&fs, file_name, | 537 | err = fsspec_to_posix_pathname (&fs, file_name, |
| 552 | sizeof (file_name) - 1); | 538 | sizeof (file_name) - 1); |
| 553 | if (err == noErr) | ||
| 554 | err = AECreateDesc (TYPE_FILE_NAME, file_name, | ||
| 555 | strlen (file_name), result); | ||
| 556 | AEDisposeDesc (&desc); | 539 | AEDisposeDesc (&desc); |
| 557 | } | 540 | } |
| 558 | #endif | ||
| 559 | } | 541 | } |
| 560 | break; | 542 | if (err == noErr) |
| 561 | 543 | err = AECreateDesc (TYPE_FILE_NAME, file_name, | |
| 562 | default: | 544 | strlen (file_name), result); |
| 563 | err = errAECoercionFail; | 545 | #endif |
| 564 | break; | 546 | } |
| 565 | } | ||
| 566 | else | 547 | else |
| 567 | abort (); | 548 | abort (); |
| 568 | 549 | ||
| @@ -581,31 +562,9 @@ mac_coerce_file_name_desc (from_desc, to_type, handler_refcon, result) | |||
| 581 | OSErr err = noErr; | 562 | OSErr err = noErr; |
| 582 | DescType from_type = from_desc->descriptorType; | 563 | DescType from_type = from_desc->descriptorType; |
| 583 | 564 | ||
| 584 | if (from_type == TYPE_FILE_NAME) | 565 | if (from_type == typeNull) |
| 585 | { | 566 | err = errAECoercionFail; |
| 586 | if (to_type != TYPE_FILE_NAME && to_type != typeWildCard | 567 | else if (from_type == to_type || to_type == typeWildCard) |
| 587 | && to_type != typeAlias && to_type != typeFSS | ||
| 588 | && to_type != typeFSRef | ||
| 589 | #ifdef MAC_OSX | ||
| 590 | && to_type != typeFileURL | ||
| 591 | #endif | ||
| 592 | ) | ||
| 593 | return errAECoercionFail; | ||
| 594 | } | ||
| 595 | else if (to_type == TYPE_FILE_NAME) | ||
| 596 | { | ||
| 597 | if (from_type != typeAlias && from_type != typeFSS | ||
| 598 | && from_type != typeFSRef | ||
| 599 | #ifdef MAC_OSX | ||
| 600 | && from_type != typeFileURL | ||
| 601 | #endif | ||
| 602 | ) | ||
| 603 | return errAECoercionFail; | ||
| 604 | } | ||
| 605 | else | ||
| 606 | abort (); | ||
| 607 | |||
| 608 | if (from_type == to_type || to_type == typeWildCard) | ||
| 609 | err = AEDuplicateDesc (from_desc, result); | 568 | err = AEDuplicateDesc (from_desc, result); |
| 610 | else | 569 | else |
| 611 | { | 570 | { |
diff --git a/src/macfns.c b/src/macfns.c index 4ede8b7971b..110b697ce5e 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -2880,24 +2880,37 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 2880 | (display) | 2880 | (display) |
| 2881 | Lisp_Object display; | 2881 | Lisp_Object display; |
| 2882 | { | 2882 | { |
| 2883 | int mac_major_version; | 2883 | UInt32 response, major, minor, bugfix; |
| 2884 | SInt32 response; | ||
| 2885 | OSErr err; | 2884 | OSErr err; |
| 2886 | 2885 | ||
| 2887 | BLOCK_INPUT; | 2886 | BLOCK_INPUT; |
| 2888 | err = Gestalt (gestaltSystemVersion, &response); | 2887 | err = Gestalt (gestaltSystemVersion, &response); |
| 2888 | if (err == noErr) | ||
| 2889 | if (response >= 0x00001040) | ||
| 2890 | { | ||
| 2891 | err = Gestalt ('sys1', &major); /* gestaltSystemVersionMajor */ | ||
| 2892 | if (err == noErr) | ||
| 2893 | err = Gestalt ('sys2', &minor); /* gestaltSystemVersionMinor */ | ||
| 2894 | if (err == noErr) | ||
| 2895 | err = Gestalt ('sys3', &bugfix); /* gestaltSystemVersionBugFix */ | ||
| 2896 | } | ||
| 2897 | else | ||
| 2898 | { | ||
| 2899 | bugfix = response & 0xf; | ||
| 2900 | response >>= 4; | ||
| 2901 | minor = response & 0xf; | ||
| 2902 | response >>= 4; | ||
| 2903 | /* convert BCD to int */ | ||
| 2904 | major = response - (response >> 4) * 6; | ||
| 2905 | } | ||
| 2889 | UNBLOCK_INPUT; | 2906 | UNBLOCK_INPUT; |
| 2890 | 2907 | ||
| 2891 | if (err != noErr) | 2908 | if (err != noErr) |
| 2892 | error ("Cannot get Mac OS version"); | 2909 | error ("Cannot get Mac OS version"); |
| 2893 | 2910 | ||
| 2894 | mac_major_version = (response >> 8) & 0xff; | 2911 | return Fcons (make_number (major), |
| 2895 | /* convert BCD to int */ | 2912 | Fcons (make_number (minor), |
| 2896 | mac_major_version -= (mac_major_version >> 4) * 6; | 2913 | Fcons (make_number (bugfix), |
| 2897 | |||
| 2898 | return Fcons (make_number (mac_major_version), | ||
| 2899 | Fcons (make_number ((response >> 4) & 0xf), | ||
| 2900 | Fcons (make_number (response & 0xf), | ||
| 2901 | Qnil))); | 2914 | Qnil))); |
| 2902 | } | 2915 | } |
| 2903 | 2916 | ||
diff --git a/src/process.c b/src/process.c index e869456e5c8..05ea7c863b0 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -118,6 +118,14 @@ Boston, MA 02110-1301, USA. */ | |||
| 118 | #include <sys/wait.h> | 118 | #include <sys/wait.h> |
| 119 | #endif | 119 | #endif |
| 120 | 120 | ||
| 121 | /* Disable IPv6 support for w32 until someone figures out how to do it | ||
| 122 | properly. */ | ||
| 123 | #ifdef WINDOWSNT | ||
| 124 | # ifdef AF_INET6 | ||
| 125 | # undef AF_INET6 | ||
| 126 | # endif | ||
| 127 | #endif | ||
| 128 | |||
| 121 | #include "lisp.h" | 129 | #include "lisp.h" |
| 122 | #include "systime.h" | 130 | #include "systime.h" |
| 123 | #include "systty.h" | 131 | #include "systty.h" |
| @@ -140,7 +148,10 @@ Boston, MA 02110-1301, USA. */ | |||
| 140 | Lisp_Object Qprocessp; | 148 | Lisp_Object Qprocessp; |
| 141 | Lisp_Object Qrun, Qstop, Qsignal; | 149 | Lisp_Object Qrun, Qstop, Qsignal; |
| 142 | Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; | 150 | Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; |
| 143 | Lisp_Object Qlocal, Qdatagram; | 151 | Lisp_Object Qlocal, Qipv4, Qdatagram; |
| 152 | #ifdef AF_INET6 | ||
| 153 | Lisp_Object Qipv6; | ||
| 154 | #endif | ||
| 144 | Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype; | 155 | Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype; |
| 145 | Lisp_Object QClocal, QCremote, QCcoding; | 156 | Lisp_Object QClocal, QCremote, QCcoding; |
| 146 | Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; | 157 | Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; |
| @@ -1195,9 +1206,11 @@ a socket connection. */) | |||
| 1195 | DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, | 1206 | DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, |
| 1196 | 1, 2, 0, | 1207 | 1, 2, 0, |
| 1197 | doc: /* Convert network ADDRESS from internal format to a string. | 1208 | doc: /* Convert network ADDRESS from internal format to a string. |
| 1209 | A 4 or 5 element vector represents an IPv4 address (with port number). | ||
| 1210 | An 8 or 9 element vector represents an IPv6 address (with port number). | ||
| 1198 | If optional second argument OMIT-PORT is non-nil, don't include a port | 1211 | If optional second argument OMIT-PORT is non-nil, don't include a port |
| 1199 | number in the string; in this case, interpret a 4 element vector as an | 1212 | number in the string, even when present in ADDRESS. |
| 1200 | IP address. Returns nil if format of ADDRESS is invalid. */) | 1213 | Returns nil if format of ADDRESS is invalid. */) |
| 1201 | (address, omit_port) | 1214 | (address, omit_port) |
| 1202 | Lisp_Object address, omit_port; | 1215 | Lisp_Object address, omit_port; |
| 1203 | { | 1216 | { |
| @@ -1207,13 +1220,13 @@ IP address. Returns nil if format of ADDRESS is invalid. */) | |||
| 1207 | if (STRINGP (address)) /* AF_LOCAL */ | 1220 | if (STRINGP (address)) /* AF_LOCAL */ |
| 1208 | return address; | 1221 | return address; |
| 1209 | 1222 | ||
| 1210 | if (VECTORP (address)) /* AF_INET */ | 1223 | if (VECTORP (address)) /* AF_INET or AF_INET6 */ |
| 1211 | { | 1224 | { |
| 1212 | register struct Lisp_Vector *p = XVECTOR (address); | 1225 | register struct Lisp_Vector *p = XVECTOR (address); |
| 1213 | Lisp_Object args[6]; | 1226 | Lisp_Object args[6]; |
| 1214 | int nargs, i; | 1227 | int nargs, i; |
| 1215 | 1228 | ||
| 1216 | if (!NILP (omit_port) && (p->size == 4 || p->size == 5)) | 1229 | if (p->size == 4 || (p->size == 5 && !NILP (omit_port))) |
| 1217 | { | 1230 | { |
| 1218 | args[0] = build_string ("%d.%d.%d.%d"); | 1231 | args[0] = build_string ("%d.%d.%d.%d"); |
| 1219 | nargs = 4; | 1232 | nargs = 4; |
| @@ -1223,6 +1236,16 @@ IP address. Returns nil if format of ADDRESS is invalid. */) | |||
| 1223 | args[0] = build_string ("%d.%d.%d.%d:%d"); | 1236 | args[0] = build_string ("%d.%d.%d.%d:%d"); |
| 1224 | nargs = 5; | 1237 | nargs = 5; |
| 1225 | } | 1238 | } |
| 1239 | else if (p->size == 8 || (p->size == 9 && !NILP (omit_port))) | ||
| 1240 | { | ||
| 1241 | args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); | ||
| 1242 | nargs = 8; | ||
| 1243 | } | ||
| 1244 | else if (p->size == 9) | ||
| 1245 | { | ||
| 1246 | args[0] = build_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d"); | ||
| 1247 | nargs = 9; | ||
| 1248 | } | ||
| 1226 | else | 1249 | else |
| 1227 | return Qnil; | 1250 | return Qnil; |
| 1228 | 1251 | ||
| @@ -2212,6 +2235,20 @@ conv_sockaddr_to_lisp (sa, len) | |||
| 2212 | cp = (unsigned char *)&sin->sin_addr; | 2235 | cp = (unsigned char *)&sin->sin_addr; |
| 2213 | break; | 2236 | break; |
| 2214 | } | 2237 | } |
| 2238 | #ifdef AF_INET6 | ||
| 2239 | case AF_INET6: | ||
| 2240 | { | ||
| 2241 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; | ||
| 2242 | uint16_t *ip6 = (uint16_t *)&sin6->sin6_addr; | ||
| 2243 | len = sizeof (sin6->sin6_addr)/2 + 1; | ||
| 2244 | address = Fmake_vector (make_number (len), Qnil); | ||
| 2245 | p = XVECTOR (address); | ||
| 2246 | p->contents[--len] = make_number (ntohs (sin6->sin6_port)); | ||
| 2247 | for (i = 0; i < len; i++) | ||
| 2248 | p->contents[i] = make_number (ntohs (ip6[i])); | ||
| 2249 | return address; | ||
| 2250 | } | ||
| 2251 | #endif | ||
| 2215 | #ifdef HAVE_LOCAL_SOCKETS | 2252 | #ifdef HAVE_LOCAL_SOCKETS |
| 2216 | case AF_LOCAL: | 2253 | case AF_LOCAL: |
| 2217 | { | 2254 | { |
| @@ -2256,6 +2293,13 @@ get_lisp_to_sockaddr_size (address, familyp) | |||
| 2256 | *familyp = AF_INET; | 2293 | *familyp = AF_INET; |
| 2257 | return sizeof (struct sockaddr_in); | 2294 | return sizeof (struct sockaddr_in); |
| 2258 | } | 2295 | } |
| 2296 | #ifdef AF_INET6 | ||
| 2297 | else if (p->size == 9) | ||
| 2298 | { | ||
| 2299 | *familyp = AF_INET6; | ||
| 2300 | return sizeof (struct sockaddr_in6); | ||
| 2301 | } | ||
| 2302 | #endif | ||
| 2259 | } | 2303 | } |
| 2260 | #ifdef HAVE_LOCAL_SOCKETS | 2304 | #ifdef HAVE_LOCAL_SOCKETS |
| 2261 | else if (STRINGP (address)) | 2305 | else if (STRINGP (address)) |
| @@ -2302,6 +2346,23 @@ conv_lisp_to_sockaddr (family, address, sa, len) | |||
| 2302 | sin->sin_port = htons (i); | 2346 | sin->sin_port = htons (i); |
| 2303 | cp = (unsigned char *)&sin->sin_addr; | 2347 | cp = (unsigned char *)&sin->sin_addr; |
| 2304 | } | 2348 | } |
| 2349 | #ifdef AF_INET6 | ||
| 2350 | else if (family == AF_INET6) | ||
| 2351 | { | ||
| 2352 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; | ||
| 2353 | uint16_t *ip6 = (uint16_t *)&sin6->sin6_addr; | ||
| 2354 | len = sizeof (sin6->sin6_addr) + 1; | ||
| 2355 | i = XINT (p->contents[--len]); | ||
| 2356 | sin6->sin6_port = htons (i); | ||
| 2357 | for (i = 0; i < len; i++) | ||
| 2358 | if (INTEGERP (p->contents[i])) | ||
| 2359 | { | ||
| 2360 | int j = XFASTINT (p->contents[i]) & 0xffff; | ||
| 2361 | ip6[i] = ntohs (j); | ||
| 2362 | } | ||
| 2363 | return; | ||
| 2364 | } | ||
| 2365 | #endif | ||
| 2305 | } | 2366 | } |
| 2306 | else if (STRINGP (address)) | 2367 | else if (STRINGP (address)) |
| 2307 | { | 2368 | { |
| @@ -2595,10 +2656,13 @@ a random port number is selected for the server. | |||
| 2595 | stream type connection, `datagram' creates a datagram type connection. | 2656 | stream type connection, `datagram' creates a datagram type connection. |
| 2596 | 2657 | ||
| 2597 | :family FAMILY -- FAMILY is the address (and protocol) family for the | 2658 | :family FAMILY -- FAMILY is the address (and protocol) family for the |
| 2598 | service specified by HOST and SERVICE. The default address family is | 2659 | service specified by HOST and SERVICE. The default (nil) is to use |
| 2599 | Inet (or IPv4) for the host and port number specified by HOST and | 2660 | whatever address family (IPv4 or IPv6) that is defined for the host |
| 2600 | SERVICE. Other address families supported are: | 2661 | and port number specified by HOST and SERVICE. Other address families |
| 2662 | supported are: | ||
| 2601 | local -- for a local (i.e. UNIX) address specified by SERVICE. | 2663 | local -- for a local (i.e. UNIX) address specified by SERVICE. |
| 2664 | ipv4 -- use IPv4 address family only. | ||
| 2665 | ipv6 -- use IPv6 address family only. | ||
| 2602 | 2666 | ||
| 2603 | :local ADDRESS -- ADDRESS is the local address used for the connection. | 2667 | :local ADDRESS -- ADDRESS is the local address used for the connection. |
| 2604 | This parameter is ignored when opening a client process. When specified | 2668 | This parameter is ignored when opening a client process. When specified |
| @@ -2715,8 +2779,8 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2715 | struct Lisp_Process *p; | 2779 | struct Lisp_Process *p; |
| 2716 | #ifdef HAVE_GETADDRINFO | 2780 | #ifdef HAVE_GETADDRINFO |
| 2717 | struct addrinfo ai, *res, *lres; | 2781 | struct addrinfo ai, *res, *lres; |
| 2718 | struct addrinfo hints; | 2782 | struct addrinfo hints; |
| 2719 | char *portstring, portbuf[128]; | 2783 | char *portstring, portbuf[128]; |
| 2720 | #else /* HAVE_GETADDRINFO */ | 2784 | #else /* HAVE_GETADDRINFO */ |
| 2721 | struct _emacs_addrinfo | 2785 | struct _emacs_addrinfo |
| 2722 | { | 2786 | { |
| @@ -2855,19 +2919,29 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2855 | 2919 | ||
| 2856 | /* :family FAMILY -- nil (for Inet), local, or integer. */ | 2920 | /* :family FAMILY -- nil (for Inet), local, or integer. */ |
| 2857 | tem = Fplist_get (contact, QCfamily); | 2921 | tem = Fplist_get (contact, QCfamily); |
| 2858 | if (INTEGERP (tem)) | 2922 | if (NILP (tem)) |
| 2859 | family = XINT (tem); | ||
| 2860 | else | ||
| 2861 | { | 2923 | { |
| 2862 | if (NILP (tem)) | 2924 | #if defined(HAVE_GETADDRINFO) && defined(AF_INET6) |
| 2863 | family = AF_INET; | 2925 | family = AF_UNSPEC; |
| 2864 | #ifdef HAVE_LOCAL_SOCKETS | 2926 | #else |
| 2865 | else if (EQ (tem, Qlocal)) | 2927 | family = AF_INET; |
| 2866 | family = AF_LOCAL; | ||
| 2867 | #endif | 2928 | #endif |
| 2868 | } | 2929 | } |
| 2869 | if (family < 0) | 2930 | #ifdef HAVE_LOCAL_SOCKETS |
| 2931 | else if (EQ (tem, Qlocal)) | ||
| 2932 | family = AF_LOCAL; | ||
| 2933 | #endif | ||
| 2934 | #ifdef AF_INET6 | ||
| 2935 | else if (EQ (tem, Qipv6)) | ||
| 2936 | family = AF_INET6; | ||
| 2937 | #endif | ||
| 2938 | else if (EQ (tem, Qipv4)) | ||
| 2939 | family = AF_INET; | ||
| 2940 | else if (INTEGERP (tem)) | ||
| 2941 | family = XINT (tem); | ||
| 2942 | else | ||
| 2870 | error ("Unknown address family"); | 2943 | error ("Unknown address family"); |
| 2944 | |||
| 2871 | ai.ai_family = family; | 2945 | ai.ai_family = family; |
| 2872 | 2946 | ||
| 2873 | /* :service SERVICE -- string, integer (port number), or t (random port). */ | 2947 | /* :service SERVICE -- string, integer (port number), or t (random port). */ |
| @@ -2933,7 +3007,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2933 | QUIT; | 3007 | QUIT; |
| 2934 | memset (&hints, 0, sizeof (hints)); | 3008 | memset (&hints, 0, sizeof (hints)); |
| 2935 | hints.ai_flags = 0; | 3009 | hints.ai_flags = 0; |
| 2936 | hints.ai_family = NILP (Fplist_member (contact, QCfamily)) ? AF_UNSPEC : family; | 3010 | hints.ai_family = family; |
| 2937 | hints.ai_socktype = socktype; | 3011 | hints.ai_socktype = socktype; |
| 2938 | hints.ai_protocol = 0; | 3012 | hints.ai_protocol = 0; |
| 2939 | ret = getaddrinfo (SDATA (host), portstring, &hints, &res); | 3013 | ret = getaddrinfo (SDATA (host), portstring, &hints, &res); |
| @@ -3522,6 +3596,21 @@ static struct ifflag_def ifflag_table[] = { | |||
| 3522 | #ifdef IFF_DYNAMIC | 3596 | #ifdef IFF_DYNAMIC |
| 3523 | { IFF_DYNAMIC, "dynamic" }, | 3597 | { IFF_DYNAMIC, "dynamic" }, |
| 3524 | #endif | 3598 | #endif |
| 3599 | #ifdef IFF_OACTIV | ||
| 3600 | { IFF_OACTIV, "oactiv" }, /* OpenBSD: transmission in progress */ | ||
| 3601 | #endif | ||
| 3602 | #ifdef IFF_SIMPLEX | ||
| 3603 | { IFF_SIMPLEX, "simplex" }, /* OpenBSD: can't hear own transmissions */ | ||
| 3604 | #endif | ||
| 3605 | #ifdef IFF_LINK0 | ||
| 3606 | { IFF_LINK0, "link0" }, /* OpenBSD: per link layer defined bit */ | ||
| 3607 | #endif | ||
| 3608 | #ifdef IFF_LINK1 | ||
| 3609 | { IFF_LINK1, "link1" }, /* OpenBSD: per link layer defined bit */ | ||
| 3610 | #endif | ||
| 3611 | #ifdef IFF_LINK2 | ||
| 3612 | { IFF_LINK2, "link2" }, /* OpenBSD: per link layer defined bit */ | ||
| 3613 | #endif | ||
| 3525 | { 0, 0 } | 3614 | { 0, 0 } |
| 3526 | }; | 3615 | }; |
| 3527 | 3616 | ||
| @@ -3816,6 +3905,9 @@ server_accept_connection (server, channel) | |||
| 3816 | union u_sockaddr { | 3905 | union u_sockaddr { |
| 3817 | struct sockaddr sa; | 3906 | struct sockaddr sa; |
| 3818 | struct sockaddr_in in; | 3907 | struct sockaddr_in in; |
| 3908 | #ifdef AF_INET6 | ||
| 3909 | struct sockaddr_in6 in6; | ||
| 3910 | #endif | ||
| 3819 | #ifdef HAVE_LOCAL_SOCKETS | 3911 | #ifdef HAVE_LOCAL_SOCKETS |
| 3820 | struct sockaddr_un un; | 3912 | struct sockaddr_un un; |
| 3821 | #endif | 3913 | #endif |
| @@ -3872,6 +3964,26 @@ server_accept_connection (server, channel) | |||
| 3872 | } | 3964 | } |
| 3873 | break; | 3965 | break; |
| 3874 | 3966 | ||
| 3967 | #ifdef AF_INET6 | ||
| 3968 | case AF_INET6: | ||
| 3969 | { | ||
| 3970 | Lisp_Object args[9]; | ||
| 3971 | uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; | ||
| 3972 | int i; | ||
| 3973 | args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); | ||
| 3974 | for (i = 0; i < 8; i++) | ||
| 3975 | args[i+1] = make_number (ntohs(ip6[i])); | ||
| 3976 | host = Fformat (9, args); | ||
| 3977 | service = make_number (ntohs (saddr.in.sin_port)); | ||
| 3978 | |||
| 3979 | args[0] = build_string (" <[%s]:%d>"); | ||
| 3980 | args[1] = host; | ||
| 3981 | args[2] = service; | ||
| 3982 | caller = Fformat (3, args); | ||
| 3983 | } | ||
| 3984 | break; | ||
| 3985 | #endif | ||
| 3986 | |||
| 3875 | #ifdef HAVE_LOCAL_SOCKETS | 3987 | #ifdef HAVE_LOCAL_SOCKETS |
| 3876 | case AF_LOCAL: | 3988 | case AF_LOCAL: |
| 3877 | #endif | 3989 | #endif |
| @@ -6721,6 +6833,10 @@ init_process () | |||
| 6721 | #ifdef HAVE_LOCAL_SOCKETS | 6833 | #ifdef HAVE_LOCAL_SOCKETS |
| 6722 | ADD_SUBFEATURE (QCfamily, Qlocal); | 6834 | ADD_SUBFEATURE (QCfamily, Qlocal); |
| 6723 | #endif | 6835 | #endif |
| 6836 | ADD_SUBFEATURE (QCfamily, Qipv4); | ||
| 6837 | #ifdef AF_INET6 | ||
| 6838 | ADD_SUBFEATURE (QCfamily, Qipv6); | ||
| 6839 | #endif | ||
| 6724 | #ifdef HAVE_GETSOCKNAME | 6840 | #ifdef HAVE_GETSOCKNAME |
| 6725 | ADD_SUBFEATURE (QCservice, Qt); | 6841 | ADD_SUBFEATURE (QCservice, Qt); |
| 6726 | #endif | 6842 | #endif |
| @@ -6779,6 +6895,12 @@ syms_of_process () | |||
| 6779 | staticpro (&Qlisten); | 6895 | staticpro (&Qlisten); |
| 6780 | Qlocal = intern ("local"); | 6896 | Qlocal = intern ("local"); |
| 6781 | staticpro (&Qlocal); | 6897 | staticpro (&Qlocal); |
| 6898 | Qipv4 = intern ("ipv4"); | ||
| 6899 | staticpro (&Qipv4); | ||
| 6900 | #ifdef AF_INET6 | ||
| 6901 | Qipv6 = intern ("ipv6"); | ||
| 6902 | staticpro (&Qipv6); | ||
| 6903 | #endif | ||
| 6782 | Qdatagram = intern ("datagram"); | 6904 | Qdatagram = intern ("datagram"); |
| 6783 | staticpro (&Qdatagram); | 6905 | staticpro (&Qdatagram); |
| 6784 | 6906 | ||
diff --git a/src/window.h b/src/window.h index cb819990258..03f416aa9bc 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Window definitions for GNU Emacs. | 1 | /* Window definitions for GNU Emacs. |
| 2 | Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001, | 2 | Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001, |
| 3 | 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | 3 | 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -865,6 +865,7 @@ extern Lisp_Object Vwindow_list; | |||
| 865 | 865 | ||
| 866 | EXFUN (Fwindow_end, 2); | 866 | EXFUN (Fwindow_end, 2); |
| 867 | EXFUN (Fselected_window, 0); | 867 | EXFUN (Fselected_window, 0); |
| 868 | EXFUN (Fwindow_minibuffer_p, 1); | ||
| 868 | EXFUN (Fdelete_window, 1); | 869 | EXFUN (Fdelete_window, 1); |
| 869 | EXFUN (Fwindow_buffer, 1); | 870 | EXFUN (Fwindow_buffer, 1); |
| 870 | EXFUN (Fget_buffer_window, 2); | 871 | EXFUN (Fget_buffer_window, 2); |