mbaddch.c revision 2
1N/A * The contents of this file are subject to the terms of the 1N/A * Common Development and Distribution License, Version 1.0 only 1N/A * (the "License"). You may not use this file except in compliance 1N/A * See the License for the specific language governing permissions 1N/A * and limitations under the License. 1N/A * When distributing Covered Code, include this CDDL HEADER in each 1N/A * If applicable, add the following below this CDDL HEADER, with the 1N/A * fields enclosed by brackets "[]" replaced with your own identifying 1N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1N/A/* Copyright (c) 1988 AT&T */ 1N/A/* All Rights Reserved */ 1N/A * Copyright (c) 1997, by Sun Microsystems, Inc. 1N/A * All rights reserved. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/A * Clear the space occupied by a multicolumn character 1N/A /* ASSERT(_scrmax > 1); */ 1N/A /* compute the bounds for the character */ 1N/A /* update the change structure */ 1N/A /* clear the character */ * Make sure the window cursor point to a valid place. * If win->_insmode or isedge, the cursor has to * point to the start of a whole character; otherwise, the * cursor has to point to a part of a whole character. /* ASSERT(_scrmax > 1); */ /* make wp points to the start column of a mb-character */ /* make sure that wp points to a whole character */ /* decode the character into a sequence of bytes */ /* add the sequence to the image */ for (n = 0; n <
nc; ++n) {
/* first byte of a multi-byte character */ /* if character is not ready to process */ /* begin processing the character */ /* window too small or char cannot be stored */ /* if the character won't fit into the line */ /* perform the right shift */ /* clear any multi-byte char about to be overwritten */ for (m = 0; m <
len; ++m)
/* pack two bytes at a time */ for (m =
nbyte/
2; m > 0; m -=
1,
wch +=
2)
/* do the remaining byte if any */ /* fill-in for remaining display columns */ /* the first column has Continue BIT off */