~ubuntu-branches/ubuntu/maverick/uim/maverick

« back to all changes in this revision

Viewing changes to uim/uim-util.h

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2008-06-25 19:56:33 UTC
  • mfrom: (3.1.18 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080625195633-8jljph4rfq00l8o7
Tags: 1:1.5.1-2
* uim-tcode: provide tutcode-custom.scm, tutcode-bushudic.scm
  and tutcode-rule.scm (Closes: #482659)
* Fix FTBFS: segv during compile (Closes: #483078).
  I personally think this bug is not specific for uim but is a optimization
  problem on gcc-4.3.1. (https://bugs.freedesktop.org/show_bug.cgi?id=16477)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
  uim-util.h utility function prototypes for uim.
3
3
 
4
 
  Copyright (c) 2004-2006 uim Project http://uim.freedesktop.org/
 
4
  Copyright (c) 2004-2008 uim Project http://code.google.com/p/uim/
5
5
 
6
6
  All rights reserved.
7
7
 
32
32
 
33
33
*/
34
34
 
35
 
#ifndef _uim_util_h_included_
36
 
#define _uim_util_h_included_
 
35
#ifndef UIM_UTIL_H
 
36
#define UIM_UTIL_H
 
37
 
 
38
#include <stdio.h>
 
39
#include <sys/types.h>
 
40
 
 
41
#include "uim.h"
37
42
 
38
43
#ifdef __cplusplus
39
44
extern "C" {
40
45
#endif
41
46
 
42
47
/**
43
 
 *  *
44
 
 * @param localename locale string. typical format of this string
45
 
 * is ll_CC.charset. E.G. for Japanese locale, ja_JP.EUC-JP
46
 
 * ll is language code defined in ISO 639, CC is country code defined
47
 
 * in ISO 3166.
48
 
 * @return language name string. (Now it's untranslated.)
 
48
 * Returns human-readable language name from a locale string.
 
49
 *
 
50
 * @param locale locale string. typical format of this string is
 
51
 * ll_CC.charset. e.g. for Japanese locale, ja_JP.EUC-JP ll is language code
 
52
 * defined in ISO 639-1, CC is country code defined in ISO 3166.
 
53
 *
 
54
 * @return untranslated language name string, or else "-" if no language is
 
55
 * matched. apply gettext() in caller side if needed.
49
56
 *
50
57
 * @see uim_create_context
51
58
 */
52
59
const char *
53
 
uim_get_language_name_from_locale(const char *localename);
 
60
uim_get_language_name_from_locale(const char *locale);
54
61
 
 
62
/**
 
63
 * Returns ISO 639-1 language code from a human-readable language name.
 
64
 *
 
65
 * @param language_name a human-readable language name in English such as
 
66
 * "Japanese".
 
67
 *
 
68
 * @return ISO 639-1 language code such as "ja", or else "-" if no language
 
69
 * is matched.
 
70
 */
55
71
const char *
56
72
uim_get_language_code_from_language_name(const char *language_name);
57
73
 
58
 
/* uim's iconv_open wrapper */
59
 
void *uim_iconv_open(const char *tocode, const char *fromcode);
 
74
 
 
75
/* command execution in pipe-connected subprocess (like popen(3))*/
 
76
pid_t uim_ipc_open_command(pid_t old_pid,
 
77
                           FILE **read_handler, FILE **write_handler,
 
78
                           const char *command);
 
79
pid_t uim_ipc_open_command_with_option(pid_t old_pid,
 
80
                                       FILE **read_handler,
 
81
                                       FILE **write_handler,
 
82
                                       const char *command,
 
83
                                       const char *option);
 
84
char *uim_ipc_send_command(pid_t *pid,
 
85
                           FILE **read_handler, FILE **write_handler,
 
86
                           const char *command, const char *str);
 
87
 
 
88
/* an uim_code_converter implementation using iconv */
 
89
extern struct uim_code_converter *uim_iconv;
 
90
 
60
91
 
61
92
#ifdef __cplusplus
62
93
}