Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain-global-db
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain-global-db
Commits
7e1fb01a
Commit
7e1fb01a
authored
5 years ago
by
anta999
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://gitlab.demlabs.net/cellframe/libdap-chain-global-db
into HEAD
parents
b26e3cdc
94d4a28d
No related branches found
Branches containing commit
No related tags found
2 merge requests
!2
Master
,
!1
1.1 12 win
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+19
-1
19 additions, 1 deletion
CMakeLists.txt
dap_chain_global_db.c
+4
-1
4 additions, 1 deletion
dap_chain_global_db.c
dap_chain_global_db_driver_cdb.c
+14
-2
14 additions, 2 deletions
dap_chain_global_db_driver_cdb.c
with
37 additions
and
4 deletions
CMakeLists.txt
+
19
−
1
View file @
7e1fb01a
...
@@ -4,9 +4,27 @@ project (dap_chain_global_db)
...
@@ -4,9 +4,27 @@ project (dap_chain_global_db)
file
(
GLOB DAP_CHAIN_GLOBAL_DB_SRC *.c
)
file
(
GLOB DAP_CHAIN_GLOBAL_DB_SRC *.c
)
file
(
GLOB DAP_CHAIN_GLOBAL_DB_HDR *.h
)
file
(
GLOB DAP_CHAIN_GLOBAL_DB_HDR *.h
)
if
(
WIN32
)
include_directories
(
../libdap/src/win32/
)
include_directories
(
../3rdparty/libmemcached/
)
include_directories
(
../3rdparty/libmemcached/win32/
)
include_directories
(
../3rdparty/wepoll/include/
)
include_directories
(
../3rdparty/uthash/src/
)
include_directories
(
../3rdparty/libjson-c/
)
include_directories
(
../3rdparty/libmagic/src/
)
include_directories
(
../3rdparty/curl/include/
)
include_directories
(
../3rdparty/libsqlite3/
)
endif
()
add_library
(
${
PROJECT_NAME
}
STATIC
${
DAP_CHAIN_GLOBAL_DB_SRC
}
${
DAP_CHAIN_GLOBAL_DB_HDR
}
)
add_library
(
${
PROJECT_NAME
}
STATIC
${
DAP_CHAIN_GLOBAL_DB_SRC
}
${
DAP_CHAIN_GLOBAL_DB_HDR
}
)
target_link_libraries
(
dap_chain_global_db dap_core dap_crypto dap_chain dap_chain_crypto ldb talloc tevent sqlite3
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcuttdb.a
)
if
(
WIN32
)
target_link_libraries
(
dap_chain_global_db dap_core dap_crypto dap_chain dap_chain_crypto
)
endif
()
if
(
UNIX
)
target_link_libraries
(
dap_chain_global_db dap_core dap_crypto dap_chain dap_chain_crypto ldb talloc tevent sqlite3
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcuttdb.a
)
endif
()
target_include_directories
(
dap_chain_global_db INTERFACE .
)
target_include_directories
(
dap_chain_global_db INTERFACE .
)
set
(
${
PROJECT_NAME
}
_DEFINITIONS CACHE INTERNAL
"
${
PROJECT_NAME
}
: Definitions"
FORCE
)
set
(
${
PROJECT_NAME
}
_DEFINITIONS CACHE INTERNAL
"
${
PROJECT_NAME
}
: Definitions"
FORCE
)
...
...
This diff is collapsed.
Click to expand it.
dap_chain_global_db.c
+
4
−
1
View file @
7e1fb01a
...
@@ -77,7 +77,10 @@ char * extract_group_prefix(const char * a_group)
...
@@ -77,7 +77,10 @@ char * extract_group_prefix(const char * a_group)
{
{
char
*
l_group_prefix
=
NULL
,
*
l_delimeter
;
char
*
l_group_prefix
=
NULL
,
*
l_delimeter
;
size_t
l_group_prefix_size
;
size_t
l_group_prefix_size
;
l_delimeter
=
index
(
a_group
,
'.'
);
// l_delimeter = index(a_group, '.');
l_delimeter
=
strchr
(
a_group
,
'.'
);
if
(
l_delimeter
==
NULL
)
{
if
(
l_delimeter
==
NULL
)
{
l_group_prefix
=
dap_strdup
(
a_group
);
l_group_prefix
=
dap_strdup
(
a_group
);
l_group_prefix_size
=
dap_strlen
(
l_group_prefix
)
+
1
;
l_group_prefix_size
=
dap_strlen
(
l_group_prefix
)
+
1
;
...
...
This diff is collapsed.
Click to expand it.
dap_chain_global_db_driver_cdb.c
+
14
−
2
View file @
7e1fb01a
...
@@ -187,7 +187,13 @@ int dap_db_driver_cdb_init(const char *a_cdb_path, dap_db_driver_callbacks_t *a_
...
@@ -187,7 +187,13 @@ int dap_db_driver_cdb_init(const char *a_cdb_path, dap_db_driver_callbacks_t *a_
if
(
s_cdb_path
[
strlen
(
s_cdb_path
)]
==
'/'
)
{
if
(
s_cdb_path
[
strlen
(
s_cdb_path
)]
==
'/'
)
{
s_cdb_path
[
strlen
(
s_cdb_path
)]
=
'\0'
;
s_cdb_path
[
strlen
(
s_cdb_path
)]
=
'\0'
;
}
}
#ifdef _WIN32
mkdir
(
s_cdb_path
);
#else
mkdir
(
s_cdb_path
,
0755
);
mkdir
(
s_cdb_path
,
0755
);
#endif
struct
dirent
*
d
;
struct
dirent
*
d
;
DIR
*
dir
=
opendir
(
s_cdb_path
);
DIR
*
dir
=
opendir
(
s_cdb_path
);
if
(
!
dir
)
{
if
(
!
dir
)
{
...
@@ -229,7 +235,13 @@ int dap_cdb_add_group(const char *a_group) {
...
@@ -229,7 +235,13 @@ int dap_cdb_add_group(const char *a_group) {
strcat
(
l_cdb_path
,
s_cdb_path
);
strcat
(
l_cdb_path
,
s_cdb_path
);
strcat
(
l_cdb_path
,
"/"
);
strcat
(
l_cdb_path
,
"/"
);
strcat
(
l_cdb_path
,
a_group
);
strcat
(
l_cdb_path
,
a_group
);
#ifdef _WIN32
mkdir
(
l_cdb_path
);
#else
mkdir
(
l_cdb_path
,
0755
);
mkdir
(
l_cdb_path
,
0755
);
#endif
return
0
;
return
0
;
}
}
...
@@ -312,7 +324,7 @@ dap_store_obj_t *dap_db_driver_cdb_read_store_obj(const char *a_group, const cha
...
@@ -312,7 +324,7 @@ dap_store_obj_t *dap_db_driver_cdb_read_store_obj(const char *a_group, const cha
if
(
a_count_out
)
{
if
(
a_count_out
)
{
*
a_count_out
=
l_count_out
;
*
a_count_out
=
l_count_out
;
}
}
for
(
u
long
i
=
0
;
i
<
l_count_out
;
++
i
)
{
for
(
u
int64_t
i
=
0
;
i
<
l_count_out
;
++
i
)
{
l_arg
.
o
[
i
].
group
=
dap_strdup
(
a_group
);
l_arg
.
o
[
i
].
group
=
dap_strdup
(
a_group
);
}
}
l_obj
=
l_arg
.
o
;
l_obj
=
l_arg
.
o
;
...
@@ -360,7 +372,7 @@ dap_store_obj_t* dap_db_driver_cdb_read_cond_store_obj(const char *a_group, uint
...
@@ -360,7 +372,7 @@ dap_store_obj_t* dap_db_driver_cdb_read_cond_store_obj(const char *a_group, uint
if
(
a_count_out
)
{
if
(
a_count_out
)
{
*
a_count_out
=
l_count_out
;
*
a_count_out
=
l_count_out
;
}
}
for
(
u
long
i
=
0
;
i
<
l_count_out
;
++
i
)
{
for
(
u
int64_t
i
=
0
;
i
<
l_count_out
;
++
i
)
{
l_arg
.
o
[
i
].
group
=
dap_strdup
(
a_group
);
l_arg
.
o
[
i
].
group
=
dap_strdup
(
a_group
);
}
}
return
l_arg
.
o
;
return
l_arg
.
o
;
...
...
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