Mercurial > sci
view scid/scid.c @ 26:7e10cace67a3
scid: add basic mustache support
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 02 Aug 2022 13:24:13 +0200 |
parents | |
children | 4c16bb25e4f1 |
line wrap: on
line source
#include <assert.h> #include <stdio.h> #include "db.h" #include "log.h" #include "scid.h" struct scid scid = { .dbpath = VARDIR "/db/sci/sci.db" }; void scid_init(void) { log_open("scid"); log_info("opening database %s", scid.dbpath); if (db_open(scid.dbpath) < 0) log_die("abort: unable to open database"); } const char * scid_theme_path(const char *filename) { assert(filename); /* Build path to the template file. */ static _Thread_local char path[PATH_MAX]; snprintf(path, sizeof (path), "%s/%s", scid.themedir, filename); return path; } void scid_finish(void) { db_finish(); log_finish(); }