From: Tom Hromatka Date: Wed, 15 Dec 2021 21:04:06 +0000 (+0000) Subject: python: Delete old python bindings X-Git-Tag: v3.0~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b59aaf0ad5653a207ef504efd22f36a86f35d6d1;p=thirdparty%2Flibcgroup.git python: Delete old python bindings Remove the old python bindings. They will be replaced with Cython bindings in a subsequent commit. Signed-off-by: Tom Hromatka Reviewed-by: Kamalesh Babulal --- diff --git a/configure.ac b/configure.ac index 1b45fc1c..2e6b0a5a 100644 --- a/configure.ac +++ b/configure.ac @@ -38,18 +38,6 @@ LT_INIT AC_CONFIG_SRCDIR([src]) AC_CONFIG_HEADER([config.h]) -AC_ARG_ENABLE([bindings], - [AS_HELP_STRING([--enable-bindings],[enable python bindings [default=no]])], - [ - if test "x$enableval" = xno; then - with_bindings=false - else - with_bindings=true - fi - ], - [with_bindings = false]) -AM_CONDITIONAL([WITH_BINDINGS], [test x$with_bindings = xtrue]) - # Process command line options AC_ARG_ENABLE([tools], [AS_HELP_STRING([--enable-tools],[compile libcgroup tools [default=yes]])], @@ -214,7 +202,6 @@ AC_CONFIG_FILES([Makefile src/daemon/Makefile src/tools/Makefile src/pam/Makefile - src/bindings/Makefile scripts/Makefile scripts/init.d/cgconfig scripts/init.d/cgred diff --git a/src/Makefile.am b/src/Makefile.am index 37db235c..f407f609 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,11 +2,7 @@ BUILT_SOURCES = parse.c parse.h -if WITH_BINDINGS -BINDINGS_SUBDIR = bindings -endif - -SUBDIRS = . daemon pam tools $(BINDINGS_SUBDIR) +SUBDIRS = . daemon pam tools # generate parse.h from parse.y AM_YFLAGS = -d diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am deleted file mode 100644 index d7e32bcd..00000000 --- a/src/bindings/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -SUBDIRS = . -AM_CPPFLAGS = -I$(top_srcdir)/include - -lib_LTLIBRARIES = _libcgroup.la -_libcgroup_la_SOURCES = libcgroup.c -_libcgroup_la_LDFLAGS = $(shell python-config --ldflags) -module -avoid-version -_libcgroup_la_CFLAGS = $(shell python-config --cflags) -_libcgroup_la_LIBADD = $(top_builddir)/src/libcgroup.la -SWIG=swig - - -libcgroup.c: libcgroup.p $(top_srcdir)/include/libcgroup.h - cp libcgroup.p libcgroup.i - $(CC) $(INCLUDES) -DSWIG -E $(top_srcdir)/include/libcgroup.h >> libcgroup.i - $(SWIG) -python -o libcgroup.c libcgroup.i diff --git a/src/bindings/libcgroup.p b/src/bindings/libcgroup.p deleted file mode 100644 index ed3f32fd..00000000 --- a/src/bindings/libcgroup.p +++ /dev/null @@ -1,21 +0,0 @@ -%module libcgroup -%{ -#include "libcgroup.h" -%} - -%include typemaps.i -%include cpointer.i -%pointer_functions(int, intp); -%typemap (in) void** (void *temp) { - void *arg; - if ((arg = PyCObject_AsVoidPtr($input)) != NULL) { - $1 = &arg; - } else - $1 = &temp; -} - -%typemap (argout) void** { - PyObject *obj = PyCObject_FromVoidPtr(*$1, NULL); - $result = PyTuple_Pack(2, $result, obj); -} - diff --git a/src/bindings/tests/stat.py b/src/bindings/tests/stat.py deleted file mode 100644 index 3cfdb246..00000000 --- a/src/bindings/tests/stat.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python - -from libcgroup import * -from ctypes import * - -ret = cgroup_init() -if (ret != 0): - print cgroup_strerror(ret) - exit(1) - -# -# Add the correct controllers based on the mount point -# -cg_stat = cgroup_stat() -tree_handle = c_void_p() -info = cgroup_file_info() -lvl = new_intp() -ret1, tree_handle = cgroup_walk_tree_begin("memory", "/", 0, tree_handle, info, lvl) -root_len = len(info.full_path) - 1 -while ret1 != ECGEOF: - if (info.type == CGROUP_FILE_TYPE_DIR): - dir = info.full_path[root_len:] - print "\nDirectory %s\n" %(dir) - - p = c_void_p() - ret, p = cgroup_read_stats_begin("memory", dir, p, cg_stat) - while ret != ECGEOF: - print "%s:%s" %(cg_stat.name, cg_stat.value.strip('\n')) - ret, p = cgroup_read_stats_next(p, cg_stat) - - cgroup_read_stats_end(p) - ret1, tree_handle = cgroup_walk_tree_next(0, tree_handle, info, intp_value(lvl)) - -cgroup_walk_tree_end(tree_handle) -delete_intp(lvl)