diff options
author | Dan Winship <danw@gnome.org> | 2011-05-19 16:12:03 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2011-08-12 11:10:43 -0400 |
commit | 4dabe20ed5753bccd2abf8ad02e95ce6ab53036c (patch) | |
tree | 493ae7ef585a60e35c9c7b37bbb31b9f98a42e48 /girepository/gitypeinfo.c | |
parent | a588cee7d719e0b1764d2b7687cd90424faec9d0 (diff) | |
download | gobject-introspection-4dabe20ed5753bccd2abf8ad02e95ce6ab53036c.tar.gz |
Deprecate ErrorDomain
The previous ErrorDomain blob was never actually scanned or used, and
it was kind of a lame API conceptually.
To keep some compatibility, rather than removing the enumeration
values, rename them to _INVALID, and don't bump the typelib version.
This should in theory allow a new libgirepository to read an old
typelib.
Based on a patch from Colin Walters
https://bugzilla.gnome.org/show_bug.cgi?id=602516
Diffstat (limited to 'girepository/gitypeinfo.c')
-rw-r--r-- | girepository/gitypeinfo.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/girepository/gitypeinfo.c b/girepository/gitypeinfo.c index 1bc9b0a1..5864f82f 100644 --- a/girepository/gitypeinfo.c +++ b/girepository/gitypeinfo.c @@ -340,72 +340,3 @@ g_type_info_get_array_type (GITypeInfo *info) return -1; } - -/** - * g_type_info_get_n_error_domains: - * @info: a #GITypeInfo - * - * Obtain the number of error domains for this type. The type tag - * must be a #GI_TYPE_TAG_ERROR or -1 will be returned. - * - * Returns: number of error domains or -1 - */ -gint -g_type_info_get_n_error_domains (GITypeInfo *info) -{ - GIRealInfo *rinfo = (GIRealInfo *)info; - SimpleTypeBlob *type; - - g_return_val_if_fail (info != NULL, 0); - g_return_val_if_fail (GI_IS_TYPE_INFO (info), 0); - - type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset]; - - if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0)) - { - ErrorTypeBlob *blob = (ErrorTypeBlob *)&rinfo->typelib->data[rinfo->offset]; - - if (blob->tag == GI_TYPE_TAG_ERROR) - return blob->n_domains; - } - - return 0; -} - -/** - * g_type_info_get_error_domain: - * @info: a #GITypeInfo - * @n: index of error domain - * - * Obtain the error domains at index @n for this type. The type tag - * 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 with g_base_info_unref() when done. - */ -GIErrorDomainInfo * -g_type_info_get_error_domain (GITypeInfo *info, - gint n) -{ - GIRealInfo *rinfo = (GIRealInfo *)info; - SimpleTypeBlob *type; - - g_return_val_if_fail (info != NULL, NULL); - g_return_val_if_fail (GI_IS_TYPE_INFO (info), NULL); - - type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset]; - - if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0)) - { - ErrorTypeBlob *blob = (ErrorTypeBlob *)&rinfo->typelib->data[rinfo->offset]; - - if (blob->tag == GI_TYPE_TAG_ERROR) - return (GIErrorDomainInfo *) _g_info_from_entry (rinfo->repository, - rinfo->typelib, - blob->domains[n]); - } - - return NULL; -} - - |