diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-09-19 13:01:04 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-09-19 13:01:04 (GMT) |
commit | 859bdb6b51d76058eb1a8bfa619a15978f50b251 (patch) | |
tree | 306ba7f92d84f10c0a7fc8e385cb32b85bb3cb73 /src | |
parent | ff4fd84840beca40a88db2ca0ce90e6511fb852b (diff) |
Improved the pyoida module.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@116 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/analysis/binary.c | 4 | ||||
-rw-r--r-- | src/analysis/binary.h | 2 | ||||
-rwxr-xr-x | src/common/Makefile.am | 7 | ||||
-rw-r--r-- | src/common/xml.c (renamed from src/xml.c) | 2 | ||||
-rw-r--r-- | src/common/xml.h (renamed from src/xml.h) | 0 | ||||
-rw-r--r-- | src/configuration.c | 2 | ||||
-rw-r--r-- | src/plugins/pglist.c | 2 | ||||
-rw-r--r-- | src/plugins/plugin.c | 4 | ||||
-rw-r--r-- | src/project.c | 2 | ||||
-rw-r--r-- | src/shell.c | 37 |
11 files changed, 40 insertions, 25 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index ea03c36..7e819de 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -79,8 +79,7 @@ openida_SOURCES = \ params.h params.c \ project.h project.c \ shell.h shell.c \ - xdg.h xdg.c \ - xml.h xml.c + xdg.h xdg.c INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/intl $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) `pkg-config --cflags gthread-2.0` $(LIBPYTHON_CFLAGS) $(LIBVTE_CFLAGS) diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 4e63cbe..c991125 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -137,7 +137,7 @@ static void g_openida_binary_class_init(GOpenidaBinaryClass *klass) /****************************************************************************** * * -* Paramètres : line = instance à initialiser. * +* Paramètres : binary = instance à initialiser. * * * * Description : Initialise une description de fichier binaire. * * * @@ -147,7 +147,7 @@ static void g_openida_binary_class_init(GOpenidaBinaryClass *klass) * * ******************************************************************************/ -static void g_openida_binary_init(GOpenidaBinary *line) +static void g_openida_binary_init(GOpenidaBinary *binary) { } diff --git a/src/analysis/binary.h b/src/analysis/binary.h index 0a8d0e9..ac5af77 100644 --- a/src/analysis/binary.h +++ b/src/analysis/binary.h @@ -32,7 +32,7 @@ #include "line.h" #include "../arch/processor.h" #include "../format/executable.h" -#include "../xml.h" +#include "../common/xml.h" diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 1bb66d9..c4937dd 100755 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -5,12 +5,13 @@ libcommon_la_SOURCES = \ dllist.h dllist.c \ endianness.h endianness.c \ extstr.h extstr.c \ - macros.h + macros.h \ + xml.h xml.c -libcommon_la_LDFLAGS = +libcommon_la_LDFLAGS = $(LIBGTK_LIBS) $(LIBXML_LIBS) -INCLUDES = +INCLUDES = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) AM_CPPFLAGS = diff --git a/src/xml.c b/src/common/xml.c index 19003eb..b89b4f9 100644 --- a/src/xml.c +++ b/src/common/xml.c @@ -29,7 +29,7 @@ #include <string.h> -#include "common/extstr.h" +#include "extstr.h" #ifdef DEBUG diff --git a/src/xml.h b/src/common/xml.h index 82e2578..82e2578 100644 --- a/src/xml.h +++ b/src/common/xml.h diff --git a/src/configuration.c b/src/configuration.c index de4f2f1..8823271 100644 --- a/src/configuration.c +++ b/src/configuration.c @@ -30,8 +30,8 @@ #include "xdg.h" -#include "xml.h" #include "common/extstr.h" +#include "common/xml.h" diff --git a/src/plugins/pglist.c b/src/plugins/pglist.c index 6725fd8..6d47f57 100644 --- a/src/plugins/pglist.c +++ b/src/plugins/pglist.c @@ -77,7 +77,7 @@ bool init_all_plugins(GObject *ref) { _list.ref = ref; - browse_directory_for_plugins(&_list, PACKAGE_SOURCE_DIR "/plugins.disabled"); + browse_directory_for_plugins(&_list, PACKAGE_SOURCE_DIR "/plugins"); return true; diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index cde1ab5..7c62146 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -135,7 +135,7 @@ GPluginModule *g_plugin_module_new(const gchar *filename, GObject *ref) result->module = g_module_open(filename, G_MODULE_BIND_LAZY); - +#if 0 if (!g_module_symbol(result->module, "get_plugin_action", (gpointer *)&__get_action)) { printf("Err plugin get_action sym\n"); @@ -156,7 +156,7 @@ GPluginModule *g_plugin_module_new(const gchar *filename, GObject *ref) } - +#endif if (!g_module_symbol(result->module, "init_plugin", (gpointer *)&result->init)) diff --git a/src/project.c b/src/project.c index 06059ed..cf76a33 100644 --- a/src/project.c +++ b/src/project.c @@ -29,7 +29,7 @@ #include "params.h" -#include "xml.h" +#include "common/xml.h" #include "gtkext/easygtk.h" #include "gtkext/gtkblockview.h" #include "gtkext/gtkdockpanel.h" diff --git a/src/shell.c b/src/shell.c index 1f8d28d..2d3420f 100644 --- a/src/shell.c +++ b/src/shell.c @@ -105,7 +105,11 @@ GtkWidget *build_shell_panel(GObject *ref) vte_terminal_set_cursor_blinks(VTE_TERMINAL(term), TRUE); - //return result; +#if 0 + vte_terminal_fork_command (term, "/bin/sh", NULL, NULL, "/", 0, 0, 0); + return result; +#endif + openpty(&amaster, &aslave, name, NULL, NULL); @@ -264,6 +268,10 @@ static gpointer python_shell_thread(gpointer data) { FILE *stream; + int stdout2; + FILE *out2; + + printf("==== FE :: '%s'\n", ptsname(amaster)); printf("==== FE :: '%s'\n", ptsname(aslave)); @@ -279,38 +287,45 @@ static gpointer python_shell_thread(gpointer data) /* Mise à jour des entrées/sorties */ - /* + + stdout2 = dup(STDOUT_FILENO); + out2 = fdopen(stdout2, "w"); + + fprintf(out2, ">>> stdout2 :: %d\n", stdout2); + + +#if 1 close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); dup(aslave); dup(aslave); dup(aslave); - */ - +#endif Py_Initialize(); - amaster = STDIN_FILENO; - + //amaster = STDIN_FILENO; + /* write(amaster, "import pyoida\n", strlen("import pyoida\n")); write(amaster, "from pyoida import *\n", strlen("from pyoida import *\n")); + write(amaster, "logger.log_simple_message(2, 'uhih')\n", strlen("logger.log_simple_message(2, 'uhih')\n")); + write(amaster, "for i in pyoida.current_binary().lines():\n", strlen("for i in pyoida.current_binary().lines():\n")); + write(amaster, "\tprint i\n", strlen("\tprint i\n")); + */ - - write(amaster, "logger.log_simple_message(2, 'uhih')\n", strlen("logger.log_simple_message(2, 'uhih')\n")); - + write(amaster, "execfile('test.py')", strlen("execfile('test.py')")); - write(amaster, "for i in pyoida.current_binary().lines():\n", strlen("for i in pyoida.current_binary().lines():\n")); - write(amaster, "\tprint i\n", strlen("\tprint i\n")); + fprintf(out2, ">>> stdout2 :: %d (inside)\n", stdout2); |