Top | ![]() |
![]() |
![]() |
![]() |
gint64 camel_util_bdata_get_number (gchar **bdata_ptr
,gint64 default_value
);
Reads a numeric data from the bdata_ptr
and moves the bdata_ptr
after that number. If the number cannot be read, then the default_value
is returned instead and the bdata_ptr
is left unchanged. The number
might be previously stored with the camel_util_bdata_put_number()
.
bdata_ptr |
a backend specific data (bdata) pointer |
|
default_value |
a value to return, when no data can be read |
Since: 3.24
void camel_util_bdata_put_number (GString *bdata_str
,gint64 value
);
Puts the number value
at the end of the bdata_str
. In case the bdata_str
is not empty a space is added before the numeric value
. The stored value
can be read back with the camel_util_bdata_get_number()
.
Since: 3.24
gchar * camel_util_bdata_get_string (gchar **bdata_ptr
,const gchar *default_value
);
Reads a string data from the bdata_ptr
and moves the bdata_ptr
after that string. If the string cannot be read, then the default_value
is returned instead and the bdata_ptr
is left unchanged. The string
might be previously stored with the camel_util_bdata_put_string()
.
bdata_ptr |
a backend specific data (bdata) pointer |
|
default_value |
a value to return, when no data can be read |
Newly allocated string, which was read, or
dupped the default_value
, if the bdata_ptr
doesn't point to a string.
Free returned pointer with g_free()
when done with it.
[transfer full]
Since: 3.24
void camel_util_bdata_put_string (GString *bdata_str
,const gchar *value
);
Puts the string value
at the end of the bdata_str
. In case the bdata_str
is not empty a space is added before the string value
. The stored value
can be read back with the camel_util_bdata_get_string()
.
The strings are encoded as "length-value", quotes for clarity only.
Since: 3.24
time_t camel_time_value_apply (time_t src_time
,CamelTimeUnit unit
,gint value
);
Applies the given time value
in unit unit
to the src_time
.
Use negative value to subtract it. The time part is rounded
to the beginning of the day.
src_time |
a time_t to apply the value to, or -1 to use the current time |
|
unit |
||
value |
a value to apply |
src_time
modified by the given parameters as date, with
the time part being beginning of the day.
Since: 3.24
GWeakRef *
camel_utils_weak_ref_new (gpointer object
);
Allocates a new GWeakRef and calls g_weak_ref_set()
with object
.
Free the returned GWeakRef with camel_utils_weak_ref_free()
.
[skip]
Since: 3.40
void
camel_utils_weak_ref_free (GWeakRef *weak_ref
);
Frees a GWeakRef created by camel_utils_weak_ref_new()
.
[skip]
Since: 3.40
gboolean camel_util_fill_message_info_user_headers (CamelMessageInfo *info
,const CamelNameValueArray *headers
);
Fill info
's user-headers with the user-defined headers from
the headers
array.
Since: 3.42
gchar * camel_util_encode_user_header_setting (const gchar *display_name
,const gchar *header_name
);
Encode the optional display_name
and the header_name
to a value suitable
for GSettings schema org.gnome.evolution-data-server and key camel-message-info-user-headers.
Free the returned string with g_free()
, when no longer needed.
display_name |
display name for the header name, or |
[nullable] |
header_name |
the header name |
Since: 3.42
void camel_util_decode_user_header_setting (const gchar *setting_value
,gchar **out_display_name
,const gchar **out_header_name
);
Decode the values previously encoded by camel_util_encode_user_header_setting()
.
The out_header_name
points to the setting_value
, thus it's valid as long
as the setting_value
is valid and unchanged.
The out_header_name
can result in NULL
when the setting_value
contains invalid data.
The out_display_name
can result in NULL
when the setting_value
does not contain the display name. In such case the header name can
be used as the display name.
setting_value |
the value to decode |
|
out_display_name |
location for the decoded display name, or |
[out][transfer full][nullable] |
out_header_name |
the location for the decoded header name. |
[out] |
Since: 3.42