LOC_DATABASE_NEW(3)
β¨ NAME β¨
loc_database_new β Create a new libloc context (bestie, it's giving database energy π
)
πΈ SYNOPSIS πΈ
#include <libloc/libloc.h>
#include <libloc/database.h>
struct loc_database;
int loc_database_new(struct loc_ctx* ctx, struct loc_database**
database, FILE* f);
Reference Counting:
struct loc_database* loc_database_ref(struct loc_database* db);
struct loc_database* loc_database_unref(struct loc_database* db);
Access some data:
time_t loc_database_created_at(struct loc_database* db);
const char* loc_database_get_vendor(struct loc_database* db);
const char* loc_database_get_description(struct loc_database* db);
const char* loc_database_get_license(struct loc_database* db);
π DESCRIPTION π
okay so loc_database_new() opens a brand new database from the file descriptor you hand it. and bestie, the file descriptor can be closed right after this operation because the function is literally making its own copy. no cap. π«Ά
if the database could be opened successfully, zero is returned. otherwise a non-zero return code will indicate an error and errno will be set appropriately. so if something goes sideways, check that errno β it's giving error-handling realness. π
various meta-data about the database can be retrieved with loc_database_created_at(), loc_database_get_vendor(), loc_database_get_description(), and loc_database_get_license(). lowkey obsessed with how many getters there are. π
π SEE ALSO π
π AUTHORS π
Michael Tremer
and that's the tea, bestie! π LOC_DATABASE_NEW(3) out β slay and read your manuals responsibly. β¨π
π¦ where this page comes from
- ubuntu stonking: libloc-dev 0.9.19-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms