]> git.ipfire.org Git - location/libloc.git/commitdiff
man: Add man page for loc_database_new
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 2 Jan 2022 14:16:01 +0000 (14:16 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 2 Jan 2022 14:16:01 +0000 (14:16 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
man/loc_database_new.txt [new file with mode: 0644]

index 92c09d7a7f1d1287297a84e04cd6ce7df3f04c03..f9aadf5ae844790cc347275b8158ffdde59e8d78 100644 (file)
@@ -422,6 +422,7 @@ src_test_signature_LDADD = \
 MANPAGES = \
        man/libloc.3 \
        man/location.8 \
+       man/loc_database_new.3 \
        man/loc_get_log_priority.3 \
        man/loc_new.3 \
        man/loc_set_log_fn.3 \
diff --git a/man/loc_database_new.txt b/man/loc_database_new.txt
new file mode 100644 (file)
index 0000000..86a021b
--- /dev/null
@@ -0,0 +1,53 @@
+= loc_database_new(3)
+
+== Name
+
+loc_database_new - Create a new libloc context
+
+== Synopsis
+[verse]
+
+#include <libloc/libloc.h>
+#include <libloc/database.h>
+
+struct loc_database;
+
+int loc_database_new(struct loc_ctx{empty}* ctx,
+       struct loc_database{empty}*{empty}* database, FILE{empty}* f);
+
+Reference Counting:
+
+struct loc_database{empty}* loc_database_ref(struct loc_database{empty}* db);
+
+struct loc_database{empty}* loc_database_unref(struct loc_database{empty}* db);
+
+Access some data:
+
+time_t loc_database_created_at(struct loc_database{empty}* db);
+
+const char{empty}* loc_database_get_vendor(struct loc_database{empty}* db);
+
+const char{empty}* loc_database_get_description(struct loc_database{empty}* db);
+
+const char{empty}* loc_database_get_license(struct loc_database{empty}* db);
+
+== 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().
+
+== See Also
+
+link:libloc[3]
+
+== Authors
+
+Michael Tremer