Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-julialib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-julialib
Commits
75aa37e2
Commit
75aa37e2
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Move library_name to global var
parent
babf6bd1
No related branches found
Branches containing commit
No related tags found
1 merge request
!5
ENH: Check OS and choose library name accordingly
Pipeline
#10872
failed
3 years ago
Stage: info
Stage: code-style
Stage: setup
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/CaosDB.jl
+21
-11
21 additions, 11 deletions
src/CaosDB.jl
with
21 additions
and
11 deletions
src/CaosDB.jl
+
21
−
11
View file @
75aa37e2
...
...
@@ -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
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_utility_get_env_var
,
CaosDB
.
library_name
),
Cstring
,
(
Cstring
,
Cstring
),
var
,
...
...
@@ -89,7 +96,7 @@ mutable struct _Authenticator
if
t
.
wrapped_authenticator
!=
C_NULL
# Only if pointer was filled after real initialization
ccall
(
(
:
caosdb_authentication_delete_authenticator
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_authentication_delete_authenticator
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Authenticator
},),
Ref
{
_Authenticator
}(
t
),
...
...
@@ -118,7 +125,7 @@ function create_plain_password_authenticator(
auth
=
Ref
{
_Authenticator
}(
_Authenticator
())
err_code
=
ccall
(
(
:
caosdb_authentication_create_plain_password_authenticator
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_authentication_create_plain_password_authenticator
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Authenticator
},
Cstring
,
Cstring
),
auth
,
...
...
@@ -158,7 +165,7 @@ mutable struct _Connection
function
f
(
t
)
if
t
.
wrapped_connection
!=
C_NULL
ccall
(
(
:
caosdb_connection_delete_connection
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_connection_delete_connection
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Connection
},),
Ref
{
_Connection
}(
t
),
...
...
@@ -184,7 +191,7 @@ mutable struct _CertificateProvider
function
f
(
t
)
if
t
.
wrapped_certificate_provider
!=
C_NULL
ccall
(
(
:
caosdb_connection_delete_certificate_provider
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_connection_delete_certificate_provider
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_CertificateProvider
},),
Ref
{
_CertificateProvider
}(
t
),
...
...
@@ -210,7 +217,10 @@ mutable struct _Configuration
function
f
(
t
)
if
t
.
wrapped_connection_configuration
!=
C_NULL
ccall
(
(
:
caosdb_connection_delete_connection_configuration
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)),
(
:
caosdb_connection_delete_connection_configuration
,
CaosDB
.
library_name
,
),
Cint
,
(
Ref
{
_Configuration
},),
Ref
{
_Configuration
}(
t
),
...
...
@@ -232,7 +242,7 @@ function create_pem_file_certificate_provider(path::AbstractString)
cert_provider
=
Ref
{
_CertificateProvider
}(
_CertificateProvider
())
err_code
=
ccall
(
(
:
caosdb_connection_create_pem_file_certificate_provider
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_connection_create_pem_file_certificate_provider
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_CertificateProvider
},
Cstring
),
cert_provider
,
...
...
@@ -269,7 +279,7 @@ function create_tls_connection_configuration(
config
=
Ref
{
_Configuration
}(
_Configuration
())
err_code
=
ccall
(
(
:
caosdb_connection_create_tls_connection_configuration
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_connection_create_tls_connection_configuration
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Configuration
},
...
...
@@ -300,7 +310,7 @@ function create_insecure_connection_configuration(host::AbstractString, port::Ci
config
=
Ref
{
_Configuration
}(
_Configuration
())
err_code
=
ccall
(
(
:
caosdb_connection_create_insecure_connection_configuration
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_connection_create_insecure_connection_configuration
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Configuration
},
Cstring
,
Cint
),
config
,
...
...
@@ -327,7 +337,7 @@ function create_connection(config::Ref{_Configuration})
connection
=
Ref
{
_Connection
}(
_Connection
())
err_code
=
ccall
(
(
:
caosdb_connection_create_connection
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_connection_create_connection
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Connection
},
Ref
{
_Configuration
}),
connection
,
...
...
@@ -355,7 +365,7 @@ function get_version_info(con::Ref{_Connection})
info
=
Ref
{
CaosDB
.
Info
.
_VersionInfo
}(
CaosDB
.
Info
.
_VersionInfo
())
err_code
=
ccall
(
(
:
caosdb_connection_get_version_info
,
(
@static
Sys
.
iswindows
()
?
"ccaosdb"
:
"libccaosdb"
)
),
(
:
caosdb_connection_get_version_info
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
CaosDB
.
Info
.
_VersionInfo
},
Ref
{
_Connection
}),
info
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment