Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-server-core-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-server-core-python
Commits
9116d006
Commit
9116d006
authored
5 years ago
by
Alexey Stratulat
Browse files
Options
Downloads
Patches
Plain Diff
Added to initialization/deinitialization dap_events, dap_client_remote
parent
c813334c
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Features 2392
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/libdap-server-core-python.h
+15
-1
15 additions, 1 deletion
include/libdap-server-core-python.h
src/libdap-server-core-python.c
+33
-1
33 additions, 1 deletion
src/libdap-server-core-python.c
with
48 additions
and
2 deletions
include/libdap-server-core-python.h
+
15
−
1
View file @
9116d006
#define PY_SSIZE_T_CLEAN
#include
"Python.h"
#include
"dap_server.h"
#include
"dap_client_remote.h"
#include
"dap_events.h"
#include
"dap_common.h"
#ifdef __cplusplus
extern
"C"
{
#endif
dap_server_t
*
t_server
;
#define LOG_TAG "libdap-server-core-python"
static
PyObject
*
dap_server_core_init
(
PyObject
*
self
,
PyObject
*
args
);
static
PyObject
*
dap_server_core_deinit
();
static
PyObject
*
dap_server_core_deinit
(
void
);
static
PyObject
*
dap_server_core_loop
(
PyObject
*
self
,
PyObject
*
args
);
static
PyObject
*
dap_server_core_listen
(
PyObject
*
self
,
PyObject
*
args
);
static
PyMethodDef
DapServerCorePythonMethods
[]
=
{
{
"init"
,
dap_server_core_init
,
METH_VARARGS
,
"Initialization of the DAP (Deus Applicaions Prototypes) server core library"
},
{
"deinit"
,
dap_server_core_deinit
,
METH_NOARGS
,
"Deinitialization of the DAP (Deus Applicaions Prototypes) server core library"
},
{
"loop"
,
dap_server_core_loop
,
METH_VARARGS
,
""
},
{
"listen"
,
dap_server_core_listen
,
METH_VARARGS
,
""
},
{
NULL
,
NULL
,
0
,
NULL
}
};
...
...
This diff is collapsed.
Click to expand it.
src/libdap-server-core-python.c
+
33
−
1
View file @
9116d006
...
...
@@ -2,9 +2,41 @@
static
PyObject
*
dap_server_core_init
(
PyObject
*
self
,
PyObject
*
args
){
return
PyLong_FromLong
(
0
);
uint32_t
l_thread_cnt
;
size_t
conn_t
;
if
(
!
PyArg_ParseTuple
(
args
,
"I|n"
,
&
l_thread_cnt
,
&
conn_t
)){
return
NULL
;
}
int32_t
result
=
dap_server_init
(
l_thread_cnt
);
if
(
result
!=
0
)
{
log_it
(
L_CRITICAL
,
"Can't init socket server module"
);
}
dap_events_init
(
l_thread_cnt
,
conn_t
);
dap_client_remote_init
();
return
PyLong_FromLong
(
result
);
}
static
PyObject
*
dap_server_core_deinit
(){
dap_client_remote_deinit
();
dap_server_deinit
();
dap_events_deinit
();
return
PyLong_FromLong
(
0
);
}
static
PyObject
*
dap_server_core_loop
(
PyObject
*
self
,
PyObject
*
args
){
int32_t
result
=
dap_server_loop
(
t_server
);
return
PyLong_FromLong
(
result
);
}
static
PyObject
*
dap_server_core_listen
(
PyObject
*
self
,
PyObject
*
args
){
const
char
*
addr
;
uint16_t
port
;
uint16_t
type
;
if
(
!
PyArg_ParseTuple
(
args
,
"s|H|H"
,
&
addr
,
&
port
,
&
type
)){
return
NULL
;
}
if
(
type
>
1
)
return
NULL
;
t_server
=
dap_server_listen
(
addr
,
port
,
type
);
return
PyLong_FromLong
(
0
);
}
...
...
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