Hopefully fix compilation on *BSD.
[librote.git] / utf8.c
blob2dbf44861782e7ff0f6e213d552dfef1ca87fa83
1 /*
2 LICENSE INFORMATION:
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Lesser General Public
5 License (LGPL) as published by the Free Software Foundation.
7 Please refer to the COPYING file for more information.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 Copyright (c) 2007 Ryo Dairiki
21 #ifdef USE_UTF8
22 #include "utf8.h"
23 #include "rote.h"
24 #include "roteprivate.h"
26 void rote_utf8_erase_character(RoteTerm *rt, size_t row, size_t col) {
27 if (row < rt->rows || col < rt->cols) return;
29 const size_t fcount = rt->cells[row][col].fcount;
30 const size_t findex = rt->cells[row][col].findex;
32 int i;
33 for (i = rt->ccol - findex; i < rt->cols && i < rt->ccol + fcount - findex; ++i) {
34 rt->cells[row][i].empty = true;
35 rt->cells[row][i].fcount = 1;
36 rt->cells[row][i].findex = 0;
37 rt->cells[row][i].ch = 0x20;
38 rt->cells[row][i].attr = rt->curattr;
42 #endif