diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2012-08-03 13:03:26 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2012-08-03 13:03:26 (GMT) | 
| commit | b7c83221f2a60be8ee5d44a7599dbe6869af005f (patch) | |
| tree | 814e294533920d18f8734baa9aaef47c676e520a /plugins/pychrysa/pychrysa.c | |
| parent | 7d2b7ca95966c2d687526cd75a96d1ea67d3f503 (diff) | |
Loaded the permissions used by an APK file.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@255 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/pychrysa/pychrysa.c')
| -rw-r--r-- | plugins/pychrysa/pychrysa.c | 47 | 
1 files changed, 36 insertions, 11 deletions
diff --git a/plugins/pychrysa/pychrysa.c b/plugins/pychrysa/pychrysa.c index 84400a1..7bb1e00 100644 --- a/plugins/pychrysa/pychrysa.c +++ b/plugins/pychrysa/pychrysa.c @@ -26,6 +26,7 @@  #include <dirent.h>  #include <pygobject.h> +#include <string.h>  #include <config.h> @@ -62,7 +63,27 @@ static PyMethodDef SpamMethods[] = {  /******************************************************************************  *                                                                             * -*  Paramètres  : ref = espace de référencement global.                        * +*  Paramètres  : -                                                            * +*                                                                             * +*  Description : Précise le nom associé au greffon.                           * +*                                                                             * +*  Retour      : Nom à libérer de la mémoire.                                 * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +char *get_plugin_name(void) +{ +    return strdup("PyChrysalide"); + +} + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : plugin = instance représentant le greffon en chargement.     * +*                ref    = espace de référencement global.                     *  *                                                                             *  *  Description : Initialise le greffon permettant l'usage de Python.          *  *                                                                             * @@ -72,7 +93,7 @@ static PyMethodDef SpamMethods[] = {  *                                                                             *  ******************************************************************************/ -bool init_plugin(GObject *ref) +bool init_plugin(GPluginModule *plugin, GObject *ref)  {      char *paths;                            /* Emplacements de greffons    */      char *path;                             /* Chemin à fouiller           */ @@ -86,7 +107,7 @@ bool init_plugin(GObject *ref) -    GPluginModule *plugin; +    GPluginModule *pyplugin; @@ -133,14 +154,18 @@ bool init_plugin(GObject *ref)              filename = stradd(filename, ".");              filename = stradd(filename, "__init__"); -            plugin = g_python_plugin_new(entry.d_name, filename); +            pyplugin = g_python_plugin_new(entry.d_name, filename); -            if (plugin == NULL) -                 printf("No suitable Python plugin found in '%s'\n", filename);  /* FIXME : LOG(...) */ +            if (pyplugin == NULL) +                g_plugin_module_log_variadic_message(plugin, LMT_ERROR,  +                                                     _("No suitable Python plugin found in '%s'"), +                                                     filename);              else              { -                printf("ok pour %s\n", filename); -                add_plugin_to_main_list(plugin); +                g_plugin_module_log_variadic_message(plugin, LMT_PROCESS,  +                                                     _("Loaded Python plugin '<b>%s</b>' from the '<b>%s</b>' directory"), +                                                     g_plugin_module_get_name(G_PLUGIN_MODULE(pyplugin)), path); +                add_plugin_to_main_list(pyplugin);              }              free(filename); @@ -202,8 +227,8 @@ PyMODINIT_FUNC PyInit_pychrysa(void)  {      static struct PyModuleDef spammodule = {          PyModuleDef_HEAD_INIT, -        "pychrysa", -        "pychrysa_doc", +        "pychrysalide", +        "pychrysalide_doc",          -1,          SpamMethods      }; @@ -233,7 +258,7 @@ PyMODINIT_FUNC initpychrysa(void)      pygobject_init(-1, -1, -1);      pychrysalide_init_quirks(); -    module = Py_InitModule("pychrysa", SpamMethods); +    module = Py_InitModule("pychrysalide", SpamMethods);      //add_analysis_roptions_to_python_module(module);      add_analysis_module_to_python_module(module);  | 
