diff options
Diffstat (limited to 'plugins/pychrysalide')
| -rw-r--r-- | plugins/pychrysalide/format/symbol.c | 39 | 
1 files changed, 38 insertions, 1 deletions
| diff --git a/plugins/pychrysalide/format/symbol.c b/plugins/pychrysalide/format/symbol.c index c948423..bb58f64 100644 --- a/plugins/pychrysalide/format/symbol.c +++ b/plugins/pychrysalide/format/symbol.c @@ -60,6 +60,9 @@ static PyObject *py_binary_symbol_get_label(PyObject *, void *);  /* Fournit l'emplacement où se situe un symbole. */  static PyObject *py_binary_symbol_get_range(PyObject *, void *); +/* Définit la couverture physique / en mémoire d'un symbole. */ +static int py_binary_symbol_set_range(PyObject *, PyObject *, void *); +  /* Fournit la visibilité du symbole. */  static PyObject *py_binary_symbol_get_status(PyObject *, void *); @@ -295,6 +298,40 @@ static PyObject *py_binary_symbol_get_range(PyObject *self, void *closure)  /******************************************************************************  *                                                                             *  *  Paramètres  : self    = objet Python concerné par l'appel.                 * +*                value   = valeur fournie à intégrer ou prendre en compte.    * +*                closure = adresse non utilisée ici.                          * +*                                                                             * +*  Description : Définit la couverture physique / en mémoire d'un symbole.    * +*                                                                             * +*  Retour      : -                                                            * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +static int py_binary_symbol_set_range(PyObject *self, PyObject *value, void *closure) +{ +    int ret;                                /* Bilan d'analyse             */ +    mrange_t *range;                        /* Espace mémoire à manipuler  */ +    GBinSymbol *symbol;                     /* Elément à consulter         */ + +    ret = PyObject_IsInstance(value, (PyObject *)get_python_mrange_type()); +    if (!ret) return -1; + +    range = get_internal_mrange(value); + +    symbol = G_BIN_SYMBOL(pygobject_get(self)); + +    g_binary_symbol_set_range(symbol, range); + +    return 0; + +} + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : self    = objet Python concerné par l'appel.                 *  *                closure = non utilisé ici.                                   *  *                                                                             *  *  Description : Fournit la visibilité du symbole.                            * @@ -391,7 +428,7 @@ PyTypeObject *get_python_binary_symbol_type(void)              "Label of the symbol, provided by the internal component or by an alternative label.", NULL          },          { -            "range", py_binary_symbol_get_range, NULL, +            "range", py_binary_symbol_get_range, py_binary_symbol_set_range,              "Range covered by the symbol.", NULL          },          { | 
