Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
18
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
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
4959efd6
Commit
4959efd6
authored
6 years ago
by
Dmitriy A. Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[*] Blank functions for PoS
parent
2774aba8
No related branches found
No related tags found
1 merge request
!24
Support 3689
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+15
-0
15 additions, 0 deletions
CMakeLists.txt
dap_chain_cs_dag_pos.c
+93
-0
93 additions, 0 deletions
dap_chain_cs_dag_pos.c
dap_chain_cs_dag_pos.h
+40
-0
40 additions, 0 deletions
dap_chain_cs_dag_pos.h
with
148 additions
and
0 deletions
CMakeLists.txt
0 → 100644
+
15
−
0
View file @
4959efd6
cmake_minimum_required
(
VERSION 2.8
)
project
(
dap_chain_cs_dag_pos
)
set
(
DAP_CHAIN_CS_DAG_POS_SRCS
dap_chain_cs_dag_pos.c
)
set
(
DAP_CHAIN_CS_DAG_POS_HEADERS
dap_chain_cs_dag_pos.h
)
add_library
(
${
PROJECT_NAME
}
STATIC
${
DAP_CHAIN_CS_DAG_POS_SRCS
}
${
DAP_CHAIN_CS_DAG_POS_HEADERS
}
)
target_link_libraries
(
dap_chain_cs_dag_pos dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_cs_dag
)
target_include_directories
(
dap_chain_cs_dag_pos INTERFACE .
)
This diff is collapsed.
Click to expand it.
dap_chain_cs_dag_pos.c
0 → 100644
+
93
−
0
View file @
4959efd6
/*
* Authors:
* Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net>
* DeM Labs Inc. https://demlabs.net
* Kelvin Project https://github.com/kelvinblockchain
* Copyright (c) 2017-2019
* All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"dap_common.h"
#include
"dap_chain_cs.h"
#include
"dap_chain_cs_dag.h"
#include
"dap_chain_cs_dag_pos.h"
#define LOG_TAG "dap_chain_cs_dag_pos"
typedef
struct
dap_chain_cs_dag_pos_pvt
{
uint8_t
padding
;
}
dap_chain_cs_dag_pos_pvt_t
;
#define PVT(a) ((dap_chain_cs_dag_pos_pvt_t *) a->_pvt )
static
void
s_chain_cs_dag_callback_delete
(
dap_chain_cs_dag_t
*
a_dag
);
static
void
s_chain_cs_callback_new
(
dap_chain_t
*
a_chain
,
dap_config_t
*
a_chain_cfg
);
/**
* @brief dap_chain_cs_dag_pos_init
* @return
*/
int
dap_chain_cs_dag_pos_init
()
{
dap_chain_cs_add
(
"dag-pos"
,
s_chain_cs_callback_new
);
return
0
;
}
/**
* @brief dap_chain_cs_dag_pos_deinit
*/
void
dap_chain_cs_dag_pos_deinit
()
{
}
/**
* @brief s_cs_callback
* @param a_chain
* @param a_chain_cfg
*/
static
void
s_chain_cs_callback_new
(
dap_chain_t
*
a_chain
,
dap_config_t
*
a_chain_cfg
)
{
dap_chain_cs_dag_new
(
a_chain
,
a_chain_cfg
);
dap_chain_cs_dag_t
*
l_dag
=
DAP_CHAIN_CS_DAG
(
a_chain
);
dap_chain_cs_dag_pos_t
*
l_pos
=
DAP_NEW_Z
(
dap_chain_cs_dag_pos_t
);
l_dag
->
_inheritor
=
l_pos
;
l_dag
->
callback_delete
=
s_chain_cs_dag_callback_delete
;
l_pos
->
_pvt
=
DAP_NEW_Z
(
dap_chain_cs_dag_pos_pvt_t
);
dap_chain_cs_dag_pos_pvt_t
*
l_pos_pvt
=
PVT
(
l_pos
);
}
/**
* @brief s_chain_cs_dag_callback_delete
* @param a_dag
*/
static
void
s_chain_cs_dag_callback_delete
(
dap_chain_cs_dag_t
*
a_dag
)
{
dap_chain_cs_dag_pos_t
*
l_pos
=
DAP_CHAIN_CS_DAG_POS
(
a_dag
);
if
(
l_pos
->
_pvt
)
{
dap_chain_cs_dag_pos_pvt_t
*
l_pos_pvt
=
PVT
(
l_pos
);
DAP_DELETE
(
l_pos
->
_pvt
);
}
if
(
l_pos
->
_inheritor
)
{
DAP_DELETE
(
l_pos
->
_inheritor
);
}
}
This diff is collapsed.
Click to expand it.
dap_chain_cs_dag_pos.h
0 → 100644
+
40
−
0
View file @
4959efd6
/*
* Authors:
* Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net>
* DeM Labs Inc. https://demlabs.net
* Kelvin Project https://github.com/kelvinblockchain
* Copyright (c) 2017-2018
* All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include
"dap_chain_cs_dag.h"
#include
"dap_chain_cert.h"
typedef
struct
dap_chain_cs_dag_pos
{
dap_chain_t
*
chain
;
dap_chain_cs_dag_t
*
dag
;
void
*
_pvt
;
void
*
_inheritor
;
}
dap_chain_cs_dag_pos_t
;
#define DAP_CHAIN_CS_DAG_POS(a) ( (dap_chain_cs_dag_pos_t *) (a)->_inheritor)
int
dap_chain_cs_dag_pos_init
();
void
dap_chain_cs_dag_pos_deinit
();
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