diff --git a/src/fileio.c b/src/fileio.c index fdabe0aa..cbebbc24 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -450,7 +450,7 @@ static int ihex_readrec(struct ihexsrec *ihex, char *rec) { } // Extract correct memory from large any memory assuming multi-memory model -static int any2mem(const AVRPART *p, const AVRMEM *mem, const Segment *segp, const AVRMEM *any, unsigned maxsize) { +int fileio_any2mem(const AVRPART *p, const AVRMEM *mem, const Segment *segp, const AVRMEM *any, unsigned maxsize) { // Compute location for multi-memory file input unsigned location = maxsize > MEND(FLASH) + 1? fileio_mem_offset(p, mem): 0; @@ -622,7 +622,7 @@ static int ihex2b(const char *infile, FILE *inf, const AVRPART *p, const AVRMEM pmsg_warning("no end of file record found for Intel Hex file %s\n", infile); done: - rc = any2mem(p, mem, segp, any, maxaddr); + rc = fileio_any2mem(p, mem, segp, any, maxaddr); avr_free_mem(any); if(!rc) pmsg_warning("no %s data found in Intel Hex file %s\n", mem->desc, infile); @@ -950,7 +950,7 @@ static int srec2b(const char *infile, FILE *inf, const AVRPART *p, pmsg_warning("no end of file record found for Motorola S-Records file %s\n", infile); done: - rc = any2mem(p, mem, segp, any, maxaddr); + rc = fileio_any2mem(p, mem, segp, any, maxaddr); avr_free_mem(any); if(!rc) pmsg_warning("no %s data found in Motorola S-Record file %s\n", mem->desc, infile); diff --git a/src/libavrdude.h b/src/libavrdude.h index dc87875b..2ba0f258 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -1307,6 +1307,7 @@ extern "C" { FILE *fileio_fopenr(const char *fname); int is_generated_fname(const char *filename); int generated_file_has_contents(const AVRPART *part, const char *filename); + int fileio_any2mem(const AVRPART *p, const AVRMEM *mem, const Segment *segp, const AVRMEM *any, unsigned maxsize); int fileio_fmt_autodetect_fp(FILE *f); int fileio_fmt_autodetect(const char *fname); int fileio_mem(int oprwv, const char *filename, FILEFMT format, const AVRPART *p, const AVRMEM *mem, int size);