Esempio n. 1
0
static gboolean dpap_copy_connected_cb (DPAPCopy* self, DMAPConnection* connection, gboolean _result_, const gchar* reason) {
	gboolean result = FALSE;
	ValaDMAPDb* _tmp0_ = NULL;
	gint64 _tmp1_ = 0LL;
	ValaDMAPDb* _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (connection != NULL, FALSE);
	_tmp0_ = self->priv->db;
	_tmp1_ = dmap_db_count ((DMAPDb*) _tmp0_);
	g_debug ("dmapcopy.vala:30: %lld entries\n", _tmp1_);
	_tmp2_ = self->priv->db;
	dmap_db_foreach ((DMAPDb*) _tmp2_, ___lambda4__gh_func, self);
	result = TRUE;
	return result;
}
Esempio n. 2
0
GHashTable *
dmap_db_apply_filter (DMAPDb * db, GSList * filter_def)
{
	GHashTable *ht;
	FilterData data;

	ht = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL,
				    g_object_unref);
	data.db = db;
	data.filter_def = filter_def;
	data.ht = ht;

	dmap_db_foreach (db, (GHFunc) apply_filter, &data);

	return data.ht;
}
Esempio n. 3
0
static void
connected_cb (DMAPConnection *connection,
	      gboolean        result,
	      const char     *reason,
	      DMAPDb         *db)
{
	guint port;
	char *name, *host;
	static guint count = 1; // This counts up, iteration_count goes down.

	g_print ("Connection cb., DB has %lu entries\n", dmap_db_count (db));
	g_print ("Iteration %d...\n", count++);

	dmap_db_foreach (db, (GHFunc) process_record, NULL);

	g_object_get (connection,
		     "name", &name,
		     "host", &host,
		     "port", &port,
		      NULL);

	/* Tear down connection. */
	g_object_unref (connection);

	if (--iteration_count > 0) {
		/* Create another connection to same service. */
		create_connection (get_service_type (connection),
				   name,
				   host,
				   port);
	} else {
		g_main_loop_quit (loop);
	}

	g_free (name);
	g_free (host);
}