This source file includes following definitions.
- is_8859_6_break
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include <config.h>
21
22 #include "unigbrk.h"
23
24 #include <locale.h>
25 #include <stdlib.h>
26
27 #include "macros.h"
28
29 static bool
30 is_8859_6_break (unsigned char c)
31 {
32
33 return !(c >= 0xeb && c <= 0xf2);
34 }
35
36 int
37 main ()
38 {
39
40 if (setlocale (LC_ALL, "") == NULL)
41 return 1;
42
43
44 ulc_grapheme_breaks (NULL, 0, NULL);
45
46 #if HAVE_ICONV
47 {
48
49
50
51
52 static const char s[] = "ZYX\352\353W\360\361V\362";
53 enum { LENGTH = sizeof s - 1 };
54 char p[LENGTH];
55 size_t i;
56
57 ulc_grapheme_breaks (s, LENGTH, p);
58 for (i = 0; i < LENGTH; i++)
59 if (p[i] != is_8859_6_break (s[i]))
60 {
61 size_t j;
62
63 fprintf (stderr, "wrong grapheme breaks:\n");
64
65 fprintf (stderr, " input:");
66 for (j = 0; j < LENGTH; j++)
67 fprintf (stderr, " %02x", (unsigned char) s[j]);
68 putc ('\n', stderr);
69
70 fprintf (stderr, "expected:");
71 for (j = 0; j < LENGTH; j++)
72 fprintf (stderr, " %d", is_8859_6_break (s[j]));
73 putc ('\n', stderr);
74
75 fprintf (stderr, " actual:");
76 for (j = 0; j < LENGTH; j++)
77 fprintf (stderr, " %d", p[j]);
78 putc ('\n', stderr);
79
80 abort ();
81 }
82 }
83 #endif
84
85 return 0;
86 }