diff options
Diffstat (limited to 'src/analysis/db/collection-int.h')
-rw-r--r-- | src/analysis/db/collection-int.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/analysis/db/collection-int.h b/src/analysis/db/collection-int.h new file mode 100644 index 0000000..6ca9ab4 --- /dev/null +++ b/src/analysis/db/collection-int.h @@ -0,0 +1,78 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * collection-int.h - prototypes et définitions internes pour les collections d'éléments + * + * Copyright (C) 2015 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * OpenIDA 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. + * + * OpenIDA 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 <http://www.gnu.org/licenses/>. + */ + + +#ifndef _ANALYSIS_DB_COLLECTION_INT_H +#define _ANALYSIS_DB_COLLECTION_INT_H + + +#include "collection.h" + + +#include <stdarg.h> + + + +/* Décrit les colonnes utiles à un chargement de données. */ +typedef bool (* collec_setup_load_fc) (GDbCollection *, bound_value **, size_t *); + +/* Charge les valeurs utiles pour une localisation. */ +typedef bool (* collec_load_item) (GDbCollection *, const bound_value *, size_t); + +/* Détermine si un élément est déjà présent ou non. */ +typedef GDbItem * (* collec_has_key_fc) (GDbCollection *, va_list *); + + + +/* Collection générique d'éléments (instance) */ +struct _GDbCollection +{ + GObject parent; /* A laisser en premier */ + + uint32_t featuring; /* Fonctionnalité représentée */ + GType type; /* Identifiant GLib équivalent */ + const char *name; /* Nom en base de données */ + + GList *items; /* Eléments rassemblés */ + GList *sorted; /* Eléments triés */ + GRWLock params_access; /* Verrou de protection */ + +}; + +/* Collection générique d'éléments (classe) */ +struct _GDbCollectionClass +{ + GObjectClass parent; /* A laisser en premier */ + + collec_setup_load_fc setup_load; /* Prépare le chargement */ + collec_load_item load_item; /* Charge un élément */ + collec_has_key_fc has_key; /* Recherche de présence */ + + /* Signaux */ + + void (* content_changed) (GDbCollection *, DBAction, GDbItem *); + +}; + + + +#endif /* _ANALYSIS_DB_COLLECTION_INT_H */ |