X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fwidechar%2Flib_in_wch.c;h=1d27332279a73463a35132230fffdc2839a585cc;hp=5e110cb63548a666513df40347ff114e9712380b;hb=f67a188e71a0e6f80c1c45e50e7a7449c2d7bfb3;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/ncurses/widechar/lib_in_wch.c b/ncurses/widechar/lib_in_wch.c index 5e110cb6..1d273322 100644 --- a/ncurses/widechar/lib_in_wch.c +++ b/ncurses/widechar/lib_in_wch.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 2002-2009,2016 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +28,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas Dickey 2002 * + * Author: Thomas Dickey * ****************************************************************************/ /* @@ -39,22 +40,26 @@ #include -MODULE_ID("$Id: lib_in_wch.c,v 1.2 2002/08/03 20:23:29 tom Exp $") +MODULE_ID("$Id: lib_in_wch.c,v 1.7 2020/02/02 23:34:34 tom Exp $") NCURSES_EXPORT(int) -win_wch(WINDOW *win, cchar_t * wcval) +win_wch(WINDOW *win, cchar_t *wcval) { - int row, col; int code = OK; - TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval)); + TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), (void *) win, (void *) wcval)); + if (win != 0 && wcval != 0) { + int row, col; + getyx(win, row, col); *wcval = win->_line[row].text[col]; + TR(TRACE_CCALLS, ("data %s", _tracecchar_t(wcval))); } else { code = ERR; } - returnCode(code); + TR(TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); }