Mercurial > molko
comparison libmlk-core/core/save.c @ 261:bfde372bf152
core: prefix utilities with util_
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 06 Dec 2020 23:06:34 +0100 |
parents | f978fa0137ce |
children | 3f710c68bb97 |
comparison
equal
deleted
inserted
replaced
260:60a214ec1ab4 | 261:bfde372bf152 |
---|---|
50 } | 50 } |
51 | 51 |
52 static const char * | 52 static const char * |
53 path(unsigned int idx) | 53 path(unsigned int idx) |
54 { | 54 { |
55 return pprintf("%s/%u", sys_dir(SYS_DIR_SAVE), idx); | 55 return util_pathf("%s/%u", sys_dir(SYS_DIR_SAVE), idx); |
56 } | 56 } |
57 | 57 |
58 static bool | 58 static bool |
59 execu(struct save *db, const unsigned char *sql) | 59 execu(struct save *db, const unsigned char *sql) |
60 { | 60 { |
79 { .date = &db->created, { .key = "molko.create-date" } }, | 79 { .date = &db->created, { .key = "molko.create-date" } }, |
80 { .date = &db->updated, { .key = "molko.update-date" } }, | 80 { .date = &db->updated, { .key = "molko.update-date" } }, |
81 }; | 81 }; |
82 | 82 |
83 /* Ensure create and update dates are present. */ | 83 /* Ensure create and update dates are present. */ |
84 for (size_t i = 0; i < NELEM(table); ++i) { | 84 for (size_t i = 0; i < UTIL_SIZE(table); ++i) { |
85 if (!save_get_property(db, &table[i].prop)) { | 85 if (!save_get_property(db, &table[i].prop)) { |
86 sqlite3_close(db->handle); | 86 sqlite3_close(db->handle); |
87 return errorf(_("database not initialized correctly")); | 87 return errorf(_("database not initialized correctly")); |
88 } | 88 } |
89 | 89 |