mir
null+****@clear*****
Thu Oct 4 10:29:15 JST 2012
mir 2009-08-08 21:40:37 +0900 (Sat, 08 Aug 2009) New Revision: e69f984edc7bc528a5249581b4bffe1c0d2fcedb https://github.com/mroonga/mroonga/commit/e69f984edc7bc528a5249581b4bffe1c0d2fcedb Log: add groonga api sample. Added files: test/unit/api-sample.c Modified files: test/unit/Makefile.am Modified: test/unit/Makefile.am (+2 -1) =================================================================== --- test/unit/Makefile.am 2009-08-08 19:07:34 +0900 (8528bac) +++ test/unit/Makefile.am 2009-08-08 21:40:37 +0900 (4b80b08) @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = test_start_stop.la test_driver.la +noinst_LTLIBRARIES = test_start_stop.la test_driver.la api_sample.la AM_CPPFLAGS = $(GROONGA_INCLUDES) $(MECAB_INCLUDES) $(CUTTER_CFLAGS) $(GCUTTER_CFLAGS) AM_INCLUDES = -l. -l.. @@ -14,3 +14,4 @@ DRIVER_SRC = ../../driver.c test_start_stop_la_SOURCES = $(DRIVER_SRC) test-start-stop.c test_driver_la_SOURCES = $(DRIVER_SRC) test-driver.c +api_sample_la_SOURCES = api-sample.c Added: test/unit/api-sample.c (+22 -0) 100644 =================================================================== --- /dev/null +++ test/unit/api-sample.c 2009-08-08 21:40:37 +0900 (b3b079f) @@ -0,0 +1,22 @@ +#include <gcutter.h> +#include <glib/gstdio.h> +#include <groonga.h> + +static gchar *base_directory; +static gchar *tmp_directory; +static grn_ctx *ctx; + +void cut_startup() +{ + base_directory = g_get_current_dir(); + tmp_directory = g_build_filename(base_directory, "/tmp", NULL); + cut_remove_path(tmp_directory, NULL); + g_mkdir_with_parents(tmp_directory, 0700); + g_chdir(tmp_directory); +} + +void cut_shutdown() +{ + g_chdir(base_directory); + g_free(tmp_directory); +} -------------- next part -------------- HTML����������������������������...Download