rename functions for symmetry

This commit is contained in:
Jazz Turner-Baggs 2026-02-19 17:20:48 -08:00
parent a11e3c3fed
commit 9e03eca3c4
No known key found for this signature in database
4 changed files with 6 additions and 6 deletions

View File

@ -54,10 +54,10 @@ pub fn create_context(name: repr_c::String) -> repr_c::Box<ContextHandle> {
Box::new(ContextHandle(Context::new_with_name(&*name))).into()
}
/// Returns the friendly name of the context's identity
/// Returns the friendly name of the contexts installation.
#[ffi_export]
pub fn get_friendly_name(ctx: &ContextHandle) -> repr_c::String {
ctx.0.get_friendly_name().to_string().into()
pub fn installation_name(ctx: &ContextHandle) -> repr_c::String {
ctx.0.installation_name().to_string().into()
}
/// Destroys a conversation store and frees its memory

View File

@ -31,7 +31,7 @@ impl Context {
}
}
pub fn get_friendly_name(&self) -> &str {
pub fn installation_name(&self) -> &str {
self._identity.get_name()
}

View File

@ -101,7 +101,7 @@ proc create_context*(name: ReprCString): ContextHandle {.importc, dynlib: CONVER
## Returns the friendly name of the context's identity
## The result must be freed by the caller (repr_c::String ownership transfers)
proc get_friendly_name*(ctx: ContextHandle): ReprCString {.importc, dynlib: CONVERSATIONS_LIB.}
proc installation_name*(ctx: ContextHandle): ReprCString {.importc, dynlib: CONVERSATIONS_LIB.}
## Destroys a context and frees its memory
## - handle must be a valid pointer from create_context()

View File

@ -24,7 +24,7 @@ proc newConversationsContext*(name: string): LibChat =
proc getInstallationName*(ctx: LibChat): string =
if ctx.handle == nil:
return ""
let name = get_friendly_name(ctx.handle)
let name = installation_name(ctx.handle)
result = $name
## Destroy the context and free resources