2 * compiler.h -- part of ZilUtils/ZilAsm
4 * Copyright (C) 2020 Jason Self <j@jxself.org>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>
19 * SPDX-License-Identifier: AGPL-3.0-or-later
21 #ifndef ZILASM_COMPILER
22 #define ZILASM_COMPILER
32 struct String_Table_Elem
34 string value; // value in ASCII format
44 void fill_config(void);
45 void get_arguments(int argc, char *argv[], char *envp[]);
46 char *get_output_file_name();
51 list < String_Table_Elem > m_string_table;
54 char *build_output_filename(const char basename[], const char *suffix);
55 void fill_zserial(void);
56 void new_file_suffix(char *result, size_t maxlen, const char *src,
57 const char *newsuffix);
58 void output_code_section();
59 void output_function_table(FILE *file);
60 void parse_intarg(int *dest, const char name[], int min, int max,
62 void parse_zserial(void);
63 void print_usage(int failed);
65 void wrong_arg(const char *err, ...);
70 FAIL = -1, OK = 0, NEED_RESTART = 1