/**
 * g_callable_info_iterate_return_attributes:
 * @info: a #GICallableInfo
 * @iterator: (inout): a #GIAttributeIter structure, must be initialized; see below
 * @name: (out) (transfer none): Returned name, must not be freed
 * @value: (out) (transfer none): Returned name, must not be freed
 *
 * Iterate over all attributes associated with the return value.  The
 * iterator structure is typically stack allocated, and must have its
 * first member initialized to %NULL.
 *
 * Both the @name and @value should be treated as constants
 * and must not be freed.
 *
 * See g_base_info_iterate_attributes() for an example of how to use a
 * similar API.
 *
 * Returns: %TRUE if there are more attributes
 */
gboolean
g_callable_info_iterate_return_attributes (GICallableInfo  *info,
                                           GIAttributeIter *iterator,
                                           char           **name,
                                           char          **value)
{
  GIRealInfo *rinfo = (GIRealInfo *)info;
  Header *header = (Header *)rinfo->typelib->data;
  AttributeBlob *next, *after;
  guint32 blob_offset;

  after = (AttributeBlob *) &rinfo->typelib->data[header->attributes +
                                                  header->n_attributes * header->attribute_blob_size];

  blob_offset = signature_offset (info);

  if (iterator->data != NULL)
    next = (AttributeBlob *) iterator->data;
  else
    next = _attribute_blob_find_first (info, blob_offset);

  if (next == NULL || next->offset != blob_offset || next >= after)
    return FALSE;

  *name = (gchar*) g_typelib_get_string (rinfo->typelib, next->name);
  *value = (gchar*) g_typelib_get_string (rinfo->typelib, next->value);
  iterator->data = next + 1;

  return TRUE;
}
/**
 * g_object_info_get_type_init:
 * @info: a #GIObjectInfo
 *
 * Obtain the function which when called will return the GType
 * function for which this object type is registered.
 *
 * Returns: the type init function
 */
const gchar *
g_object_info_get_type_init (GIObjectInfo *info)
{
  GIRealInfo *rinfo = (GIRealInfo *)info;
  ObjectBlob *blob;

  g_return_val_if_fail (info != NULL, NULL);
  g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);

  blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];

  return g_typelib_get_string (rinfo->typelib, blob->gtype_init);
}
/**
 * g_function_info_get_symbol:
 * @info: a #GIFunctionInfo
 *
 * Obtain the symbol of the function. The symbol is the name of the
 * exported function, suitable to be used as an argument to
 * g_module_symbol().
 *
 * Returns: the symbol
 */
const gchar *
g_function_info_get_symbol (GIFunctionInfo *info)
{
  GIRealInfo *rinfo;
  FunctionBlob *blob;

  g_return_val_if_fail (info != NULL, NULL);
  g_return_val_if_fail (GI_IS_FUNCTION_INFO (info), NULL);

  rinfo = (GIRealInfo *)info;
  blob = (FunctionBlob *)&rinfo->typelib->data[rinfo->offset];

  return g_typelib_get_string (rinfo->typelib, blob->symbol);
}
/**
 * g_object_info_get_set_value_function:
 * @info: a #GIObjectInfo
 *
 * Obtain the symbol name of the function that should be called to convert
 * set a GValue giving an object instance pointer of this object type.
 * I's mainly used fundamental types. The type signature for the symbol
 * is %GIObjectInfoSetValueFunction, to fetch the function pointer
 * see g_object_info_get_set_value_function().
 *
 * Returns: the symbol or %NULL
 */
const char *
g_object_info_get_set_value_function (GIObjectInfo *info)
{
  GIRealInfo *rinfo = (GIRealInfo *)info;
  ObjectBlob *blob;

  g_return_val_if_fail (info != NULL, NULL);
  g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);

  blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];

  if (blob->set_value_func)
    return g_typelib_get_string (rinfo->typelib, blob->set_value_func);

  return NULL;
}
const gchar *
g_enum_info_get_error_domain (GIEnumInfo *info)
{
  GIRealInfo *rinfo = (GIRealInfo *)info;
  EnumBlob *blob;

  g_return_val_if_fail (info != NULL, 0);
  g_return_val_if_fail (GI_IS_ENUM_INFO (info), 0);

  blob = (EnumBlob *)&rinfo->typelib->data[rinfo->offset];

  if (blob->error_domain)
    return g_typelib_get_string (rinfo->typelib, blob->error_domain);
  else
    return NULL;
}