Top | ![]() |
![]() |
![]() |
![]() |
constgchar * e_get_user_cache_dir (void
);
Returns a base directory in which to store user-specific, non-essential cached data for Evolution or Evolution-Data-Server.
The returned string is owned by libedataserver and must not be modified or freed.
Since: 2.32
constgchar * e_get_user_config_dir (void
);
Returns a base directory in which to store user-specific configuration information for Evolution or Evolution-Data-Server.
The returned string is owned by libedataserver and must not be modified or freed.
Since: 2.32
constgchar * e_get_user_data_dir (void
);
Returns a base directory in which to store user-specific data for Evolution or Evolution-Data-Server.
The returned string is owned by libedataserver and must not be modified or freed.
Since: 2.32
gboolean e_util_strv_equal (,
gconstpointer v1);
gconstpointer v2
Compares v1
and v2
for equality, handling NULL
The arguments types are generic for compatibility with
v1 |
a |
[allow-none] |
v2 |
another |
[allow-none] |
Since: 3.12
gchar * e_util_strdup_strip (const
);gchar *string
Duplicates string
and strips off any leading or trailing whitespace.
The resulting string is returned unless it is empty or NULL
NULL
Free the returned string with g_free()
Since: 3.6
gchar * e_util_strstrcase (const
,gchar *haystackconst
);gchar *needle
Find the first instance of needle
in haystack
, ignoring case for
bytes that are ASCII characters.
gchar * e_util_unicode_get_utf8 (const
,gchar *text);
gunichar *out
Get a UTF-8 character from the beginning of text
.
constgchar * e_util_utf8_strstrcase (const
,gchar *haystackconst
);gchar *needle
Find the first instance of needle
in haystack
, ignoring case. (No
proper case folding or decomposing is done.) Both needle
and
haystack
are UTF-8 strings.
constgchar * e_util_utf8_strstrcasedecomp (const
,gchar *haystackconst
);gchar *needle
Find the first instance of needle
in haystack
, where both needle
and haystack
are UTF-8 strings. Both strings are stripped and
decomposed for comparison, and case is ignored.
gint e_util_utf8_strcasecmp (const
,gchar *s1const
);gchar *s2
Compares two UTF-8 strings using approximate case-insensitive ordering.
gchar * e_util_utf8_remove_accents (const
);gchar *str
Returns a newly-allocated copy of str
with accents removed.
Since: 2.28
gchar * e_util_utf8_make_valid (const
);gchar *str
Returns a newly-allocated copy of str
, with invalid characters
replaced by Unicode replacement characters (U+FFFD).
For NULL
str
returns newly allocated empty string ("").
Since: 3.0
gchar * e_util_utf8_data_make_valid (const
,gchar *data);
gsize data_bytes
Returns a newly-allocated NULL-terminated string with invalid characters
replaced by Unicode replacement characters (U+FFFD).
For NULL
data
returns newly allocated empty string ("").
Since: 3.6
gchar * e_util_utf8_normalize (const
);gchar *str
Normalizes str
by making it all lower case and removing any accents from it.
Since: 3.8
constgchar * e_util_ensure_gdbus_string (const
,gchar *str);
gchar **gdbus_str
If str
is a valid UTF-8 string, the function returns str
and does
not set gdbus_str
.
If str
is an invalid UTF-8 string, the function calls
e_util_utf8_make_valid()
and points gdbus_str
to the newly-allocated,
valid UTF-8 string, and also returns it. The caller should free the
string pointed to by gdbus_str
with g_free()
If str
is NULL
gdbus_str
.
Admittedly, the function semantics are a little awkward. The example
below illustrates the easiest way to cope with the gdbus_str
argument:
const gchar *trusted_utf8; gchar *allocated = NULL; trusted_utf8 = e_util_ensure_gdbus_string (untrusted_utf8, &allocated); Do stuff with trusted_utf8, then clear it. trusted_utf8 = NULL; g_free (allocated); allocated = NULL;
str |
a possibly invalid UTF-8 string, or |
|
gdbus_str |
return location for the corrected string |
Since: 3.0
guint64 e_util_gthread_id ();
GThread *thread
Returns a 64-bit integer hopefully uniquely identifying the thread. To be used in debugging output and logging only. The returned value is just a cast of a pointer to the 64-bit integer.
There is no guarantee that calling e_util_gthread_id()
on one
thread first and later after that thread has dies on another won't
return the same integer.
On Linux and Win32, known to really return a unique id for each thread existing at a certain time. No guarantee that ids won't be reused after a thread has terminated, though.
Since: 2.32
gchar * e_filename_mkdir_encoded (const
,gchar *basepathconst
,gchar *fileprefixconst
,gchar *filename);
gint fileindex
Creates a local path constructed from basepath
/ fileprefix
+ "-" + filename
,
and makes sure the path basepath
exists. If creation of
the path fails, then NULL is returned.
basepath |
base path of a file name; this is left unchanged |
|
fileprefix |
prefix for the filename; this is encoded |
|
filename |
file name to use; this is encoded; can be |
|
fileindex |
used when |
Full local path like g_build_filename()
fileprefix
and filename
are encoded to create a proper file elements for
a file system. Free returned pointer with g_free()
Since: 3.4
gsize e_utf8_strftime (,
gchar *string,
gsize maxconst
,gchar *fmtconst struct tm *tm
);
The UTF-8 equivalent of e_strftime()
.
gsize e_strftime (,
gchar *string,
gsize maxconst
,gchar *fmtconst struct tm *tm
);
This function is a wrapper around the strftime (3) function, which converts the %l and %k (12h and 24h) format variables if necessary.
gchar ** e_util_slist_to_strv (const
);GSList *strings
Convert list of strings into NULL-terminates array of strings.
Newly allocated NULL
g_strfreev()
Note: Pair function for this is e_util_strv_to_slist()
.
[transfer full]
Since: 3.4
GSList * e_util_strv_to_slist (const
);gchar * const *strv
Convert NULL-terminated array of strings to a list of strings.
Newly allocated e_util_free_string_slist()
.
Note: Pair function for this is e_util_slist_to_strv()
.
[transfer full][element-type utf8]
Since: 3.4
void e_util_free_nullable_object_slist ();
GSList *objects
Calls g_object_unref()
objects
if non-NULL
objects
itself.
Since: 3.6
void e_util_safe_free_string ();
gchar *str
Calls g_free()
string
, but before it rewrites its content with zeros.
This is suitable to free strings with passwords.
Since: 3.16
void e_queue_transfer (,
GQueue *src_queue);
GQueue *dst_queue
Transfers the contents of src_queue
to the tail of dst_queue
.
When the operation is complete, src_queue
will be empty.
Since: 3.8
GWeakRef * e_weak_ref_new ();
gpointer object
Allocates a new g_weak_ref_set()
object
.
Free the returned e_weak_ref_free()
.
[skip]
Since: 3.10
void e_weak_ref_free ();
GWeakRef *weak_ref
Frees a e_weak_ref_new()
.
[skip]
Since: 3.10
gboolean e_file_recursive_delete_sync (,
GFile *file,
GCancellable *cancellable);
GError **error
Deletes file
. If file
is a directory, its contents are deleted
recursively before file
itself is deleted. The recursive delete
operation will stop on the first error.
If cancellable
is not NULL
file |
a |
|
cancellable |
optional |
|
error |
return location for a |
Since: 3.6
void e_file_recursive_delete (,
GFile *file,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback);
gpointer user_data
Asynchronously deletes file
. If file
is a directory, its contents
are deleted recursively before file
itself is deleted. The recursive
delete operation will stop on the first error.
If cancellable
is not NULL
When the operation is finished, callback
will be called. You can then
call e_file_recursive_delete_finish()
to get the result of the operation.
file |
a |
|
io_priority |
the I/O priority of the request |
|
cancellable |
optional |
|
callback |
a |
|
user_data |
data to pass to the callback function |
Since: 3.6
gboolean e_file_recursive_delete_finish (,
GFile *file,
GAsyncResult *result);
GError **error
Finishes the operation started with e_file_recursive_delete()
.
If the operation was cancelled, the error
file |
a |
|
result |
a |
[transfer full] |
error |
return location for a |
Since: 3.6
GBinding * e_binding_bind_property (,
gpointer sourceconst
,gchar *source_property,
gpointer targetconst
,gchar *target_property);
GBindingFlags flags
Thread safe variant of g_object_bind_property()
source |
the source |
[type GObject.Object] |
source_property |
the property on |
|
target |
the target |
[type GObject.Object] |
target_property |
the property on |
|
flags |
flags to pass to |
Since: 3.16
GBinding * e_binding_bind_property_full (,
gpointer sourceconst
,gchar *source_property,
gpointer targetconst
,gchar *target_property,
GBindingFlags flags,
GBindingTransformFunc transform_to,
GBindingTransformFunc transform_from,
gpointer user_data);
GDestroyNotify notify
Thread safe variant of g_object_bind_property_full()
source |
the source |
[type GObject.Object] |
source_property |
the property on |
|
target |
the target |
[type GObject.Object] |
target_property |
the property on |
|
flags |
flags to pass to |
|
transform_to |
the transformation function
from the |
[scope notified][allow-none] |
transform_from |
the transformation function
from the |
[scope notified][allow-none] |
user_data |
custom data to be passed to the transformation functions,
or |
|
notify |
function to be called when disposing the binding, to free the resources used by the transformation functions |
the
[transfer none]
Since: 3.16
GBinding * e_binding_bind_property_with_closures (,
gpointer sourceconst
,gchar *source_property,
gpointer targetconst
,gchar *target_property,
GBindingFlags flags,
GClosure *transform_to);
GClosure *transform_from
Thread safe variant of g_object_bind_property_with_closures()
[rename-to e_binding_bind_property_full]
source |
the source |
[type GObject.Object] |
source_property |
the property on |
|
target |
the target |
[type GObject.Object] |
target_property |
the property on |
|
flags |
flags to pass to |
|
transform_to |
a |
|
transform_from |
a |
the
[transfer none]
Since: 3.16
gboolean e_binding_transform_enum_value_to_nick (,
GBinding *bindingconst
,GValue *source_value,
GValue *target_value);
gpointer not_used
Transforms an enumeration value to its corresponding nickname.
binding |
a |
|
source_value |
a |
|
target_value |
a |
|
not_used |
not used |
Since: 3.4
gboolean e_binding_transform_enum_nick_to_value (,
GBinding *bindingconst
,GValue *source_value,
GValue *target_value);
gpointer not_used
Transforms an enumeration nickname to its corresponding value.
binding |
a |
|
source_value |
a |
|
target_value |
a |
|
not_used |
not used |
Since: 3.4
gboolean e_enum_from_string (,
GType enum_typeconst
,gchar *string);
gint *enum_value
Fetches the appropriate enumeration value for string
in the given
enum type type
and stores the result in enum_value
enum_type |
The enum type |
|
string |
The string containing the enum value or nick |
|
enum_value |
A return location to store the result |
TRUE
type
, FALSE
Since: 3.8
constgchar * e_enum_to_string (,
GType enum_type);
gint enum_value
Converts an enum value to a string using strings from the GType system.
Since: 3.8
EAsyncClosure *
e_async_closure_new (void
);
Creates a new EAsyncClosure for use with asynchronous functions.
[skip]
Since: 3.6
GAsyncResult * e_async_closure_wait (EAsyncClosure *closure
);
Call this function immediately after starting an asynchronous operation.
The function waits for the asynchronous operation to complete and returns
its
This function can be called repeatedly on the same EAsyncClosure to easily string together multiple asynchronous operations.
[skip]
Since: 3.6
void e_async_closure_free (EAsyncClosure *closure
);
Frees the closure
and the resources it holds.
[skip]
Since: 3.6
void e_async_closure_callback (,
GObject *object,
GAsyncResult *result);
gpointer closure
Pass this function as the
This causes e_async_closure_wait()
to terminate and return result
.
[skip]
object |
a |
|
result |
a |
|
closure |
Since: 3.6
gchar * e_util_replace_prefix (const
,gchar *configure_time_prefixconst
,gchar *runtime_prefixconst
);gchar *configure_time_path
void e_util_win32_initialize (void
);
Initializes win32 environment. This might be called in main()
ENamedParameters *
e_named_parameters_new (void
);
Creates a new instance of an ENamedParameters. This should be freed
with e_named_parameters_free()
, when no longer needed. Names are
compared case insensitively.
The structure is not thread safe, if the caller requires thread safety, then it should provide it on its own.
Since: 3.8
ENamedParameters *
e_named_parameters_new_strv (const gchar * const *strv
);
Creates a new instance of an ENamedParameters, with initial content
being taken from strv
. This should be freed with e_named_parameters_free()
,
when no longer needed. Names are compared case insensitively.
The structure is not thread safe, if the caller requires thread safety, then it should provide it on its own.
strv |
NULL-terminated string array to be used as a content of a newly created ENamedParameters |
Since: 3.8
ENamedParameters *
e_named_parameters_new_string (const gchar *str
);
Creates a new instance of an str
. This should be freed with e_named_parameters_free()
,
when no longer needed. Names are compared case insensitively.
The str
should be created with e_named_parameters_to_string()
, to be
properly encoded.
The structure is not thread safe, if the caller requires thread safety, then it should provide it on its own.
Since: 3.18
ENamedParameters *
e_named_parameters_new_clone (const ENamedParameters *parameters
);
Creates a new instance of an ENamedParameters, with initial content
being taken from parameters
. This should be freed with e_named_parameters_free()
,
when no longer needed. Names are compared case insensitively.
The structure is not thread safe, if the caller requires thread safety, then it should provide it on its own.
parameters |
an ENamedParameters to be used as a content of a newly created ENamedParameters |
Since: 3.16
void e_named_parameters_free (ENamedParameters *parameters
);
Frees an instance of ENamedParameters, previously allocated
with e_named_parameters_new()
. Function does nothing, if
parameters
is NULL
Since: 3.8
void e_named_parameters_clear (ENamedParameters *parameters
);
Removes all stored parameters from parameters
.
Since: 3.8
void e_named_parameters_assign (ENamedParameters *parameters
,const ENamedParameters *from
);
Makes content of the parameters
the same as from
.
Functions clears content of parameters
if from
is NULL
parameters |
an ENamedParameters to assign values to |
|
from |
an ENamedParameters to get values from, or |
[allow-none] |
Since: 3.8
void e_named_parameters_set (ENamedParameters *parameters
,const
,gchar *nameconst
);gchar *value
Sets parameter named name
to value value
. If value
is NULL,
then the parameter is removed. value
can be an empty string.
Note: There is a restriction on parameter names, it cannot be empty or contain a colon character (':'), otherwise it can be pretty much anything.
parameters |
||
name |
name of a parameter to set |
|
value |
value to set, or |
[allow-none] |
Since: 3.8
constgchar * e_named_parameters_get (const ENamedParameters *parameters
,const
);gchar *name
Returns current value of a parameter with name name
. If not such
exists, then returns NULL
Since: 3.8
gchar ** e_named_parameters_to_strv (const ENamedParameters *parameters
);
Since: 3.8
gchar * e_named_parameters_to_string (const ENamedParameters *parameters
);
Since: 3.18
gboolean e_named_parameters_test (const ENamedParameters *parameters
,const
,gchar *nameconst
,gchar *value);
gboolean case_sensitively
Compares current value of parameter named name
with given value
and returns whether they are equal, either case sensitively or
insensitively, based on case_sensitively
argument. Function
returns FALSE
parameters |
||
name |
name of a parameter to test |
|
value |
value to test |
|
case_sensitively |
whether to compare case sensitively |
Since: 3.8
gboolean e_named_parameters_exists (const ENamedParameters *parameters
,const
);gchar *name
Since: 3.18
guint e_named_parameters_count (const ENamedParameters *parameters
);
Since: 3.18
gchar * e_named_parameters_get_name (const ENamedParameters *parameters
,);
gint index
The name of the parameters at index index
,
or NULL
index
is out of bounds or other error. The returned
string should be freed with g_free()
[transfer full]
Since: 3.18
#define e_named_timeout_add(interval, function, data)
Similar to g_timeout_add()
function
and the
PACKAGE
definintion from a <config.h> file.
interval |
the time between calls to the function, in milliseconds (1/1000ths of a second) |
|
function |
function to call |
|
data |
data to pass to |
Since: 3.12
#define e_named_timeout_add_full(priority, interval, function, data, notify)
Similar to g_timeout_add_full()
function
and the
PACKAGE
definition from a <config.h> file.
priority |
the priority of the timeout source, typically in the
range between |
|
interval |
the time between calls to the function, in milliseconds (1/1000ths of a second) |
|
function |
function to call |
|
data |
data to pass to |
|
notify |
function to call when the timeout is removed, or |
Since: 3.12
#define e_named_timeout_add_seconds(interval, function, data)
Similar to g_timeout_add_seconds()
function
and the
PACKAGE
definition from a <config.h> file.
interval |
the time between calls to the function, in seconds |
|
function |
function to call |
|
data |
data to pass to |
Since: 3.12
#define e_named_timeout_add_seconds_full(priority, interval, function, data, notify)
Similar to g_timeout_add_seconds_full()
function
and the
PACKAGE
definition from a <config.h> file.
priority |
the priority of the timeout source, typically in the
range between |
|
interval |
the time between calls to the function, in seconds |
|
function |
function to call |
|
data |
data to pass to |
|
notify |
function to call when the timeout is removed, or |
Since: 3.12
guint e_timeout_add_with_name (,
gint priority,
guint intervalconst
,gchar *name,
GSourceFunc function,
gpointer data);
GDestroyNotify notify
Similar to g_timeout_add_full()
name
.
You might find e_named_timeout_add()
or e_named_timeout_add_full()
more
convenient. Those macros name the
priority |
the priority of the timeout source, typically in the
range between |
|
interval |
the time between calls to the function, in milliseconds (1/1000ths of a second) |
|
name |
debug name for the source. |
[allow-none] |
function |
function to call |
|
data |
data to pass to |
|
notify |
function to call when the timeout is removed,
or |
[allow-none] |
Since: 3.12
guint e_timeout_add_seconds_with_name (,
gint priority,
guint intervalconst
,gchar *name,
GSourceFunc function,
gpointer data);
GDestroyNotify notify
Similar to g_timeout_add_seconds_full()
name
You might find e_named_timeout_add_seconds()
or
e_named_timeout_add_seconds_full()
more convenient. Those macros name
the
priority |
the priority of the timeout source, typically in the
range between |
|
interval |
the time between calls to the function, in seconds |
|
name |
debug name for the source. |
[allow-none] |
function |
function to call |
|
data |
data to pass to |
|
notify |
function to call when the timeout is removed,
or |
[allow-none] |
Since: 3.12
void e_util_free_string_slist ();
GSList *strings
e_util_free_string_slist
has been deprecated since version 3.8 and should not be used in newly-written code.
Use g_slist_free_full()
Frees memory previously allocated by e_util_strv_to_slist()
.
Since: 3.4
void e_util_free_object_slist ();
GSList *objects
e_util_free_object_slist
has been deprecated since version 3.8 and should not be used in newly-written code.
Use g_slist_free_full()
Calls g_object_unref()
objects
and then frees
also objects
itself.
Since: 3.4
GSList * e_util_copy_string_slist (,
GSList *copy_toconst
);GSList *strings
e_util_copy_string_slist
has been deprecated since version 3.8 and should not be used in newly-written code.
Use g_slist_copy_deep()
g_slist_concat()
Copies copy_to
.
copy_to |
Where to copy; can be |
[element-type utf8][allow-none] |
strings |
|
[element-type utf8] |
New head of copy_to
.
Returned pointer can be freed with e_util_free_string_slist()
.
[transfer full][element-type utf8]
Since: 3.4
GSList * e_util_copy_object_slist (,
GSList *copy_toconst
);GSList *objects
e_util_copy_object_slist
has been deprecated since version 3.8 and should not be used in newly-written code.
Use g_slist_copy_deep()
g_slist_concat()
Copies copy_to
.
copy_to |
Where to copy; can be |
[element-type GObject][allow-none] |
objects |
|
[element-type GObject] |
New head of copy_to
.
Returned pointer can be freed with e_util_free_object_slist()
.
[transfer full][element-type GObject]
Since: 3.4
gint e_data_server_util_get_dbus_call_timeout (void
);
e_data_server_util_get_dbus_call_timeout
has been deprecated since version 3.8 and should not be used in newly-written code.
This value is not used anywhere.
Returns the value set by e_data_server_util_set_dbus_call_timeout()
.
Since: 3.0
void e_data_server_util_set_dbus_call_timeout ();
gint timeout_msec
e_data_server_util_set_dbus_call_timeout
has been deprecated since version 3.8 and should not be used in newly-written code.
This value is not used anywhere.
Sets default timeout, in milliseconds, for calls of g_dbus_proxy_call()
-1 means the default value as set by D-Bus itself. G_MAXINT means no timeout at all.
Default value is set also by configure option --with-dbus-call-timeout=ms and -1 is used when not set.
Since: 3.0
gboolean e_source_registry_debug_enabled (void
);
e_source_registry_debug_enabled
is deprecated and should not be used in newly-written code.
Whether debugging is enabled, that is,
whether e_source_registry_debug_print()
will produce any output.
Since: 3.16
void e_source_registry_debug_print (const
,gchar *format...
);
Prints the text only if a debugging is enabled with an environment variable ESR_DEBUG=1.
Since: 3.16
void (*ETypeFunc) (,
GType type);
gpointer user_data
Specifies the type of functions passed to e_type_traverse()
.
Since: 3.4
void e_type_traverse (,
GType parent_typeETypeFunc func
,);
gpointer user_data
Calls func
for all instantiable subtypes of parent_type
.
This is often useful for extending functionality by way of EModule.
A module may register a subtype of parent_type
in its e_module_load()
e_type_traverse()
to instantiate all registered subtypes of parent_type
.
parent_type |
the root |
|
func |
the function to call for each visited |
[scope call] |
user_data |
user data to pass to the function |
Since: 3.4
gchar * e_util_get_source_full_name (struct _ESourceRegistry *registry
,struct _ESource *source
);
Constructs a full name of the source
with all of its parents
of the form: "<account-name> : <parent>/<source>" where
the "<parent>/" part can be repeated zero or more times, depending
on the deep level of the source
.
gboolean e_util_get_source_oauth2_access_token_sync (struct _ESource *source
,const ENamedParameters *credentials
,,
gchar **out_access_token,
gint *out_expires_in_seconds,
GCancellable *cancellable);
GError **error
Obtains the OAuth 2.0 access token for source
along with its expiry
in seconds from the current time (or 0 if unknown).
Free the returned access token with g_free()
error
and return FALSE
source |
an ESource |
|
credentials |
an ENamedParameters |
|
out_access_token |
return location for the access token,
or |
[allow-none][out] |
out_expires_in_seconds |
return location for the token expiry,
or |
[allow-none][out] |
cancellable |
optional |
[allow-none] |
error |
return location for a |
typedef struct _EAsyncClosure EAsyncClosure;
EAsyncClosure provides a simple way to run an asynchronous function
synchronously without blocking a running
1) Create an EAsyncClosure with e_async_closure_new()
.
2) Call the asynchronous function passing e_async_closure_callback()
as
the
3) Call e_async_closure_wait()
and collect the
4) Call the corresponding asynchronous "finish" function, passing the
e_async_closure_wait()
.
5) If needed, repeat steps 2-4 for additional asynchronous functions using the same EAsyncClosure.
6) Finally, free the EAsyncClosure with e_async_closure_free()
.
Since: 3.6