SCIMBridge  0.4.x
scim-bridge-string.h
Go to the documentation of this file.
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 
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 
44  typedef uint32_t wchar;
45 #else
46 
49  typedef wchar_t wchar;
50 #endif
51 
59  ssize_t scim_bridge_string_to_wstring (wchar **wstr, const char *str);
60 
68  ssize_t scim_bridge_wstring_to_string (char **str, const wchar *wstr);
69 
76  ssize_t scim_bridge_string_get_length (const char *str);
77 
84  ssize_t scim_bridge_wstring_get_length (const wchar *wstr);
85 
93  retval_t scim_bridge_string_to_uint (unsigned int *dst, const char *str);
94 
102  retval_t scim_bridge_string_to_int (int *dst, const char *str);
103 
111  retval_t scim_bridge_string_to_boolean (boolean *dst, const char *str);
112 
120  size_t scim_bridge_string_from_uint (char **str, unsigned int value);
121 
129  size_t scim_bridge_string_from_int (char **str, int value);
130 
138  size_t scim_bridge_string_from_boolean (char **str, boolean value);
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 #endif /*SCIMBRIDGESTRING_H_*/
RETVAL_FAILED
#define RETVAL_FAILED
Definition: scim-bridge.h:64
scim_bridge_wstring_get_length
ssize_t scim_bridge_wstring_get_length(const wchar *wstr)
Definition: scim-bridge-string.c:248
scim-bridge-string.h
This is the header for the functions to manupulate strings.
scim-bridge.h
This header describes about fundamental definitions of scim-bridge.
RETVAL_SUCCEEDED
#define RETVAL_SUCCEEDED
Definition: scim-bridge.h:69
scim_bridge_string_to_wstring
ssize_t scim_bridge_string_to_wstring(wchar **wstr, const char *str)
Definition: scim-bridge-string.c:31
scim_bridge_string_from_uint
size_t scim_bridge_string_from_uint(char **str, unsigned int value)
Definition: scim-bridge-string.c:432
scim-bridge-output.h
This header is used for print out error messages.
wchar
uint32_t wchar
Definition: scim-bridge-string.h:44
scim_bridge_wstring_to_string
ssize_t scim_bridge_wstring_to_string(char **str, const wchar *wstr)
Definition: scim-bridge-string.c:181
scim_bridge_string_to_uint
retval_t scim_bridge_string_to_uint(unsigned int *dst, const char *str)
Definition: scim-bridge-string.c:273
scim_bridge_string_from_boolean
size_t scim_bridge_string_from_boolean(char **str, boolean value)
Definition: scim-bridge-string.c:450
scim_bridge_string_to_boolean
retval_t scim_bridge_string_to_boolean(boolean *dst, const char *str)
Definition: scim-bridge-string.c:412
scim_bridge_string_to_int
retval_t scim_bridge_string_to_int(int *dst, const char *str)
Definition: scim-bridge-string.c:333
scim_bridge_perrorln
void scim_bridge_perrorln(const char *format,...)
Definition: scim-bridge-agent-output.cpp:103
scim_bridge_string_from_int
size_t scim_bridge_string_from_int(char **str, int value)
Definition: scim-bridge-string.c:441
scim_bridge_string_get_length
ssize_t scim_bridge_string_get_length(const char *str)
Definition: scim-bridge-string.c:262
retval_t
int retval_t
Definition: scim-bridge.h:59