wins_wch.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1995, by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* XCurses Library
*
* Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved.
*
*/
#ifdef M_RCSID
#ifndef lint
static char rcsID[] = "$Header: /rd/src/libc/xcurses/rcs/wins_wch.c 1.9 1995/09/28 13:18:36 ant Exp $";
#endif
#endif
#include <private.h>
/*
* Insert a character into a window line, shifting the line right
* the column width of the inserted character. The right most columns
* will be truncated according to the width of the character inserted.
*/
int
__m_cc_ins(w, y, x, cc)
WINDOW *w;
int y, x;
{
extern void *memmove(); /* quiet sparcv9 warning */
int width;
/* Determine the character width to insert. */
return -1;
x = __m_cc_first(w, y, x);
/* Insert a "hole" into the line. */
(void) memmove(
);
/* Write the character into the hole. */
return -1;
/* Update dirty region markers. */
if (x < w->_first[y])
w->_first[y] = x;
/* If the last character on the line is incomplete,
* blank it out.
*/
return width;
}
/*
* Special internal version of wins_wch() that can track the cursor
* position to facilitate inserting strings containing special characters
* like \b, \n, \r, and \t.
*/
int
WINDOW *w;
int y, x;
{
const wchar_t *p;
#ifdef M_CURSES_TRACE
#endif
case '\r':
x = 0;
break;
case '\b':
if (0 < x)
--x;
break;
case '\t':
goto error;
break;
case '\n':
/* Truncate the tail of the current line. */
goto error;
if (__m_do_scroll(w, y, x, &y, &x) == ERR)
goto error;
break;
default:
goto error;
x += width;
break;
}
/* Convert non-printables into printable representation. */
goto error;
for ( ; *p != '\0'; ++p, x += width) {
goto error;
}
}
if (yp != (int *) 0)
*yp = y;
if (xp != (int *) 0)
*xp = x;
WSYNC(w);
}
/*f
* Insert a character (with attributes) before the cursor. All
* characters to the right of the cursor are moved one space to
* the right, with a possibility of the rightmost character on
* the line being lost. The cursor position does not change.
*/
int
WINDOW *w;
{
int code;
#ifdef M_CURSES_TRACE
#endif
}