diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-11-10 09:00:41 -0800 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-11-11 21:38:48 +0100 |
commit | 4f85a1eb76d1e7109bcc60ba6f3262a5654ac61b (patch) | |
tree | e996818c6aa6b6f702a6c805c447c20724eff265 /payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c | |
parent | 2ea24dabd658b8396e0abf79318a538ef0f3a5b8 (diff) |
libpayload: Rename PDCurses-3.4 to PDCurses
Change-Id: If881ec130833c7e7e62caa3d31e350a531f5bc8e
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/12398
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c')
-rw-r--r-- | payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c | 185 |
1 files changed, 0 insertions, 185 deletions
diff --git a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c deleted file mode 100644 index 1922bb83f0..0000000000 --- a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c +++ /dev/null @@ -1,185 +0,0 @@ -/* Public Domain Curses */ - -#include "pdcos2.h" - -RCSID("$Id: pdcclip.c,v 1.33 2008/07/14 04:24:51 wmcbrine Exp $") - -/*man-start************************************************************** - - Name: clipboard - - Synopsis: - int PDC_getclipboard(char **contents, long *length); - int PDC_setclipboard(const char *contents, long length); - int PDC_freeclipboard(char *contents); - int PDC_clearclipboard(void); - - Description: - PDC_getclipboard() gets the textual contents of the system's - clipboard. This function returns the contents of the clipboard - in the contents argument. It is the responsibilitiy of the - caller to free the memory returned, via PDC_freeclipboard(). - The length of the clipboard contents is returned in the length - argument. - - PDC_setclipboard copies the supplied text into the system's - clipboard, emptying the clipboard prior to the copy. - - PDC_clearclipboard() clears the internal clipboard. - - Return Values: - indicator of success/failure of call. - PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for - the clipboard contents - PDC_CLIP_EMPTY the clipboard contains no text - PDC_CLIP_ACCESS_ERROR no clipboard support - - Portability X/Open BSD SYS V - PDC_getclipboard - - - - PDC_setclipboard - - - - PDC_freeclipboard - - - - PDC_clearclipboard - - - - -**man-end****************************************************************/ - -int PDC_getclipboard(char **contents, long *length) -{ -#ifndef EMXVIDEO - HMQ hmq; - HAB hab; - PTIB ptib; - PPIB ppib; - ULONG ulRet; - long len; - int rc; -#endif - PDC_LOG(("PDC_getclipboard() - called\n")); - -#ifndef EMXVIDEO - DosGetInfoBlocks(&ptib, &ppib); - ppib->pib_ultype = 3; - hab = WinInitialize(0); - hmq = WinCreateMsgQueue(hab, 0); - - if (!WinOpenClipbrd(hab)) - { - WinDestroyMsgQueue(hmq); - WinTerminate(hab); - return PDC_CLIP_ACCESS_ERROR; - } - - rc = PDC_CLIP_EMPTY; - - ulRet = WinQueryClipbrdData(hab, CF_TEXT); - - if (ulRet) - { - len = strlen((char *)ulRet); - *contents = malloc(len + 1); - - if (!*contents) - rc = PDC_CLIP_MEMORY_ERROR; - else - { - strcpy((char *)*contents, (char *)ulRet); - *length = len; - rc = PDC_CLIP_SUCCESS; - } - } - - WinCloseClipbrd(hab); - WinDestroyMsgQueue(hmq); - WinTerminate(hab); - - return rc; -#else - return PDC_CLIP_ACCESS_ERROR; -#endif -} - -int PDC_setclipboard(const char *contents, long length) -{ -#ifndef EMXVIDEO - HAB hab; - PTIB ptib; - PPIB ppib; - ULONG ulRC; - PSZ szTextOut = NULL; - int rc; -#endif - PDC_LOG(("PDC_setclipboard() - called\n")); - -#ifndef EMXVIDEO - DosGetInfoBlocks(&ptib, &ppib); - ppib->pib_ultype = 3; - hab = WinInitialize(0); - - if (!WinOpenClipbrd(hab)) - { - WinTerminate(hab); - return PDC_CLIP_ACCESS_ERROR; - } - - rc = PDC_CLIP_MEMORY_ERROR; - - ulRC = DosAllocSharedMem((PVOID)&szTextOut, NULL, length + 1, - PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE); - - if (ulRC == 0) - { - strcpy(szTextOut, contents); - WinEmptyClipbrd(hab); - - if (WinSetClipbrdData(hab, (ULONG)szTextOut, CF_TEXT, CFI_POINTER)) - rc = PDC_CLIP_SUCCESS; - else - { - DosFreeMem(szTextOut); - rc = PDC_CLIP_ACCESS_ERROR; - } - } - - WinCloseClipbrd(hab); - WinTerminate(hab); - - return rc; -#else - return PDC_CLIP_ACCESS_ERROR; -#endif -} - -int PDC_freeclipboard(char *contents) -{ - PDC_LOG(("PDC_freeclipboard() - called\n")); - - if (contents) - free(contents); - - return PDC_CLIP_SUCCESS; -} - -int PDC_clearclipboard(void) -{ -#ifndef EMXVIDEO - HAB hab; - PTIB ptib; - PPIB ppib; -#endif - PDC_LOG(("PDC_clearclipboard() - called\n")); - -#ifndef EMXVIDEO - DosGetInfoBlocks(&ptib, &ppib); - ppib->pib_ultype = 3; - hab = WinInitialize(0); - - WinEmptyClipbrd(hab); - - WinCloseClipbrd(hab); - WinTerminate(hab); - - return PDC_CLIP_SUCCESS; -#else - return PDC_CLIP_ACCESS_ERROR; -#endif -} |