]>
git.datanom.net - lensdb.git/blob - src/main.c
4 * Copyright 2024 Michael Rasmussen <mir@datanom.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
29 #include <glib/gstdio.h>
30 #include <glib-object.h>
32 #include "sqlite-storage.h"
34 #include "lib/scanner.h"
36 gint
main(gint argc
, gchar
** argv
) {
39 //gchar* path = g_path_get_dirname(argv[0]);
40 gchar
* path
= g_build_filename(g_get_user_config_dir(), PACKAGE
, NULL
); //g_strconcat(g_get_home_dir(), "/.local/share/", PACKAGE, NULL);
41 if (!g_file_test(path
, G_FILE_TEST_EXISTS
| G_FILE_TEST_IS_DIR
)) {
42 if (g_mkdir(path
, 0766)) {
43 fprintf(stderr
, "%s: Failed to create dir for database\n", path
);
47 fprintf(stdout
, "workdir: %s\n", path
);
48 if ((status
= init_storage(path
)) > 0) {
49 fprintf(stderr
, "%s: Failed to open DB\n", path
);
51 gtk_init(&argc
, &argv
);
53 gchar
* err
= g_strdup_printf("Failed initializing GUI\n");
55 show_err_msg(GTK_MESSAGE_ERROR
, err
);
This page took 0.85893 seconds and 6 git commands to generate.