diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-02-11 05:25:25 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-02-11 05:25:25 +0000 |
commit | 4c1e84038ff95cd5b4fef0d8928a525e3822106d (patch) | |
tree | ae9bf398c51398598067bed864d5c06e491dad18 | |
parent | 39b46a6cbf9e3f5152e88f22c61e1e38dd2c4016 (diff) | |
download | anaconda-4c1e84038ff95cd5b4fef0d8928a525e3822106d.tar.gz anaconda-4c1e84038ff95cd5b4fef0d8928a525e3822106d.tar.xz anaconda-4c1e84038ff95cd5b4fef0d8928a525e3822106d.zip |
put start bterm in lang.c, bind from python
-rw-r--r-- | isys/Makefile | 2 | ||||
-rw-r--r-- | isys/isys.c | 8 | ||||
-rw-r--r-- | isys/isys.py | 3 | ||||
-rw-r--r-- | isys/lang.c | 28 | ||||
-rw-r--r-- | isys/lang.h | 1 |
5 files changed, 41 insertions, 1 deletions
diff --git a/isys/Makefile b/isys/Makefile index b864d7619..c5b6454ea 100644 --- a/isys/Makefile +++ b/isys/Makefile @@ -7,7 +7,7 @@ OBJECTS = nfsmount.o nfsmount_clnt.o nfsmount_xdr.o imount.o \ lang.o isofs.o dns.o linkdetect.o pdc.o hpt.o silraid.o SOBJECTS = $(patsubst %.o,%.lo,$(OBJECTS)) SOURCES = $(patsubst %.o,%.c,$(OBJECTS)) isys.c -LOADLIBES = -lresolv -lpci -lpopt -lpump -lext2fs -lz +LOADLIBES = -lresolv -lpci -lpopt -lpump -lext2fs -lz -lbterm -lbogl -lwlite PYMODULES = _isys.so SUBDIRS = gzlib DIET = diet diff --git a/isys/isys.c b/isys/isys.c index 72794364d..d74112607 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -99,6 +99,7 @@ static PyObject * doGetPageSize(PyObject * s, PyObject * args); static PyObject * py_bind_textdomain_codeset(PyObject * o, PyObject * args); static PyObject * getLinkStatus(PyObject * s, PyObject * args); static PyObject * hasIdeRaidMagic(PyObject * s, PyObject * args); +static PyObject * start_bterm(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL }, @@ -147,6 +148,7 @@ static PyMethodDef isysModuleMethods[] = { { "bind_textdomain_codeset", (PyCFunction) py_bind_textdomain_codeset, METH_VARARGS, NULL}, { "getLinkStatus", (PyCFunction) getLinkStatus, METH_VARARGS, NULL }, { "hasIdeRaidMagic", (PyCFunction) hasIdeRaidMagic, METH_VARARGS, NULL }, + { "startBterm", (PyCFunction) start_bterm, METH_VARARGS, NULL }, { NULL } } ; @@ -1453,3 +1455,9 @@ static PyObject * hasIdeRaidMagic(PyObject * s, PyObject * args) { return Py_None; #endif } + +static PyObject * start_bterm(PyObject * s, PyObject * args) { + if (!PyArg_ParseTuple(args, "")) return NULL; + + return Py_BuildValue("i", isysStartBterm()); +} diff --git a/isys/isys.py b/isys/isys.py index bba4448a1..2f104ee5c 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -576,6 +576,9 @@ def getpagesize(): def getLinkStatus(dev): return _isys.getLinkStatus(dev) +def startBterm(): + return _isys.startBterm() + printObject = _isys.printObject bind_textdomain_codeset = _isys.bind_textdomain_codeset diff --git a/isys/lang.c b/isys/lang.c index 7b00d6dde..74e09a53c 100644 --- a/isys/lang.c +++ b/isys/lang.c @@ -5,6 +5,7 @@ #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> +#include <sys/stat.h> #include <unistd.h> #include <linux/keyboard.h> @@ -161,3 +162,30 @@ int isysLoadKeymap(char * keymap) { return rc; } + +/* returns 0 on success, 1 on failure */ +extern int bterm_main(int argc, char **argv); + +int isysStartBterm(void) { + char * btermargs[4] = { "bterm", "-s", "-f", NULL }; + int rc; + struct stat sb; + + /* assume that if we're already on a pty we can handle unicode */ + fstat(0, &sb); + if (major(sb.st_rdev) == 3 || major(sb.st_rdev) == 136) + return 0; + + if (!access("/etc/font.bgf.gz", R_OK)) + btermargs[3] = "/etc/font.bgf.gz"; + else if (!access("/usr/lib/bogl/font.bgf.gz", R_OK)) + btermargs[3] = "/usr/lib/bogl/font.bgf.gz"; + else if (!access("font.bgf.gz", R_OK)) + btermargs[3] = "font.bgf.gz"; + else + return 0; + + rc = bterm_main(4, btermargs); + + return rc; +} diff --git a/isys/lang.h b/isys/lang.h index 55e5769a1..2fd6c1c5b 100644 --- a/isys/lang.h +++ b/isys/lang.h @@ -21,5 +21,6 @@ int loadKeymap(gzFile stream); int isysLoadFont(void); int isysLoadKeymap(char * keymap); int isysSetUnicodeKeymap(void); +int isysStartBterm(void); #endif |