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
6
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
9502c629
Commit
9502c629
authored
5 years ago
by
alexey.stratulat
Browse files
Options
Downloads
Patches
Plain Diff
Prepared the basis for creating python-cellframe
parent
8b6c4a91
No related branches found
No related tags found
1 merge request
!1
Features 2466
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+46
-0
46 additions, 0 deletions
CMakeLists.txt
include/python-cellframe.h
+34
-0
34 additions, 0 deletions
include/python-cellframe.h
src/python-cellframe.c
+35
-0
35 additions, 0 deletions
src/python-cellframe.c
with
115 additions
and
0 deletions
CMakeLists.txt
0 → 100644
+
46
−
0
View file @
9502c629
project
(
CellFrame C
)
cmake_minimum_required
(
VERSION 2.8
)
set
(
CMAKE_VERBOSE_MAKEFILE ON
)
set
(
CMAKE_COLOR_MAKEFILE ON
)
set
(
CMAKE_C_STANDARD 11
)
set
(
SUBMODULES_NO_BUILD ON
)
#add_subdirectory(libdap)
#add_subdirectory(libdap-crypto)
file
(
GLOB PYTHON_CELLFRAME_SRCS src/*.c
)
file
(
GLOB PYTHON_CELLFRAME_HEADERS include/*.h
)
set
(
Python_ADDITIONAL_VERSIONS 3.7
)
find_package
(
PythonLibs REQUIRED
)
#find_package(PkgConfig)
#pkg_check_modules(PC_JSON-C REQUIRED json-c)
include_directories
(
${
PYTHON_INCLUDE_DIR
}
include/
)
add_library
(
${
PROJECT_NAME
}
SHARED
${
PYTHON_CELLFRAME_SRCS
}
${
PYTHON_CELLFRAME_HEADERS
}
)
target_link_libraries
(
${
PROJECT_NAME
}
)
target_link_libraries
(
${
PROJECT_NAME
}
${
PYTHON_LIBRARIES
}
)
#target_compile_options(
# dap_core PRIVATE
# "-fpic"
#)
#target_link_libraries(${PROJECT_NAME} dap_core dap_crypto)
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/libdapConnector.py
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/main_test.py
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
#if(BUILD_DAP_TESTS)
# file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/main_test.py
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
# enable_testing()
#add_subdirectory(test)
#endif()
This diff is collapsed.
Click to expand it.
include/python-cellframe.h
0 → 100644
+
34
−
0
View file @
9502c629
#define PY_SSIZE_T_CLEAN
#include
"Python.h"
#ifdef __cplusplus
extern
"C"
{
#endif
PyObject
*
python_cellframe_init
(
PyObject
*
self
,
PyObject
*
args
);
static
PyMethodDef
CellFramePythonMethods
[]
=
{
{
"init"
,
python_cellframe_init
,
METH_VARARGS
,
"Initialization of the python-cellframe interface DAP (Deus Applicaions Prototypes)"
},
//{"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
}
};
static
struct
PyModuleDef
CellFramePythonModule
=
{
PyModuleDef_HEAD_INIT
,
"libCellFrame"
,
/* name of module */
NULL
,
/* module documentation, may be NULL */
-
1
,
/* size of per-interpreter state of the module,
or -1 if the module keeps state in global variables. */
CellFramePythonMethods
};
PyMODINIT_FUNC
PyInit_libCellFrame
(
void
);
#ifdef __cplusplus
}
#endif
This diff is collapsed.
Click to expand it.
src/python-cellframe.c
0 → 100644
+
35
−
0
View file @
9502c629
#include
"python-cellframe.h"
PyMODINIT_FUNC
PyInit_libCellFrame
(
void
){
PyObject
*
module
=
PyModule_Create
(
&
CellFramePythonModule
);
return
module
;
}
PyObject
*
python_cellframe_init
(
PyObject
*
self
,
PyObject
*
args
){
return
PyLong_FromLong
(
0
);
}
int
main
(
int
argc
,
char
**
argv
)
{
wchar_t
*
program
=
Py_DecodeLocale
(
argv
[
0
],
NULL
);
if
(
program
==
NULL
)
{
fprintf
(
stderr
,
"Fatal error: cannot decode argv[0]
\n
"
);
exit
(
1
);
}
/* Add a built-in module, before Py_Initialize */
PyImport_AppendInittab
(
"libCellFrame"
,
PyInit_libCellFrame
);
/* Pass argv[0] to the Python interpreter */
Py_SetProgramName
(
program
);
/* Initialize the Python interpreter. Required. */
Py_Initialize
();
/* Optionally import the module; alternatively,
import can be deferred until the embedded script
imports it. */
PyImport_ImportModule
(
"libCellFrame"
);
PyMem_RawFree
(
program
);
return
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