+/* Insert enough spaces into the output area of PRETTY-PRINTER to bring
+ the column position to the current indentation level, assuming that a
+ newline has just been written to the buffer. */
+void
+pp_base_indent (pretty_printer *pp)
+{
+ int n = pp_indentation (pp);
+ int i;
+
+ for (i = 0; i < n; ++i)
+ pp_space (pp);
+}
+
+/* Prepare PP to format a message pointed to by TEXT, with tentative
+ location LOCUS. It is expected that a call to pp_format_text with
+ exactly the same PP and TEXT arguments will follow. This routine
+ may modify the data in memory at TEXT and LOCP, and if it does,
+ caller is expected to notice.
+
+ Currently, all this does is notice a %H or %J escape at the beginning
+ of the string, and update LOCUS to match. */
+void
+pp_base_prepare_to_format (pretty_printer *pp ATTRIBUTE_UNUSED,
+ text_info *text,
+ location_t *locus)
+{
+ const char *p = text->format_spec;
+ tree t;
+
+ /* Extract the location information if any. */
+ if (p[0] == '%')
+ switch (p[1])
+ {
+ case 'H':
+ *locus = *va_arg (*text->args_ptr, location_t *);
+ text->format_spec = p + 2;
+ break;
+
+ case 'J':
+ t = va_arg (*text->args_ptr, tree);
+ *locus = DECL_SOURCE_LOCATION (t);
+ text->format_spec = p + 2;
+ break;
+ }
+}
+
+