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
3
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
41f696a3
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
Branches containing commit
No related tags found
1 merge request
!26
Support 3689
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_
#pragma once
#define _WRAPPING_DAP_CHAIN_NET_NODE_CLI_
#include
<Python.h>
#include
<Python.h>
#include
"dap_config.h"
#include
"dap_config.h"
...
@@ -8,14 +7,10 @@
...
@@ -8,14 +7,10 @@
#include
"wrapping_dap_chain_common.h"
#include
"wrapping_dap_chain_common.h"
#include
"wrapping_dap_chain_net_node.h"
#include
"wrapping_dap_chain_net_node.h"
#ifdef __cplusplus
typedef
struct
PyDapAppCliServer
{
extern
"C"
{
#endif
typedef
struct
PyDapChainNodeCli
{
PyObject_HEAD
PyObject_HEAD
cmdfunc_t
*
func
;
cmdfunc_t
*
func
;
}
PyDap
ChainNodeCli
Object
;
}
PyDap
AppCliServer
Object
;
static
PyObject
*
binded_object_cmdfunc
=
NULL
;
static
PyObject
*
binded_object_cmdfunc
=
NULL
;
int
dap_chain_node_cli_init_py
(
dap_config_t
*
g_config
);
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);
...
@@ -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
);
PyObject
*
dap_chain_node_addr_get_by_alias_py
(
PyObject
*
self
,
PyObject
*
args
);
static
PyMethodDef
DapChainNodeCliMethods
[]
=
{
static
PyMethodDef
DapChainNodeCliMethods
[]
=
{
{
"cmdItemCreate"
,
dap_chain_node_cli_cmd_item_create_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
,
""
},
{
"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
,
""
},
{
"getByAlias"
,
dap_chain_node_addr_get_by_alias_py
,
METH_VARARGS
|
METH_STATIC
,
""
},
{
NULL
,
NULL
,
0
,
NULL
}
{
NULL
,
NULL
,
0
,
NULL
}
};
};
static
PyTypeObject
DapChainNodeCliObject_DapChainNodeCliObjectType
=
{
static
PyTypeObject
DapChainNodeCliObject_DapChainNodeCliObjectType
=
{
PyVarObject_HEAD_INIT
(
NULL
,
0
)
PyVarObject_HEAD_INIT
(
NULL
,
0
)
"
CellFrame.Chain.Node.cli
"
,
/* tp_name */
"
AppCliServer
"
,
/* tp_name */
sizeof
(
PyDap
ChainNodeCli
Object
),
/* tp_basicsize */
sizeof
(
PyDap
AppCliServer
Object
),
/* tp_basicsize */
0
,
/* tp_itemsize */
0
,
/* tp_itemsize */
0
,
/* tp_dealloc */
0
,
/* tp_dealloc */
0
,
/* tp_print */
0
,
/* tp_print */
...
@@ -79,9 +74,3 @@ static PyTypeObject DapChainNodeCliObject_DapChainNodeCliObjectType = {
...
@@ -79,9 +74,3 @@ static PyTypeObject DapChainNodeCliObject_DapChainNodeCliObjectType = {
char
**
PyListToString
(
PyObject
*
list
);
char
**
PyListToString
(
PyObject
*
list
);
PyObject
*
stringToPyList
(
char
**
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
){
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
);
dap_chain_node_cli_init
(
g_config
);
}
}
void
dap_chain_node_cli_delete_py
(
void
){
void
dap_chain_node_cli_delete_py
(
void
){
...
@@ -26,7 +29,7 @@ static int wrapping_cmdfunc(int argc, char **argv, char **str_reply){
...
@@ -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
){
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
;
obj
->
func
=
wrapping_cmdfunc
;
return
(
PyObject
*
)
obj
;
return
(
PyObject
*
)
obj
;
}
}
...
@@ -35,7 +38,7 @@ PyObject *dap_chain_node_cli_cmd_item_create_py(PyObject *a_self, PyObject *a_ar
...
@@ -35,7 +38,7 @@ PyObject *dap_chain_node_cli_cmd_item_create_py(PyObject *a_self, PyObject *a_ar
(
void
)
a_self
;
(
void
)
a_self
;
const
char
*
name
,
*
doc
,
*
doc_ex
;
const
char
*
name
,
*
doc
,
*
doc_ex
;
PyObject
*
obj_cmdfunc
;
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
;
return
NULL
;
}
else
{
}
else
{
if
(
!
PyCallable_Check
(
obj_cmdfunc
)){
if
(
!
PyCallable_Check
(
obj_cmdfunc
)){
...
@@ -46,11 +49,12 @@ PyObject *dap_chain_node_cli_cmd_item_create_py(PyObject *a_self, PyObject *a_ar
...
@@ -46,11 +49,12 @@ PyObject *dap_chain_node_cli_cmd_item_create_py(PyObject *a_self, PyObject *a_ar
Py_XINCREF
(
obj_cmdfunc
);
Py_XINCREF
(
obj_cmdfunc
);
Py_XDECREF
(
binded_object_cmdfunc
);
Py_XDECREF
(
binded_object_cmdfunc
);
binded_object_cmdfunc
=
obj_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
);
return
PyLong_FromLong
(
0
);
}
}
PyObject
*
dap_chain_node_cli_set_reply_text_py
(
PyObject
*
self
,
PyObject
*
args
){
PyObject
*
dap_chain_node_cli_set_reply_text_py
(
PyObject
*
self
,
PyObject
*
args
){
(
void
)
self
;
PyObject
*
obj_str_reply_list
;
PyObject
*
obj_str_reply_list
;
const
char
*
str_list
;
const
char
*
str_list
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|O"
,
&
obj_str_reply_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){
...
@@ -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
){
PyObject
*
dap_chain_node_addr_get_by_alias_py
(
PyObject
*
self
,
PyObject
*
args
){
(
void
)
self
;
PyObject
*
chain_net
;
PyObject
*
chain_net
;
const
char
*
alias
;
const
char
*
alias
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|s"
,
&
chain_net
,
&
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