/* Chrysalide - Outil d'analyse de fichiers binaires * instance-int.h - définitions internes propres aux instances partagées * * Copyright (C) 2016-2017 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 Foobar. If not, see . */ #ifndef _ARCH_SHARING_INSTANCE_INT_H #define _ARCH_SHARING_INSTANCE_INT_H #include "instance.h" /* Initialise un nouvel objet partagé avec des informations. */ typedef bool (* init_shared_fc) (GSharedInstance *, const GSharedInstance *); /* Procède à l'initialisation de l'interface de partage. */ typedef void (* qck_copy_shared_fc) (const GSharedInstance *, GSharedInstance *); /* Fournit la valeur du compteur de partage. */ typedef unsigned int (* get_shared_ref_fc) (const GSharedInstance *); /* Incrémente le compteur de partage. */ typedef void (* inc_shared_ref_fc) (GSharedInstance *); /* Décrémente le compteur de partage. */ typedef void (* dec_shared_ref_fc) (GSharedInstance *); /* Procède à l'initialisation de l'interface de partage. */ typedef int (* qck_compare_shared_fc) (const GSharedInstance **, const GSharedInstance **); /* Règles de partage d'une instance GObject (interface) */ struct _GSharedInstanceIface { GTypeInterface base_iface; /* A laisser en premier */ init_shared_fc init; /* Initialisation de l'objet */ qck_copy_shared_fc qck_copy; /* Copie minimale des détails */ get_shared_ref_fc get_ref; /* Obtention du compteur */ inc_shared_ref_fc inc_ref; /* Incrémentation du compteur */ dec_shared_ref_fc dec_ref; /* Décrémentation du compteur */ qck_compare_shared_fc qck_cmp; /* Comparaison des détails */ }; /* Redéfinition */ typedef GSharedInstanceIface GSharedInstanceInterface; #endif /* _ARCH_SHARING_INSTANCE_INT_H */