2
Copyright (c) 2003-2005 uim Project http://uim.freedesktop.org/
6
Redistribution and use in source and binary forms, with or without
7
modification, are permitted provided that the following conditions
10
1. Redistributions of source code must retain the above copyright
11
notice, this list of conditions and the following disclaimer.
12
2. Redistributions in binary form must reproduce the above copyright
13
notice, this list of conditions and the following disclaimer in the
14
documentation and/or other materials provided with the distribution.
15
3. Neither the name of authors nor the names of its contributors
16
may be used to endorse or promote products derived from this software
17
without specific prior written permission.
19
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
20
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
23
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36
#include <uim/uim-custom.h>
39
dump_custom(const char *custom_sym)
41
struct uim_custom *custom;
44
custom = uim_custom_get(custom_sym);
46
/* human readable variable name and description */
47
printf("\n;; %s\n;; %s\n", custom->label, custom->desc);
49
def_literal = uim_custom_definition_as_literal(custom_sym);
51
printf("%s\n", def_literal);
54
uim_custom_free(custom);
61
dump_group(const char *group_sym)
63
struct uim_custom_group *group;
64
char **custom_syms, **custom_sym;
66
group = uim_custom_group_get(group_sym);
70
/* print group header */
71
printf(";;;\n;;; %s\n;;;\n", group->label);
73
custom_syms = uim_custom_collect_by_group(group_sym);
75
for (custom_sym = custom_syms; *custom_sym; custom_sym++) {
76
dump_custom(*custom_sym);
78
uim_custom_symbol_list_free(custom_syms);
87
main(int argc, char *argv[])
90
fprintf(stderr, "uim_init() failed.\n");
94
if (uim_custom_enable()) {
95
char **primary_groups, **grp;
97
primary_groups = uim_custom_primary_groups();
98
for (grp = primary_groups; *grp; grp++) {
101
uim_custom_symbol_list_free(primary_groups);
103
fprintf(stderr, "uim_custom_enable() failed.\n");