mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
[doc] Document GIErrorDomainInfo methods
This commit is contained in:
parent
c2b89be46e
commit
3bab700cd4
47
ginfo.c
47
ginfo.c
@ -1644,7 +1644,7 @@ g_type_info_get_n_error_domains (GITypeInfo *info)
|
||||
* must be a #GI_TYPE_TAG_ERROR or -1 will be returned.
|
||||
*
|
||||
* Returns: (transfer full): the error domain or %NULL if type tag is wrong,
|
||||
* free the struct withg_base_info_unref() when done.
|
||||
* free the struct with g_base_info_unref() when done.
|
||||
*/
|
||||
GIErrorDomainInfo *
|
||||
g_type_info_get_error_domain (GITypeInfo *info,
|
||||
@ -1673,20 +1673,61 @@ g_type_info_get_error_domain (GITypeInfo *info,
|
||||
|
||||
|
||||
/* GIErrorDomainInfo functions */
|
||||
|
||||
/**
|
||||
* SECTION:gierrordomaininfo
|
||||
* @Short_description: Struct representing an error domain
|
||||
* @Title: GIErrorDomainInfo
|
||||
*
|
||||
* A GIErrorDomainInfo struct represents a domain of a #GError.
|
||||
* An error domain is associated with a #GQuark and contains a pointer
|
||||
* to an enum with all the error codes.
|
||||
*/
|
||||
|
||||
/**
|
||||
* g_error_domain_info_get_quark:
|
||||
* @info: a #GIErrorDomainInfo
|
||||
*
|
||||
* Obtain a string representing the quark for this error domain.
|
||||
* %NULL will be returned if the type tag is wrong or if a quark is
|
||||
* missing in the typelib.
|
||||
*
|
||||
* Returns: the quark represented as a string or %NULL
|
||||
*/
|
||||
const gchar *
|
||||
g_error_domain_info_get_quark (GIErrorDomainInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ErrorDomainBlob *blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
ErrorDomainBlob *blob;
|
||||
|
||||
g_return_val_if_fail (info != NULL, NULL);
|
||||
g_return_val_if_fail (GI_IS_ERROR_DOMAIN_INFO (info), NULL);
|
||||
|
||||
blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
|
||||
return g_typelib_get_string (rinfo->typelib, blob->get_quark);
|
||||
}
|
||||
|
||||
/**
|
||||
* g_error_domain_info_get_codes:
|
||||
* @info: a #GIErrorDomainInfo
|
||||
*
|
||||
* Obtain the enum containing all the error codes for this error domain.
|
||||
* The return value will have a #GIInfoType of %GI_INFO_TYPE_ERROR_DOMAIN
|
||||
*
|
||||
* Returns: (transfer full): the error domain or %NULL if type tag is wrong,
|
||||
* free the struct with g_base_info_unref() when done.
|
||||
*/
|
||||
GIInterfaceInfo *
|
||||
g_error_domain_info_get_codes (GIErrorDomainInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ErrorDomainBlob *blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
ErrorDomainBlob *blob;
|
||||
|
||||
g_return_val_if_fail (info != NULL, NULL);
|
||||
g_return_val_if_fail (GI_IS_ERROR_DOMAIN_INFO (info), NULL);
|
||||
|
||||
blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
|
||||
return (GIInterfaceInfo *) g_info_from_entry (rinfo->repository,
|
||||
rinfo->typelib, blob->error_codes);
|
||||
|
Loading…
Reference in New Issue
Block a user