コード例 #1
0
ファイル: gsf-doc-meta-data.c プロジェクト: GNOME/libgsf
static void
cb_print_property (char const *name,
		   GsfDocProp const *prop)
{
	if (gsf_doc_prop_get_link (prop) != NULL)
		g_print ("prop '%s' LINKED TO  -> '%s'\n",
			 name, gsf_doc_prop_get_link (prop));
	else
		g_print ("prop '%s'\n", name);

	gsf_doc_prop_dump (prop);
}
コード例 #2
0
ファイル: wvSummary.c プロジェクト: gxf/heigong
static void
cb_print_property (char const *name, GsfDocProp const *prop, GHashTable * human_readable_names)
{
  GValue const *val = gsf_doc_prop_get_val  (prop);
  char *tmp;
  char const * _name;

  if((_name = g_hash_table_lookup(human_readable_names, name)) == NULL)
    _name = name;
  
  if (gsf_doc_prop_get_link (prop) != NULL)
    fprintf (stdout, "\t%s LINKED TO  -> '%s'\n",
	     _name, gsf_doc_prop_get_link (prop));
  else
    fprintf (stdout, "\t%s = ", _name);
  
  if (VAL_IS_GSF_DOCPROP_VECTOR ((GValue *)val)) {
    GValueArray *va = gsf_value_get_docprop_varray (val);
    unsigned i;
    
    fprintf(stdout, "[");
    for (i = 0 ; i < va->n_values; i++) {
      tmp = g_strdup_value_contents (g_value_array_get_nth (va, i));
      if(i != 0)
	fprintf(stdout, ", ");
      fprintf (stdout, "(%u, %s)", i, tmp);
      g_free (tmp);
    }
    fprintf(stdout, "]");
  } else {
    tmp = g_strdup_value_contents (val);
    fprintf (stdout, "%s", tmp);
    g_free (tmp);
  }

  fprintf (stdout, "\n");
}