/* 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" #include "manager.h" /* Fournit le gestionnaire de partages attribué à un type. */ typedef GShareManager * (* get_share_manager_fc) (const GSharedInstance *); /* Initialise un nouvel objet partagé avec des informations. */ typedef bool (* apply_shared_template_fc) (GSharedInstance *, const GSharedInstance *); /* Procède à l'initialisation de l'interface de partage. */ typedef void (* define_shared_template_fc) (const GSharedInstance *, GSharedInstance *); /* Initialise un nouvel objet partagé avec des informations. */ typedef bool (* free_shared_template_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 (* compare_shared_fc) (const GSharedInstance * const *, const GSharedInstance * const *); /* Règles de partage d'une instance GObject (interface) */ struct _GSharedInstanceIface { GTypeInterface base_iface; /* A laisser en premier */ get_share_manager_fc get_manager; /* Accès au gestionnaire */ apply_shared_template_fc apply_template;/* Intialisation d'instance */ define_shared_template_fc define_template; /* Copie minimale de détails*/ free_shared_template_fc free_template; /* Libération d'un patron */ 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 */ compare_shared_fc compare; /* Comparaison des détails */ }; /* Redéfinition */ typedef GSharedInstanceIface GSharedInstanceInterface; #endif /* _ARCH_SHARING_INSTANCE_INT_H */