X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/c8d3a25c0981020e1b8aa3bf96a4a0059be82431..287d70764c83f6054eb2a0ede942eda01c20fcdf:/src/w16select.c diff --git a/src/w16select.c b/src/w16select.c index 270118358b..864757b3e6 100644 --- a/src/w16select.c +++ b/src/w16select.c @@ -1,6 +1,6 @@ /* 16-bit Windows Selection processing for emacs on MS-Windows -Copyright (C) 1996-1997, 2001-2012 Free Software Foundation, Inc. +Copyright (C) 1996-1997, 2001-2013 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -31,7 +31,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "dispextern.h" /* frame.h seems to want this */ #include "frame.h" /* Need this to get the X window of selected_frame */ @@ -453,14 +452,10 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat CHECK_STRING (string); - if (NILP (frame)) - frame = Fselected_frame (); - - CHECK_LIVE_FRAME (frame); - if ( !FRAME_MSDOS_P (XFRAME (frame))) + if (!FRAME_MSDOS_P (decode_live_frame (frame))) goto done; - BLOCK_INPUT; + block_input (); if (!open_clipboard ()) goto error; @@ -493,7 +488,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat setup_coding_system (Fcheck_coding_system (coding_system), &coding); coding.dst_bytes = nbytes * 4; - coding.destination = (unsigned char *) xmalloc (coding.dst_bytes); + coding.destination = xmalloc (coding.dst_bytes); Vnext_selection_coding_system = Qnil; coding.mode |= CODING_MODE_LAST_BLOCK; dst = coding.destination; @@ -521,7 +516,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat unblock: xfree (dst); - UNBLOCK_INPUT; + unblock_input (); /* Notify user if the text is too large to fit into DOS memory. (This will happen somewhere after 600K bytes (470K in DJGPP v1.x), @@ -533,13 +528,13 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat switch (put_status) { case 1: - message2 (no_mem_msg, sizeof (no_mem_msg) - 1, 0); + message3 (make_unibyte_string (no_mem_msg, sizeof (no_mem_msg) - 1)); break; case 2: - message2 (binary_msg, sizeof (binary_msg) - 1, 0); + message3 (make_unibyte_string (binary_msg, sizeof (binary_msg) - 1)); break; case 3: - message2 (system_error_msg, sizeof (system_error_msg) - 1, 0); + message3 (make_unibyte_string (system_error_msg, sizeof (system_error_msg) - 1)); break; } sit_for (make_number (2), 0, 2); @@ -559,20 +554,16 @@ DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_dat Lisp_Object ret = Qnil; int require_decoding = 0; - if (NILP (frame)) - frame = Fselected_frame (); - - CHECK_LIVE_FRAME (frame); - if ( !FRAME_MSDOS_P (XFRAME (frame))) + if (!FRAME_MSDOS_P (decode_live_frame (frame))) goto done; - BLOCK_INPUT; + block_input (); if (!open_clipboard ()) goto unblock; if ((data_size = get_clipboard_data_size (CF_OEMTEXT)) == 0 || - (htext = (unsigned char *)xmalloc (data_size)) == 0) + (htext = xmalloc (data_size)) == 0) goto closeclip; /* need to know final size after '\r' chars are removed because @@ -627,7 +618,7 @@ DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_dat close_clipboard (); unblock: - UNBLOCK_INPUT; + unblock_input (); done: