Commit 8400d7e1 authored by Shawn Webb's avatar Shawn Webb
Browse files

Add API for getting the ABI version of the various objects


Signed-off-by: Shawn Webb's avatarShawn Webb <shawn.webb@hardenedbsd.org>
parent dd77e5af
......@@ -123,6 +123,14 @@ lattutil_config_path_t *lattutil_find_config(const char **, size_t, const char *
*/
void lattutil_free_config_path(lattutil_config_path_t **);
/**
* Get the ABI version of the config path object
*
* @param The config path object
* @return The version number
*/
uint64_t lattutil_config_get_version(lattutil_config_path_t *);
/**
* Return the fully-qualified path of the config file
*
......@@ -179,6 +187,14 @@ lattutil_log_t *lattutil_log_init(char *, int);
*/
void lattutil_log_free(lattutil_log_t **);
/**
* Get the ABI version number of the log object
*
* @param The log object
* @return The ABI version number
*/
uint64_t lattutil_log_get_version(lattutil_log_t *);
/**
* Initialize syslog-based logging
*
......@@ -234,6 +250,14 @@ int lattutil_log_set_verbosity(lattutil_log_t *, int);
lattutil_sqlite_ctx_t *lattutil_sqlite_ctx_new(const char *, lattutil_log_t *,
uint64_t);
/**
* Get the ABI version number of the sqlite wrapper
*
* @param The lattutil sqlite context object
* @return The ABI version number
*/
uint64_t lattutil_sqlite_get_version(lattutil_sqlite_ctx_t *);
/**
* Free The SQLite3 context object
*
......
......@@ -123,6 +123,18 @@ lattutil_free_config_path(lattutil_config_path_t **obj)
*obj = NULL; /* Prevent UAF */
}
EXPORTED_SYM
uint64_t
lattutil_config_get_version(lattutil_config_path_t *obj)
{
if (obj == NULL) {
return (0);
}
return (obj->l_version);
}
EXPORTED_SYM
char *
lattutil_config_path_path(lattutil_config_path_t *path)
......
......@@ -80,6 +80,18 @@ lattutil_log_free(lattutil_log_t **logp)
*logp = NULL;
}
EXPORTED_SYM
uint64_t
lattutil_log_get_version(lattutil_log_t *logp)
{
if (logp == NULL) {
return (0);
}
return (logp->ll_version);
}
EXPORTED_SYM
bool
lattutil_log_ready(lattutil_log_t *logp)
......
......@@ -94,6 +94,18 @@ lattutil_sqlite_ctx_free(lattutil_sqlite_ctx_t **ctx)
*ctx = NULL;
}
EXPORTED_SYM
uint64_t
lattutil_sqlite_get_version(lattutil_sqlite_ctx_t *ctx)
{
if (ctx == NULL) {
return (0);
}
return (ctx->lsq_version);
}
EXPORTED_SYM
lattutil_sqlite_query_t *
lattutil_sqlite_prepare(lattutil_sqlite_ctx_t *ctx, const char *query_string)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment