1 | /*----------------------------------------------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: encoding.C |
2 | * File: encoding.C |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * All portions of code are copyright by their respective author/s. |
5 | * All portions of code are copyright by their respective author/s. |
6 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
6 | * Copyright (c) 2003-2006 Marc Lehmann <schmorp@schmorp.de> |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation; either version 3 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
… | |
… | |
23 | #include "../config.h" |
23 | #include "../config.h" |
24 | |
24 | |
25 | #include "encoding.h" |
25 | #include "encoding.h" |
26 | #include "rxvtutil.h" |
26 | #include "rxvtutil.h" |
27 | |
27 | |
28 | #include <cstdlib> |
28 | #include <stdlib.h> |
29 | #include <cstring> |
29 | #include <string.h> |
30 | |
30 | |
31 | static const struct n2cs { |
31 | static const struct n2cs { |
32 | const char *name; |
32 | const char *name; |
33 | codeset cs; |
33 | codeset cs; |
34 | } n2cs[] = { |
34 | } n2cs[] = { |
… | |
… | |
286 | |
286 | |
287 | unicode_t |
287 | unicode_t |
288 | rxvt_compose (unicode_t c1, unicode_t c2) |
288 | rxvt_compose (unicode_t c1, unicode_t c2) |
289 | { |
289 | { |
290 | int l = 0; |
290 | int l = 0; |
291 | int r = ARRAY_LENGTH(rxvt_compose_table) - 1; |
291 | int r = ecb_array_length (rxvt_compose_table) - 1; |
292 | int m; |
292 | int m; |
293 | |
293 | |
294 | while (r >= l) |
294 | while (r >= l) |
295 | { |
295 | { |
296 | m = (l + r) / 2; |
296 | m = (l + r) / 2; |