Home | History | Annotate | Download | only in ghdr
      1 /*************************************************************************/
      2 /* module:          Type definitions for SyncML                          */
      3 /*                                                                       */
      4 /* file:            SMLDef.h                                             */
      5 /* target system:   all                                                  */
      6 /* target OS:       all                                                  */
      7 /*                                                                       */
      8 /* Description:                                                          */
      9 /* Platform independent header with syncML types and definitions         */
     10 /*************************************************************************/
     11 
     12 
     13 /*
     14  * Copyright Notice
     15  * Copyright (c) Ericsson, IBM, Lotus, Matsushita Communication
     16  * Industrial Co., Ltd., Motorola, Nokia, Openwave Systems, Inc.,
     17  * Palm, Inc., Psion, Starfish Software, Symbian, Ltd. (2001).
     18  * All Rights Reserved.
     19  * Implementation of all or part of any Specification may require
     20  * licenses under third party intellectual property rights,
     21  * including without limitation, patent rights (such a third party
     22  * may or may not be a Supporter). The Sponsors of the Specification
     23  * are not responsible and shall not be held responsible in any
     24  * manner for identifying or failing to identify any or all such
     25  * third party intellectual property rights.
     26  *
     27  * THIS DOCUMENT AND THE INFORMATION CONTAINED HEREIN ARE PROVIDED
     28  * ON AN "AS IS" BASIS WITHOUT WARRANTY OF ANY KIND AND ERICSSON, IBM,
     29  * LOTUS, MATSUSHITA COMMUNICATION INDUSTRIAL CO. LTD, MOTOROLA,
     30  * NOKIA, PALM INC., PSION, STARFISH SOFTWARE AND ALL OTHER SYNCML
     31  * SPONSORS DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
     32  * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
     33  * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
     34  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
     35  * SHALL ERICSSON, IBM, LOTUS, MATSUSHITA COMMUNICATION INDUSTRIAL CO.,
     36  * LTD, MOTOROLA, NOKIA, PALM INC., PSION, STARFISH SOFTWARE OR ANY
     37  * OTHER SYNCML SPONSOR BE LIABLE TO ANY PARTY FOR ANY LOSS OF
     38  * PROFITS, LOSS OF BUSINESS, LOSS OF USE OF DATA, INTERRUPTION OF
     39  * BUSINESS, OR FOR DIRECT, INDIRECT, SPECIAL OR EXEMPLARY, INCIDENTAL,
     40  * PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND IN CONNECTION WITH
     41  * THIS DOCUMENT OR THE INFORMATION CONTAINED HEREIN, EVEN IF ADVISED
     42  * OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
     43  *
     44  * The above notice and this paragraph must be included on all copies
     45  * of this document that are made.
     46  *
     47  */
     48 
     49 
     50 
     51 
     52 #ifndef _SML_DEF_H
     53   #define _SML_DEF_H
     54 
     55 
     56 
     57 /*************************************************************************
     58  *  Definitions
     59  *************************************************************************/
     60 
     61 
     62 
     63 /**
     64  * include target/compiler specific defines/options/settings
     65  **/
     66 #include <define.h>
     67 
     68 
     69 /**
     70  * ===================================
     71  * Common all-purpose type definitions
     72  * ===================================
     73  **/
     74 
     75 
     76 
     77 /**
     78  * ==================================
     79  * Basic data types
     80  * ==================================
     81  **/
     82 typedef short         Short_t;      // short integer,  16 Bytes
     83 typedef long          Long_t;       // long integer,   32 Bytes
     84 typedef char*         String_t;     // String pointer,
     85 typedef unsigned char Byte_t;       // a single byte
     86 typedef Byte_t        Boolean_t;    // a boolean
     87 #ifndef NULL                        // a NULL pointer
     88   #define NULL (void*) 0
     89 #endif
     90 
     91 
     92 typedef Short_t       Ret_t;        // Return Type of API Commands
     93 typedef Long_t        Length_t;     // System dependent string length
     94 typedef Short_t       MemHandle_t;  // Memory object Handle
     95 typedef unsigned char *MemPtr_t;    // Memory object Pointer
     96 typedef void          *VoidPtr_t;   // Void Pointer
     97 typedef Long_t        MemSize_t;    // System dependent memory object size
     98 typedef unsigned char MemByte_t;    // Memory element
     99 typedef unsigned int  Flag_t;       // A generic flag type. This type is used to
    100                                     // declare variables in structures wherever
    101                                     // flags are used.
    102 
    103 
    104 
    105 
    106 /**
    107  * ==================================
    108  * Definitions used in the SyncML API
    109  * ==================================
    110  **/
    111 
    112 
    113 /**
    114  * Application callback function displaying output strings to the user
    115  **/
    116 typedef void (*smlPrintFunc) (String_t outputString);
    117 
    118 
    119 /**
    120  * structure describing the options and setting of this syncml process
    121  **/
    122 typedef struct sml_options_s {
    123   smlPrintFunc  defaultPrintFunc;       // default application callback for displaying strings,
    124   MemSize_t     maxWorkspaceAvailMem;   // size which all workspaces in total MUST not exceed
    125 } *SmlOptionsPtr_t, SmlOptions_t;
    126 
    127 
    128 /**
    129  * Reference of an instance
    130  **/
    131 #ifdef NOWSM
    132 typedef void *InstanceID_t;          // without wsm, instance ID is direct pointer to instance info
    133 #else
    134 typedef MemHandle_t InstanceID_t;    // Handle, used as a unique ID of
    135 #endif                               // an synchronization instance
    136 
    137 
    138 /**
    139  * Type of used encoding
    140  **/
    141 typedef enum {
    142 	SML_UNDEF = 0,
    143         SML_WBXML,
    144         SML_XML
    145 } SmlEncoding_t;
    146 
    147 
    148 /** %%% added luz 2003-07-31:
    149  * SyncML version
    150  **/
    151 typedef enum {
    152   SML_VERS_UNDEF = 0,
    153   SML_VERS_1_0,
    154   SML_VERS_1_1,
    155   SML_VERS_1_2,
    156   SML_NUM_VERS
    157 } SmlVersion_t;
    158 
    159 /**
    160  * structure describing the options of an instance,
    161  **/
    162 typedef struct sml_instance_options_s {
    163   SmlEncoding_t encoding;               // Used encoding type,
    164   MemSize_t     workspaceSize;          // size of the workspace to allocate (instance buffer size if NOWSM defined)
    165   #ifndef NOWSM
    166   String_t      workspaceName;          // name of the workspace
    167   #else
    168   MemSize_t     maxOutgoingSize;        // max size of outgoing message, 0 if no restriction
    169   #endif
    170 } *SmlInstanceOptionsPtr_t, SmlInstanceOptions_t;
    171 
    172 
    173 /**
    174  * Processing modes
    175  **/
    176 typedef enum {
    177   SML_DO_NOTHING = 0,
    178   SML_FIRST_COMMAND,
    179   SML_NEXT_COMMAND,
    180   SML_NEXT_MESSAGE,
    181   SML_ALL_COMMANDS
    182 } SmlProcessMode_t;
    183 
    184 
    185 /**
    186  * Requested buffer pointer position
    187  **/
    188 typedef enum {
    189   SML_FIRST_DATA_ITEM = 0,
    190   SML_FIRST_FREE_ITEM
    191 } SmlBufPtrPos_t;
    192 
    193 
    194 
    195 /**
    196  * SyncML Protocol Management and Command Elements (PE)
    197  **/
    198 typedef enum {
    199     SML_PE_UNDEF = 0,
    200     SML_PE_ERROR,
    201     SML_PE_ADD,
    202     SML_PE_ALERT,
    203     SML_PE_ATOMIC_START,
    204     SML_PE_ATOMIC_END,
    205     SML_PE_COPY,
    206     SML_PE_DELETE,
    207     SML_PE_EXEC,
    208     SML_PE_GET,
    209     SML_PE_MAP,
    210     SML_PE_PUT,
    211     SML_PE_RESULTS,
    212     SML_PE_SEARCH,
    213     SML_PE_SEQUENCE_START,
    214     SML_PE_SEQUENCE_END,
    215     SML_PE_STATUS,
    216     SML_PE_SYNC_START,
    217     SML_PE_SYNC_END,
    218     SML_PE_REPLACE,
    219     SML_PE_HEADER,
    220     SML_PE_PUT_GET,
    221     SML_PE_CMD_GROUP,
    222     SML_PE_GENERIC,
    223     SML_PE_FINAL
    224 } SmlProtoElement_t;
    225 
    226 typedef struct
    227 {
    228     Byte_t      token;
    229     String_t    escape_str;
    230 } ESCAPE_CHAR_TABLE_T;
    231 
    232 #endif
    233