~ubuntu-branches/ubuntu/hardy/uim/hardy

« back to all changes in this revision

Viewing changes to helper/dict-anthy.c

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2005-12-04 13:10:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051204131042-ktzc8b17zi7a3cw8
Tags: 1:0.4.9.1-1
* New upstream release
* libuim0-nox, libuim-nox-dev, and libuim0-dbg-nox is now obsolete.
  Because libuim0 does not depends on X11. They now become dummy package,
  therefore you can safely remove them.
* Add --enable-debug in configure again.
* debian/patches/08_fix_privilage_escalation_CVE_2005_3149: disabled.
* Fix Error on purge because update-uim-config is not found.
  (closes: Bug#339345)
* uim-qt: New package for Qt utilities for uim. qt-immodule does not
  contained yet because of Debian's Qt3 does not support immodule and
  because uim does not recognize libqt4-dev's headers properly. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *     may be used to endorse or promote products derived from this software
18
18
 *     without specific prior written permission.
19
19
 *
20
 
 *  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 
20
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
21
21
 *  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
22
 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
 
 *  ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 
23
 *  ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
24
24
 *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
25
 *  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
26
 *  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
101
101
get_anthydic_api()
102
102
{
103
103
    anthy_dic_lib = dlopen("libanthydic.so.0", RTLD_GLOBAL |RTLD_NOW);
104
 
    if(anthy_dic_lib == NULL) {
 
104
    if (anthy_dic_lib == NULL) {
105
105
        return -1;
106
106
    }
107
107
 
121
121
 
122
122
    anthy_dic_api.priv_dic_add_entry = dlsym(anthy_dic_lib, "anthy_priv_dic_add_entry");
123
123
 
124
 
    if(!anthy_dic_api.util_init && !anthy_dic_api.util_set_personality
 
124
    if (!anthy_dic_api.util_init && !anthy_dic_api.util_set_personality
125
125
       && !anthy_dic_api.util_get_anthydir && !anthy_dic_api.priv_dic_delete
126
126
       && !anthy_dic_api.priv_dic_select_first_entry
127
127
       && !anthy_dic_api.priv_dic_select_next_entry
140
140
static int
141
141
dict_anthy_init(void)
142
142
{
143
 
    if(get_anthydic_api() == -1)
 
143
    if (get_anthydic_api() == -1)
144
144
        return -1;
145
145
    anthy_dic_api.util_init();
146
146
    return 0;
149
149
static int
150
150
dict_anthy_exit(void)
151
151
{
152
 
    if(anthy_dic_lib)
 
152
    if (anthy_dic_lib)
153
153
        return dlclose(anthy_dic_lib);
154
154
    else
155
155
        return -1;
161
161
    char phon[100], desc[100], cclass_code[100];
162
162
    int ret = 0;
163
163
 
164
 
    if(anthy_dic_api.priv_dic_select_first_entry() == -1) {
 
164
    if (anthy_dic_api.priv_dic_select_first_entry() == -1) {
165
165
        *head = NULL;
166
166
        return -1;
167
167
    }
168
168
 
169
 
    while(ret == 0) {
170
 
        if(anthy_dic_api.priv_dic_get_index(phon, sizeof(phon))
 
169
    while (ret == 0) {
 
170
        if (anthy_dic_api.priv_dic_get_index(phon, sizeof(phon))
171
171
           && anthy_dic_api.priv_dic_get_wtype(cclass_code, sizeof(cclass_code))
172
172
           && anthy_dic_api.priv_dic_get_word(desc, sizeof(desc))) {
173
173
            gint pos;
193
193
dict_anthy_add_priv_dic_with_flags(char *phon, char *desc,
194
194
                                   char *cclass_code, int freq)
195
195
{
196
 
    if((strlen(phon) == 0) ||
 
196
    if ((strlen(phon) == 0) ||
197
197
       (strlen(desc) == 0) ||
198
198
       (strlen(cclass_code) == 0)) {
199
199
        return -1;