/* linebreak.c - line breaking of Unicode strings
- Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2007 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#include <string.h>
#include "c-ctype.h"
#include "xsize.h"
-
-#include "utf8-ucs4.h"
-
-#include "utf16-ucs4.h"
+#include "unistr.h"
#ifdef unused
static inline int
-u32_mbtouc (unsigned int *puc, const unsigned int *s, size_t n)
+u32_mbtouc_unsafe (unsigned int *puc, const unsigned int *s, size_t n)
{
*puc = *s;
return 1;
unsigned int uc;
int w;
- s += u8_mbtouc (&uc, s, s_end - s);
+ s += u8_mbtouc_unsafe (&uc, s, s_end - s);
if (uc == 0)
break; /* end of string reached */
unsigned int uc;
int w;
- s += u16_mbtouc (&uc, s, s_end - s);
+ s += u16_mbtouc_unsafe (&uc, s, s_end - s);
if (uc == 0)
break; /* end of string reached */
while (s < s_end)
{
unsigned int uc;
- int count = u8_mbtouc (&uc, s, s_end - s);
+ int count = u8_mbtouc_unsafe (&uc, s, s_end - s);
int prop = lbrkprop_lookup (uc);
if (prop == LBP_BK)
while (s < s_end)
{
unsigned int uc;
- int count = u16_mbtouc (&uc, s, s_end - s);
+ int count = u16_mbtouc_unsafe (&uc, s, s_end - s);
int prop = lbrkprop_lookup (uc);
if (prop == LBP_BK)
while (s < s_end)
{
unsigned int uc;
- int count = u8_mbtouc (&uc, s, s_end - s);
+ int count = u8_mbtouc_unsafe (&uc, s, s_end - s);
/* Respect the override. */
if (o != NULL && *o != UC_BREAK_UNDEFINED)
while (s < s_end)
{
unsigned int uc;
- int count = u16_mbtouc (&uc, s, s_end - s);
+ int count = u16_mbtouc_unsafe (&uc, s, s_end - s);
/* Respect the override. */
if (o != NULL && *o != UC_BREAK_UNDEFINED)