Mercurial > sci
comparison scid/scid.c @ 66:5076be758687 0.1.0
misc: update before 0.1.0 release
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 20 Aug 2022 10:36:55 +0200 |
parents | 85c59fbf1407 |
children | 71cd8447e3a4 |
comparison
equal
deleted
inserted
replaced
65:471410c90954 | 66:5076be758687 |
---|---|
23 #include "log.h" | 23 #include "log.h" |
24 #include "scid.h" | 24 #include "scid.h" |
25 #include "theme.h" | 25 #include "theme.h" |
26 | 26 |
27 struct scid scid = { | 27 struct scid scid = { |
28 .themedir = SHAREDIR "/sci/themes/bulma", | |
28 .dbpath = VARDIR "/db/sci/sci.db" | 29 .dbpath = VARDIR "/db/sci/sci.db" |
29 }; | 30 }; |
30 | 31 |
31 static inline void | 32 static inline void |
32 init_log(void) | 33 init_log(void) |
35 } | 36 } |
36 | 37 |
37 static void | 38 static void |
38 init_database(void) | 39 init_database(void) |
39 { | 40 { |
41 log_info("scid: opening database %s", scid.dbpath); | |
42 | |
40 if (db_open(scid.dbpath) < 0) | 43 if (db_open(scid.dbpath) < 0) |
41 log_die("scid: unable to open database"); | 44 exit(1); |
42 | 45 |
43 /* Retrieve or create the API key if not existing. */ | 46 /* Retrieve or create the API key if not existing. */ |
44 switch (db_key_get(scid.apikey, sizeof (scid.apikey))) { | 47 switch (db_key_get(scid.apikey, sizeof (scid.apikey))) { |
45 case 0: | 48 case 0: |
46 /* Not found, create immediately. */ | 49 /* Not found, create immediately. */ |