]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
python: Delete old python bindings
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 15 Dec 2021 21:04:06 +0000 (21:04 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 3 Feb 2022 21:42:42 +0000 (14:42 -0700)
Remove the old python bindings.  They will be replaced with Cython
bindings in a subsequent commit.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
configure.ac
src/Makefile.am
src/bindings/Makefile.am [deleted file]
src/bindings/libcgroup.p [deleted file]
src/bindings/tests/stat.py [deleted file]

index 1b45fc1cbec5ae24f1c76c1a1ac72e4a1b19ef4a..2e6b0a5aaba999d452624dc83947f01f79da100e 100644 (file)
@@ -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
index 37db235c51b41a8b48f0470369837c4d91022597..f407f609ca73336949688a220d8f03cdbc2d9ebc 100644 (file)
@@ -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 (file)
index d7e32bc..0000000
+++ /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 (file)
index ed3f32f..0000000
+++ /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 (file)
index 3cfdb24..0000000
+++ /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)