Skip to content

Commit

Permalink
feat(BIC-1999): Expose Couchbase Lite C version (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nao-ris authored Jun 19, 2024
1 parent 1727bc1 commit 0558f4a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mod c_api;

use self::c_api::{
CBLListenerToken, CBLRefCounted, CBL_DumpInstances, CBL_InstanceCount, CBL_Release, CBL_Retain,
CBLListener_Remove,
CBLListener_Remove, CBLITE_VERSION,
};
#[cfg(target_os = "android")]
use self::c_api::{CBLError, CBLInitContext, CBL_Init};
Expand Down Expand Up @@ -120,6 +120,10 @@ impl Drop for ListenerToken {

//////// MISC. API FUNCTIONS

pub fn couchbase_lite_c_version() -> String {
String::from_utf8_lossy(CBLITE_VERSION).to_string()
}

/** Returns the total number of Couchbase Lite objects. Useful for leak checking. */
pub fn instance_count() -> usize {
unsafe { CBL_InstanceCount() as usize }
Expand Down

0 comments on commit 0558f4a

Please sign in to comment.