summaryrefslogtreecommitdiffstats
path: root/unicode/graphemetest.c
blob: fbad13de6ae127c6b6e11eb923569bdbdece9dac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
** Copyright 2011 Double Precision, Inc.
** See COPYING for distribution information.
**
*/

#include	"unicode_config.h"
#include	"courier-unicode.h"
#include	<string.h>
#include	<stdlib.h>
#include	<stdio.h>
#include	<errno.h>


int main(int argc, char **argv)
{
	if (argc >= 3)
	{
		unicode_grapheme_break_info_t t=unicode_grapheme_break_init();
		int n=0;
		int i;
		for (i=1; i<argc; ++i)
		{
			n=unicode_grapheme_break_next(t,
						      strtol(argv[i], NULL, 0));
		}
		unicode_grapheme_break_deinit(t);

		printf("%d\n", n);
	}
	return (0);
}