Exemplo n.º 1
0
static gboolean
grl_gravatar_source_may_resolve (GrlSource *source,
                                 GrlMedia *media,
                                 GrlKeyID key_id,
                                 GList **missing_keys)
{
  /* FIXME: we should check whether the artist/author in @media is in an email
   * format */

  if (key_id == GRL_METADATA_KEY_ARTIST_AVATAR)
    return has_dependency (media, GRL_METADATA_KEY_ARTIST, missing_keys);
  else if (key_id == GRL_METADATA_KEY_AUTHOR_AVATAR)
    return has_dependency (media, GRL_METADATA_KEY_AUTHOR, missing_keys);

  return FALSE;
}
Exemplo n.º 2
0
int add_dependency(struct node *n, struct node *dep)
{
    struct node_list *link;

    if (has_dependency(n, dep))
	return 0;

    link = malloc(sizeof(*link));
    if (!link) {
	perror("malloc failed");
	return 1;
    }

    debug_printf(DEBUG_LOTS, "adding dependency %s -> %s\n",
	    n->file, dep->file);

    link->n = n;
    link->next = dep->kids;
    dep->kids = link;

    return 0;
}