1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00

Define "ezstream" only once

This commit is contained in:
Moritz Grimm 2018-07-17 10:31:25 +02:00
parent 92ffc9ac50
commit 9f2cd71aed

View File

@ -28,6 +28,8 @@
#include <libxml/parser.h> #include <libxml/parser.h>
#define CFGFILE_XML_NAME "ezstream"
static int _cfgfile_xml_parse_server(xmlDocPtr, xmlNodePtr); static int _cfgfile_xml_parse_server(xmlDocPtr, xmlNodePtr);
static int _cfgfile_xml_parse_servers(xmlDocPtr, xmlNodePtr); static int _cfgfile_xml_parse_servers(xmlDocPtr, xmlNodePtr);
static int _cfgfile_xml_parse_stream(xmlDocPtr, xmlNodePtr); static int _cfgfile_xml_parse_stream(xmlDocPtr, xmlNodePtr);
@ -480,8 +482,9 @@ cfgfile_xml_parse(const char *config_file)
log_error("%s: empty document", config_file); log_error("%s: empty document", config_file);
goto error; goto error;
} }
if (0 != xmlStrcasecmp(cur->name, XML_CHAR("ezstream"))) { if (0 != xmlStrcasecmp(cur->name, XML_CHAR(CFGFILE_XML_NAME))) {
log_error("%s: not ezstream config", config_file); log_error("%s: %s configuration not recognized", config_file,
CFGFILE_XML_NAME);
goto error; goto error;
} }
@ -693,7 +696,7 @@ _cfgfile_xml_print_encoder(cfg_encoder_t e, void *arg)
void void
cfgfile_xml_print(FILE *fp) cfgfile_xml_print(FILE *fp)
{ {
fprintf(fp, "<ezstream>\n"); fprintf(fp, "<%s>\n", CFGFILE_XML_NAME);
fprintf(fp, "\n"); fprintf(fp, "\n");
fprintf(fp, " <servers>\n"); fprintf(fp, " <servers>\n");
cfg_server_list_foreach(cfg_get_servers(), _cfgfile_xml_print_server, cfg_server_list_foreach(cfg_get_servers(), _cfgfile_xml_print_server,
@ -745,5 +748,5 @@ cfgfile_xml_print(FILE *fp)
fprintf(fp, " <no_updates>yes</no_updates>\n"); fprintf(fp, " <no_updates>yes</no_updates>\n");
fprintf(fp, " </metadata>\n"); fprintf(fp, " </metadata>\n");
} }
fprintf(fp, "</ezstream>\n"); fprintf(fp, "</%s>\n", CFGFILE_XML_NAME);
} }