summaryrefslogtreecommitdiffstats
path: root/edd/pyedd.c
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-05-09 15:14:42 +0000
committerMatt Wilson <msw@redhat.com>2000-05-09 15:14:42 +0000
commitd1ce6dffd3bb9b940e6d8fd5d47958ccc47eec2f (patch)
tree927e31bc6bdfc23b6de36728cacc79a2c4115ac1 /edd/pyedd.c
parent411ecdc3cc519b861d6219292a25dbca245342ae (diff)
downloadanaconda-d1ce6dffd3bb9b940e6d8fd5d47958ccc47eec2f.tar.gz
anaconda-d1ce6dffd3bb9b940e6d8fd5d47958ccc47eec2f.tar.xz
anaconda-d1ce6dffd3bb9b940e6d8fd5d47958ccc47eec2f.zip
import of edd detection
Diffstat (limited to 'edd/pyedd.c')
-rw-r--r--edd/pyedd.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/edd/pyedd.c b/edd/pyedd.c
new file mode 100644
index 000000000..a0d845caf
--- /dev/null
+++ b/edd/pyedd.c
@@ -0,0 +1,46 @@
+/*
+ * pyedd.c - real mode bios library for discovering EDD capabilities of
+ * BIOS drives
+ *
+ * Matt Wilson <msw@redhat.com>
+ *
+ * Copyright 2000 Red Hat, Inc.
+ *
+ * This software may be freely redistributed under the terms of the GNU
+ * library public license.
+ *
+ * You should have received a copy of the GNU Library Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include "edd.h"
+
+#include <Python.h>
+
+static PyObject * edd_py_detect (PyObject * s, PyObject * args);
+
+static PyMethodDef edd_module_methods[] = {
+ { "detect", (PyCFunction) edd_py_detect, METH_VARARGS, NULL },
+ { NULL }
+};
+
+static PyObject *
+edd_py_detect (PyObject * s, PyObject * args) {
+ int device = 0x80;
+ EDDCapability *ec;
+
+ if (!PyArg_ParseTuple(args, "|i", &device))
+ return NULL;
+
+ if ((ec = edd_supported(device))) {
+ free (ec);
+ return Py_BuildValue ("i", 1);
+ }
+ return Py_BuildValue ("i", 0);
+}
+
+void initedd (void) {
+ Py_InitModule("edd", edd_module_methods);
+}