/* Chrysalide - Outil d'analyse de fichiers binaires * output.h - prototypes pour les sorties en langage de programmation * * Copyright (C) 2010-2013 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 . */ #ifndef _DECOMP_OUTPUT_H #define _DECOMP_OUTPUT_H #include "../glibext/gcodebuffer.h" #define G_TYPE_LANG_OUTPUT g_lang_output_get_type() #define G_LANG_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_lang_output_get_type(), GLangOutput)) #define G_IS_LANG_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_lang_output_get_type())) #define G_LANG_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_LANG_OUTPUT, GLangOutputClass)) #define G_IS_LANG_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_LANG_OUTPUT)) #define G_LANG_OUTPUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_LANG_OUTPUT, GLangOutputClass)) /* Sortie selon un langage de programmation (instance) */ typedef struct _GLangOutput GLangOutput; /* Sortie selon un langage de programmation (classe) */ typedef struct _GLangOutputClass GLangOutputClass; /* Indique le type défini pour une sortie de langage de programmation. */ GType g_lang_output_get_type(void); /* Marque le début d'une série de commentaires. */ GBufferLine *g_lang_output_start_comments(GLangOutput *, GCodeBuffer *); /* Poursuit l'ajout d'une ligne de commentaires. */ GBufferLine *g_lang_output_continue_comments(GLangOutput *, GCodeBuffer *, const char *, size_t); /* Marque la fin d'une série de commentaires. */ GBufferLine *g_lang_output_end_comments(GLangOutput *, GCodeBuffer *); /* Ajoute un commentaire à un tampon donné. */ GBufferLine *g_lang_output_write_comments(GLangOutput *, GCodeBuffer *, const char *, size_t); /* Liste des signes binaires de comparaison */ typedef enum _CompSignType { CST_EQ, /* == */ CST_NE, /* != */ CST_LT, /* < */ CST_GE, /* >= */ CST_GT, /* > */ CST_LE, /* <= */ CST_COUNT } CompSignType; /* Liste des signes binaires de comparaison */ typedef enum _CondOperatorType { COT_NONE, /* pas de condition */ COT_AND, /* && */ COT_OR, /* || */ COT_COUNT } CondOperatorType; /* Imprime dans un tampon donné une méthode de comparaison. */ void g_lang_output_write_comp_sign(GLangOutput *, GBufferLine *, CompSignType); /* Imprime dans un tampon donné un opérateur logique. */ void g_lang_output_write_cond_operator(GLangOutput *, GBufferLine *, CondOperatorType); /* Débute la définition d'une classe. */ GBufferLine *g_lang_output_start_class(GLangOutput *, GCodeBuffer *, const void *); /* Termine la définition d'une classe. */ void g_lang_output_end_class(GLangOutput *, GCodeBuffer *); /* Débute la documentation d'une routine. */ GBufferLine *g_lang_output_start_routine_info(const GLangOutput *, GCodeBuffer *); /* Définit le prototype d'une routine. */ GBufferLine *g_lang_output_start_routine_prototype(GLangOutput *, GCodeBuffer *, const void *); /* Marque la fin du prototype d'une routine. */ void g_lang_output_end_routine_prototype(GLangOutput *, GCodeBuffer *, GBufferLine *); /* Commence la définition du corps d'une routine. */ void g_lang_output_start_routine_body(GLangOutput *, GCodeBuffer *, GBufferLine *); /* Termine la définition du corps d'une routine. */ void g_lang_output_end_routine_body(GLangOutput *, GCodeBuffer *); /* Commence la définition d'un bloc de code. */ GBufferLine *g_lang_output_start_code_block(GLangOutput *, GCodeBuffer *, GBufferLine *, size_t); /* Termine la définition d'un bloc de code. */ GBufferLine *g_lang_output_end_code_block(GLangOutput *, GCodeBuffer *, GBufferLine *, size_t); /* Emballe une expression conditionelle. */ GBufferLine *g_lang_output_encapsulate_condition(GLangOutput *, GCodeBuffer *, GBufferLine *, bool); typedef unsigned int lang_t; #include "lang/java.h" #endif /* _DECOMP_OUTPUT_H */