diff options
Diffstat (limited to 'plugins/pychrysalide/analysis/db/client.c')
-rw-r--r-- | plugins/pychrysalide/analysis/db/client.c | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/plugins/pychrysalide/analysis/db/client.c b/plugins/pychrysalide/analysis/db/client.c index 13966f5..e5b67da 100644 --- a/plugins/pychrysalide/analysis/db/client.c +++ b/plugins/pychrysalide/analysis/db/client.c @@ -51,6 +51,9 @@ static PyObject *py_hub_client_stop(PyObject *, PyObject *); /* Effectue une demande de sauvegarde de l'état courant. */ static PyObject *py_hub_client_save(PyObject *, PyObject *); +/* Active les éléments en amont d'un horodatage donné. */ +static PyObject *py_hub_client_set_last_active(PyObject *, PyObject *); + /****************************************************************************** @@ -146,7 +149,7 @@ static PyObject *py_hub_client_new(PyTypeObject *type, PyObject *args, PyObject /****************************************************************************** * * -* Paramètres : self = serveur à manipuler. * +* Paramètres : self = client à manipuler. * * args = paramètres à transmettre à l'appel natif. * * * * Description : Démarre la connexion à la base de données. * @@ -201,7 +204,7 @@ static PyObject *py_hub_client_start(PyObject *self, PyObject *args) /****************************************************************************** * * -* Paramètres : self = serveur à manipuler. * +* Paramètres : self = client à manipuler. * * args = arguments d'appel non utilisés ici. * * * * Description : Arrête la connexion à la base de données. * @@ -238,7 +241,7 @@ static PyObject *py_hub_client_stop(PyObject *self, PyObject *args) /****************************************************************************** * * -* Paramètres : self = serveur à manipuler. * +* Paramètres : self = client à manipuler. * * args = arguments d'appel non utilisés ici. * * * * Description : Effectue une demande de sauvegarde de l'état courant. * @@ -279,6 +282,56 @@ static PyObject *py_hub_client_save(PyObject *self, PyObject *args) /****************************************************************************** * * +* Paramètres : self = client à manipuler. * +* args = arguments d'appel à consulter. * +* * +* Description : Active les éléments en amont d'un horodatage donné. * +* * +* Retour : True si la commande a bien été envoyée, False sinon. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static PyObject *py_hub_client_set_last_active(PyObject *self, PyObject *args) +{ + PyObject *result; /* Bilan à retourner */ + unsigned long long timestamp; /* Horodatage de limite */ + int ret; /* Bilan de lecture des args. */ + GHubClient *client; /* Version native du serveur */ + bool status; /* Bilan de l'opération */ + +#define HUB_CLIENT_SET_LAST_ACTIVE_METHOD PYTHON_METHOD_DEF \ +( \ + set_last_active, "$self, timestamp, /", \ + METH_VARARGS, py_hub_client, \ + "Define the timestamp of the last active item in the collection" \ + " and returns the status of the request transmission." \ + "\n" \ + "This method should not be used directly. Prefer calling" \ + " pychrysalide.analysis.LoadedBinary.set_last_active() instead," \ + " as some items may be volatile and thus not handled by clients." \ +) + + ret = PyArg_ParseTuple(args, "K", ×tamp); + if (!ret) return NULL; + + client = G_HUB_CLIENT(pygobject_get(self)); + + status = g_hub_client_set_last_active(client, timestamp); + + result = status ? Py_True : Py_False; + Py_INCREF(result); + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : - * * * * Description : Fournit un accès à une définition de type à diffuser. * @@ -295,6 +348,7 @@ PyTypeObject *get_python_hub_client_type(void) HUB_CLIENT_START_METHOD, HUB_CLIENT_STOP_METHOD, HUB_CLIENT_SAVE_METHOD, + HUB_CLIENT_SET_LAST_ACTIVE_METHOD, { NULL } }; |