Debian Codegraph @

src/fcml_messages.h

raw
1 /*
2 * FCML - Free Code Manipulation Library.
3 * Copyright (C) 2010-2020 Slawomir Wojtasiak
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #ifndef FCML_MESSAGES_H_
21 #define FCML_MESSAGES_H_
22
23 #include <fcml_errors.h>
24 #include <fcml_types.h>
25
26 #define FCML_MESSAGE_MAX 512
27
28 typedef enum fcml_en_msg_message_code {
29 /* Global error codes. */
30 FCML_MC_CEH_GEC_NO_ERROR = 0,
31 FCML_MC_CEH_GEC_OUT_OF_MEMORY = 1,
32 FCML_MC_CEH_GEC_INVALID_INPUT = 2,
33 FCML_MC_CEH_GEC_INTERNAL_ERROR = 3,
34 FCML_MC_CEH_GEC_NOT_INITIALIZED = 4,
35 FCML_MC_CEH_GEC_EOF = 5,
36 FCML_MC_CEH_GEC_VALUE_OUT_OF_RANGE = 6,
37 FCML_MC_CEH_GEC_FEATURE_NOT_SUPPORTED = 7,
38 FCML_MC_CEH_GEC_INVALID_ADDRESSING_MODE = 8,
39 FCML_MC_CEH_GEC_INVALID_ADDRESSING_FORM = 9,
40 FCML_MC_CEH_GEC_INVALID_INSTRUCTION_FORM = 10,
41 FCML_MC_CEH_GEC_INVALID_OPPERAND = 11,
42 FCML_MC_CEH_GEC_UNKNOWN_MNEMONIC = 12,
43 FCML_MC_CEH_GEC_INVALID_OPPERAND_SIZE = 13,
44 FCML_MC_CEH_GEC_INVALID_ADDRESS_SIZE = 14,
45 FCML_MC_CEH_GEC_UNKNOWN_INSTRUCTION = 15,
46 FCML_MC_CEH_GEC_INVALID_PREFIX = 16,
47 FCML_MC_CEH_GEC_INVALID_REGISTER_TYPE = 17,
48 FCML_MC_CEH_GEC_INVALID_REGISTER = 18,
49 FCML_MC_CEH_GEC_UNDEFINED_SYMBOL = 19,
50 /* Message error codes. */
51 FCML_MC_SEGMENT_REGISTER_CAN_NOT_BE_OVERRIDDEN,
52 FCML_MC_SEGMENT_INVALID_PSEUDO_OPCODE_IMM,
53 FCML_MC_SEGMENT_HLE_PREFIXES_NOT_ALLOWED,
54 FCML_MC_SEGMENT_HLE_MORE_THAN_ONE_PREFIX,
55 FCML_MC_SEGMENT_WRONG_REGISTER_TYPE_SEG,
56 FCML_MC_SEGMENT_SYMBOL_ALREADY_DEFINED,
57 FCML_MC_SEGMENT_UNDEFINED_SYMBOL,
58 FCML_MC_SEGMENT_PARSED_LINE_TO_LONG
59 } fcml_en_msg_message_code;
60
61 fcml_string fcml_fn_msg_get_message(fcml_en_msg_message_code code);
62
63 void fcml_fn_msg_add_error_message(fcml_st_ceh_error_container *errors,
64 fcml_en_msg_message_code msg_code, fcml_ceh_error code,
65 fcml_en_ceh_error_level level, ...);
66
67 #endif /* FCML_MESSAGES_H_ */