Skip to content
Snippets Groups Projects

ENH: Add minimal functionality

Merged Florian Spreckelsen requested to merge f-minimal into dev
2 files
+ 13
9
Compare changes
  • Side-by-side
  • Inline

Files

+ 9
8
@@ -81,13 +81,13 @@ authenticator object from a configuration.
mutable struct _Authenticator
wrapped_authenticator::Ptr{Cvoid}
function _Authenticator()
function _Authenticator(managed_by_julia::Bool=false)
auth = new()
# force this to point to C_NULL after initialization
auth.wrapped_authenticator = C_NULL
function f(t)
if t.wrapped_authenticator != C_NULL
# Only if pointer was filled after real initialization
if managed_by_julia
# Only append a finalizer for this if the object is
# actually managed by Julia and not created and destroyed
# internally by libcaosdb.
function f(t)
ccall(
(:caosdb_authentication_delete_authenticator, "libccaosdb"),
Cint,
@@ -95,8 +95,9 @@ mutable struct _Authenticator
Ref{_Authenticator}(t),
)
end
finalizer(f, auth)
end
finalizer(f, auth)
return auth
end
end
@@ -115,7 +116,7 @@ function create_plain_password_authenticator(
password::AbstractString,
)
auth = Ref{_Authenticator}(_Authenticator())
auth = Ref{_Authenticator}(_Authenticator(true))
err_code = ccall(
(:caosdb_authentication_create_plain_password_authenticator, "libccaosdb"),
Loading