Skip to content
Snippets Groups Projects
Commit a8da4e1b authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2524] Add libyaml in configure and makefile

parent 257fbcc2
No related branches found
No related tags found
No related merge requests found
......@@ -265,9 +265,24 @@ fi
xml_CFLAGS=
xml_LIBS=-lexpat
AC_SUBST(xml_CFLAGS)
AC_SUBST(xml_CFLAGS)
AC_SUBST(xml_LIBS)
AC_CHECK_LIB([yaml], yaml_parser_initialize,
[AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)],
have_yaml = false)
if ! $have_yaml; then
AC_MSG_ERROR([You need the eXpat xml parser]
[http://expat.sourceforge.net/])
fi
yaml_CFLAGS=
yaml_LIBS=lyaml
AC_SUBST(yaml_CFLAGS)
AC_SUBST(yaml_LIBS)
AC_CHECK_LIB([pthread], pthread_create,
[AC_CHECK_HEADERS(pthread.h, have_pthread=true, have_pthread=false)],
have_pthread=false)
......@@ -292,6 +307,7 @@ AC_SUBST(PCRE_CFLAGS)
# For the tools/, we need libdbus-c++ for the "build" architecture as well
AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")
......
......@@ -3,4 +3,21 @@ SUBDIRS =
noinst_LTLIBRARIES = libconfig.la
libconfig_la_SOURCES = \
config.cpp config.h
config.cpp \
yamlengine.cpp \
yamlemitter.cpp \
yamlparser.cpp
noinst_HEADERS = \
config.h \
engine.h \
serializable.h \
yamlengine.h \
yamlemitter.h \
yamlparser.h
libconfig_la_LDFLAGS = \
${yaml_LIBS}
libconfig_la_CFLAGS = \
${yaml_CFLAGS}
\ No newline at end of file
......@@ -31,10 +31,11 @@
#ifndef __YAMLENGINE_H__
#define __YAMLENGINE_H__
#include "engine.h"
#include "yamlparser.h"
#include "yamlemiter.h"
#include "yamlemitter.h"
class YamlEngine : Engine {
class YamlEngine : public Engine {
public:
......@@ -54,7 +55,7 @@ class YamlEngine : Engine {
YamlParser *parser;
YamlEmiter *emiter;
YamlEmitter *emitter;
};
......
......@@ -34,7 +34,7 @@
YamlParser::YamlParser()
{
memset(buffer, 0, BUFFER_SIZE);
memset(buffer, 0, PARSER_BUFFERSIZE);
open();
}
......@@ -69,12 +69,12 @@ void YamlParser::close()
void YamlParser::parse()
{
bool done;
bool done = false;
yaml_event_t event;
while(!done) {
if(!yaml_parser_parse(&parse, &event))
if(!yaml_parser_parse(&parser, &event))
throw 20;
done = (event.type == YAML_STREAM_END_EVENT);
......
......@@ -43,7 +43,7 @@ class YamlParser {
YamlParser();
~YamlParsere();
~YamlParser();
void open();
......@@ -68,7 +68,7 @@ class YamlParser {
/**
* The event structure array.
*/
yaml_event_t event[PARSER_MAXEVENT];
yaml_event_t events[PARSER_MAXEVENT];
/**
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment