*file_line = mapping->file_line + mapping->line_inc*(line-mapping->line);
}
+int
+yasm_linemap_traverse_filenames(yasm_linemap *linemap, /*@null@*/ void *d,
+ int (*func) (const char *filename, void *d))
+{
+ return HAMT_traverse(linemap->filenames, d, (int (*) (void *, void *))func);
+}
+
int
yasm_linemap_get_source(yasm_linemap *linemap, unsigned long line,
yasm_bytecode **bcp, const char **sourcep)
void yasm_linemap_lookup(yasm_linemap *linemap, unsigned long line,
/*@out@*/ const char **filename,
/*@out@*/ unsigned long *file_line);
+
+/** Traverses all filenames used in a linemap, calling a function on each
+ * filename.
+ * \param linemap line mapping repository
+ * \param d data pointer passed to func on each call
+ * \param func function
+ * \return Stops early (and returns func's return value) if func returns a
+ * nonzero value; otherwise 0.
+ */
+int yasm_linemap_traverse_filenames
+ (yasm_linemap *linemap, /*@null@*/ void *d,
+ int (*func) (const char *filename, void *d));
+
#endif