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
string class
[
group__DBusInternals.html
D-BUS internal implementation details
]
structDBusString.html
DBusString
data structure.
#_details
More...
Defines
#define
group__DBusString.html#ga64
ASSIGN_2_OCTETS
(p, octets)   *((
group__DBusTypes.html#ga5
dbus_uint16_t
*)(p)) = *((
group__DBusTypes.html#ga5
dbus_uint16_t
*)(octets));
assign 2 bytes from one string to another
#define
group__DBusString.html#ga65
ASSIGN_4_OCTETS
(p, octets)   *((
group__DBusTypes.html#ga3
dbus_uint32_t
*)(p)) = *((
group__DBusTypes.html#ga3
dbus_uint32_t
*)(octets));
assign 4 bytes from one string to another
#define
group__DBusString.html#ga66
ASSIGN_8_OCTETS
(p, octets)   *((
group__DBusTypes.html#ga7
dbus_uint64_t
*)(p)) = *((
group__DBusTypes.html#ga7
dbus_uint64_t
*)(octets));
assign 8 bytes from one string to another
#define
group__DBusString.html#ga67
DBUS_STRING_COPY_PREAMBLE
(source, start, dest, insert_at)
Checks assertions for two strings we're copying a segment between, and declares real_source/real_dest variables.
#ga67
#define
group__DBusString.html#ga68
UTF8_COMPUTE
(Char, Mask, Len)
computes length and mask of a unicode character
#ga68
#define
group__DBusString.html#ga69
UTF8_LENGTH
(Char)
computes length of a unicode character in UTF-8
#ga69
#define
group__DBusString.html#ga70
UTF8_GET
(Result, Chars, Count, Mask, Len)
Gets a UTF-8 value.
#ga70
#define
group__DBusString.html#ga71
UNICODE_VALID
(Char)
Check whether a unicode char is in a valid range.
#ga71
Functions
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga0
_dbus_string_ends_with_c_str
(const
structDBusString.html
DBusString
*a, const char *c_str)
Returns whether a string ends with the given suffix.
#ga0
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga1
_dbus_string_find_byte_backward
(const
structDBusString.html
DBusString
*str, int start, unsigned char byte, int *found)
Find the given byte scanning backward from the given start.
#ga1
void
group__DBusString.html#ga2
_dbus_string_skip_white
(const
structDBusString.html
DBusString
*str, int start, int *end)
Skips whitespace from start, storing the first non-whitespace in *end.
#ga2
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga5
_dbus_string_init_preallocated
(
structDBusString.html
DBusString
*str, int allocate_size)
Initializes a string that can be up to the given allocation size before it has to realloc.
#ga5
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga6
_dbus_string_init
(
structDBusString.html
DBusString
*str)
Initializes a string.
#ga6
void
group__DBusString.html#ga7
_dbus_string_init_const
(
structDBusString.html
DBusString
*str, const char *value)
Initializes a constant string.
#ga7
void
group__DBusString.html#ga8
_dbus_string_init_const_len
(
structDBusString.html
DBusString
*str, const char *value, int len)
Initializes a constant string with a length.
#ga8
void
group__DBusString.html#ga9
_dbus_string_free
(
structDBusString.html
DBusString
*str)
Frees a string created by
group__DBusString.html#ga6
_dbus_string_init()
.
#ga9
char *
group__DBusString.html#ga13
_dbus_string_get_data_len
(
structDBusString.html
DBusString
*str, int start, int len)
Gets a sub-portion of the raw character buffer from the string.
#ga13
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga14
_dbus_string_insert_bytes
(
structDBusString.html
DBusString
*str, int i, int n_bytes, unsigned char byte)
Inserts a number of bytes of a given value at the given position.
#ga14
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga15
_dbus_string_insert_byte
(
structDBusString.html
DBusString
*str, int i, unsigned char byte)
Inserts a single byte at the given position.
#ga15
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga16
_dbus_string_steal_data
(
structDBusString.html
DBusString
*str, char **data_return)
Like _dbus_string_get_data(), but removes the gotten data from the original string.
#ga16
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga17
_dbus_string_copy_data
(const
structDBusString.html
DBusString
*str, char **data_return)
Copies the data from the string into a char*.
#ga17
void
group__DBusString.html#ga18
_dbus_string_copy_to_buffer
(const
structDBusString.html
DBusString
*str, char *buffer, int avail_len)
Copies the contents of a
structDBusString.html
DBusString
into a different buffer.
#ga18
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga19
_dbus_string_lengthen
(
structDBusString.html
DBusString
*str, int additional_length)
Makes a string longer by the given number of bytes.
#ga19
void
group__DBusString.html#ga20
_dbus_string_shorten
(
structDBusString.html
DBusString
*str, int length_to_remove)
Makes a string shorter by the given number of bytes.
#ga20
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga21
_dbus_string_set_length
(
structDBusString.html
DBusString
*str, int length)
Sets the length of a string.
#ga21
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga24
_dbus_string_align_length
(
structDBusString.html
DBusString
*str, int alignment)
Align the length of a string to a specific alignment (typically 4 or 8) by appending nul bytes to the string.
#ga24
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga25
_dbus_string_alloc_space
(
structDBusString.html
DBusString
*str, int extra_bytes)
Preallocate extra_bytes such that a future lengthening of the string by extra_bytes is guaranteed to succeed without an out of memory error.
#ga25
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga27
_dbus_string_append
(
structDBusString.html
DBusString
*str, const char *buffer)
Appends a nul-terminated C-style string to a
structDBusString.html
DBusString
.
#ga27
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga28
_dbus_string_insert_2_aligned
(
structDBusString.html
DBusString
*str, int insert_at, const unsigned char octets[4])
Inserts 2 bytes aligned on a 2 byte boundary with any alignment padding initialized to 0.
#ga28
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga29
_dbus_string_insert_4_aligned
(
structDBusString.html
DBusString
*str, int insert_at, const unsigned char octets[4])
Inserts 4 bytes aligned on a 4 byte boundary with any alignment padding initialized to 0.
#ga29
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga30
_dbus_string_insert_8_aligned
(
structDBusString.html
DBusString
*str, int insert_at, const unsigned char octets[8])
Inserts 8 bytes aligned on an 8 byte boundary with any alignment padding initialized to 0.
#ga30
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga31
_dbus_string_insert_alignment
(
structDBusString.html
DBusString
*str, int *insert_at, int alignment)
Inserts padding at *insert_at such to align it to the given boundary.
#ga31
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga32
_dbus_string_append_printf_valist
(
structDBusString.html
DBusString
*str, const char *format, va_list args)
Appends a printf-style formatted string to the
structDBusString.html
DBusString
.
#ga32
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga33
_dbus_string_append_printf
(
structDBusString.html
DBusString
*str, const char *format,...)
Appends a printf-style formatted string to the
structDBusString.html
DBusString
.
#ga33
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga34
_dbus_string_append_len
(
structDBusString.html
DBusString
*str, const char *buffer, int len)
Appends block of bytes with the given length to a
structDBusString.html
DBusString
.
#ga34
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga35
_dbus_string_append_byte
(
structDBusString.html
DBusString
*str, unsigned char byte)
Appends a single byte to the string, returning
group__DBusMacros.html#ga3
FALSE
if not enough memory.
#ga35
void
group__DBusString.html#ga37
_dbus_string_delete
(
structDBusString.html
DBusString
*str, int start, int len)
Deletes a segment of a
structDBusString.html
DBusString
with length len starting at start.
#ga37
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga39
_dbus_string_move
(
structDBusString.html
DBusString
*source, int start,
structDBusString.html
DBusString
*dest, int insert_at)
Moves the end of one string into another string.
#ga39
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga40
_dbus_string_copy
(const
structDBusString.html
DBusString
*source, int start,
structDBusString.html
DBusString
*dest, int insert_at)
Like
group__DBusString.html#ga39
_dbus_string_move()
, but does not delete the section of the source string that's copied to the dest string.
#ga40
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga41
_dbus_string_move_len
(
structDBusString.html
DBusString
*source, int start, int len,
structDBusString.html
DBusString
*dest, int insert_at)
Like
group__DBusString.html#ga39
_dbus_string_move()
, but can move a segment from the middle of the source string.
#ga41
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga42
_dbus_string_copy_len
(const
structDBusString.html
DBusString
*source, int start, int len,
structDBusString.html
DBusString
*dest, int insert_at)
Like
group__DBusString.html#ga40
_dbus_string_copy()
, but can copy a segment from the middle of the source string.
#ga42
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga43
_dbus_string_replace_len
(const
structDBusString.html
DBusString
*source, int start, int len,
structDBusString.html
DBusString
*dest, int replace_at, int replace_len)
Replaces a segment of dest string with a segment of source string.
#ga43
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga44
_dbus_string_find
(const
structDBusString.html
DBusString
*str, int start, const char *substr, int *found)
Finds the given substring in the string, returning
group__DBusMacros.html#ga2
TRUE
and filling in the byte index where the substring was found, if it was found.
#ga44
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga45
_dbus_string_find_to
(const
structDBusString.html
DBusString
*str, int start, int end, const char *substr, int *found)
Finds the given substring in the string, up to a certain position, returning
group__DBusMacros.html#ga2
TRUE
and filling in the byte index where the substring was found, if it was found.
#ga45
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga46
_dbus_string_find_blank
(const
structDBusString.html
DBusString
*str, int start, int *found)
Finds a blank (space or tab) in the string.
#ga46
void
group__DBusString.html#ga47
_dbus_string_skip_blank
(const
structDBusString.html
DBusString
*str, int start, int *end)
Skips blanks from start, storing the first non-blank in *end (blank is space or tab).
#ga47
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga48
_dbus_string_pop_line
(
structDBusString.html
DBusString
*source,
structDBusString.html
DBusString
*dest)
Assigns a newline-terminated or \r\n-terminated line from the front of the string to the given dest string.
#ga48
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga49
_dbus_string_equal
(const
structDBusString.html
DBusString
*a, const
structDBusString.html
DBusString
*b)
Tests two
structDBusString.html
DBusString
for equality.
#ga49
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga50
_dbus_string_equal_substring
(const
structDBusString.html
DBusString
*a, int a_start, int a_len, const
structDBusString.html
DBusString
*b, int b_start)
Tests two sub-parts of two
structDBusString.html
DBusString
for equality.
#ga50
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga51
_dbus_string_equal_c_str
(const
structDBusString.html
DBusString
*a, const char *c_str)
Checks whether a string is equal to a C string.
#ga51
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga52
_dbus_string_append_byte_as_hex
(
structDBusString.html
DBusString
*str, int byte)
Appends a two-character hex digit to a string, where the hex digit has the value of the given byte.
#ga52
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga53
_dbus_string_hex_encode
(const
structDBusString.html
DBusString
*source, int start,
structDBusString.html
DBusString
*dest, int insert_at)
Encodes a string in hex, the way MD5 and SHA-1 are usually encoded.
#ga53
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga54
_dbus_string_hex_decode
(const
structDBusString.html
DBusString
*source, int start, int *end_return,
structDBusString.html
DBusString
*dest, int insert_at)
Decodes a string from hex encoding.
#ga54
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga55
_dbus_string_validate_ascii
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is valid ASCII with no nul bytes.
#ga55
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga56
_dbus_string_validate_utf8
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is valid UTF-8.
#ga56
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga57
_dbus_string_validate_nul
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is all nul bytes.
#ga57
void
group__DBusString.html#ga58
_dbus_string_zero
(
structDBusString.html
DBusString
*str)
Clears all allocated bytes in the string to zero.
#ga58
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga59
_dbus_string_get_dirname
(const
structDBusString.html
DBusString
*filename,
structDBusString.html
DBusString
*dirname)
Get the directory name from a complete filename.
#ga59
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga60
_dbus_string_append_int
(
structDBusString.html
DBusString
*str, long value)
Appends an integer to a
structDBusString.html
DBusString
.
#ga60
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga61
_dbus_string_append_uint
(
structDBusString.html
DBusString
*str, unsigned long value)
Appends an unsigned integer to a
structDBusString.html
DBusString
.
#ga61
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga62
_dbus_string_parse_int
(const
structDBusString.html
DBusString
*str, int start, long *value_return, int *end_return)
Parses an integer contained in a
structDBusString.html
DBusString
.
#ga62
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusString.html#ga63
_dbus_check_dir_is_private_to_user
(
structDBusString.html
DBusString
*dir,
structDBusError.html
DBusError
*error)
Checks to make sure the given directory is private to the user.
#ga63
Detailed Description
structDBusString.html
DBusString
data structure.
Types and functions related to
structDBusString.html
DBusString
.
structDBusString.html
DBusString
is intended to be a string class that makes it hard to mess up security issues (and just in general harder to write buggy code). It should be used (or extended and then used) rather than the libc stuff in string.h. The string class is a bit inconvenient at spots because it handles out-of-memory failures and tries to be extra-robust.
A
structDBusString.html
DBusString
has a maximum length set at initialization time; this can be used to ensure that a buffer doesn't get too big. The
group__DBusString.html#ga19
_dbus_string_lengthen()
method checks for overflow, and for max length being exceeded.
Try to avoid conversion to a plain C string, i.e. add methods on the string object instead, only convert to C string when passing things out to the public API. In particular, no sprintf, strcpy, strcat, any of that should be used. The GString feature of accepting negative numbers for "length of string" is also absent, because it could keep us from detecting bogus huge lengths. i.e. if we passed in some bogus huge length it would be taken to mean "current length of string" instead of "broken crack"
todo.html#_todo000065
Todo:
structDBusString.html
DBusString
needs a lot of cleaning up; some of the API is no longer used, and the API is pretty inconsistent.
In particular all the "append" APIs, especially those involving alignment but probably lots of them, are no longer used by the marshaling code which always does "inserts" now.
Define Documentation
#define DBUS_STRING_COPY_PREAMBLE
(
source,
start,
dest,
insert_at
)
Value:
structDBusRealString.html
DBusRealString
*real_source = (
structDBusRealString.html
DBusRealString
*) source;               \
structDBusRealString.html
DBusRealString
*real_dest = (
structDBusRealString.html
DBusRealString
*) dest;                   \
group__DBusInternalsUtils.html#ga130
_dbus_assert
((source) != (dest));                                    \
group__DBusStringInternals.html#ga1
DBUS_GENERIC_STRING_PREAMBLE
(real_source);                           \
group__DBusStringInternals.html#ga1
DBUS_GENERIC_STRING_PREAMBLE
(real_dest);                             \
group__DBusInternalsUtils.html#ga130
_dbus_assert
(!real_dest->
structDBusRealString.html#o4
constant
);                                  \
group__DBusInternalsUtils.html#ga130
_dbus_assert
(!real_dest->
structDBusRealString.html#o5
locked
);                                    \
group__DBusInternalsUtils.html#ga130
_dbus_assert
((start) >= 0);                                          \
group__DBusInternalsUtils.html#ga130
_dbus_assert
((start) <= real_source->
structDBusRealString.html#o1
len
);                           \
group__DBusInternalsUtils.html#ga130
_dbus_assert
((insert_at) >= 0);                                      \
group__DBusInternalsUtils.html#ga130
_dbus_assert
((insert_at) <= real_dest->
structDBusRealString.html#o1
len
)
Checks assertions for two strings we're copying a segment between, and declares real_source/real_dest variables.
Parameters:
source
the source string
start
the starting offset
dest
the dest string
insert_at
where the copied segment is inserted
Definition at line
dbus-string_8c-source.html#l01424
1424
of file
dbus-string_8c-source.html
dbus-string.c
.
Referenced by
dbus-string_8c-source.html#l01472
_dbus_string_copy()
,
dbus-string_8c-source.html#l01567
_dbus_string_copy_len()
,
dbus-string_8c-source.html#l01500
_dbus_string_move_len()
, and
dbus-string_8c-source.html#l01605
_dbus_string_replace_len()
.
#define UNICODE_VALID
(
Char
)
Value:
((Char) < 0x110000 &&                     \
(((Char) & 0xFFFFF800) != 0xD800) &&     \
((Char) < 0xFDD0 || (Char) > 0xFDEF) &&  \
((Char) & 0xFFFF) != 0xFFFF)
Check whether a unicode char is in a valid range.
Parameters:
Char
the character
Definition at line
dbus-string_8c-source.html#l01713
1713
of file
dbus-string_8c-source.html
dbus-string.c
.
Referenced by
dbus-string_8c-source.html#l02540
_dbus_string_validate_utf8()
.
#define UTF8_COMPUTE
(
Char,
Mask,
Len
)
computes length and mask of a unicode character
Parameters:
Char
the char
Mask
the mask variable to assign to
Len
the length variable to assign to
Definition at line
dbus-string_8c-source.html#l01638
1638
of file
dbus-string_8c-source.html
dbus-string.c
.
Referenced by
dbus-string_8c-source.html#l02540
_dbus_string_validate_utf8()
.
#define UTF8_GET
(
Result,
Chars,
Count,
Mask,
Len
)
Value:
(
namespaceDBus.html#a7
Result
) = (Chars)[0] & (Mask);                                       \
for
((Count) = 1; (Count) < (Len); ++(Count))                               \
{                                                                         \
if
(((Chars)[(Count)] & 0xc0) != 0x80)                                  \
{                                                                     \
(
namespaceDBus.html#a7
Result
) = -1;                                                      \
break
;                                                              \
}                                                                     \
(
namespaceDBus.html#a7
Result
) <<= 6;                                                         \
(
namespaceDBus.html#a7
Result
) |= ((Chars)[(Count)] & 0x3f);                                  \
}
Gets a UTF-8 value.
Parameters:
Result
variable for extracted unicode char.
Chars
the bytes to decode
Count
counter variable
Mask
mask for this char
Len
length for this char in bytes
Definition at line
dbus-string_8c-source.html#l01695
1695
of file
dbus-string_8c-source.html
dbus-string.c
.
Referenced by
dbus-string_8c-source.html#l02540
_dbus_string_validate_utf8()
.
#define UTF8_LENGTH
(
Char
)
Value:
((Char) < 0x80 ? 1 :                 \
((Char) < 0x800 ? 2 :               \
((Char) < 0x10000 ? 3 :            \
((Char) < 0x200000 ? 4 :          \
((Char) < 0x4000000 ? 5 : 6)))))
computes length of a unicode character in UTF-8
Parameters:
Char
the char
Definition at line
dbus-string_8c-source.html#l01679
1679
of file
dbus-string_8c-source.html
dbus-string.c
.
Referenced by
dbus-string_8c-source.html#l02540
_dbus_string_validate_utf8()
.
Function Documentation
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_check_dir_is_private_to_user
(
structDBusString.html
DBusString
*
dir
,
structDBusError.html
DBusError
*
error
)
Checks to make sure the given directory is private to the user.
Parameters:
error
error return
Returns:
group__DBusMacros.html#ga3
FALSE
on failure
Definition at line
dbus-sysdeps_8c-source.html#l01168
1168
of file
dbus-sysdeps_8c-source.html
dbus-sysdeps.c
.
References
dbus-sysdeps_8c-source.html#l02611
_dbus_error_from_errno()
,
dbus-sysdeps_8c-source.html#l02559
_dbus_strerror()
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_align_length
(
structDBusString.html
DBusString
*
str
,
int
alignment
)
Align the length of a string to a specific alignment (typically 4 or 8) by appending nul bytes to the string.
Parameters:
str
a string
alignment
the alignment
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-string_8c-source.html#l00934
934
of file
dbus-string_8c-source.html
dbus-string.c
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_alloc_space
(
structDBusString.html
DBusString
*
str
,
int
extra_bytes
)
Preallocate extra_bytes such that a future lengthening of the string by extra_bytes is guaranteed to succeed without an out of memory error.
Parameters:
str
a string
extra_bytes
bytes to alloc
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-string_8c-source.html#l00950
950
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l00811
_dbus_string_lengthen()
,
dbus-string_8c-source.html#l00831
_dbus_string_shorten()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-marshal-recursive_8c-source.html#l02387
_dbus_type_writer_write_basic()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append
(
structDBusString.html
DBusString
*
str
,
const char *
buffer
)
Appends a nul-terminated C-style string to a
structDBusString.html
DBusString
.
Parameters:
str
the
structDBusString.html
DBusString
buffer
the nul-terminated characters to append
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory.
Definition at line
dbus-string_8c-source.html#l00986
986
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00049
DBusRealString::max_length
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-sysdeps-util_8c-source.html#l00064
_dbus_become_daemon()
,
dbus-sysdeps-util_8c-source.html#l00504
_dbus_directory_get_next_file()
,
dbus-userdb_8c-source.html#l00366
_dbus_homedir_from_username()
,
dbus-keyring_8c-source.html#l00715
_dbus_keyring_new_homedir()
,
dbus-server-unix_8c-source.html#l00315
_dbus_server_new_for_domain_socket()
,
dbus-server-unix_8c-source.html#l00395
_dbus_server_new_for_tcp_socket()
,
dbus-sysdeps-util_8c-source.html#l00708
_dbus_string_get_dirname()
,
dbus-sysdeps_8c-source.html#l02120
_dbus_string_save_to_file()
,
dbus-transport-unix_8c-source.html#l01192
_dbus_transport_new_for_domain_socket()
,
dbus-transport-unix_8c-source.html#l01259
_dbus_transport_new_for_tcp_socket()
,
dbus-sysdeps-util_8c-source.html#l00348
_dbus_user_at_console()
,
dbus-server_8c-source.html#l00486
dbus_server_listen()
, and
dbus-errors_8c-source.html#l00313
dbus_set_error()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_byte
(
structDBusString.html
DBusString
*
str
,
unsigned char
byte
)
Appends a single byte to the string, returning
group__DBusMacros.html#ga3
FALSE
if not enough memory.
Parameters:
str
the string
byte
the byte to append
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-string_8c-source.html#l01273
1273
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-address_8c-source.html#l00187
_dbus_address_append_escaped()
,
dbus-sysdeps_8c-source.html#l02363
_dbus_concat_dir_and_file()
,
dbus-string_8c-source.html#l02272
_dbus_string_append_byte_as_hex()
, and
dbus-string_8c-source.html#l02356
_dbus_string_hex_decode()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_byte_as_hex
(
structDBusString.html
DBusString
*
str
,
int
byte
)
Appends a two-character hex digit to a string, where the hex digit has the value of the given byte.
Parameters:
str
the string
byte
the byte
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-string_8c-source.html#l02272
2272
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l01273
_dbus_string_append_byte()
,
dbus-string_8c-source.html#l00853
_dbus_string_set_length()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-address_8c-source.html#l00187
_dbus_address_append_escaped()
, and
dbus-string_8c-source.html#l02306
_dbus_string_hex_encode()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_int
(
structDBusString.html
DBusString
*
str
,
long
value
)
Appends an integer to a
structDBusString.html
DBusString
.
Parameters:
str
the string
value
the integer value
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory or other failure.
Definition at line
dbus-sysdeps_8c-source.html#l01014
1014
of file
dbus-sysdeps_8c-source.html
dbus-sysdeps.c
.
References
dbus-string_8c-source.html#l00456
_dbus_string_get_data_len()
,
dbus-string_8c-source.html#l00811
_dbus_string_lengthen()
,
dbus-string_8c-source.html#l00831
_dbus_string_shorten()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-sysdeps-util_8c-source.html#l00064
_dbus_become_daemon()
,
dbus-server-unix_8c-source.html#l00395
_dbus_server_new_for_tcp_socket()
, and
dbus-transport-unix_8c-source.html#l01259
_dbus_transport_new_for_tcp_socket()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_len
(
structDBusString.html
DBusString
*
str
,
const char *
buffer
,
int
len
)
Appends block of bytes with the given length to a
structDBusString.html
DBusString
.
Parameters:
str
the
structDBusString.html
DBusString
buffer
the bytes to append
len
the number of bytes to append
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory.
Definition at line
dbus-string_8c-source.html#l01253
1253
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-sha_8c-source.html#l00455
_dbus_sha_final()
,
dbus-message_8c-source.html#l01625
dbus_message_iter_get_signature()
, and
dbus-signature_8c-source.html#l00092
dbus_signature_iter_get_signature()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_printf
(
structDBusString.html
DBusString
*
str
,
const char *
format
,
...
)
Appends a printf-style formatted string to the
structDBusString.html
DBusString
.
Parameters:
str
the string
format
printf format
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-string_8c-source.html#l01230
1230
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l01191
_dbus_string_append_printf_valist()
.
Referenced by
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_printf_valist
(
structDBusString.html
DBusString
*
str
,
const char *
format
,
va_list
args
)
Appends a printf-style formatted string to the
structDBusString.html
DBusString
.
Parameters:
str
the string
format
printf format
args
variable argument list
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-string_8c-source.html#l01191
1191
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l00811
_dbus_string_lengthen()
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-string_8c-source.html#l01230
_dbus_string_append_printf()
,
dbus-message_8c-source.html#l00979
dbus_message_new_error_printf()
, and
dbus-errors_8c-source.html#l00313
dbus_set_error()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_append_uint
(
structDBusString.html
DBusString
*
str
,
unsigned long
value
)
Appends an unsigned integer to a
structDBusString.html
DBusString
.
Parameters:
str
the string
value
the integer value
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory or other failure.
Definition at line
dbus-sysdeps_8c-source.html#l01052
1052
of file
dbus-sysdeps_8c-source.html
dbus-sysdeps.c
.
References
dbus-string_8c-source.html#l00456
_dbus_string_get_data_len()
,
dbus-string_8c-source.html#l00811
_dbus_string_lengthen()
,
dbus-string_8c-source.html#l00831
_dbus_string_shorten()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_copy
(
const
structDBusString.html
DBusString
*
source
,
int
start
,
structDBusString.html
DBusString
*
dest
,
int
insert_at
)
Like
group__DBusString.html#ga39
_dbus_string_move()
, but does not delete the section of the source string that's copied to the dest string.
Parameters:
source
the source string
start
where to start copying the source string
dest
the destination string
insert_at
where to place the copied part of source string
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-string_8c-source.html#l01472
1472
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l01424
DBUS_STRING_COPY_PREAMBLE
.
Referenced by
dbus-auth_8c-source.html#l02407
_dbus_auth_decode_data()
,
dbus-auth_8c-source.html#l02344
_dbus_auth_encode_data()
,
dbus-auth_8c-source.html#l01975
_dbus_auth_server_new()
,
dbus-sysdeps_8c-source.html#l02363
_dbus_concat_dir_and_file()
,
dbus-marshal-header_8c-source.html#l00481
_dbus_header_copy()
,
dbus-keyring_8c-source.html#l00715
_dbus_keyring_new_homedir()
,
dbus-sysdeps_8c-source.html#l02120
_dbus_string_save_to_file()
, and
dbus-message_8c-source.html#l01022
dbus_message_copy()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_copy_data
(
const
structDBusString.html
DBusString
*
str
,
char **
data_return
)
Copies the data from the string into a char*.
Parameters:
str
the string
data_return
place to return the data
Returns:
group__DBusMacros.html#ga2
TRUE
on success,
group__DBusMacros.html#ga3
FALSE
on no memory
Definition at line
dbus-string_8c-source.html#l00696
696
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
,
dbus-memory_8c-source.html#l00437
dbus_malloc()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
group__DBusMacros.html#ga4
NULL
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-transport_8c-source.html#l00091
_dbus_transport_init_base()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_copy_len
(
const
structDBusString.html
DBusString
*
source
,
int
start
,
int
len
,
structDBusString.html
DBusString
*
dest
,
int
insert_at
)
Like
group__DBusString.html#ga40
_dbus_string_copy()
, but can copy a segment from the middle of the source string.
Parameters:
source
the source string
start
where to start copying the source string
len
length of segment to copy
dest
the destination string
insert_at
where to place the copied segment of source string
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-string_8c-source.html#l01567
1567
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
, and
dbus-string_8c-source.html#l01424
DBUS_STRING_COPY_PREAMBLE
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
,
dbus-sysdeps-util_8c-source.html#l00708
_dbus_string_get_dirname()
, and
dbus-address_8c-source.html#l00320
dbus_parse_address()
.
void _dbus_string_copy_to_buffer
(
const
structDBusString.html
DBusString
*
str
,
char *
buffer
,
int
avail_len
)
Copies the contents of a
structDBusString.html
DBusString
into a different buffer.
The resulting buffer will be nul-terminated.
Parameters:
str
a string
buffer
a C buffer to copy data to
avail_len
maximum length of C buffer
Definition at line
dbus-string_8c-source.html#l00720
720
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
, and
dbus-string-private_8h-source.html#l00046
DBusRealString::str
.
Referenced by
dbus-sysdeps_8c-source.html#l02447
_dbus_generate_random_bytes_buffer()
.
void _dbus_string_delete
(
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Deletes a segment of a
structDBusString.html
DBusString
with length len starting at start.
(Hint: to clear an entire string, setting length to 0 with
group__DBusString.html#ga21
_dbus_string_set_length()
is easier.)
Parameters:
str
the
structDBusString.html
DBusString
start
where to start deleting
len
the number of bytes to delete
Definition at line
dbus-string_8c-source.html#l01382
1382
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
, and
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
.
Referenced by
dbus-auth_8c-source.html#l02224
_dbus_auth_bytes_sent()
,
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
, and
dbus-marshal-recursive_8c-source.html#l02753
_dbus_type_writer_write_reader_partial()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_ends_with_c_str
(
const
structDBusString.html
DBusString
*
a
,
const char *
c_str
)
Returns whether a string ends with the given suffix.
todo.html#_todo000064
Todo:
memcmp might make this faster.
Parameters:
a
the string
c_str
the C-style string
Returns:
group__DBusMacros.html#ga2
TRUE
if the string ends with the suffix
Definition at line
dbus-string-util_8c-source.html#l00044
44
of file
dbus-string-util_8c-source.html
dbus-string-util.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00078
DBUS_GENERIC_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
group__DBusMacros.html#ga4
NULL
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_equal
(
const
structDBusString.html
DBusString
*
a
,
const
structDBusString.html
DBusString
*
b
)
Tests two
structDBusString.html
DBusString
for equality.
todo.html#_todo000070
Todo:
memcmp is probably faster
Parameters:
a
first string
b
second string
Returns:
group__DBusMacros.html#ga2
TRUE
if equal
Definition at line
dbus-string_8c-source.html#l02056
2056
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string-private_8h-source.html#l00078
DBUS_GENERIC_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-keyring_8c-source.html#l01010
_dbus_keyring_is_for_user()
, and
dbus-errors_8c-source.html#l00260
dbus_error_has_name()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_equal_c_str
(
const
structDBusString.html
DBusString
*
a
,
const char *
c_str
)
Checks whether a string is equal to a C string.
Parameters:
a
the string
c_str
the C string
Returns:
group__DBusMacros.html#ga2
TRUE
if equal
Definition at line
dbus-string_8c-source.html#l02197
2197
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00078
DBUS_GENERIC_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
group__DBusMacros.html#ga4
NULL
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-address_8c-source.html#l00146
dbus_address_entry_get_value()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_equal_substring
(
const
structDBusString.html
DBusString
*
a
,
int
a_start
,
int
a_len
,
const
structDBusString.html
DBusString
*
b
,
int
b_start
)
Tests two sub-parts of two
structDBusString.html
DBusString
for equality.
The specified range of the first string must exist; the specified start position of the second string must exist.
todo.html#_todo000071
Todo:
write a unit test
todo.html#_todo000071
Todo:
memcmp is probably faster
Parameters:
a
first string
a_start
where to start substring in first string
a_len
length of substring in first string
b
second string
b_start
where to start substring in second string
Returns:
group__DBusMacros.html#ga2
TRUE
if the two substrings are equal
Definition at line
dbus-string_8c-source.html#l02149
2149
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00078
DBUS_GENERIC_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_find
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
const char *
substr
,
int *
found
)
Finds the given substring in the string, returning
group__DBusMacros.html#ga2
TRUE
and filling in the byte index where the substring was found, if it was found.
Returns
group__DBusMacros.html#ga3
FALSE
if the substring wasn't found. Sets *start to the length of the string if the substring is not found.
Parameters:
str
the string
start
where to start looking
substr
the substring
found
return location for where it was found, or
group__DBusMacros.html#ga4
NULL
Returns:
group__DBusMacros.html#ga2
TRUE
if found
Definition at line
dbus-string_8c-source.html#l01783
1783
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l01810
_dbus_string_find_to()
.
Referenced by
dbus-keyring_8c-source.html#l00875
_dbus_keyring_validate_context()
,
dbus-string_8c-source.html#l01958
_dbus_string_pop_line()
, and
dbus-address_8c-source.html#l00320
dbus_parse_address()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_find_blank
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int *
found
)
Finds a blank (space or tab) in the string.
Returns
group__DBusMacros.html#ga2
TRUE
if found,
group__DBusMacros.html#ga3
FALSE
otherwise. If a blank is not found sets *found to the length of the string.
Parameters:
str
the string
start
byte index to start looking
found
place to store the location of the first blank
Returns:
group__DBusMacros.html#ga2
TRUE
if a blank was found
Definition at line
dbus-string_8c-source.html#l01878
1878
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-keyring_8c-source.html#l00875
_dbus_keyring_validate_context()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_find_byte_backward
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
unsigned char
byte
,
int *
found
)
Find the given byte scanning backward from the given start.
Sets *found to -1 if the byte is not found.
Parameters:
str
the string
start
the place to start scanning (will not find the byte at this point)
byte
the byte to find
found
return location for where it was found
Returns:
group__DBusMacros.html#ga2
TRUE
if found
Definition at line
dbus-string-util_8c-source.html#l00088
88
of file
dbus-string-util_8c-source.html
dbus-string-util.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-sysdeps-util_8c-source.html#l00708
_dbus_string_get_dirname()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_find_to
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
end
,
const char *
substr
,
int *
found
)
Finds the given substring in the string, up to a certain position, returning
group__DBusMacros.html#ga2
TRUE
and filling in the byte index where the substring was found, if it was found.
Returns
group__DBusMacros.html#ga3
FALSE
if the substring wasn't found. Sets *start to the length of the string if the substring is not found.
Parameters:
str
the string
start
where to start looking
end
where to stop looking
substr
the substring
found
return location for where it was found, or
group__DBusMacros.html#ga4
NULL
Returns:
group__DBusMacros.html#ga2
TRUE
if found
Definition at line
dbus-string_8c-source.html#l01810
1810
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-string_8c-source.html#l01783
_dbus_string_find()
, and
dbus-address_8c-source.html#l00320
dbus_parse_address()
.
void _dbus_string_free
(
structDBusString.html
DBusString
*
str
)
Frees a string created by
group__DBusString.html#ga6
_dbus_string_init()
.
Parameters:
str
memory where the string is stored.
Definition at line
dbus-string_8c-source.html#l00261
261
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string-private_8h-source.html#l00053
DBusRealString::align_offset
,
dbus-string-private_8h-source.html#l00050
DBusRealString::constant
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-string-private_8h-source.html#l00078
DBUS_GENERIC_STRING_PREAMBLE
,
dbus-string-private_8h-source.html#l00052
DBusRealString::invalid
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-auth_8c-source.html#l02021
_dbus_auth_client_new()
,
dbus-auth_8c-source.html#l01975
_dbus_auth_server_new()
,
dbus-auth_8c-source.html#l02074
_dbus_auth_unref()
,
dbus-sysdeps-util_8c-source.html#l00064
_dbus_become_daemon()
,
dbus-sysdeps_8c-source.html#l02447
_dbus_generate_random_bytes_buffer()
,
dbus-marshal-header_8c-source.html#l00481
_dbus_header_copy()
,
dbus-marshal-header_8c-source.html#l00467
_dbus_header_free()
,
dbus-keyring_8c-source.html#l00715
_dbus_keyring_new_homedir()
,
dbus-keyring_8c-source.html#l00689
_dbus_keyring_unref()
,
dbus-message_8c-source.html#l03173
_dbus_message_loader_unref()
,
dbus-server_8c-source.html#l00195
_dbus_server_finalize_base()
,
dbus-server_8c-source.html#l00114
_dbus_server_init_base()
,
dbus-server-unix_8c-source.html#l00315
_dbus_server_new_for_domain_socket()
,
dbus-server-unix_8c-source.html#l00395
_dbus_server_new_for_tcp_socket()
,
dbus-sha_8c-source.html#l00482
_dbus_sha_compute()
,
dbus-string_8c-source.html#l02356
_dbus_string_hex_decode()
,
dbus-string_8c-source.html#l02306
_dbus_string_hex_encode()
,
dbus-sysdeps_8c-source.html#l02120
_dbus_string_save_to_file()
,
dbus-transport-unix_8c-source.html#l01192
_dbus_transport_new_for_domain_socket()
,
dbus-transport-unix_8c-source.html#l01122
_dbus_transport_new_for_fd()
,
dbus-transport-unix_8c-source.html#l01259
_dbus_transport_new_for_tcp_socket()
,
dbus-transport_8c-source.html#l00212
_dbus_transport_open()
,
dbus-sysdeps-util_8c-source.html#l00348
_dbus_user_at_console()
,
dbus-address_8c-source.html#l00533
dbus_address_escape_value()
,
dbus-address_8c-source.html#l00566
dbus_address_unescape_value()
,
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-message_8c-source.html#l01022
dbus_message_copy()
,
dbus-message_8c-source.html#l01625
dbus_message_iter_get_signature()
,
dbus-message_8c-source.html#l00979
dbus_message_new_error_printf()
,
dbus-address_8c-source.html#l00320
dbus_parse_address()
,
dbus-server_8c-source.html#l00486
dbus_server_listen()
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
, and
dbus-signature_8c-source.html#l00092
dbus_signature_iter_get_signature()
.
char* _dbus_string_get_data_len
(
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Gets a sub-portion of the raw character buffer from the string.
The "len" field is required simply for error checking, to be sure you don't try to use more string than exists. The nul termination of the returned buffer remains at the end of the entire string, not at start + len.
Parameters:
str
the string
start
byte offset to return
len
length of segment to return
Returns:
the string data
Definition at line
dbus-string_8c-source.html#l00456
456
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
, and
dbus-string-private_8h-source.html#l00046
DBusRealString::str
.
Referenced by
dbus-marshal-header_8c-source.html#l01427
_dbus_header_toggle_flag()
,
dbus-marshal-byteswap_8c-source.html#l00220
_dbus_marshal_byteswap()
,
dbus-sysdeps_8c-source.html#l00191
_dbus_read()
,
dbus-sysdeps_8c-source.html#l01014
_dbus_string_append_int()
, and
dbus-sysdeps_8c-source.html#l01052
_dbus_string_append_uint()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_get_dirname
(
const
structDBusString.html
DBusString
*
filename
,
structDBusString.html
DBusString
*
dirname
)
Get the directory name from a complete filename.
Parameters:
filename
the filename
dirname
string to append directory name to
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-sysdeps-util_8c-source.html#l00708
708
of file
dbus-sysdeps-util_8c-source.html
dbus-sysdeps-util.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l00986
_dbus_string_append()
,
dbus-string_8c-source.html#l01567
_dbus_string_copy_len()
,
dbus-string-util_8c-source.html#l00088
_dbus_string_find_byte_backward()
, and
group__DBusMacros.html#ga4
NULL
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_hex_decode
(
const
structDBusString.html
DBusString
*
source
,
int
start
,
int *
end_return
,
structDBusString.html
DBusString
*
dest
,
int
insert_at
)
Decodes a string from hex encoding.
Parameters:
source
the string to decode
start
byte index to start decode
end_return
return location of the end of the hex data, or
group__DBusMacros.html#ga4
NULL
dest
string where decoded data should be placed
insert_at
where to place decoded data
Returns:
group__DBusMacros.html#ga2
TRUE
if decoding was successful,
group__DBusMacros.html#ga3
FALSE
if no memory.
Definition at line
dbus-string_8c-source.html#l02356
2356
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l01273
_dbus_string_append_byte()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-string_8c-source.html#l00174
_dbus_string_init()
,
dbus-string_8c-source.html#l01448
_dbus_string_move()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_hex_encode
(
const
structDBusString.html
DBusString
*
source
,
int
start
,
structDBusString.html
DBusString
*
dest
,
int
insert_at
)
Encodes a string in hex, the way MD5 and SHA-1 are usually encoded.
(Each byte is two hex digits.)
Parameters:
source
the string to encode
start
byte index to start encoding
dest
string where encoded data should be placed
insert_at
where to place encoded data
Returns:
group__DBusMacros.html#ga2
TRUE
if encoding was successful,
group__DBusMacros.html#ga3
FALSE
if no memory etc.
Definition at line
dbus-string_8c-source.html#l02306
2306
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l02272
_dbus_string_append_byte_as_hex()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-string_8c-source.html#l00174
_dbus_string_init()
,
dbus-string_8c-source.html#l01448
_dbus_string_move()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-keyring_8c-source.html#l01029
_dbus_keyring_get_hex_key()
,
dbus-server_8c-source.html#l00114
_dbus_server_init_base()
, and
dbus-sha_8c-source.html#l00482
_dbus_sha_compute()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_init
(
structDBusString.html
DBusString
*
str
)
Initializes a string.
The string starts life with zero length. The string must eventually be freed with
group__DBusString.html#ga9
_dbus_string_free()
.
Parameters:
str
memory to hold the string
Returns:
group__DBusMacros.html#ga2
TRUE
on success,
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-string_8c-source.html#l00174
174
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l00130
_dbus_string_init_preallocated()
.
Referenced by
dbus-auth_8c-source.html#l02021
_dbus_auth_client_new()
,
dbus-auth_8c-source.html#l01975
_dbus_auth_server_new()
,
dbus-sysdeps-util_8c-source.html#l00064
_dbus_become_daemon()
,
dbus-sysdeps_8c-source.html#l02447
_dbus_generate_random_bytes_buffer()
,
dbus-keyring_8c-source.html#l00715
_dbus_keyring_new_homedir()
,
dbus-message_8c-source.html#l03123
_dbus_message_loader_new()
,
dbus-server_8c-source.html#l00114
_dbus_server_init_base()
,
dbus-server-unix_8c-source.html#l00315
_dbus_server_new_for_domain_socket()
,
dbus-server-unix_8c-source.html#l00395
_dbus_server_new_for_tcp_socket()
,
dbus-sha_8c-source.html#l00482
_dbus_sha_compute()
,
dbus-string_8c-source.html#l02356
_dbus_string_hex_decode()
,
dbus-string_8c-source.html#l02306
_dbus_string_hex_encode()
,
dbus-sysdeps_8c-source.html#l02120
_dbus_string_save_to_file()
,
dbus-string_8c-source.html#l00607
_dbus_string_steal_data()
,
dbus-transport-unix_8c-source.html#l01192
_dbus_transport_new_for_domain_socket()
,
dbus-transport-unix_8c-source.html#l01122
_dbus_transport_new_for_fd()
,
dbus-transport-unix_8c-source.html#l01259
_dbus_transport_new_for_tcp_socket()
,
dbus-sysdeps-util_8c-source.html#l00348
_dbus_user_at_console()
,
dbus-address_8c-source.html#l00533
dbus_address_escape_value()
,
dbus-address_8c-source.html#l00566
dbus_address_unescape_value()
,
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-message_8c-source.html#l01625
dbus_message_iter_get_signature()
,
dbus-message_8c-source.html#l00979
dbus_message_new_error_printf()
,
dbus-address_8c-source.html#l00320
dbus_parse_address()
,
dbus-server_8c-source.html#l00486
dbus_server_listen()
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
, and
dbus-signature_8c-source.html#l00092
dbus_signature_iter_get_signature()
.
void _dbus_string_init_const
(
structDBusString.html
DBusString
*
str
,
const char *
value
)
Initializes a constant string.
The value parameter is not copied (should be static), and the string may never be modified. It is safe but not necessary to call
group__DBusString.html#ga9
_dbus_string_free()
on a const string. The string has a length limit of MAXINT - 8.
Parameters:
str
memory to use for the string
value
a string to be stored in str (not copied!!!)
Definition at line
dbus-string_8c-source.html#l00208
208
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l00228
_dbus_string_init_const_len()
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-keyring_8c-source.html#l00715
_dbus_keyring_new_homedir()
,
dbus-server-unix_8c-source.html#l00315
_dbus_server_new_for_domain_socket()
,
dbus-server-unix_8c-source.html#l00395
_dbus_server_new_for_tcp_socket()
,
dbus-transport_8c-source.html#l00212
_dbus_transport_open()
,
dbus-address_8c-source.html#l00533
dbus_address_escape_value()
,
dbus-address_8c-source.html#l00566
dbus_address_unescape_value()
,
dbus-errors_8c-source.html#l00260
dbus_error_has_name()
,
dbus-message_8c-source.html#l02220
dbus_message_iter_open_container()
,
dbus-address_8c-source.html#l00320
dbus_parse_address()
,
dbus-server_8c-source.html#l00486
dbus_server_listen()
, and
dbus-signature_8c-source.html#l00207
dbus_signature_validate()
.
void _dbus_string_init_const_len
(
structDBusString.html
DBusString
*
str
,
const char *
value
,
int
len
)
Initializes a constant string with a length.
The value parameter is not copied (should be static), and the string may never be modified. It is safe but not necessary to call
group__DBusString.html#ga9
_dbus_string_free()
on a const string.
Parameters:
str
memory to use for the string
value
a string to be stored in str (not copied!!!)
len
the length to use
Definition at line
dbus-string_8c-source.html#l00228
228
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00071
_DBUS_STRING_MAX_MAX_LENGTH
,
dbus-string-private_8h-source.html#l00053
DBusRealString::align_offset
,
dbus-string-private_8h-source.html#l00048
DBusRealString::allocated
,
dbus-string-private_8h-source.html#l00050
DBusRealString::constant
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00052
DBusRealString::invalid
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00051
DBusRealString::locked
,
dbus-string-private_8h-source.html#l00049
DBusRealString::max_length
,
group__DBusMacros.html#ga4
NULL
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-server_8c-source.html#l00114
_dbus_server_init_base()
, and
dbus-string_8c-source.html#l00208
_dbus_string_init_const()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_init_preallocated
(
structDBusString.html
DBusString
*
str
,
int
allocate_size
)
Initializes a string that can be up to the given allocation size before it has to realloc.
The string starts life with zero length. The string must eventually be freed with
group__DBusString.html#ga9
_dbus_string_free()
.
Parameters:
str
memory to hold the string
allocate_size
amount to preallocate
Returns:
group__DBusMacros.html#ga2
TRUE
on success,
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-string_8c-source.html#l00130
130
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00071
_DBUS_STRING_MAX_MAX_LENGTH
,
dbus-string-private_8h-source.html#l00053
DBusRealString::align_offset
,
dbus-string-private_8h-source.html#l00048
DBusRealString::allocated
,
dbus-string-private_8h-source.html#l00050
DBusRealString::constant
,
dbus-memory_8c-source.html#l00437
dbus_malloc()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00052
DBusRealString::invalid
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00051
DBusRealString::locked
,
dbus-string-private_8h-source.html#l00049
DBusRealString::max_length
,
group__DBusMacros.html#ga4
NULL
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-marshal-header_8c-source.html#l00481
_dbus_header_copy()
,
dbus-marshal-header_8c-source.html#l00450
_dbus_header_init()
,
dbus-string_8c-source.html#l00174
_dbus_string_init()
, and
dbus-message_8c-source.html#l01022
dbus_message_copy()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_insert_2_aligned
(
structDBusString.html
DBusString
*
str
,
int
insert_at
,
const unsigned char
octets
[4]
)
Inserts 2 bytes aligned on a 2 byte boundary with any alignment padding initialized to 0.
Parameters:
str
the
structDBusString.html
DBusString
insert_at
where to insert
octets
2 bytes to insert
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory.
Definition at line
dbus-string_8c-source.html#l01091
1091
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l01002
ASSIGN_2_OCTETS
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_insert_4_aligned
(
structDBusString.html
DBusString
*
str
,
int
insert_at
,
const unsigned char
octets
[4]
)
Inserts 4 bytes aligned on a 4 byte boundary with any alignment padding initialized to 0.
Parameters:
str
the
structDBusString.html
DBusString
insert_at
where to insert
octets
4 bytes to insert
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory.
Definition at line
dbus-string_8c-source.html#l01115
1115
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string_8c-source.html#l01006
ASSIGN_4_OCTETS
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_insert_8_aligned
(
structDBusString.html
DBusString
*
str
,
int
insert_at
,
const unsigned char
octets
[8]
)
Inserts 8 bytes aligned on an 8 byte boundary with any alignment padding initialized to 0.
Parameters:
str
the
structDBusString.html
DBusString
insert_at
where to insert
octets
8 bytes to insert
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory.
Definition at line
dbus-string_8c-source.html#l01139
1139
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l01011
ASSIGN_8_OCTETS
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_insert_alignment
(
structDBusString.html
DBusString
*
str
,
int *
insert_at
,
int
alignment
)
Inserts padding at *insert_at such to align it to the given boundary.
Initializes the padding to nul bytes. Sets *insert_at to the aligned position.
Parameters:
str
the
structDBusString.html
DBusString
insert_at
location to be aligned
alignment
alignment boundary (1, 2, 4, or 8)
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory.
Definition at line
dbus-string_8c-source.html#l01167
1167
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_insert_byte
(
structDBusString.html
DBusString
*
str
,
int
i
,
unsigned char
byte
)
Inserts a single byte at the given position.
Parameters:
str
the string
i
the position
byte
the value to insert
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-string_8c-source.html#l00580
580
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-marshal-basic_8c-source.html#l00844
_dbus_marshal_write_basic()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_insert_bytes
(
structDBusString.html
DBusString
*
str
,
int
i
,
int
n_bytes
,
unsigned char
byte
)
Inserts a number of bytes of a given value at the given position.
Parameters:
str
the string
i
the position
n_bytes
number of bytes
byte
the value to insert
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-string_8c-source.html#l00550
550
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_lengthen
(
structDBusString.html
DBusString
*
str
,
int
additional_length
)
Makes a string longer by the given number of bytes.
Checks whether adding additional_length to the current length would overflow an integer, and checks for exceeding a string's max length. The new bytes are not initialized, other than nul-terminating the end of the string. The uninitialized bytes may contain nul bytes or other junk.
Parameters:
str
a string
additional_length
length to add to the string.
Returns:
group__DBusMacros.html#ga2
TRUE
on success.
Definition at line
dbus-string_8c-source.html#l00811
811
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
, and
dbus-string-private_8h-source.html#l00049
DBusRealString::max_length
.
Referenced by
dbus-sysdeps_8c-source.html#l00191
_dbus_read()
,
dbus-string_8c-source.html#l00950
_dbus_string_alloc_space()
,
dbus-sysdeps_8c-source.html#l01014
_dbus_string_append_int()
,
dbus-string_8c-source.html#l01191
_dbus_string_append_printf_valist()
, and
dbus-sysdeps_8c-source.html#l01052
_dbus_string_append_uint()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_move
(
structDBusString.html
DBusString
*
source
,
int
start
,
structDBusString.html
DBusString
*
dest
,
int
insert_at
)
Moves the end of one string into another string.
Both strings must be initialized, valid strings.
Parameters:
source
the source string
start
where to chop off the source string
dest
the destination string
insert_at
where to move the chopped-off part of source string
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-string_8c-source.html#l01448
1448
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l01500
_dbus_string_move_len()
, and
dbus-string-private_8h-source.html#l00047
DBusRealString::len
.
Referenced by
dbus-string_8c-source.html#l02356
_dbus_string_hex_decode()
, and
dbus-string_8c-source.html#l02306
_dbus_string_hex_encode()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_move_len
(
structDBusString.html
DBusString
*
source
,
int
start
,
int
len
,
structDBusString.html
DBusString
*
dest
,
int
insert_at
)
Like
group__DBusString.html#ga39
_dbus_string_move()
, but can move a segment from the middle of the source string.
todo.html#_todo000066
Todo:
this doesn't do anything with max_length field.
we should probably just kill the max_length field though.
Parameters:
source
the source string
start
first byte of source string to move
len
length of segment to move
dest
the destination string
insert_at
where to move the bytes from the source string
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-string_8c-source.html#l01500
1500
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l01424
DBUS_STRING_COPY_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-string_8c-source.html#l01448
_dbus_string_move()
, and
dbus-string_8c-source.html#l01958
_dbus_string_pop_line()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_parse_int
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
long *
value_return
,
int *
end_return
)
Parses an integer contained in a
structDBusString.html
DBusString
.
Either return parameter may be
group__DBusMacros.html#ga4
NULL
if you aren't interested in it. The integer is parsed and stored in value_return. Return parameters are not initialized if the function returns
group__DBusMacros.html#ga3
FALSE
.
Parameters:
str
the string
start
the byte index of the start of the integer
value_return
return location of the integer value or
group__DBusMacros.html#ga4
NULL
end_return
return location of the end of the integer, or
group__DBusMacros.html#ga4
NULL
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-sysdeps_8c-source.html#l01134
1134
of file
dbus-sysdeps_8c-source.html
dbus-sysdeps.c
.
References
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-userdb_8c-source.html#l00077
_dbus_is_a_number()
,
dbus-sysdeps_8c-source.html#l02819
_dbus_parse_uid()
,
dbus-transport_8c-source.html#l00212
_dbus_transport_open()
, and
dbus-server_8c-source.html#l00486
dbus_server_listen()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_pop_line
(
structDBusString.html
DBusString
*
source
,
structDBusString.html
DBusString
*
dest
)
Assigns a newline-terminated or \r\n-terminated line from the front of the string to the given dest string.
The dest string's previous contents are deleted. If the source string contains no newline, moves the entire source string to the dest string.
todo.html#_todo000069
Todo:
owen correctly notes that this is a stupid function (it was written purely for test code, e.g.
dbus-message-builder.c). Probably should be enforced as test code only with ifdef DBUS_BUILD_TESTS
Parameters:
source
the source string
dest
the destination string (contents are replaced)
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory, or source has length 0
Definition at line
dbus-string_8c-source.html#l01958
1958
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l01783
_dbus_string_find()
,
dbus-string_8c-source.html#l01500
_dbus_string_move_len()
,
dbus-string_8c-source.html#l00853
_dbus_string_set_length()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_replace_len
(
const
structDBusString.html
DBusString
*
source
,
int
start
,
int
len
,
structDBusString.html
DBusString
*
dest
,
int
replace_at
,
int
replace_len
)
Replaces a segment of dest string with a segment of source string.
todo.html#_todo000067
Todo:
optimize the case where the two lengths are the same, and avoid memmoving the data in the trailing part of the string twice.
todo.html#_todo000067
Todo:
avoid inserting the source into dest, then deleting the replaced chunk of dest (which creates a potentially large intermediate string).
Instead, extend the replaced chunk of dest with padding to the same size as the source chunk, then copy in the source bytes.
Parameters:
source
the source string
start
where to start copying the source string
len
length of segment to copy
dest
the destination string
replace_at
start of segment of dest string to replace
replace_len
length of segment of dest string to replace
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-string_8c-source.html#l01605
1605
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l01424
DBUS_STRING_COPY_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-auth_8c-source.html#l02487
_dbus_auth_set_context()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_set_length
(
structDBusString.html
DBusString
*
str
,
int
length
)
Sets the length of a string.
Can be used to truncate or lengthen the string. If the string is lengthened, the function may fail and return
group__DBusMacros.html#ga3
FALSE
. Newly-added bytes are not initialized, as with
group__DBusString.html#ga19
_dbus_string_lengthen()
.
Parameters:
str
a string
length
new length of the string.
Returns:
group__DBusMacros.html#ga3
FALSE
on failure.
Definition at line
dbus-string_8c-source.html#l00853
853
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
, and
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
.
Referenced by
dbus-address_8c-source.html#l00187
_dbus_address_append_escaped()
,
dbus-auth_8c-source.html#l02300
_dbus_auth_delete_unused_bytes()
,
dbus-sysdeps-util_8c-source.html#l00504
_dbus_directory_get_next_file()
,
dbus-sysdeps_8c-source.html#l02014
_dbus_file_get_contents()
,
dbus-sysdeps_8c-source.html#l02479
_dbus_generate_random_bytes()
,
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
,
dbus-marshal-header_8c-source.html#l00430
_dbus_header_reinit()
,
dbus-keyring_8c-source.html#l00715
_dbus_keyring_new_homedir()
,
dbus-message_8c-source.html#l03123
_dbus_message_loader_new()
,
dbus-sysdeps_8c-source.html#l00191
_dbus_read()
,
dbus-string_8c-source.html#l02272
_dbus_string_append_byte_as_hex()
, and
dbus-string_8c-source.html#l01958
_dbus_string_pop_line()
.
void _dbus_string_shorten
(
structDBusString.html
DBusString
*
str
,
int
length_to_remove
)
Makes a string shorter by the given number of bytes.
Parameters:
str
a string
length_to_remove
length to remove from the string.
Definition at line
dbus-string_8c-source.html#l00831
831
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
, and
dbus-string-private_8h-source.html#l00047
DBusRealString::len
.
Referenced by
dbus-sysdeps_8c-source.html#l02363
_dbus_concat_dir_and_file()
,
dbus-string_8c-source.html#l00950
_dbus_string_alloc_space()
,
dbus-sysdeps_8c-source.html#l01014
_dbus_string_append_int()
, and
dbus-sysdeps_8c-source.html#l01052
_dbus_string_append_uint()
.
void _dbus_string_skip_blank
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int *
end
)
Skips blanks from start, storing the first non-blank in *end (blank is space or tab).
Parameters:
str
the string
start
where to start
end
where to store the first non-blank byte index
Definition at line
dbus-string_8c-source.html#l01916
1916
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
, and
dbus-string-private_8h-source.html#l00046
DBusRealString::str
.
void _dbus_string_skip_white
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int *
end
)
Skips whitespace from start, storing the first non-whitespace in *end.
(whitespace is space, tab, newline, CR).
Parameters:
str
the string
start
where to start
end
where to store the first non-whitespace byte index
Definition at line
dbus-string-util_8c-source.html#l00123
123
of file
dbus-string-util_8c-source.html
dbus-string-util.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
, and
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_steal_data
(
structDBusString.html
DBusString
*
str
,
char **
data_return
)
Like _dbus_string_get_data(), but removes the gotten data from the original string.
The caller must free the data returned. This function may fail due to lack of memory, and return
group__DBusMacros.html#ga3
FALSE
.
Parameters:
str
the string
data_return
location to return the buffer
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-string_8c-source.html#l00607
607
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l00174
_dbus_string_init()
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00049
DBusRealString::max_length
,
group__DBusMacros.html#ga4
NULL
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-address_8c-source.html#l00533
dbus_address_escape_value()
,
dbus-address_8c-source.html#l00566
dbus_address_unescape_value()
,
dbus-message_8c-source.html#l01625
dbus_message_iter_get_signature()
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
, and
dbus-signature_8c-source.html#l00092
dbus_signature_iter_get_signature()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_validate_ascii
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is valid ASCII with no nul bytes.
If the given range is not entirely contained in the string, returns
group__DBusMacros.html#ga3
FALSE
.
todo.html#_todo000073
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is all valid ASCII
Definition at line
dbus-string_8c-source.html#l02497
2497
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-sysdeps_8c-source.html#l02523
_dbus_generate_random_ascii()
, and
dbus-keyring_8c-source.html#l00875
_dbus_keyring_validate_context()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_validate_nul
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is all nul bytes.
If the given range is not entirely contained in the string, returns
group__DBusMacros.html#ga3
FALSE
.
todo.html#_todo000075
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is all nul bytes
Definition at line
dbus-string_8c-source.html#l02638
2638
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_string_validate_utf8
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is valid UTF-8.
If the given range is not entirely contained in the string, returns
group__DBusMacros.html#ga3
FALSE
. If the string contains any nul bytes in the given range, returns
group__DBusMacros.html#ga3
FALSE
. If the start and start+len are not on character boundaries, returns
group__DBusMacros.html#ga3
FALSE
.
todo.html#_todo000074
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is all valid UTF-8
Definition at line
dbus-string_8c-source.html#l02540
2540
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string-private_8h-source.html#l00107
DBUS_CONST_STRING_PREAMBLE
,
group__DBusMacros.html#ga3
FALSE
,
dbus-string-private_8h-source.html#l00047
DBusRealString::len
,
dbus-string-private_8h-source.html#l00046
DBusRealString::str
,
group__DBusMacros.html#ga2
TRUE
,
dbus-string_8c-source.html#l01713
UNICODE_VALID
,
dbus-string_8c-source.html#l01638
UTF8_COMPUTE
,
dbus-string_8c-source.html#l01695
UTF8_GET
, and
dbus-string_8c-source.html#l01679
UTF8_LENGTH
.
void _dbus_string_zero
(
structDBusString.html
DBusString
*
str
)
Clears all allocated bytes in the string to zero.
Parameters:
str
the string
Definition at line
dbus-string_8c-source.html#l02670
2670
of file
dbus-string_8c-source.html
dbus-string.c
.
References
dbus-string-private_8h-source.html#l00053
DBusRealString::align_offset
,
dbus-string-private_8h-source.html#l00048
DBusRealString::allocated
,
dbus-string-private_8h-source.html#l00086
DBUS_STRING_PREAMBLE
, and
dbus-string-private_8h-source.html#l00046
DBusRealString::str
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
