Beispiel #1
0
ERL_NIF_TERM norm(ErlNifEnv* env, ErlNifBinary in, 
    UNormalizationMode mode)
{
    int32_t ulen;
    ErlNifBinary out;
    UErrorCode status;

    ulen = TO_ULEN(in.size);
    do_norm(in, out, ulen, mode, status);
    if (status == U_BUFFER_OVERFLOW_ERROR) {
        do_norm(in, out, ulen, mode, status);
    }
    CHECK(env, status);
    return enif_make_binary(env, &out);
}
Beispiel #2
0
int			print_str(t_form *info, t_data *d, int ret)
{
	int newret;

	newret = 0;
	if (info->prec > ret || info->prec == -1)
		info->prec = ret;
	do_norm(info, d, &newret);
	do_left(info, d, &newret, ret);
	return (ret + newret);
}
Beispiel #3
0
int			print_nocon(t_form *info, int ret)
{
	int		newret;
	char	ospace;

	ospace = info->zero == 1 ? '0' : ' ';
	newret = 0;
	if (info->prec == -1)
		info->prec = 0;
	if (info->width == -1)
		info->width = 0;
	do_norm(info, ret, &newret, ospace);
	do_left(info, ret, &newret, ospace);
	return (ret + newret);
}
Beispiel #4
0
int			print_wstr(t_form *info, int ret, wchar_t *str)
{
	int newret;
	int count;

	newret = 0;
	if (info->prec != -1 && info->prec < ret)
		ret = info->prec;
	count = info->prec;
	if (count == -1 || count > ret)
		count = ret;
	do_norm(info, str, &newret, count);
	do_left(info, str, &newret, ret);
	return (ret + newret);
}
Beispiel #5
0
 void operator() (T& x, P& p, std::size_t i) const
 {
     do_norm(x, p, i, bool_type<type_traits<T>::is_polynom>::value);
 }