Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-cellframe
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
1
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
python-cellframe
Commits
d6ca6138
Commit
d6ca6138
authored
4 years ago
by
alexey.stratulat
Browse files
Options
Downloads
Plain Diff
[*] Fixed merge conflicts.
parents
3195c5da
268d0cb2
No related branches found
No related tags found
1 merge request
!25
Features 2773
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CellFrame/python-cellframe.c
+67
-26
67 additions, 26 deletions
CellFrame/python-cellframe.c
cellframe-sdk
+1
-1
1 addition, 1 deletion
cellframe-sdk
include/python-cellframe.h
+12
-0
12 additions, 0 deletions
include/python-cellframe.h
with
80 additions
and
27 deletions
CellFrame/python-cellframe.c
+
67
−
26
View file @
d6ca6138
...
...
@@ -21,9 +21,32 @@ static bool s_init_cs_dag_pos = false;
static
bool
s_init_chain_net_srv
=
false
;
static
bool
s_init_ks
=
false
;
static
bool
submodules_deint
;
PyObject
*
CellFrame_error
=
NULL
;
#ifdef _WIN32
BOOL
WINAPI
consoleHandler
(
DWORD
dwType
){
if
(
dwType
==
CTRL_C_EVENT
){
log_it
(
L_NOTICE
,
"Handler Ctrl+C"
);
dap_server_loop_stop
();
deinit_modules
();
}
return
TRUE
;
}
#else
void
sigfunc
(
int
sig
){
if
(
sig
==
SIGINT
){
log_it
(
L_NOTICE
,
"Handler Ctrl+C"
);
dap_server_loop_stop
();
deinit_modules
();
}
}
#endif
PyObject
*
python_cellframe_init
(
PyObject
*
self
,
PyObject
*
args
){
const
char
*
app_name
;
const
char
*
file_name_log
;
...
...
@@ -32,6 +55,13 @@ PyObject *python_cellframe_init(PyObject *self, PyObject *args){
const
char
*
JSON_str
;
s_init_ks
=
true
;
submodules_deint
=
false
;
#ifdef _WIN32
setConsoleCtrlHandler
((
PHANDLER_ROUTINE
)
consoleHandler
,
TRUE
);
#else
signal
(
SIGINT
,
sigfunc
);
#endif
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
JSON_str
)){
PyErr_SetString
(
CellFrame_error
,
"ERROR in function call signature: can't get one String argument"
);
...
...
@@ -463,32 +493,39 @@ PyMODINIT_FUNC PyInit_libCellFrame(void){
return
module
;
}
PyObject
*
python_cellframe_deinit
(
PyObject
*
self
,
PyObject
*
args
){
if
(
s_init_crypto
){
dap_crypto_deinit
();
dap_cert_deinit
();
}
if
(
s_init_chain
){
deinit_chain_py
();
dap_chain_cs_deinit_py
();
}
if
(
s_init_stream
){
dap_stream_deinit
();
}
if
(
s_init_stream_ctl
){
dap_stream_ctl_deinit
();
}
if
(
s_init_http_folder
){
dap_http_folder_deinit
();
}
if
(
s_init_http
){
dap_http_deinit
();
}
if
(
s_init_server_core
){
dap_server_core_deinit
();
}
if
(
s_init_ks
){
dap_enc_ks_deinit
();
void
deinit_modules
(
void
){
if
(
!
submodules_deint
){
log_it
(
L_NOTICE
,
"Start deint submodules"
);
if
(
s_init_crypto
){
dap_crypto_deinit
();
dap_cert_deinit
();
}
if
(
s_init_chain
){
deinit_chain_py
();
dap_chain_cs_deinit_py
();
}
if
(
s_init_stream
){
dap_stream_deinit
();
}
if
(
s_init_stream_ctl
){
dap_stream_ctl_deinit
();
}
if
(
s_init_http_folder
){
dap_http_folder_deinit
();
}
if
(
s_init_http
){
dap_http_deinit
();
}
if
(
s_init_server_core
){
dap_server_core_deinit
();
}
if
(
s_init_ks
){
dap_enc_ks_deinit
();
}
dap_config_close
(
g_config
);
dap_config_deinit
();
dap_common_deinit
();
submodules_deint
=
true
;
}
if
(
s_init_wallet
){
dap_chain_wallet_deinit_py
();
...
...
@@ -496,6 +533,10 @@ PyObject *python_cellframe_deinit(PyObject *self, PyObject *args){
dap_config_close
(
g_config
);
dap_config_deinit
();
dap_common_deinit
();
}
PyObject
*
python_cellframe_deinit
(
PyObject
*
self
,
PyObject
*
args
){
deinit_modules
();
return
PyLong_FromLong
(
0
);
}
...
...
This diff is collapsed.
Click to expand it.
cellframe-sdk
@
c833958a
Compare
f9421297
...
c833958a
Subproject commit
f94212973623702bff498780fc2d0426e595d5ec
Subproject commit
c833958ae5e623292aa1d54617548cb4a42f9525
This diff is collapsed.
Click to expand it.
include/python-cellframe.h
+
12
−
0
View file @
d6ca6138
...
...
@@ -60,9 +60,21 @@
#include
"wrapping_dap_chain_gdb.h"
#include
"dap_common.h"
#include
"dap_server.h"
#ifdef _WIN32
#include
"Windows.h"
BOOL
WINAPI
consoleHandler
(
DWORD
);
#else
#include
"signal.h"
void
sigfunc
(
int
sig
);
#endif
PyObject
*
python_cellframe_init
(
PyObject
*
self
,
PyObject
*
args
);
void
deinit_modules
(
void
);
PyObject
*
python_cellframe_deinit
(
PyObject
*
self
,
PyObject
*
args
);
static
PyMethodDef
CellFramePythonMethods
[]
=
{
...
...
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