2 * Copyright © 2013 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 #define AO_HEX_RECORD_NORMAL 0x00
27 #define AO_HEX_RECORD_EOF 0x01
28 #define AO_HEX_RECORD_EXTENDED_ADDRESS_4 0x02
29 #define AO_HEX_RECORD_EXTENDED_ADDRESS_8 0x04
30 #define AO_HEX_RECORD_SYMBOL 0xfe
32 /* Intel hex file format data
34 struct ao_hex_record {
44 struct ao_hex_record *records[0];
61 ao_hex_file_read(FILE *file, char *name);
64 ao_hex_file_free(struct ao_hex_file *hex);
67 ao_hex_image_create(struct ao_hex_file *hex);
70 ao_hex_image_free(struct ao_hex_image *image);
73 ao_hex_load(char *filename, struct ao_sym **symbols, int *num_symbols);
76 ao_hex_image_cat(struct ao_hex_image *a, struct ao_hex_image *b);
79 ao_hex_image_equal(struct ao_hex_image *a, struct ao_hex_image *b);
82 ao_hex_save(FILE *file, struct ao_hex_image *image,
83 struct ao_sym *symbols, int num_symbols);
85 #endif /* _AO_HEX_H_ */