forked from github/server
we do not need a USE_LIBXML define, xml is a hard requirement.
This commit is contained in:
parent
866abcc92c
commit
ffbc9596d7
7 changed files with 0 additions and 28 deletions
|
@ -294,5 +294,4 @@ include_directories (${LIBXML2_INCLUDE_DIR})
|
||||||
target_link_libraries(eressea ${LIBXML2_LIBRARIES})
|
target_link_libraries(eressea ${LIBXML2_LIBRARIES})
|
||||||
target_link_libraries(convert ${LIBXML2_LIBRARIES})
|
target_link_libraries(convert ${LIBXML2_LIBRARIES})
|
||||||
target_link_libraries(test_eressea ${LIBXML2_LIBRARIES})
|
target_link_libraries(test_eressea ${LIBXML2_LIBRARIES})
|
||||||
add_definitions(-DUSE_LIBXML2)
|
|
||||||
endif (LIBXML2_FOUND)
|
endif (LIBXML2_FOUND)
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
#include <platform.h>
|
#include <platform.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
#include <kernel/xmlreader.h>
|
#include <kernel/xmlreader.h>
|
||||||
#include <util/xml.h>
|
#include <util/xml.h>
|
||||||
#endif
|
|
||||||
#include <kernel/race.h>
|
#include <kernel/race.h>
|
||||||
#include <kernel/rules.h>
|
#include <kernel/rules.h>
|
||||||
#include <races/races.h>
|
#include <races/races.h>
|
||||||
|
@ -21,12 +19,9 @@ int main(int argc, char **argv) {
|
||||||
const char *mode;
|
const char *mode;
|
||||||
|
|
||||||
register_races();
|
register_races();
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
register_xmlreader();
|
register_xmlreader();
|
||||||
#endif
|
|
||||||
if (argc < 2) return usage();
|
if (argc < 2) return usage();
|
||||||
mode = argv[1];
|
mode = argv[1];
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
if (strcmp(mode, "rules")==0) {
|
if (strcmp(mode, "rules")==0) {
|
||||||
const char *xmlfile, *catalog;
|
const char *xmlfile, *catalog;
|
||||||
if (argc < 4) return usage();
|
if (argc < 4) return usage();
|
||||||
|
@ -36,7 +31,6 @@ int main(int argc, char **argv) {
|
||||||
write_rules("rules.dat");
|
write_rules("rules.dat");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (strcmp(mode, "po")==0) {
|
if (strcmp(mode, "po")==0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,9 +85,7 @@ void game_init(void)
|
||||||
|
|
||||||
register_weapons();
|
register_weapons();
|
||||||
register_xerewards();
|
register_xerewards();
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
register_xmlreader();
|
register_xmlreader();
|
||||||
#endif
|
|
||||||
register_attributes();
|
register_attributes();
|
||||||
register_gmcmd();
|
register_gmcmd();
|
||||||
|
|
||||||
|
|
|
@ -73,11 +73,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "guard.h"
|
#include "guard.h"
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
|
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
/* libxml includes */
|
/* libxml includes */
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
#include <libxml/xpath.h>
|
#include <libxml/xpath.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
/* external libraries */
|
/* external libraries */
|
||||||
#include <iniparser.h>
|
#include <iniparser.h>
|
||||||
|
@ -602,9 +600,7 @@ void kernel_done(void)
|
||||||
/* calling this function releases memory assigned to static variables, etc.
|
/* calling this function releases memory assigned to static variables, etc.
|
||||||
* calling it is optional, e.g. a release server will most likely not do it.
|
* calling it is optional, e.g. a release server will most likely not do it.
|
||||||
*/
|
*/
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
xml_done();
|
xml_done();
|
||||||
#endif
|
|
||||||
attrib_done();
|
attrib_done();
|
||||||
item_done();
|
item_done();
|
||||||
message_done();
|
message_done();
|
||||||
|
|
|
@ -48,12 +48,10 @@ without prior permission by the authors of Eressea.
|
||||||
#include <util/nrmessage.h>
|
#include <util/nrmessage.h>
|
||||||
#include <util/xml.h>
|
#include <util/xml.h>
|
||||||
|
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
/* libxml includes */
|
/* libxml includes */
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
#include <libxml/xpath.h>
|
#include <libxml/xpath.h>
|
||||||
#include <libxml/encoding.h>
|
#include <libxml/encoding.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -61,7 +59,6 @@ without prior permission by the authors of Eressea.
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
|
|
||||||
static variant xml_fraction(xmlNodePtr node, const char *name) {
|
static variant xml_fraction(xmlNodePtr node, const char *name) {
|
||||||
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
|
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
|
||||||
|
@ -1761,4 +1758,3 @@ void register_xmlreader(void)
|
||||||
xml_register_callback(parse_strings);
|
xml_register_callback(parse_strings);
|
||||||
xml_register_callback(parse_messages);
|
xml_register_callback(parse_messages);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -16,10 +16,8 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
|
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
#include <libxml/catalog.h>
|
#include <libxml/catalog.h>
|
||||||
#include <libxml/xmlstring.h>
|
#include <libxml/xmlstring.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -27,7 +25,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
int xml_ivalue(xmlNodePtr node, const char *name, int dflt)
|
int xml_ivalue(xmlNodePtr node, const char *name, int dflt)
|
||||||
{
|
{
|
||||||
int i = dflt;
|
int i = dflt;
|
||||||
|
@ -110,11 +107,9 @@ void xml_register_callback(xml_callback callback)
|
||||||
insert = &(*insert)->next;
|
insert = &(*insert)->next;
|
||||||
*insert = reader;
|
*insert = reader;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int read_xml(const char *filename, const char *catalog)
|
int read_xml(const char *filename, const char *catalog)
|
||||||
{
|
{
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
xml_reader *reader = xmlReaders;
|
xml_reader *reader = xmlReaders;
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
int result;
|
int result;
|
||||||
|
@ -141,8 +136,4 @@ int read_xml(const char *filename, const char *catalog)
|
||||||
}
|
}
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
return result;
|
return result;
|
||||||
#else
|
|
||||||
log_error("LIBXML2 disabled, cannot read %s.\n", filename);
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_LIBXML2
|
|
||||||
/* new xml functions: */
|
/* new xml functions: */
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
|
|
||||||
|
@ -30,7 +29,6 @@ extern "C" {
|
||||||
double xml_fvalue(xmlNodePtr node, const char *name, double dflt);
|
double xml_fvalue(xmlNodePtr node, const char *name, double dflt);
|
||||||
int xml_ivalue(xmlNodePtr node, const char *name, int dflt);
|
int xml_ivalue(xmlNodePtr node, const char *name, int dflt);
|
||||||
bool xml_bvalue(xmlNodePtr node, const char *name, bool dflt);
|
bool xml_bvalue(xmlNodePtr node, const char *name, bool dflt);
|
||||||
#endif
|
|
||||||
|
|
||||||
void xml_done(void);
|
void xml_done(void);
|
||||||
int read_xml(const char *filename, const char *catalog);
|
int read_xml(const char *filename, const char *catalog);
|
||||||
|
|
Loading…
Reference in a new issue