-struct macro_source_file *(macro_definition_location
- (struct macro_source_file *source,
- int line,
- const char *name,
- int *definition_line));
-
-/* Callback function when walking a macro table. NAME is the name of
- the macro, and DEFINITION is the definition. */
-typedef void (*macro_callback_fn) (const char *name,
- const struct macro_definition *definition);
-
-/* Call the function FN for each macro in the macro table TABLE. */
-void macro_for_each (struct macro_table *table, macro_callback_fn fn);
-
+struct macro_source_file *macro_definition_location
+ (struct macro_source_file *source,
+ int line,
+ const char *name,
+ int *definition_line);
+
+/* Prototype for a callback callable when walking a macro table. NAME
+ is the name of the macro, and DEFINITION is the definition. SOURCE
+ is the file at the start of the include path, and LINE is the line
+ number of the SOURCE file where the macro was defined. */
+typedef void (macro_callback_fn) (const char *name,
+ const struct macro_definition *definition,
+ struct macro_source_file *source,
+ int line);
+
+/* Call the callable FN for each macro in the macro table TABLE. */
+void macro_for_each (struct macro_table *table,
+ gdb::function_view<macro_callback_fn> fn);
+
+/* Call FN for each macro that is visible in a given scope. The scope
+ is represented by FILE and LINE. */
+void macro_for_each_in_scope (struct macro_source_file *file, int line,
+ gdb::function_view<macro_callback_fn> fn);
+
+/* Return FILE->filename with possibly prepended compilation directory name.
+ This is raw concatenation without the "set substitute-path" and gdb_realpath
+ applications done by symtab_to_fullname.
+
+ THis function ignores the "set filename-display" setting. Its default
+ setting is "relative" which is backward compatible but the former behavior
+ of macro filenames printing was "absolute". */
+extern std::string macro_source_fullname (struct macro_source_file *file);