2 /***************************************************************************
4 ****************************************************************************
5 * ncurses is copyright (C) 1992-1995 *
7 * zmbenhal@netcom.com *
9 * esr@snark.thyrsus.com *
11 * Permission is hereby granted to reproduce and distribute ncurses *
12 * by any means and for any fee, whether alone or as part of a *
13 * larger distribution, in source or in binary form, PROVIDED *
14 * this notice is included with any such distribution, and is not *
15 * removed from any of its header files. Mention of ncurses in any *
16 * applications linked with it is highly appreciated. *
18 * ncurses comes AS IS with no warranty, implied or expressed. *
20 ***************************************************************************/
25 ** The routines waddnstr(), waddchnstr().
29 #include <curses.priv.h>
31 MODULE_ID("$Id: lib_addstr.c,v 1.11 1997/03/08 21:38:52 tom Exp $")
34 waddnstr(WINDOW *win, const char *const astr, int n)
36 unsigned const char *str = (unsigned const char *)astr;
39 T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbuf(astr), n));
40 T(("... current %s", _traceattr(win->_attrs)));
44 TR(TRACE_VIRTPUT, ("str is not null"));
47 n = (int)strlen(astr);
49 while((n-- > 0) && (*str != '\0')) {
50 TR(TRACE_VIRTPUT, ("*str = %#x", *str));
51 if (_nc_waddch_nosync(win, (chtype)*str++) == ERR) {
58 TR(TRACE_VIRTPUT, ("waddnstr returns %d", code));
63 waddchnstr(WINDOW *win, const chtype *const astr, int n)
65 short oy = win->_cury;
66 short ox = win->_curx;
67 const chtype *str = (const chtype *)astr;
70 T((T_CALLED("waddchnstr(%p,%p,%d)"), win, str, n));
76 str = (const chtype *)astr;
80 if (_nc_waddch_nosync(win, *str++) == ERR) {