diff options
Diffstat (limited to 'src/format/preload.h')
-rw-r--r-- | src/format/preload.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/src/format/preload.h b/src/format/preload.h new file mode 100644 index 0000000..a915462 --- /dev/null +++ b/src/format/preload.h @@ -0,0 +1,98 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * preload.h - prototypes pour le préchargement d'instructions à partir d'un format + * + * Copyright (C) 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 <http://www.gnu.org/licenses/>. + */ + + +#ifndef _FORMAT_PRELOAD_H +#define _FORMAT_PRELOAD_H + + +#include <glib-object.h> + + +#include "../analysis/db/items/comment.h" +#include "../arch/instruction.h" + + + +#define G_TYPE_PRELOAD_INFO g_preload_info_get_type() +#define G_PRELOAD_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_PRELOAD_INFO, GPreloadInfo)) +#define G_IS_PRELOAD_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_PRELOAD_INFO)) +#define G_PRELOAD_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_PRELOAD_INFO, GPreloadInfoClass)) +#define G_IS_PRELOAD_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_PRELOAD_INFO)) +#define G_PRELOAD_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_PRELOAD_INFO, GPreloadInfoClass)) + + +/* Préchargement d'origine formatée (instance) */ +typedef struct _GPreloadInfo GPreloadInfo; + +/* Préchargement d'origine formatée (classe) */ +typedef struct _GPreloadInfoClass GPreloadInfoClass; + + +/* Indique le type défini pour un préchargement à partir d'un format. */ +GType g_preload_info_get_type(void); + +/* Crée une nouvelle collecte d'informations préchargées. */ +GPreloadInfo *g_preload_info_new(void); + +/* Verrouille les accès à la liste des instructions. */ +void g_preload_info_lock_instructions(GPreloadInfo *); + +/* Déverrouille les accès à la liste des instructions. */ +void g_preload_info_unlock_instructions(GPreloadInfo *); + +/* Ajoute une instruction supplémentaire aux préchargements. */ +void g_preload_info_add_instruction(GPreloadInfo *, GArchInstruction *); + +/* Indique la quantité d'instructions préchargées disponibles. */ +size_t _g_preload_info_count_instructions(const GPreloadInfo *); + +/* Fournit une instruction préchargée donnée. */ +GArchInstruction *_g_preload_info_get_instruction(const GPreloadInfo *, size_t); + +/* Dépile une instruction présente dans les préchargements. */ +GArchInstruction *g_preload_info_pop_instruction(GPreloadInfo *); + +/* Retire des préchargements toutes les instructions. */ +void _g_preload_info_drain_instructions(GPreloadInfo *); + +/* Verrouille les accès à la liste des commentaires. */ +void g_preload_info_lock_comments(GPreloadInfo *); + +/* Déverrouille les accès à la liste des commentaires. */ +void g_preload_info_unlock_comments(GPreloadInfo *); + +/* Ajoute un commentaire supplémentaire aux préchargements. */ +void g_preload_info_add_comment(GPreloadInfo *, GDbComment *); + +/* Indique la quantité de commentaires préchargés disponibles. */ +size_t _g_preload_info_count_comments(const GPreloadInfo *); + +/* Fournit un commentaire préchargé donné. */ +GDbComment *_g_preload_info_get_comment(const GPreloadInfo *, size_t); + +/* Dépile un commentaire présent dans les préchargements. */ +GDbComment *g_preload_info_pop_comment(GPreloadInfo *); + + + +#endif /* _FORMAT_PRELOAD_H */ |