logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

loc_database_new - Create a new libloc context

Authors

       Michael Tremer

                                                                                             LOC_DATABASE_NEW(3)

Description

       loc_database_new() opens a new database from the given file descriptor. The file descriptor can be closed
       after this operation because the function is creating its own copy.

       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.

       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().

Name

       loc_database_new - Create a new libloc context

See Also

libloc(3)

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);

See Also