~ubuntu-branches/ubuntu/wily/scim/wily-proposed

« back to all changes in this revision

Viewing changes to extras/immodules/common/scim-bridge-string.h

  • Committer: Package Import Robot
  • Author(s): Rolf Leggewie, Rolf Leggewie, Tz-Huan Huang
  • Date: 2012-06-30 11:21:42 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120630112142-a4cwzsr16dty8dk7
Tags: 1.4.14-1
[ Rolf Leggewie ]
* new upstream release 1.4.14
  - drop 32_scim-1.4.8-fix-dlopen.patch which has landed upstream
* bump compat level to 9
* debian/control: add Toni Mueller as co-maintainer
  Welcome aboard!

[ Tz-Huan Huang ]
* start shipping a couple of newly introduced im-module packages
* debian/rules:
  - simplify dh_auto_install override where upstream changes allow this
  - drop -fpermissive from CXXFLAGS, fixed upstream
* debian/README.*: update the documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * SCIM Bridge
 
3
 *
 
4
 * Copyright (c) 2006 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
 
5
 *
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU Lesser General Public
 
9
 * License as published by the Free Software Foundation and 
 
10
 * appearing in the file LICENSE.LGPL included in the package of this file.
 
11
 * You can also redistribute it and/or modify it under the terms of 
 
12
 * the GNU General Public License as published by the Free Software Foundation and 
 
13
 * appearing in the file LICENSE.GPL included in the package of this file.
 
14
 *
 
15
 * This library is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
18
 */
 
19
 
 
20
/**
 
21
 * @file
 
22
 * @author Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
 
23
 * @brief This is the header for the functions to manupulate strings.
 
24
 */
 
25
 
 
26
#ifndef SCIMBRIDGESTRING_H_
 
27
#define SCIMBRIDGESTRING_H_
 
28
 
 
29
#include <stdint.h>
 
30
#include <stdlib.h>
 
31
#include <unistd.h>
 
32
 
 
33
#include "scim-bridge.h"
 
34
 
 
35
#ifdef __cplusplus
 
36
extern "C"
 
37
{
 
38
#endif
 
39
 
 
40
#ifndef __STDC_ISO_10646__
 
41
    /**
 
42
     * The type for wide string.
 
43
     */
 
44
    typedef uint32_t wchar;
 
45
#else
 
46
    /**
 
47
     * The type for wide string.
 
48
     */
 
49
    typedef wchar_t wchar;
 
50
#endif
 
51
 
 
52
    /**
 
53
     * Translate an utf8 string into an ucs4 wide string.
 
54
     *
 
55
     * @param str String to translate.
 
56
     * @param wstr The destination for the new wide string.
 
57
     * @return The length of the new wide string. -1 means that it failed to translate.
 
58
     */
 
59
    ssize_t scim_bridge_string_to_wstring (wchar **wstr, const char *str);
 
60
 
 
61
    /**
 
62
     * Translate an ucs4 wide string into an utf8 string.
 
63
     *
 
64
     * @param wstr Wide string to translate.
 
65
     * @param str The destination for the new string.
 
66
     * @return The length of the new string. -1 means that it failed to translate.
 
67
     */
 
68
    ssize_t scim_bridge_wstring_to_string (char **str, const wchar *wstr);
 
69
 
 
70
    /**
 
71
     * Get the length of a string.
 
72
     *
 
73
     * @param str The string.
 
74
     * @return The length of the string.
 
75
     */
 
76
    ssize_t scim_bridge_string_get_length (const char *str);
 
77
 
 
78
    /**
 
79
     * Get the length of a wide string.
 
80
     *
 
81
     * @param str The wide string.
 
82
     * @return The length of the wide string.
 
83
     */
 
84
    ssize_t scim_bridge_wstring_get_length (const wchar *wstr);
 
85
 
 
86
    /**
 
87
     * Translate a string into an unsigned integer.
 
88
     *
 
89
     * @param str The string to translate.
 
90
     * @param dst The destination pointer of uint.
 
91
     * @return It returns RETVAL_SUCCEEDED if succeeded, otherwise it returns RETVAIL_FAILED.
 
92
     */
 
93
    retval_t scim_bridge_string_to_uint (unsigned int *dst, const char *str);
 
94
 
 
95
    /**
 
96
     * Translate a string into a integer.
 
97
     *
 
98
     * @param str The string to translate.
 
99
     * @param dst The destination pointer of int.
 
100
     * @return It returns RETVAL_SUCCEEDED if succeeded, otherwise it returns RETVAIL_FAILED.
 
101
     */
 
102
    retval_t scim_bridge_string_to_int (int *dst, const char *str);
 
103
 
 
104
    /**
 
105
     * Translate a string into a boolean.
 
106
     *
 
107
     * @param str The string to translate.
 
108
     * @param dst The destination pointer of boolean.
 
109
     * @return It returns RETVAL_SUCCEEDED if succeeded, otherwise it returns RETVAIL_FAILED.
 
110
     */
 
111
    retval_t scim_bridge_string_to_boolean (boolean *dst, const char *str);
 
112
 
 
113
    /**
 
114
     * Translate an unsigned integer into a string.
 
115
     *
 
116
     * @param value The value to translate.
 
117
     * @param str The destination pointer for the new string.
 
118
     * @return The length of the new string if succeeded, otherwise it returns -1.
 
119
     */
 
120
    size_t scim_bridge_string_from_uint (char **str, unsigned int value);
 
121
 
 
122
    /**
 
123
     * Translate a integer into a string.
 
124
     *
 
125
     * @param value The value to translate.
 
126
     * @param str The destination pointer for the new string.
 
127
     * @return The length of the new string if succeeded, otherwise it returns -1.
 
128
     */
 
129
    size_t scim_bridge_string_from_int (char **str, int value);
 
130
 
 
131
    /**
 
132
     * Translate a boolean into a string.
 
133
     *
 
134
     * @param value The value to translate.
 
135
     * @param str The destination pointer for the new string.
 
136
     * @return The length of the new string if succeeded, otherwise it returns -1.
 
137
     */
 
138
    size_t scim_bridge_string_from_boolean (char **str, boolean value);
 
139
 
 
140
#ifdef __cplusplus
 
141
}
 
142
#endif
 
143
#endif                                            /*SCIMBRIDGESTRING_H_*/