- if (SP != 0
- && SP->_cleanup) {
- char tmp = ch;
- /*
- * POSIX says write() is safe in a signal handler, but the
- * buffered I/O is not.
- */
- write(fileno(NC_OUTPUT), &tmp, 1);
- } else {
- putc(ch, NC_OUTPUT);
- }
- return OK;
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0)
+{
+ (void) fflush(NC_OUTPUT(SP_PARM));
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_flush(void)
+{
+ NCURSES_SP_NAME(_nc_flush) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch)
+{
+ COUNT_OUTCHARS(1);
+
+ if (HasTInfoTerminal(SP_PARM)
+ && SP_PARM != 0
+ && SP_PARM->_cleanup) {
+ char tmp = ch;
+ /*
+ * POSIX says write() is safe in a signal handler, but the
+ * buffered I/O is not.
+ */
+ write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1);
+ } else {
+ putc(ch, NC_OUTPUT(SP_PARM));
+ }
+ return OK;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_outch(int ch)
+{
+ return NCURSES_SP_NAME(_nc_outch) (CURRENT_SCREEN, ch);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(putp) (NCURSES_SP_DCLx const char *string)
+{
+ return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+ string, 1, NCURSES_SP_NAME(_nc_outch));