Exemple #1
0
gint
main (gint   argc,
      gchar *argv[])
{
	GMainLoop       *main_loop;
	CatalinaStorage *storage;

	g_type_init ();
	iris_init ();

	/* create main loop */
	main_loop = g_main_loop_new (NULL, FALSE);

	/* create storage */
	storage = catalina_storage_new ();

	/* support serialization and and compress data on disk */
	g_object_set (storage,
	              "formatter", catalina_binary_formatter_new (),
	              "transform", catalina_zlib_transform_new (),
	              NULL);

	/* open the database asynchronously */
	catalina_storage_open_async (storage,
	                             ".",          /* env dir */
	                             "storage.db", /* db name */
	                             open_cb,
	                             main_loop);

	/* run the main loop until the example finishes */
	g_main_loop_run (main_loop);

	return EXIT_SUCCESS;
}
Exemple #2
0
gint
main (gint   argc,
      gchar *argv[])
{
	IrisTask *task = NULL;
	gchar    *dir  = g_get_current_dir ();

	if (argc > 1)
		dir = g_strdup (argv [1]);

	iris_init ();

	mutex = g_mutex_new ();
	cond = g_cond_new ();

	g_mutex_lock (mutex);
	task = iris_task_new (worker, dir, NULL);
	iris_task_add_callback (task, callback, NULL, NULL);
	iris_task_run (task);

	g_cond_wait (cond, mutex);
	g_mutex_unlock (mutex);

	g_free (dir);

	return 0;
}
Exemple #3
0
gint
main (int   argc,
      char *argv[])
{
	g_test_init (&argc, &argv, NULL);

	iris_init ();

	g_test_add_func ("/gmainscheduler/new", test1);
	g_test_add_func ("/gmainscheduler/queue", test2);

	return g_test_run ();
}
Exemple #4
0
gint
main (int   argc,
      char *argv[])
{
	g_test_init (&argc, &argv, NULL);
	iris_init ();

	g_test_add_func ("/service/new", test1);
	g_test_add_func ("/service/start", test2);
	g_test_add_func ("/service/stop", test3);
	g_test_add_func ("/service/exclusive", test4);
	g_test_add_func ("/service/concurrent", test5);

	return g_test_run ();
}