sml_xml_assm_internals.h
/*
* libsyncml - A syncml protocol implementation
* Copyright (C) 2005 Armin Bauer <armin.bauer@opensync.org>
* Copyright (C) 2008 Michael Bell <michael.bell@opensync.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _SML_XML_ASSM_INTERNALS_H_
#define _SML_XML_ASSM_INTERNALS_H_
#include <libxml/xmlwriter.h>
#define XML_NODE_START 1
#define XML_NODE_TEXT 3
#define XML_NODE_CLOSE 15
#define XML_NODE_CDATA 4
typedef enum {
SML_ASSEMBLER_NODE_OPEN,
SML_ASSEMBLER_NODE_CLOSE
} SmlXmlAssemblerNodeType;
typedef struct SmlXmlAssemblerCommand {
SmlCommandType cmdType;
xmlBuffer *buffer;
SmlXmlAssemblerNodeType nodeType;
unsigned int cmdID;
GList *children;
} SmlXmlAssemblerCommand;
typedef struct SmlXmlAssemblerStatus {
unsigned int cmdRef;
unsigned int msgRef;
xmlBuffer *buffer;
unsigned int cmdID;
} SmlXmlAssemblerStatus;
struct SmlXmlAssembler {
xmlTextWriter *writer;
xmlBuffer *header_buffer;
GList *statuses;
GList *commands;
GList *last_commands;
GList *parent_commands;
GList *parent_buffers;
SmlSession *session;
SmlAssembler *assembler;
GMutex *mutex;
unsigned int reserved_statuses;
unsigned int added_statuses;
SmlBool moreDataSet;
};
SmlBool smlAssemblerStartNode(SmlAssembler *assm, const char *name, SmlError **error);
SmlBool smlAssemblerStartNodeNS(SmlAssembler *assm, const char *prefix, const char *name, const char *uri, SmlError **error);
SmlBool smlAssemblerEndNode(SmlAssembler *assm, SmlError **error);
SmlBool smlAssemblerAddString(SmlAssembler *assm, const char *name, const char *value, SmlError **error);
SmlBool smlAssemblerAddStringNS(SmlAssembler *assm, const char *prefix, const char *name, const char *uri, const char *value, SmlError **error);
SmlBool smlAssemblerAddID(SmlAssembler *assm, const char *name, unsigned int id, SmlError **error);
SmlBool smlAssemblerAddData(SmlAssembler *assm, const char *name, const char *value, SmlError **error);
#endif //_SML_XML_ASSM_INTERNALS_H_
SmlXmlAssemblerStatus
Definition: sml_xml_assm_internals.h:57
SmlXmlAssemblerCommand::nodeType
SmlXmlAssemblerNodeType nodeType
Definition: sml_xml_assm_internals.h:51
SmlAssembler
Definition: sml_parse_internals.h:33
SmlXmlAssemblerStatus::buffer
xmlBuffer * buffer
Definition: sml_xml_assm_internals.h:63
SmlXmlAssemblerCommand::cmdType
SmlCommandType cmdType
Definition: sml_xml_assm_internals.h:47
SmlXmlAssembler
Definition: sml_xml_assm_internals.h:68
SmlSession
Definition: sml_session_internals.h:27
SmlXmlAssemblerStatus::cmdRef
unsigned int cmdRef
Definition: sml_xml_assm_internals.h:59
SmlXmlAssemblerCommand::cmdID
unsigned int cmdID
Definition: sml_xml_assm_internals.h:53
SmlXmlAssemblerCommand::buffer
xmlBuffer * buffer
Definition: sml_xml_assm_internals.h:49
SmlXmlAssemblerCommand
Definition: sml_xml_assm_internals.h:45
SmlError
Represent an error.
Definition: sml_error_internals.h:29
SmlXmlAssemblerStatus::cmdID
unsigned int cmdID
Definition: sml_xml_assm_internals.h:65