changeset 30900:2bec1c202b13

(set_clipboard_data): If there's not enough memory to put text into clipboard, return 1, as Fw16_set_clipboard_data expects. In case of other failures, return 3. (system_error_msg): New error message. (Fw16_set_clipboard_data): If set_clipboard_data returns 3, print system_error_msg.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 17 Aug 2000 06:10:09 +0000
parents 429c384fc024
children 25ba383947b5
files src/w16select.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/w16select.c	Thu Aug 17 01:08:11 2000 +0000
+++ b/src/w16select.c	Thu Aug 17 06:10:09 2000 +0000
@@ -248,7 +248,7 @@
   unsigned char *dp = Data, *dstart = dp;
 
   if (Format != CF_OEMTEXT)
-    return 0;
+    return 3;
 
   /* need to know final size after '\r' chars are inserted (the
      standard CF_OEMTEXT clipboard format uses CRLF line endings,
@@ -266,10 +266,10 @@
     }
 
   if (clipboard_compact (truelen) < truelen)
-    return 0;
+    return 1;
 
   if ((xbuf_addr = alloc_xfer_buf (truelen)) == 0)
-    return 0;
+    return 1;
 
   /* Move the buffer into the low memory, convert LF into CR-LF if needed.  */
   if (Raw)
@@ -333,8 +333,8 @@
   if (regs.x.ax == 0)
     *last_clipboard_text = '\0';
 
-  /* Zero means success, otherwise (1 or 2) it's an error.  */
-  return regs.x.ax > 0 ? 0 : 1;
+  /* Zero means success, otherwise (1, 2, or 3) it's an error.  */
+  return regs.x.ax > 0 ? 0 : 3;
 }
 
 /* Return the size of the clipboard data of format FORMAT.  */
@@ -477,6 +477,8 @@
   "(Not enough DOS memory to put saved text into clipboard.)";
 static char binary_msg[] =
   "(Binary characters in saved text; clipboard data not set.)";
+static char system_error_msg[] =
+  "(Clipboard interface failure; clipboard data not set.)";
 
 DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_data, 1, 2, 0,
        "This sets the clipboard data to the given text.")
@@ -577,6 +579,9 @@
 	  case 2:
 	    message2 (binary_msg, sizeof (binary_msg) - 1, 0);
 	    break;
+	  case 3:
+	    message2 (system_error_msg, sizeof (system_error_msg) - 1, 0);
+	    break;
 	}
       sit_for (2, 0, 0, 1, 1);
     }