The Forum won’t let me Upload files so:
xmlTest.c :
// Include the core framework C APIs.
#include “legato.h”
// Include your component’s API interfaces.
#include “interfaces.h”
#include <libxml/parser.h>
#include <libxml/tree.h>
// This function is called only once on startup. Place your initialization and event registration
// here.
COMPONENT_INIT
{
xmlDocPtr doc;
doc = NULL;
if(doc == NULL)
{
LE_INFO(“Is Empty”);
}
doc = xmlParseFile(“test.xml”);
xmlFreeDoc(doc);
}
Component.cdef :
// This is component definition file that specifies the internal content and external interfaces
// of reusable software components.
//
// For more details on the component definition (.cdef) file format see:
// Component Definition .cdef - Legato Docs
// Source code files.
sources:
{
xmlTest.c
}
// Bind resources from the target module into your application.
requires:
{
// IPC APIs used by this component.
api:
{
}
// File paths local to your target module.
file:
{
}
// Directories on your target module to make accessible to the app.
dir:
{
}
// Linux filesystem device paths.
device:
{
}
component:
{
}
// Shared libraries pre-installed on the module.
lib:
{
xml2
}
}
bundles:
{
file:
{
/home/reinhard/.leaf/wp85-toolchain_SWI9X15Y_07.14.01.00-linux64/sysroots/armv7a-neon-poky-linux-gnueabi/usr/include/lib/libxml2.so /lib/
}
}
cflags:
{
}
xmlTest.adef:
// Specify the bundled components for your application here. This section needs to contain a list
// of system paths to your component directory.
version: 1.0.0
maxFileSystemBytes: 512K
sandboxed: true
start: manual
components:
{
}
// Add the list of executables to be constructed and moved to the /bin directory of the app. The
// executable content is a list of the components inside the executable.
//
// Example binding format:
// clientExe.clientComponent.clientInterface → serverExe.serverComponent.serverInterface
executables:
{
xmlTest = ( xmlTestComponent )
}
// The processes section specifies processes to run when the app is started including environment
// variables, command-line arguments, limits, and fault handling actions.
processes:
{
run:
{
( xmlTest )
}
}
// Bindings that allow client side API interfaces to be bound to servers found within other
// applications in the system.
bindings:
{
}