<libroxml  version="3.0.1" />
contact: tristan.lelong@libroxml.net
roxml_buff.c File Reference

buffer XML document backend More...

#include "roxml_core.h"
#include "roxml_parser.h"
#include "roxml_internal.h"

Go to the source code of this file.


ROXML_INT int roxml_read_buff (int pos, int size, char *buffer, node_t *node)
 read xml doc function More...
ROXML_INT void roxml_close_buff (node_t *n)
 unload function More...
ROXML_INT int roxml_parse_buff (roxml_load_ctx_t *context, roxml_parser_item_t *parser, char *buffer)
 generic load function More...
ROXML_API node_troxml_load_buf (char *buffer)
 load function for buffers More...

Detailed Description

buffer XML document backend

(C) Copyright 2014 Tristan Lelong trist.nosp@m.an.l.nosp@m.elong.nosp@m.@lib.nosp@m.roxml.nosp@m..net

SPDX-Licence-Identifier: LGPL-2.1+ The author added a static linking exception, see License.txt.

Definition in file roxml_buff.c.

Function Documentation

◆ roxml_close_buff()

void roxml_close_buff ( node_t n)

unload function

This function clear a document that was opened as part of a buffer

nis any node of the tree to be cleaned

Definition at line 29 of file roxml_buff.c.

◆ roxml_load_buf()

node_t * roxml_load_buf ( char *  buffer)

load function for buffers

This function load a document by parsing all the corresponding nodes. The document must be contained inside the char * buffer given in parameter and remain valid until the roxml_close() function is called

bufferthe XML buffer to load
the root node or ROXML_INVALID_DOC (NULL). errno is set to EINVAL in case of parsing error
See also

Definition at line 47 of file roxml_buff.c.

◆ roxml_parse_buff()

node_t * roxml_parse_buff ( roxml_load_ctx_t context,
roxml_parser_item_t parser,
char *  buffer 

generic load function

This function parse a buffer document and all the corresponding nodes

contextinternal data used for parsing
parserthe parser object to run
bufferaddress of buffer that contains xml
an error code and filled context see roxml_close_buff

Definition at line 34 of file roxml_buff.c.

◆ roxml_read_buff()

roxml_read_buff ( int  pos,
int  size,
char *  buffer,
node_t node 

read xml doc function

this function read inside a xml buffer and fill the given buffer

posthe pos in the xml document
sizethe size of the data to read
bufferthe destination buffer
nodethe node that belong to the tree we want to read to
the number of bytes read

Definition at line 16 of file roxml_buff.c.