index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
dir_000004.html
dbus
dbus-string.h
00001
/* -*- mode: C; c-file-style: "gnu" -*- */
00002
/* dbus-string.h String utility class (internal to D-BUS implementation)
00003
*
00004
* Copyright (C) 2002, 2003 Red Hat, Inc.
00005
*
00006
* Licensed under the Academic Free License version 2.1
00007
*
00008
* This program is free software; you can redistribute it and/or modify
00009
* it under the terms of the GNU General Public License as published by
00010
* the Free Software Foundation; either version 2 of the License, or
00011
* (at your option) any later version.
00012
*
00013
* This program is distributed in the hope that it will be useful,
00014
* but WITHOUT ANY WARRANTY; without even the implied warranty of
00015
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016
* GNU General Public License for more details.
00017
*
00018
* You should have received a copy of the GNU General Public License
00019
* along with this program; if not, write to the Free Software
00020
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021
*
00022
*/
00023
00024
#ifndef DBUS_STRING_H
00025
#define DBUS_STRING_H
00026
00027
#include <config.h>
00028
00029
#include <dbus/dbus-memory.h>
00030
#include <dbus/dbus-types.h>
00031
#include <dbus/dbus-sysdeps.h>
00032
00033
#include <stdarg.h>
00034
00035
group__DBusMacros.html#ga0
DBUS_BEGIN_DECLS
00036
structDBusString.html
00040
struct
structDBusString.html
DBusString
00041 {
structDBusString.html#o0
00042
const
void
*
structDBusString.html#o0
dummy1
;
structDBusString.html#o1
00043
int
structDBusString.html#o1
dummy2
;
structDBusString.html#o2
00044
int
structDBusString.html#o2
dummy3
;
structDBusString.html#o3
00045
int
structDBusString.html#o3
dummy4
;
structDBusString.html#o4
00046
unsigned
int
structDBusString.html#o4
dummy5
: 1;
structDBusString.html#o5
00047
unsigned
int
structDBusString.html#o5
dummy6
: 1;
structDBusString.html#o6
00048
unsigned
int
structDBusString.html#o6
dummy7
: 1;
structDBusString.html#o7
00049
unsigned
int
structDBusString.html#o7
dummy8
: 3;
00050 };
00051
00052
#ifdef DBUS_DISABLE_ASSERT
00053
/* Some simple inlining hacks; the current linker is not smart enough
00054
* to inline non-exported symbols across files in the library.
00055
* Note that these break type safety (due to the casts)
00056
*/
00057
#define _dbus_string_get_data(s) ((char*)(((DBusString*)(s))->dummy1))
00058
#define _dbus_string_get_length(s) (((DBusString*)(s))->dummy2)
00059
#define _dbus_string_set_byte(s, i, b) ((((unsigned char*)(((DBusString*)(s))->dummy1))[(i)]) = (unsigned char) (b))
00060
#define _dbus_string_get_byte(s, i) (((const unsigned char*)(((DBusString*)(s))->dummy1))[(i)])
00061
#define _dbus_string_get_const_data(s) ((const char*)(((DBusString*)(s))->dummy1))
00062
#define _dbus_string_get_const_data_len(s,start,len) (((const char*)(((DBusString*)(s))->dummy1)) + (start))
00063
#endif
00064
00065
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga6
_dbus_string_init
(
structDBusString.html
DBusString
*str);
00066
void
group__DBusString.html#ga7
_dbus_string_init_const
(
structDBusString.html
DBusString
*str,
00067
const
char
*value);
00068
void
group__DBusString.html#ga8
_dbus_string_init_const_len
(
structDBusString.html
DBusString
*str,
00069
const
char
*value,
00070
int
len);
00071
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga5
_dbus_string_init_preallocated
(
structDBusString.html
DBusString
*str,
00072
int
allocate_size);
00073
void
group__DBusString.html#ga9
_dbus_string_free
(
structDBusString.html
DBusString
*str);
00074
void
_dbus_string_lock                  (
structDBusString.html
DBusString
*str);
00075
#ifndef _dbus_string_get_data
00076
char
*         _dbus_string_get_data              (
structDBusString.html
DBusString
*str);
00077
#endif
/* _dbus_string_get_data */
00078
#ifndef _dbus_string_get_const_data
00079
const
char
*   _dbus_string_get_const_data        (
const
structDBusString.html
DBusString
*str);
00080
#endif
/* _dbus_string_get_const_data */
00081
char
*
group__DBusString.html#ga13
_dbus_string_get_data_len
(
structDBusString.html
DBusString
*str,
00082
int
start,
00083
int
len);
00084
#ifndef _dbus_string_get_const_data_len
00085
const
char
*   _dbus_string_get_const_data_len    (
const
structDBusString.html
DBusString
*str,
00086
int
start,
00087
int
len);
00088
#endif
00089
#ifndef _dbus_string_set_byte
00090
void
_dbus_string_set_byte              (
structDBusString.html
DBusString
*str,
00091
int
i,
00092
unsigned
char
byte);
00093
#endif
00094
#ifndef _dbus_string_get_byte
00095
unsigned
char
_dbus_string_get_byte              (
const
structDBusString.html
DBusString
*str,
00096
int
start);
00097
#endif
/* _dbus_string_get_byte */
00098
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga14
_dbus_string_insert_bytes
(
structDBusString.html
DBusString
*str,
00099
int
i,
00100
int
n_bytes,
00101
unsigned
char
byte);
00102
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga15
_dbus_string_insert_byte
(
structDBusString.html
DBusString
*str,
00103
int
i,
00104
unsigned
char
byte);
00105
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga16
_dbus_string_steal_data
(
structDBusString.html
DBusString
*str,
00106
char
**data_return);
00107
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_steal_data_len        (
structDBusString.html
DBusString
*str,
00108
char
**data_return,
00109
int
start,
00110
int
len);
00111
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga17
_dbus_string_copy_data
(
const
structDBusString.html
DBusString
*str,
00112
char
**data_return);
00113
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_copy_data_len         (
const
structDBusString.html
DBusString
*str,
00114
char
**data_return,
00115
int
start,
00116
int
len);
00117
void
group__DBusString.html#ga18
_dbus_string_copy_to_buffer
(
const
structDBusString.html
DBusString
*str,
00118
char
*buffer,
00119
int
len);
00120
#ifndef _dbus_string_get_length
00121
int
_dbus_string_get_length            (
const
structDBusString.html
DBusString
*str);
00122
#endif
/* !_dbus_string_get_length */
00123
00124
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga19
_dbus_string_lengthen
(
structDBusString.html
DBusString
*str,
00125
int
additional_length);
00126
void
group__DBusString.html#ga20
_dbus_string_shorten
(
structDBusString.html
DBusString
*str,
00127
int
length_to_remove);
00128
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga21
_dbus_string_set_length
(
structDBusString.html
DBusString
*str,
00129
int
length);
00130
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga24
_dbus_string_align_length
(
structDBusString.html
DBusString
*str,
00131
int
alignment);
00132
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga25
_dbus_string_alloc_space
(
structDBusString.html
DBusString
*str,
00133
int
extra_bytes);
00134
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga27
_dbus_string_append
(
structDBusString.html
DBusString
*str,
00135
const
char
*buffer);
00136
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga34
_dbus_string_append_len
(
structDBusString.html
DBusString
*str,
00137
const
char
*buffer,
00138
int
len);
00139
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga60
_dbus_string_append_int
(
structDBusString.html
DBusString
*str,
00140
long
value);
00141
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga61
_dbus_string_append_uint
(
structDBusString.html
DBusString
*str,
00142
unsigned
long
value);
00143
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_double         (
structDBusString.html
DBusString
*str,
00144
double
value);
00145
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga35
_dbus_string_append_byte
(
structDBusString.html
DBusString
*str,
00146
unsigned
char
byte);
00147
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_unichar        (
structDBusString.html
DBusString
*str,
00148                                                   dbus_unichar_t     ch);
00149
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_4_aligned      (
structDBusString.html
DBusString
*str,
00150
const
unsigned
char
octets[4]);
00151
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_8_aligned      (
structDBusString.html
DBusString
*str,
00152
const
unsigned
char
octets[8]);
00153
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga33
_dbus_string_append_printf
(
structDBusString.html
DBusString
*str,
00154
const
char
*format,
00155                                                   ...) _DBUS_GNUC_PRINTF (2, 3);
00156
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga32
_dbus_string_append_printf_valist
(
structDBusString.html
DBusString
*str,
00157                                                   const
char
*format,
00158                                                   va_list            args);
00159
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga28
_dbus_string_insert_2_aligned
(
structDBusString.html
DBusString
*str,
00160
int
insert_at,
00161                                                   const
unsigned
char
octets[2]);
00162
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga29
_dbus_string_insert_4_aligned
(
structDBusString.html
DBusString
*str,
00163
int
insert_at,
00164                                                   const
unsigned
char
octets[4]);
00165
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga30
_dbus_string_insert_8_aligned
(
structDBusString.html
DBusString
*str,
00166
int
insert_at,
00167                                                   const
unsigned
char
octets[8]);
00168
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga31
_dbus_string_insert_alignment
(
structDBusString.html
DBusString
*str,
00169
int
*insert_at,
00170
int
alignment);
00171
void
group__DBusString.html#ga37
_dbus_string_delete
(
structDBusString.html
DBusString
*str,
00172
int
start,
00173
int
len);
00174
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga39
_dbus_string_move
(
structDBusString.html
DBusString
*source,
00175
int
start,
00176
structDBusString.html
DBusString
*dest,
00177
int
insert_at);
00178
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga40
_dbus_string_copy
(const
structDBusString.html
DBusString
*source,
00179
int
start,
00180
structDBusString.html
DBusString
*dest,
00181
int
insert_at);
00182
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga41
_dbus_string_move_len
(
structDBusString.html
DBusString
*source,
00183
int
start,
00184
int
len,
00185
structDBusString.html
DBusString
*dest,
00186
int
insert_at);
00187
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga42
_dbus_string_copy_len
(const
structDBusString.html
DBusString
*source,
00188
int
start,
00189
int
len,
00190
structDBusString.html
DBusString
*dest,
00191
int
insert_at);
00192
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga43
_dbus_string_replace_len
(const
structDBusString.html
DBusString
*source,
00193
int
start,
00194
int
len,
00195
structDBusString.html
DBusString
*dest,
00196
int
replace_at,
00197
int
replace_len);
00198
void
_dbus_string_get_unichar           (const
structDBusString.html
DBusString
*str,
00199
int
start,
00200                                                   dbus_unichar_t    *ch_return,
00201
int
*end_return);
00202
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga62
_dbus_string_parse_int
(const
structDBusString.html
DBusString
*str,
00203
int
start,
00204
long
*value_return,
00205
int
*end_return);
00206
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_parse_uint            (const
structDBusString.html
DBusString
*str,
00207
int
start,
00208
unsigned
long
*value_return,
00209
int
*end_return);
00210
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_parse_double          (const
structDBusString.html
DBusString
*str,
00211
int
start,
00212
double
*value,
00213
int
*end_return);
00214
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga44
_dbus_string_find
(const
structDBusString.html
DBusString
*str,
00215
int
start,
00216                                                   const
char
*substr,
00217
int
*found);
00218
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga45
_dbus_string_find_to
(const
structDBusString.html
DBusString
*str,
00219
int
start,
00220
int
end,
00221                                                   const
char
*substr,
00222
int
*found);
00223
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga1
_dbus_string_find_byte_backward
(const
structDBusString.html
DBusString
*str,
00224
int
start,
00225
unsigned
char
byte,
00226
int
*found);
00227
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga46
_dbus_string_find_blank
(const
structDBusString.html
DBusString
*str,
00228
int
start,
00229
int
*found);
00230
void
group__DBusString.html#ga47
_dbus_string_skip_blank
(const
structDBusString.html
DBusString
*str,
00231
int
start,
00232
int
*end);
00233
void
group__DBusString.html#ga2
_dbus_string_skip_white
(const
structDBusString.html
DBusString
*str,
00234
int
start,
00235
int
*end);
00236
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga49
_dbus_string_equal
(const
structDBusString.html
DBusString
*a,
00237                                                   const
structDBusString.html
DBusString
*b);
00238
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga51
_dbus_string_equal_c_str
(const
structDBusString.html
DBusString
*a,
00239                                                   const
char
*c_str);
00240
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_equal_len             (const
structDBusString.html
DBusString
*a,
00241                                                   const
structDBusString.html
DBusString
*b,
00242
int
len);
00243
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga50
_dbus_string_equal_substring
(const
structDBusString.html
DBusString
*a,
00244
int
a_start,
00245
int
a_len,
00246                                                   const
structDBusString.html
DBusString
*b,
00247
int
b_start);
00248
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_starts_with_c_str     (const
structDBusString.html
DBusString
*a,
00249                                                   const
char
*c_str);
00250
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga0
_dbus_string_ends_with_c_str
(const
structDBusString.html
DBusString
*a,
00251                                                   const
char
*c_str);
00252
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga48
_dbus_string_pop_line
(
structDBusString.html
DBusString
*source,
00253
structDBusString.html
DBusString
*dest);
00254
void
_dbus_string_delete_first_word     (
structDBusString.html
DBusString
*str);
00255
void
_dbus_string_delete_leading_blanks (
structDBusString.html
DBusString
*str);
00256
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga52
_dbus_string_append_byte_as_hex
(
structDBusString.html
DBusString
*str,
00257
int
byte);
00258
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga53
_dbus_string_hex_encode
(const
structDBusString.html
DBusString
*source,
00259
int
start,
00260
structDBusString.html
DBusString
*dest,
00261
int
insert_at);
00262
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga54
_dbus_string_hex_decode
(const
structDBusString.html
DBusString
*source,
00263
int
start,
00264
int
*end_return,
00265
structDBusString.html
DBusString
*dest,
00266
int
insert_at);
00267
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga55
_dbus_string_validate_ascii
(const
structDBusString.html
DBusString
*str,
00268
int
start,
00269
int
len);
00270
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga56
_dbus_string_validate_utf8
(const
structDBusString.html
DBusString
*str,
00271
int
start,
00272
int
len);
00273
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga57
_dbus_string_validate_nul
(const
structDBusString.html
DBusString
*str,
00274
int
start,
00275
int
len);
00276
void
group__DBusString.html#ga58
_dbus_string_zero
(
structDBusString.html
DBusString
*str);
00277
00278
00284 #define _DBUS_STRING_ALLOCATION_PADDING 8
00285
00293 #define
group__DBusMarshal.html#ga50
_DBUS_STRING_DEFINE_STATIC
(name, str)                           \
00294   static const
char
_dbus_static_string_##name[] = str;                 \
00295   static const
structDBusString.html
DBusString
name = { _dbus_static_string_##name,          \
00296
sizeof
(_dbus_static_string_##name),  \
00297
sizeof
(_dbus_static_string_##name) + \
00298                                    _DBUS_STRING_ALLOCATION_PADDING,     \
00299
sizeof
(_dbus_static_string_##name),  \
00300
group__DBusMacros.html#ga2
TRUE
,
group__DBusMacros.html#ga2
TRUE
,
group__DBusMacros.html#ga3
FALSE
, 0 }
00301
00302
group__DBusMacros.html#ga1
DBUS_END_DECLS
00303
00304
#endif
/* DBUS_STRING_H */
Generated on Tue Sep 13 01:28:07 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
