diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-12-12 02:37:58 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-12-12 02:37:58 (GMT) |
commit | cdfc8c13fdd78c4af6e0ad120a8369e5fcb2e78d (patch) | |
tree | 02e84c98d3ebb264f5f96b0b984faef91138f41a /plugins/pychrysalide/core/queue.c | |
parent | 9d74efa39abcbe68b102ceff79c8d61766387f53 (diff) |
Implemented the Python bindings to load unknown binaries.
Diffstat (limited to 'plugins/pychrysalide/core/queue.c')
-rw-r--r-- | plugins/pychrysalide/core/queue.c | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/plugins/pychrysalide/core/queue.c b/plugins/pychrysalide/core/queue.c new file mode 100644 index 0000000..9c1365a --- /dev/null +++ b/plugins/pychrysalide/core/queue.c @@ -0,0 +1,103 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * queue.c - équivalent Python du fichier "core/queue.c" + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "queue.h" + + +#include <pygobject.h> + + +#include <core/queue.h> + + +#include "../access.h" +#include "../helpers.h" + + + +/* Attend que toutes les tâches de tout groupe soient traitées. */ +static PyObject *py_queue_wait_for_all_global_works(PyObject *, PyObject *); + + + +/****************************************************************************** +* * +* Paramètres : self = NULL car méthode statique. * +* args = non utilisé ici. * +* * +* Description : Attend que toutes les tâches de tout groupe soient traitées. * +* * +* Retour : None. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static PyObject *py_queue_wait_for_all_global_works(PyObject *self, PyObject *args) +{ + wait_for_all_global_works(); + + Py_RETURN_NONE; + +} + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Définit une extension du module 'core' à compléter. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool populate_core_module_with_queue(void) +{ + bool result; /* Bilan à retourner */ + PyObject *module; /* Module à recompléter */ + int ret; /* Bilan d'un appel */ + + static PyMethodDef py_queue_methods[] = { + + { "wait_for_all_global_works", py_queue_wait_for_all_global_works, + METH_NOARGS, + "wait_for_all_global_works(, /)\n--\n\nWait for all tasks being processed." + }, + { NULL } + + }; + + module = get_access_to_python_module("pychrysalide.core"); + + ret = PyModule_AddFunctions(module, py_queue_methods); + + result = (ret == 0); + + return result; + +} + |