diff options
author | Eli Zaretskii <eliz@gnu.org> | 2000-08-17 06:11:09 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2000-08-17 06:11:09 +0000 |
commit | aae41d97a4501836c911c61cec82bbb6cf955327 (patch) | |
tree | 6cbb71ecc0204e65c141adf5899c8203453ebb78 /src/w16select.c | |
parent | 357438ebe064605fbd5301ab2e04d27600a8ec0b (diff) | |
download | emacs-aae41d97a4501836c911c61cec82bbb6cf955327.tar.gz |
(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.
Diffstat (limited to 'src/w16select.c')
-rw-r--r-- | src/w16select.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/w16select.c b/src/w16select.c index dec1af7726b..df739a1356c 100644 --- a/src/w16select.c +++ b/src/w16select.c @@ -248,7 +248,7 @@ set_clipboard_data (Format, Data, Size, Raw) 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 @@ set_clipboard_data (Format, Data, Size, Raw) } 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 @@ set_clipboard_data (Format, Data, Size, Raw) 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 @@ static char no_mem_msg[] = "(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 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat 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); } |