Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain-net-python
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-net-python
Commits
41f696a3
"...git@gitlab.demlabs.net:dmitry.puzyrkov/cellframe-node.git" did not exist on "b51108b5b2697e325d8f3c2daf8d33d2ee543eb5"
Commit
41f696a3
authored
5 years ago
by
Dmitriy A. Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[*] dap_chain_node_cli -> dap_app_cli_server
parent
1d329e90
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/wrapping_dap_app_cli_server.h
+7
-18
7 additions, 18 deletions
include/wrapping_dap_app_cli_server.h
src/wrapping_dap_app_cli_server.c
+9
-4
9 additions, 4 deletions
src/wrapping_dap_app_cli_server.c
with
16 additions
and
22 deletions
include/wrapping_dap_
chain_net_node_cli
.h
→
include/wrapping_dap_
app_cli_server
.h
+
7
−
18
View file @
41f696a3
#ifndef _WRAPPING_DAP_CHAIN_NET_NODE_CLI_
#define _WRAPPING_DAP_CHAIN_NET_NODE_CLI_
#pragma once
#include
<Python.h>
#include
"dap_config.h"
...
...
@@ -8,14 +7,10 @@
#include
"wrapping_dap_chain_common.h"
#include
"wrapping_dap_chain_net_node.h"
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
PyDapChainNodeCli
{
typedef
struct
PyDapAppCliServer
{
PyObject_HEAD
cmdfunc_t
*
func
;
}
PyDap
ChainNodeCli
Object
;
}
PyDap
AppCliServer
Object
;
static
PyObject
*
binded_object_cmdfunc
=
NULL
;
int
dap_chain_node_cli_init_py
(
dap_config_t
*
g_config
);
...
...
@@ -29,16 +24,16 @@ PyObject *dap_chain_node_cli_set_reply_text_py(PyObject *self, PyObject *args);
PyObject
*
dap_chain_node_addr_get_by_alias_py
(
PyObject
*
self
,
PyObject
*
args
);
static
PyMethodDef
DapChainNodeCliMethods
[]
=
{
{
"cmdItemCreate"
,
dap_chain_node_cli_cmd_item_create_py
,
METH_VARARGS
,
""
},
{
"setReplyText"
,
dap_chain_node_cli_set_reply_text_py
,
METH_VARARGS
,
""
},
{
"cmdItemCreate"
,
dap_chain_node_cli_cmd_item_create_py
,
METH_VARARGS
|
METH_STATIC
,
""
},
{
"setReplyText"
,
dap_chain_node_cli_set_reply_text_py
,
METH_VARARGS
|
METH_STATIC
,
""
},
{
"getByAlias"
,
dap_chain_node_addr_get_by_alias_py
,
METH_VARARGS
|
METH_STATIC
,
""
},
{
NULL
,
NULL
,
0
,
NULL
}
};
static
PyTypeObject
DapChainNodeCliObject_DapChainNodeCliObjectType
=
{
PyVarObject_HEAD_INIT
(
NULL
,
0
)
"
CellFrame.Chain.Node.cli
"
,
/* tp_name */
sizeof
(
PyDap
ChainNodeCli
Object
),
/* tp_basicsize */
"
AppCliServer
"
,
/* tp_name */
sizeof
(
PyDap
AppCliServer
Object
),
/* tp_basicsize */
0
,
/* tp_itemsize */
0
,
/* tp_dealloc */
0
,
/* tp_print */
...
...
@@ -79,9 +74,3 @@ static PyTypeObject DapChainNodeCliObject_DapChainNodeCliObjectType = {
char
**
PyListToString
(
PyObject
*
list
);
PyObject
*
stringToPyList
(
char
**
list
);
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_NET_NODE_CLI_
This diff is collapsed.
Click to expand it.
src/wrapping_dap_
chain_net_node_cli
.c
→
src/wrapping_dap_
app_cli_server
.c
+
9
−
4
View file @
41f696a3
#include
"wrapping_dap_chain_net_node_cli.h"
#include
"wrapping_dap_app_cli_server.h"
#define LOG_TAG "wrapping_dap_app_cli_server"
int
dap_chain_node_cli_init_py
(
dap_config_t
*
g_config
){
log_it
(
L_DEBUG
,
"Init app cli server"
);
dap_chain_node_cli_init
(
g_config
);
}
void
dap_chain_node_cli_delete_py
(
void
){
...
...
@@ -26,7 +29,7 @@ static int wrapping_cmdfunc(int argc, char **argv, char **str_reply){
}
PyObject
*
DapChainNodeCliObject_new
(
PyTypeObject
*
type_object
,
PyObject
*
args
,
PyObject
*
kwds
){
PyDap
ChainNodeCli
Object
*
obj
=
(
PyDap
ChainNodeCli
Object
*
)
PyType_GenericNew
(
type_object
,
args
,
kwds
);
PyDap
AppCliServer
Object
*
obj
=
(
PyDap
AppCliServer
Object
*
)
PyType_GenericNew
(
type_object
,
args
,
kwds
);
obj
->
func
=
wrapping_cmdfunc
;
return
(
PyObject
*
)
obj
;
}
...
...
@@ -35,7 +38,7 @@ PyObject *dap_chain_node_cli_cmd_item_create_py(PyObject *a_self, PyObject *a_ar
(
void
)
a_self
;
const
char
*
name
,
*
doc
,
*
doc_ex
;
PyObject
*
obj_cmdfunc
;
if
(
!
PyArg_ParseTuple
(
a_args
,
"s|O:
set_c
allback|s|s"
,
&
name
,
&
obj_cmdfunc
,
&
doc
,
&
doc_ex
)){
if
(
!
PyArg_ParseTuple
(
a_args
,
"s|O:
cmdC
allback|s|s"
,
&
name
,
&
obj_cmdfunc
,
&
doc
,
&
doc_ex
)){
return
NULL
;
}
else
{
if
(
!
PyCallable_Check
(
obj_cmdfunc
)){
...
...
@@ -46,11 +49,12 @@ PyObject *dap_chain_node_cli_cmd_item_create_py(PyObject *a_self, PyObject *a_ar
Py_XINCREF
(
obj_cmdfunc
);
Py_XDECREF
(
binded_object_cmdfunc
);
binded_object_cmdfunc
=
obj_cmdfunc
;
dap_chain_node_cli_cmd_item_create
(
name
,
((
PyDap
ChainNodeCli
Object
*
)
obj_cmdfunc
)
->
func
,
doc
,
doc_ex
);
dap_chain_node_cli_cmd_item_create
(
name
,
((
PyDap
AppCliServer
Object
*
)
obj_cmdfunc
)
->
func
,
doc
,
doc_ex
);
return
PyLong_FromLong
(
0
);
}
PyObject
*
dap_chain_node_cli_set_reply_text_py
(
PyObject
*
self
,
PyObject
*
args
){
(
void
)
self
;
PyObject
*
obj_str_reply_list
;
const
char
*
str_list
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|O"
,
&
obj_str_reply_list
))
...
...
@@ -61,6 +65,7 @@ PyObject *dap_chain_node_cli_set_reply_text_py(PyObject *self, PyObject *args){
}
PyObject
*
dap_chain_node_addr_get_by_alias_py
(
PyObject
*
self
,
PyObject
*
args
){
(
void
)
self
;
PyObject
*
chain_net
;
const
char
*
alias
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|s"
,
&
chain_net
,
&
alias
))
...
...
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