sml_command_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_COMMAND_INTERNALS_H_
#define _SML_COMMAND_INTERNALS_H_
typedef struct SmlCommandAlertPrivate {
SmlAlertType type;
SmlAnchor *anchor;
char *contentType;
int maxObjSize;
} SmlCommandAlertPrivate;
typedef struct SmlCommandSyncPrivate {
unsigned int numChanged;
int maxObjSize;
SmlBool hasNumChanged;
} SmlCommandSyncPrivate;
typedef struct SmlCommandAccessPrivate {
char *type;
SmlItem *item;
} SmlCommandAccessPrivate;
typedef struct SmlCommandChangePrivate {
GList *items;
SmlChangeType type;
} SmlCommandChangePrivate;
typedef struct SmlCommandMapPrivate {
GList *items;
} SmlCommandMapPrivate;
typedef struct SmlCommandResultsPrivate {
SmlStatus *status;
} SmlCommandResultsPrivate;
typedef union SmlCommandPrivate {
SmlCommandAlertPrivate alert;
SmlCommandSyncPrivate sync;
SmlCommandAccessPrivate access;
SmlCommandChangePrivate change;
SmlCommandMapPrivate map;
SmlCommandResultsPrivate results;
} SmlCommandPrivate;
struct SmlCommand {
gint refCount;
SmlCommandType type;
unsigned int cmdID;
unsigned int msgID;
SmlCommandPrivate private;
SmlLocation *source;
SmlLocation *target;
SmlPendingStatus *pendingReply;
GList *children;
SmlCommand *parent;
SmlBool noResp;
unsigned int size;
SmlBool pushedBack;
};
struct SmlStatus {
gint refCount;
unsigned int msgRef;
unsigned int cmdRef;
SmlCommandType type;
char *data;
SmlAnchor *anchor;
SmlLocation *sourceRef;
SmlLocation *targetRef;
SmlCred *cred;
SmlChal *chal;
SmlItem *item;
SmlCommand *result;
};
SmlCommandType smlCommandTypeFromString(const char *name, SmlError **error);
const char *smlCommandTypeToString(SmlCommandType type, SmlError **error);
SmlAlertType smlAlertTypeConvert(unsigned int id, SmlError **error);
#endif //_SML_COMMAND_INTERNALS_H_
SmlCommandResultsPrivate
Definition: sml_command_internals.h:60
SmlCommandAlertPrivate
Definition: sml_command_internals.h:33
SmlCred
Definition: sml_elements_internals.h:87
SmlAnchor
Definition: sml_elements_internals.h:35
SmlCommandChangePrivate
Definition: sml_command_internals.h:51
SmlStatus
Definition: sml_command_internals.h:94
SmlCommandPrivate
Definition: sml_command_internals.h:64
SmlCommandMapPrivate
Definition: sml_command_internals.h:56
SmlCommandAccessPrivate
Definition: sml_command_internals.h:46
SmlItem
Definition: sml_elements_internals.h:46
SmlChal
Definition: sml_elements_internals.h:96
SmlPendingStatus
Definition: sml_session_internals.h:99
SmlCommand
Definition: sml_command_internals.h:73
SmlCommandSyncPrivate
Definition: sml_command_internals.h:40
SmlLocation
Definition: sml_elements_internals.h:40
SmlError
Represent an error.
Definition: sml_error_internals.h:29
SmlCommand::pushedBack
SmlBool pushedBack
Definition: sml_command_internals.h:91