Skip to content
Snippets Groups Projects
Commit 128e5866 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'f-check-system' into 'dev'

ENH: Check OS and choose library name accordingly

See merge request !5
parents 2b091084 2beabcbb
No related branches found
No related tags found
1 merge request!5ENH: Check OS and choose library name accordingly
Pipeline #11034 passed
Pipeline: CaosDB Julia Integration Tests

#11037

    ......@@ -159,7 +159,11 @@ trigger_inttest:
    ## Determine the juliainttest branch...
    # ... use an f-branch if posible...
    - if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
    JULIAINT_REF=$CI_COMMIT_REF_NAME ;
    if curl -o /dev/null -s -w "%{http_code}" $JULIAINTTEST_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then
    JULIAINT_REF=dev ;
    else
    JULIAINT_REF=$CI_COMMIT_REF_NAME;
    fi
    fi;
    # ... or use main if possible...
    - if [[ "$CI_COMMIT_REF_NAME" == "main" ]] ; then
    ......
    ......@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
    * Basic functionality to establish connection to a CaosDB server and
    retrieve its version (using the Extern C interface of caosdb-cpplib)
    * Support for Windows
    ### Changed
    ......
    ......@@ -23,6 +23,11 @@
    module CaosDB
    """
    Chose the name of the library according to the OS you're running.
    """
    library_name = (@static Sys.iswindows() ? "ccaosdb" : "libccaosdb")
    module Info
    """
    ......@@ -47,6 +52,8 @@ end # Info
    module Utility
    using ..CaosDB
    """
    get_env_var(var[, default])
    ......@@ -57,7 +64,7 @@ instead.
    function get_env_var(var::AbstractString, default::AbstractString = "")
    ret = ccall(
    (:caosdb_utility_get_env_var, "libccaosdb"),
    (:caosdb_utility_get_env_var, CaosDB.library_name),
    Cstring,
    (Cstring, Cstring),
    var,
    ......@@ -72,6 +79,8 @@ end # Utility
    module Authentication
    using ..CaosDB
    """
    Struct containing a pointer to the wrapped cpp authenticator
    class. Meant for internal use; call a
    ......@@ -89,7 +98,7 @@ mutable struct _Authenticator
    if t.wrapped_authenticator != C_NULL
    # Only if pointer was filled after real initialization
    ccall(
    (:caosdb_authentication_delete_authenticator, "libccaosdb"),
    (:caosdb_authentication_delete_authenticator, CaosDB.library_name),
    Cint,
    (Ref{_Authenticator},),
    Ref{_Authenticator}(t),
    ......@@ -118,7 +127,7 @@ function create_plain_password_authenticator(
    auth = Ref{_Authenticator}(_Authenticator())
    err_code = ccall(
    (:caosdb_authentication_create_plain_password_authenticator, "libccaosdb"),
    (:caosdb_authentication_create_plain_password_authenticator, CaosDB.library_name),
    Cint,
    (Ref{_Authenticator}, Cstring, Cstring),
    auth,
    ......@@ -158,7 +167,7 @@ mutable struct _Connection
    function f(t)
    if t.wrapped_connection != C_NULL
    ccall(
    (:caosdb_connection_delete_connection, "libccaosdb"),
    (:caosdb_connection_delete_connection, CaosDB.library_name),
    Cint,
    (Ref{_Connection},),
    Ref{_Connection}(t),
    ......@@ -184,7 +193,7 @@ mutable struct _CertificateProvider
    function f(t)
    if t.wrapped_certificate_provider != C_NULL
    ccall(
    (:caosdb_connection_delete_certificate_provider, "libccaosdb"),
    (:caosdb_connection_delete_certificate_provider, CaosDB.library_name),
    Cint,
    (Ref{_CertificateProvider},),
    Ref{_CertificateProvider}(t),
    ......@@ -210,7 +219,10 @@ mutable struct _Configuration
    function f(t)
    if t.wrapped_connection_configuration != C_NULL
    ccall(
    (:caosdb_connection_delete_connection_configuration, "libccaosdb"),
    (
    :caosdb_connection_delete_connection_configuration,
    CaosDB.library_name,
    ),
    Cint,
    (Ref{_Configuration},),
    Ref{_Configuration}(t),
    ......@@ -232,7 +244,7 @@ function create_pem_file_certificate_provider(path::AbstractString)
    cert_provider = Ref{_CertificateProvider}(_CertificateProvider())
    err_code = ccall(
    (:caosdb_connection_create_pem_file_certificate_provider, "libccaosdb"),
    (:caosdb_connection_create_pem_file_certificate_provider, CaosDB.library_name),
    Cint,
    (Ref{_CertificateProvider}, Cstring),
    cert_provider,
    ......@@ -269,7 +281,7 @@ function create_tls_connection_configuration(
    config = Ref{_Configuration}(_Configuration())
    err_code = ccall(
    (:caosdb_connection_create_tls_connection_configuration, "libccaosdb"),
    (:caosdb_connection_create_tls_connection_configuration, CaosDB.library_name),
    Cint,
    (
    Ref{_Configuration},
    ......@@ -300,7 +312,7 @@ function create_insecure_connection_configuration(host::AbstractString, port::Ci
    config = Ref{_Configuration}(_Configuration())
    err_code = ccall(
    (:caosdb_connection_create_insecure_connection_configuration, "libccaosdb"),
    (:caosdb_connection_create_insecure_connection_configuration, CaosDB.library_name),
    Cint,
    (Ref{_Configuration}, Cstring, Cint),
    config,
    ......@@ -327,7 +339,7 @@ function create_connection(config::Ref{_Configuration})
    connection = Ref{_Connection}(_Connection())
    err_code = ccall(
    (:caosdb_connection_create_connection, "libccaosdb"),
    (:caosdb_connection_create_connection, CaosDB.library_name),
    Cint,
    (Ref{_Connection}, Ref{_Configuration}),
    connection,
    ......@@ -355,7 +367,7 @@ function get_version_info(con::Ref{_Connection})
    info = Ref{CaosDB.Info._VersionInfo}(CaosDB.Info._VersionInfo())
    err_code = ccall(
    (:caosdb_connection_get_version_info, "libccaosdb"),
    (:caosdb_connection_get_version_info, CaosDB.library_name),
    Cint,
    (Ref{CaosDB.Info._VersionInfo}, Ref{_Connection}),
    info,
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment