Eliminate obstack_printf
Not used anywhere. gdb/ChangeLog: 2017-04-18 Pedro Alves <palves@redhat.com> * xml-support.c (obstack_xml_printf): Delete. * xml-support.h (obstack_xml_printf): Delete.
This commit is contained in:
parent
4895cde297
commit
fdd243b001
@ -1,3 +1,8 @@
|
||||
2017-04-18 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* xml-support.c (obstack_xml_printf): Delete.
|
||||
* xml-support.h (obstack_xml_printf): Delete.
|
||||
|
||||
2017-04-18 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* xml-support.c (gdb_xml_parser) <use_dtd, dtd_name, parse,
|
||||
|
@ -997,46 +997,6 @@ show_debug_xml (struct ui_file *file, int from_tty,
|
||||
fprintf_filtered (file, _("XML debugging is %s.\n"), value);
|
||||
}
|
||||
|
||||
void
|
||||
obstack_xml_printf (struct obstack *obstack, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
const char *f;
|
||||
const char *prev;
|
||||
int percent = 0;
|
||||
|
||||
va_start (ap, format);
|
||||
|
||||
prev = format;
|
||||
for (f = format; *f; f++)
|
||||
{
|
||||
if (percent)
|
||||
{
|
||||
switch (*f)
|
||||
{
|
||||
case 's':
|
||||
{
|
||||
char *p;
|
||||
char *a = va_arg (ap, char *);
|
||||
|
||||
obstack_grow (obstack, prev, f - prev - 1);
|
||||
p = xml_escape_text (a);
|
||||
obstack_grow_str (obstack, p);
|
||||
xfree (p);
|
||||
prev = f + 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
percent = 0;
|
||||
}
|
||||
else if (*f == '%')
|
||||
percent = 1;
|
||||
}
|
||||
|
||||
obstack_grow_str (obstack, prev);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
char *
|
||||
xml_fetch_content_from_file (const char *filename, void *baton)
|
||||
{
|
||||
|
@ -227,13 +227,6 @@ extern gdb_xml_attribute_handler gdb_xml_parse_attr_enum;
|
||||
ULONGEST gdb_xml_parse_ulongest (struct gdb_xml_parser *parser,
|
||||
const char *value);
|
||||
|
||||
/* Simple printf to obstack function. Current implemented formatters:
|
||||
%s - grow an xml escaped text in OBSTACK. */
|
||||
|
||||
extern void obstack_xml_printf (struct obstack *obstack,
|
||||
const char *format, ...)
|
||||
ATTRIBUTE_PRINTF_2;
|
||||
|
||||
/* Open FILENAME, read all its text into memory, close it, and return
|
||||
the text. If something goes wrong, return NULL and warn. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user