Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shawn Webb
liblattutil
Commits
8400d7e1
Commit
8400d7e1
authored
Jul 18, 2021
by
Shawn Webb
Browse files
Add API for getting the ABI version of the various objects
Signed-off-by:
Shawn Webb
<
shawn.webb@hardenedbsd.org
>
parent
dd77e5af
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/liblattutil.h
View file @
8400d7e1
...
...
@@ -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
*
...
...
src/config.c
View file @
8400d7e1
...
...
@@ -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
)
...
...
src/log-main.c
View file @
8400d7e1
...
...
@@ -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
)
...
...
src/sqlite3.c
View file @
8400d7e1
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment