- }
-}
-
-/* Have BUFFER start a new line. */
-
-void
-output_add_newline (buffer)
- output_buffer *buffer;
-{
- obstack_1grow (&buffer->obstack, '\n');
- output_text_length (buffer) = 0;
-}
-
-/* Appends a character to BUFFER. */
-
-void
-output_add_character (buffer, c)
- output_buffer *buffer;
- int c;
-{
- if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0)
- output_add_newline (buffer);
- obstack_1grow (&buffer->obstack, c);
- ++output_text_length (buffer);
-}
-
-/* Adds a space to BUFFER. */
-
-void
-output_add_space (buffer)
- output_buffer *buffer;
-{
- if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0)
- {
- output_add_newline (buffer);
- return;
- }
- obstack_1grow (&buffer->obstack, ' ');
- ++output_text_length (buffer);
-}
-
-/* These functions format an INTEGER into BUFFER as suggested by their
- names. */
-
-void
-output_decimal (buffer, i)
- output_buffer *buffer;
- int i;
-{
- output_formatted_integer (buffer, "%d", i);
-}
-
-static void
-output_long_decimal (buffer, i)
- output_buffer *buffer;
- long int i;
-{
- output_formatted_integer (buffer, "%ld", i);
-}
-
-static void
-output_unsigned_decimal (buffer, i)
- output_buffer *buffer;
- unsigned int i;
-{
- output_formatted_integer (buffer, "%u", i);
-}
-
-static void
-output_long_unsigned_decimal (buffer, i)
- output_buffer *buffer;
- long unsigned int i;
-{
- output_formatted_integer (buffer, "%lu", i);
-}
-
-static void
-output_octal (buffer, i)
- output_buffer *buffer;
- unsigned int i;
-{
- output_formatted_integer (buffer, "%o", i);
-}
-
-static void
-output_long_octal (buffer, i)
- output_buffer *buffer;
- unsigned long int i;
-{
- output_formatted_integer (buffer, "%lo", i);
-}
-
-static void
-output_hexadecimal (buffer, i)
- output_buffer *buffer;
- unsigned int i;
-{
- output_formatted_integer (buffer, "%x", i);
-}
-
-static void
-output_long_hexadecimal (buffer, i)
- output_buffer *buffer;
- unsigned long int i;
-{
- output_formatted_integer (buffer, "%lx", i);
-}
-
-/* Append to BUFFER a string specified by its STARTING character
- and LENGTH. */
-
-static void
-output_append_r (buffer, start, length)
- output_buffer *buffer;
- const char *start;
- int length;
-{
- obstack_grow (&buffer->obstack, start, length);
- output_text_length (buffer) += length;
-}
-
-/* Append a string deliminated by START and END to BUFFER. No wrapping is
- done. However, if beginning a new line then emit output_prefix (BUFFER)
- and skip any leading whitespace if appropriate. The caller must ensure
- that it is safe to do so. */
-
-void
-output_append (buffer, start, end)
- output_buffer *buffer;
- const char *start;
- const char *end;
-{
- /* Emit prefix and skip whitespace if we're starting a new line. */
- if (is_starting_newline (buffer))
- {
- output_emit_prefix (buffer);
- if (output_is_line_wrapping (buffer))
- while (start != end && *start == ' ')
- ++start;
- }
- output_append_r (buffer, start, end - start);
-}
-
-static void
-output_indent (buffer)
- output_buffer *buffer;
-{
- int n = output_indentation (buffer);
- int i;
-
- for (i = 0; i < n; ++i)
- output_add_character (buffer, ' ');
-}
-
-/* Wrap a text delimited by START and END into BUFFER. */
-
-static void
-wrap_text (buffer, start, end)
- output_buffer *buffer;
- const char *start;
- const char *end;
-{
- int is_wrapping = output_is_line_wrapping (buffer);
-
- while (start != end)
- {
- /* Dump anything bordered by whitespaces. */
- {
- const char *p = start;
- while (p != end && *p != ' ' && *p != '\n')
- ++p;
- if (is_wrapping && p - start >= output_space_left (buffer))
- output_add_newline (buffer);
- output_append (buffer, start, p);
- start = p;
- }
-
- if (start != end && *start == ' ')
- {
- output_add_space (buffer);
- ++start;
- }
- if (start != end && *start == '\n')