1LOC_DATABASE_NEW(3) LOC_DATABASE_NEW(3)
2
3
4
6 loc_database_new - Create a new libloc context
7
9 #include <libloc/libloc.h>
10 #include <libloc/database.h>
11
12 struct loc_database;
13
14 int loc_database_new(struct loc_ctx* ctx, struct loc_database**
15 database, FILE* f);
16
17 Reference Counting:
18
19 struct loc_database* loc_database_ref(struct loc_database* db);
20
21 struct loc_database* loc_database_unref(struct loc_database* db);
22
23 Access some data:
24
25 time_t loc_database_created_at(struct loc_database* db);
26
27 const char* loc_database_get_vendor(struct loc_database* db);
28
29 const char* loc_database_get_description(struct loc_database* db);
30
31 const char* loc_database_get_license(struct loc_database* db);
32
34 loc_database_new() opens a new database from the given file descriptor.
35 The file descriptor can be closed after this operation because the
36 function is creating its own copy.
37
38 If the database could be opened successfully, zero is returned.
39 Otherwise a non-zero return code will indicate an error and errno will
40 be set appropriately.
41
42 Various meta-data about the database can be retrieved with
43 loc_database_created_at(), loc_database_get_vendor(),
44 loc_database_get_description(), and loc_database_get_license().
45
47 libloc(3)
48
50 Michael Tremer
51
52
53
54 LOC_DATABASE_NEW(3)