xmlsrv_plat/cxml_library_api/inc/nw_wbxml_dictionary.h
branchRCL_3
changeset 21 604ca70b6235
parent 20 889504eac4fb
equal deleted inserted replaced
20:889504eac4fb 21:604ca70b6235
     1 /*
       
     2 * Copyright (c) 2000 - 2001 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /** ----------------------------------------------------------------------- **
       
    20     @package:     NW_WBXML
       
    21 
       
    22     @synopsis:    default
       
    23 
       
    24     @description: Wbxml token definitions
       
    25 
       
    26  ** ----------------------------------------------------------------------- **/
       
    27 
       
    28 #ifndef NW_PARSER_WBXML_DICTIONARY_H
       
    29 #define NW_PARSER_WBXML_DICTIONARY_H
       
    30 
       
    31 #include <xml/cxml/cxml_proj.h>
       
    32 #include <xml/cxml/nw_string_string.h>
       
    33 
       
    34 #ifdef __cplusplus
       
    35 extern "C"
       
    36 {
       
    37 #endif /* __cplusplus */
       
    38 
       
    39 /*Different feature flags for cXML Library internal use only. */
       
    40 
       
    41 #define CXML_DTD_SUPPORT_ON  0x0000001
       
    42 
       
    43 /** ----------------------------------------------------------------------- **
       
    44     @struct:      NW_WBXML_DictEntry
       
    45 
       
    46     @synopsis:    Entry
       
    47 
       
    48     @scope:       public
       
    49     @variables:
       
    50        NW_Byte token
       
    51                   The token.
       
    52 
       
    53        NW_String_UCS2Buff_t* name
       
    54                   The name.
       
    55 
       
    56     @description: Generic dictionary entry.
       
    57  ** ----------------------------------------------------------------------- **/
       
    58 typedef struct NW_WBXML_DictEntry_s{
       
    59   NW_Byte token;
       
    60   NW_String_UCS2Buff_t* name;
       
    61 }NW_WBXML_DictEntry_t;
       
    62 
       
    63 
       
    64 /** ----------------------------------------------------------------------- **
       
    65     @struct:      NW_WBXML_Codepage
       
    66 
       
    67     @synopsis:    Codepage
       
    68 
       
    69     @scope:       public
       
    70     @variables:
       
    71        NW_Byte count
       
    72                   The number of tokens.
       
    73 
       
    74        NW_WBXML_DictEntry_t* tokens
       
    75                   Ordered by token.
       
    76 
       
    77        NW_Byte* names
       
    78                   Ordered by name, stored as offsets into the token list.
       
    79 
       
    80     @description:  Codepages should be small and have efficient access
       
    81                   both by token and name. They are currently stored in
       
    82                   packed lists of token-string pairs.  While this
       
    83                   requires one more NW_Byte per entry than a sparse
       
    84                   array, they are still guaranteed to be smaller than
       
    85                   sparse arrays for tables with less.  than ~200
       
    86                   entries. Since the biggest table we know about (wbxml
       
    87                   attributes) has only 109 entries this seems like a
       
    88                   reasonable tradeoff.
       
    89 
       
    90  ** ----------------------------------------------------------------------- **/
       
    91 typedef struct NW_WBXML_Codepage_s{
       
    92   NW_Byte count;
       
    93   NW_WBXML_DictEntry_t* tokens;   
       
    94   NW_Byte* names;
       
    95 }NW_WBXML_Codepage_t;
       
    96 
       
    97 
       
    98 /** ----------------------------------------------------------------------- **
       
    99     @struct:      NW_WBXML_Dictionary
       
   100 
       
   101     @synopsis:    Dictionary
       
   102 
       
   103     @scope:       public
       
   104     @variables:
       
   105        NW_Uint32 public_id
       
   106                   The public ID.
       
   107 
       
   108        NW_Ucs2* doc_type
       
   109                   The document type.
       
   110 
       
   111        NW_Int32 tag_page_count
       
   112                   Number of tag pages.
       
   113 
       
   114        NW_WBXML_Codepage_t* tag_pages
       
   115                   Array of pages.
       
   116 
       
   117        NW_Int32 attr_page_count
       
   118                   Number of attribute pages.
       
   119 
       
   120        NW_WBXML_Codepage_t* attr_pages
       
   121                   Array of pages.
       
   122 
       
   123     @description: This structure stores the basic definition of a dictionary.
       
   124  ** ----------------------------------------------------------------------- **/
       
   125 typedef struct NW_WBXML_Dictionary_s {
       
   126   /* Dictionary identifiers */
       
   127   NW_Uint32 public_id;
       
   128   NW_Ucs2* doc_type;
       
   129   /* Tag code pages */
       
   130   NW_Int32 tag_page_count;
       
   131   NW_WBXML_Codepage_t* tag_pages;
       
   132   /* Attribute code pages */
       
   133   NW_Int32 attr_page_count;
       
   134   NW_WBXML_Codepage_t* attr_pages;
       
   135 }NW_WBXML_Dictionary_t;
       
   136 
       
   137 
       
   138 /** ----------------------------------------------------------------------- **
       
   139     @function:    NW_WBXML_Dictionary_initialize
       
   140 
       
   141     @synopsis:    Initialize dictionary.
       
   142 
       
   143     @scope:       public
       
   144 
       
   145     @parameters:
       
   146        [in] NW_Int32 n
       
   147                   Number of dictionaries.
       
   148 
       
   149        [in] NW_WBXML_Dictionary_t* d[]
       
   150                   The array of dictionaries.
       
   151 
       
   152     @description: Dictionary initialization. 
       
   153 
       
   154     @returns:     NW_Status_t
       
   155                   Status of operation.
       
   156 
       
   157        [NW_STAT_SUCCESS]
       
   158                   Dictionaries added to active list
       
   159 
       
   160        [NW_STAT_FAILURE]
       
   161                   List already full.
       
   162 
       
   163  ** ----------------------------------------------------------------------- **/
       
   164 IMPORT_C NW_Status_t 
       
   165 NW_WBXML_Dictionary_initialize(NW_Int32 n, NW_WBXML_Dictionary_t* d[]);
       
   166 
       
   167 /** ----------------------------------------------------------------------- **
       
   168     @function:    NW_WBXML_Dictionary_add
       
   169 
       
   170     @synopsis:    add dictionary(s).
       
   171 
       
   172     @scope:       public
       
   173 
       
   174     @parameters:
       
   175        [in] NW_Int32 n
       
   176                   Number of dictionaries.
       
   177 
       
   178        [in] NW_WBXML_Dictionary_t* d[]
       
   179                   The array of dictionaries.
       
   180 
       
   181     @description: add an array of dictionaries. 
       
   182 
       
   183     @returns:     NW_Status_t
       
   184                   Status of operation.
       
   185 
       
   186        [NW_STAT_SUCCESS]
       
   187                   Dictionaries added to active list
       
   188 
       
   189        [NW_STAT_FAILURE]
       
   190                   List already full.
       
   191 
       
   192  ** ----------------------------------------------------------------------- **/
       
   193 NW_Status_t 
       
   194 NW_WBXML_Dictionary_add(NW_Int32 n, NW_WBXML_Dictionary_t* d[]);
       
   195 
       
   196 /** ----------------------------------------------------------------------- **
       
   197     @function:    NW_WBXML_Dictionary_destroy
       
   198 
       
   199     @synopsis:    Destroy dictionary.
       
   200 
       
   201     @scope:       public
       
   202 
       
   203     @parameters:
       
   204        [in] void
       
   205                 
       
   206 
       
   207        [in-out] 
       
   208                 
       
   209 
       
   210     @description: Dictionary destruction.
       
   211 
       
   212     @returns:     NW_Status_t
       
   213                   default
       
   214 
       
   215  ** ----------------------------------------------------------------------- **/
       
   216 IMPORT_C NW_Status_t
       
   217 NW_WBXML_Dictionary_destroy ();
       
   218 
       
   219 /* ----------------------------------------------------------------------- **
       
   220    Dictionary lookup
       
   221 ** ----------------------------------------------------------------------- **/
       
   222 
       
   223 
       
   224 /** ----------------------------------------------------------------------- **
       
   225     @function:    NW_WBXML_Dictionary_getIndexByPublicId
       
   226 
       
   227     @synopsis:    Get dictionary index using publicID.
       
   228 
       
   229     @scope:       public
       
   230 
       
   231     @parameters:
       
   232        [in] NW_Uint32 public_id
       
   233                   The publid ID to search for.
       
   234 
       
   235     @description: Get dictionary index using publicID.
       
   236 
       
   237     @returns:     NW_Uint32
       
   238                   1 - based index or 0 if not found.
       
   239 
       
   240  ** ----------------------------------------------------------------------- **/
       
   241 NW_Uint32
       
   242 NW_WBXML_Dictionary_getIndexByPublicId (NW_Uint32 public_id);
       
   243 
       
   244 
       
   245 /** ----------------------------------------------------------------------- **
       
   246     @function:    NW_WBXML_Dictionary_getIndexByDocType
       
   247 
       
   248     @synopsis:    Get dictionary index using docType.
       
   249 
       
   250     @scope:       public
       
   251 
       
   252     @parameters:
       
   253        [out] NW_String_t* doc_type
       
   254                   Returned document type.
       
   255 
       
   256        [in] NW_Uint32 encoding
       
   257                   Requested encoding.
       
   258 
       
   259     @description: Get dictionary index using docType.
       
   260 
       
   261     @returns:     NW_Uint32
       
   262                   1 based index if found, otherwise 0.
       
   263 
       
   264  ** ----------------------------------------------------------------------- **/
       
   265 NW_Uint32 
       
   266 NW_WBXML_Dictionary_getIndexByDocType(NW_String_t* doc_type, NW_Uint32 encoding);
       
   267 
       
   268 
       
   269 /** ----------------------------------------------------------------------- **
       
   270     @function:    NW_WBXML_Dictionary_getByPublicId
       
   271 
       
   272     @synopsis:    Get dictionary using publicId.
       
   273 
       
   274     @scope:       public
       
   275 
       
   276     @parameters:
       
   277        [in] NW_Uint32 publicId
       
   278                   Public ID.
       
   279 
       
   280     @description: Look up a dictionary using the document public ID. The 
       
   281                   public ID can be gotten from the document header 
       
   282                   (NMXB_Wbxml_Document_t).
       
   283 
       
   284                   Documents contain either a public ID or a document type 
       
   285                   string. Use this function for documents containing a public ID.
       
   286 
       
   287     @returns:     NW_WBXML_Dictionary_t*
       
   288                   Pointer to dictionary or NULL if not found.
       
   289 
       
   290  ** ----------------------------------------------------------------------- **/
       
   291 IMPORT_C NW_WBXML_Dictionary_t* 
       
   292 NW_WBXML_Dictionary_getByPublicId (NW_Uint32 publicId);
       
   293 
       
   294 
       
   295 /** ----------------------------------------------------------------------- **
       
   296     @function:    NW_WBXML_Dictionary_getByDocType
       
   297 
       
   298     @synopsis:    Get dictionary using docType.
       
   299 
       
   300     @scope:       public
       
   301 
       
   302     @parameters:
       
   303        [in] NW_String_t* docType
       
   304                   A UCS-2 encoded string representing the document type.
       
   305 
       
   306        [in] NW_Uint32 encoding
       
   307                   The encoding.
       
   308 
       
   309     @description: Look up a dictionary using the document type
       
   310                   string. The document type can be gotten from the
       
   311                   document header (NW_Wbxml_Document_t). The string
       
   312                   contained in the header will be encoded in the
       
   313                   document encoding. Note that if the encoding is not
       
   314                   UCS-2, this string must be converted to a UCS-2 string
       
   315                   before being passed to this function.  Documents
       
   316                   contain either a public ID or a document type
       
   317                   string. Use this functions for documents containing a
       
   318                   document type string
       
   319 
       
   320     @returns:     NW_WBXML_Dictionary_t* 
       
   321                   Pointer to dictionary or NULL if not found.
       
   322 
       
   323  ** ----------------------------------------------------------------------- **/
       
   324 NW_WBXML_Dictionary_t* 
       
   325 NW_WBXML_Dictionary_getByDocType (NW_String_t* docType, NW_Uint32 encoding);
       
   326 
       
   327 
       
   328 /** ----------------------------------------------------------------------- **
       
   329     @function:    NW_WBXML_Dictionary_getByIndex
       
   330 
       
   331     @synopsis:    Get dictionary using index.
       
   332 
       
   333     @scope:       public
       
   334 
       
   335     @parameters:
       
   336        [in] NW_Uint32 dictIndex
       
   337                   The index.
       
   338 
       
   339     @description: Get dictionary using index.
       
   340 
       
   341     @returns:     NW_WBXML_Dictionary_t*
       
   342                   Pointer to dictionary or NULL if not found.
       
   343 
       
   344  ** ----------------------------------------------------------------------- **/
       
   345 NW_WBXML_Dictionary_t* 
       
   346 NW_WBXML_Dictionary_getByIndex(NW_Uint32 dictIndex);
       
   347 
       
   348 
       
   349 /* ----------------------------------------------------------------------- **
       
   350    Lookups by token
       
   351 ** ----------------------------------------------------------------------- **/
       
   352 
       
   353 
       
   354 /** ----------------------------------------------------------------------- **
       
   355     @function:    NW_WBXML_Dictionary_getTagByFqToken
       
   356 
       
   357     @synopsis:    Get tag using fully qualified token.
       
   358 
       
   359     @scope:       public
       
   360 
       
   361     @parameters:
       
   362        [in] NW_Uint32 fq_token
       
   363                   The fully qualified token.
       
   364 
       
   365     @description: Gets the string represented by a token. The fq_token
       
   366                   parameter is a token that was returned by the parser
       
   367                   via the FQToken callback. Such token values are "fully
       
   368                   qualified" since they contain not only the token value
       
   369                   itself, but also information that specifies the
       
   370                   dictionary, the code page, and whether the token is
       
   371                   part of the attribute or token code space. Fully
       
   372                   qualified token values should be treated as opaque
       
   373                   data. Get tag using fully qualified token.
       
   374 
       
   375     @returns:     NW_String_UCS2Buff_t*
       
   376                   Tag name or NULL if not found.
       
   377 
       
   378  ** ----------------------------------------------------------------------- **/
       
   379 IMPORT_C NW_String_UCS2Buff_t*
       
   380 NW_WBXML_Dictionary_getTagByFqToken (NW_Uint32 fq_token);
       
   381 
       
   382 
       
   383 /** ----------------------------------------------------------------------- **
       
   384     @function:    NW_WBXML_Dictionary_getElementNameByToken
       
   385 
       
   386     @synopsis:    Get element name using token.
       
   387 
       
   388     @scope:       public
       
   389 
       
   390     @parameters:
       
   391        [in] NW_WBXML_Dictionary_t* dictionary
       
   392                   The dictionary to search.
       
   393 
       
   394        [in] NW_Uint16 token
       
   395                   The token.
       
   396 
       
   397     @description: Get element name using token.
       
   398 
       
   399     @returns:     NW_String_UCS2Buff_t*
       
   400                   Element name or NULL if not found.
       
   401 
       
   402  ** ----------------------------------------------------------------------- **/
       
   403 NW_String_UCS2Buff_t*
       
   404 NW_WBXML_Dictionary_getElementNameByToken (NW_WBXML_Dictionary_t* dictionary,
       
   405                                            NW_Uint16 token);
       
   406 
       
   407 
       
   408 /** ----------------------------------------------------------------------- **
       
   409     @function:    NW_WBXML_Dictionary_getAttributeNameByToken
       
   410 
       
   411     @synopsis:    Get attribute name using token.
       
   412 
       
   413     @scope:       public
       
   414 
       
   415     @parameters:
       
   416        [in] NW_WBXML_Dictionary_t* dictionary
       
   417                   The dictionary.
       
   418 
       
   419        [in] NW_Uint16 token
       
   420                   The token.
       
   421 
       
   422     @description: Get attribute name using token.
       
   423 
       
   424     @returns:     NW_String_UCS2Buff_t*
       
   425                   Attribute name or NULL if not found.
       
   426 
       
   427  ** ----------------------------------------------------------------------- **/
       
   428 IMPORT_C NW_String_UCS2Buff_t*
       
   429 NW_WBXML_Dictionary_getAttributeNameByToken (NW_WBXML_Dictionary_t* dictionary,
       
   430                                              NW_Uint16 token);
       
   431 
       
   432 
       
   433 /** ----------------------------------------------------------------------- **
       
   434     @function:    NW_WBXML_Dictionary_resolveLiteralToken
       
   435 
       
   436     @synopsis:    Returns literal token.
       
   437 
       
   438     @scope:       public
       
   439 
       
   440     @parameters:
       
   441        [in-out] NW_Uint32* token
       
   442                   The token.
       
   443 
       
   444        [in] NW_String_t* name
       
   445                   Name to lookup.
       
   446 
       
   447        [in] NW_Bool is_tag
       
   448                   NW_TRUE if tag token otherwise NW_FALSE if attribute .
       
   449 
       
   450        [in] NW_Uint32 encoding
       
   451                   The encoding of this string.
       
   452 
       
   453        [in] NW_Bool matchCase
       
   454                   If NW_TRUE do case sensitive compare.
       
   455 
       
   456     @description: Given a tag or attribute token, if the token is a literal,
       
   457                   use the given name to lookup the tag/attribute's "real" 
       
   458                   token and return that token.
       
   459 
       
   460     @returns:     NW_Status_t
       
   461                   Status of operation.
       
   462 
       
   463        [NW_STAT_SUCCESS]
       
   464                   Token resolved.
       
   465 
       
   466        [NW_STAT_FAILURE]
       
   467                   Token lookup fails (NOT fatal)
       
   468          
       
   469        [NW_STAT_OUT_OF_MEMORY]
       
   470                   Out of memory.
       
   471  
       
   472  ** ----------------------------------------------------------------------- **/
       
   473 IMPORT_C NW_Status_t 
       
   474 NW_WBXML_Dictionary_resolveLiteralToken(NW_Uint32* token, 
       
   475                                         NW_String_t* name,
       
   476                                         NW_Bool is_tag, 
       
   477                                         NW_Uint32 encoding,
       
   478                                         NW_Bool matchCase);
       
   479 
       
   480 /* ----------------------------------------------------------------------- **
       
   481    Lookups by name  
       
   482 ** ----------------------------------------------------------------------- **/
       
   483 
       
   484 
       
   485 #define NW_WBXML_MASK_CODEPAGE       0x0000FF00
       
   486 #define NW_WBXML_MASK_TOKEN          0x000000FF
       
   487 /* mask off the page and tag leaving content and attribute bits out */
       
   488 #define NW_WBXML_MASK_FQTOKEN_TAG    0x0000FF3F
       
   489 
       
   490 #define NW_WBXML_Dictionary_extractPage(x) \
       
   491     ((NW_Uint8)(((x) & NW_WBXML_MASK_CODEPAGE) >> 8))
       
   492 
       
   493 #define NW_WBXML_Dictionary_extractToken(x) \
       
   494     ((NW_Uint8)((x) & NW_WBXML_MASK_TOKEN))
       
   495 
       
   496 
       
   497 /** ----------------------------------------------------------------------- **
       
   498     @function:    NW_WBXML_Dictionary_getAttributeToken
       
   499 
       
   500     @synopsis:    Get attribute token using name.
       
   501 
       
   502     @scope:       public
       
   503 
       
   504     @parameters:
       
   505        [in] NW_WBXML_Dictionary_t* dictionary
       
   506                   The dictionary.
       
   507 
       
   508        [in] const NW_String_t* name
       
   509                   The attribute name.
       
   510 
       
   511        [in] NW_Uint32 encoding
       
   512                   The encoding of the name.
       
   513 
       
   514        [in] NW_Bool matchCase
       
   515                   Case sensitive comparison if NW_TRUE.
       
   516 
       
   517     @description: Look up an attribute token in a dictionary. The lower
       
   518                   two bytes of the returned value represent the code
       
   519                   page and token. The token value can be calculated as
       
   520                   value&0xff ; the code page can be calculated as
       
   521                   (value>>8)&0xff.)
       
   522 
       
   523                   A fully qualified token constructed from the return
       
   524                   value violates the goal that fully qualified tokens be
       
   525                   opaque. Attribute tokens can either be attribute start
       
   526                   tokens or attribute value tokens. Attribute start
       
   527                   tokens may contain both a name and a value or a name
       
   528                   alone. To look up an attribute start token containing
       
   529                   a name and value, the string argument should be of the
       
   530                   form "name=value". Since attributes may be encoded as
       
   531                   either a single attribute start token, or an attribute
       
   532                   start token and one or more attribute value tokens,
       
   533                   dictionaries may contain multiple entries for a
       
   534                   particular attribute name. The caller may need to do
       
   535                   several lookups to convert a particular attribute
       
   536                   string into a set of tokens, especially if the caller
       
   537                   wants to find the smallest set of tokens to represent
       
   538                   a particular string.
       
   539 
       
   540                   These return the lower 16 bits of the fully qualified
       
   541                   token i.e., the token and code page. The rest of the
       
   542                   token can be constructed by the caller if needed. We
       
   543                   don't use all 32 bits in order to be able to return a
       
   544                   signed quantity to indicate failure.
       
   545 
       
   546     @returns:     NW_Int16
       
   547                   Either the token or -1 if the token is not found.
       
   548 
       
   549  ** ----------------------------------------------------------------------- **/
       
   550 IMPORT_C NW_Int16 
       
   551 NW_WBXML_Dictionary_getAttributeToken (NW_WBXML_Dictionary_t* dictionary,
       
   552                                        const NW_String_t* name,
       
   553                                        NW_Uint32 encoding,
       
   554                                        NW_Bool matchCase);
       
   555 
       
   556 
       
   557 /** ----------------------------------------------------------------------- **
       
   558     @function:    NW_WBXML_Dictionary_getTagToken
       
   559 
       
   560     @synopsis:    Get tag token using name.
       
   561 
       
   562     @scope:       public
       
   563 
       
   564     @parameters:
       
   565        [in] NW_WBXML_Dictionary_t* dictionary
       
   566                   The dictionary to look in.
       
   567 
       
   568        [in] NW_String_UCS2Buff_t* name
       
   569                   The name to search for.
       
   570 
       
   571        [in] NW_Bool matchCase
       
   572                   Case sensitive match if NW_TRUE.
       
   573 
       
   574     @description: Look up a tag token in a dictionary. The lower two
       
   575                   bytes of the returned value represent the code page
       
   576                   and token. The token value can be calculated as
       
   577                   value&0xff and the code page can be calculated as
       
   578                   (value>>8)&0xff.
       
   579 
       
   580                   A fully qualified token is constructed from the return
       
   581                   value. This violates the goal that fully qualified
       
   582                   tokens be opaque.
       
   583 
       
   584                   These return the lower 16 bits of the fully qualified
       
   585                   token i.e., the token and code page. The rest of the
       
   586                   token can be constructed by the caller if needed. We
       
   587                   don't use all 32 bits in order to be able to return a
       
   588                   signed quantity to indicate failure.
       
   589 
       
   590     @returns:     NW_Int16
       
   591                   Either the token or -1 if the token is not found.
       
   592 
       
   593  ** ----------------------------------------------------------------------- **/
       
   594 IMPORT_C NW_Int16
       
   595 NW_WBXML_Dictionary_getTagToken(NW_WBXML_Dictionary_t* dictionary, 
       
   596                                 NW_String_UCS2Buff_t* name,
       
   597                                 NW_Bool matchCase);
       
   598 
       
   599 
       
   600 /** ----------------------------------------------------------------------- **
       
   601     @function:    NW_WBXML_Dictionary_getAttributeToken2
       
   602 
       
   603     @synopsis:    Get attribute token using name (alt.)
       
   604 
       
   605     @scope:       public
       
   606 
       
   607     @parameters:
       
   608        [in] NW_WBXML_Dictionary_t* dictionary
       
   609                   The dictionary to look in.
       
   610 
       
   611        [in] NW_Uint32 encoding
       
   612                   The encoding of name.
       
   613 
       
   614        [in] NW_Uint32 charCount
       
   615                   Length of name in characters.
       
   616 
       
   617        [in] NW_Uint8* pBuf
       
   618                   The characters.
       
   619 
       
   620        [out] NW_Uint16* pPageToken
       
   621                   The token.
       
   622 
       
   623        [in] NW_Bool isName
       
   624                   NW_TRUE for attribute name, NW_FALSE for  attribute value.
       
   625 
       
   626     @description: Get attribute token using name (alt.) Boolean flag determines
       
   627                   whether to return attribute name (NW_TRUE) or attribute value
       
   628                   (NW_FALSE). A cleaner alternative is to use the more specific
       
   629                   functions which do not require the boolean argument.
       
   630 
       
   631                   These return the lower 16 bits of the fully qualified
       
   632                   token i.e., the token and code page. The rest of the
       
   633                   token can be constructed by the caller if needed. We
       
   634                   don't use all 32 bits in order to be able to return a
       
   635                   signed quantity to indicate failure.
       
   636 
       
   637     @returns:     NW_Status_t
       
   638                   Status of operation.
       
   639 
       
   640        [NW_STAT_SUCCESS]
       
   641                   Token returned.
       
   642 
       
   643        [NW_STAT_FAILURE]
       
   644                   Token not found or required parameter is NULL.
       
   645 
       
   646  ** ----------------------------------------------------------------------- **/
       
   647 NW_Status_t
       
   648 NW_WBXML_Dictionary_getAttributeToken2(NW_WBXML_Dictionary_t* dictionary,
       
   649                                        NW_Uint32 encoding,
       
   650                                        NW_Uint32 charCount,
       
   651                                        NW_Uint8* pBuf,
       
   652                                        NW_Uint16* pPageToken,
       
   653                                        NW_Bool isName);
       
   654 
       
   655 
       
   656 /** ----------------------------------------------------------------------- **
       
   657     @function:    NW_WBXML_Dictionary_getAttributeNameToken
       
   658 
       
   659     @synopsis:    Get attribute name token using name.
       
   660 
       
   661     @scope:       public
       
   662 
       
   663     @parameters:
       
   664        [in] NW_WBXML_Dictionary_t* dictionary
       
   665                   The dictionary.
       
   666 
       
   667        [in] NW_Uint32 encoding
       
   668                   The encoding.
       
   669 
       
   670        [in] NW_Uint32 charCount
       
   671                   Length of name in characters.
       
   672 
       
   673        [in] NW_Uint8* pBuf
       
   674                   The name.
       
   675 
       
   676        [out] NW_Uint16* pPageToken
       
   677                   Returned token.
       
   678 
       
   679     @description: Get attribute name token using name.
       
   680 
       
   681     @returns:     NW_Status_t
       
   682                   Status of operation.
       
   683 
       
   684        [NW_STAT_SUCCESS]
       
   685                   Token returned.
       
   686 
       
   687        [NW_STAT_FAILURE]
       
   688                   Token not found or required parameter is NULL.
       
   689 
       
   690  ** ----------------------------------------------------------------------- **/
       
   691 NW_Status_t
       
   692 NW_WBXML_Dictionary_getAttributeNameToken(NW_WBXML_Dictionary_t* dictionary,
       
   693                                           NW_Uint32 encoding,
       
   694                                           NW_Uint32 charCount,
       
   695                                           NW_Uint8* pBuf,
       
   696                                           NW_Uint16* pPageToken);
       
   697 
       
   698 
       
   699 /** ----------------------------------------------------------------------- **
       
   700     @function:    NW_WBXML_Dictionary_getAttributeValueToken
       
   701 
       
   702     @synopsis:    Get attribute value token using name.
       
   703 
       
   704     @scope:       public
       
   705 
       
   706     @parameters:
       
   707        [in] NW_WBXML_Dictionary_t* dictionary
       
   708                   The dictionary.
       
   709 
       
   710        [in] NW_Uint32 encoding
       
   711                   The encoding.
       
   712 
       
   713        [in] NW_Uint32 charCount
       
   714                   Length of attribute value.
       
   715 
       
   716        [in] NW_Uint8* pBuf
       
   717                   The attribute value.
       
   718 
       
   719        [out] NW_Uint16* pPageToken
       
   720                   The returned token.
       
   721 
       
   722     @description: Get attribute value token using name.
       
   723 
       
   724     @returns:     NW_Status_t
       
   725                   Status of operation.
       
   726 
       
   727        [NW_STAT_SUCCESS]
       
   728                   Token returned.
       
   729 
       
   730        [NW_STAT_FAILURE]
       
   731                   Token not found or required parameter is NULL.
       
   732 
       
   733  ** ----------------------------------------------------------------------- **/
       
   734 NW_Status_t
       
   735 NW_WBXML_Dictionary_getAttributeValueToken(NW_WBXML_Dictionary_t* dictionary,
       
   736                                            NW_Uint32 encoding,
       
   737                                            NW_Uint32 charCount,
       
   738                                            NW_Uint8* pBuf,
       
   739                                            NW_Uint16* pPageToken);
       
   740 
       
   741 
       
   742 /** ----------------------------------------------------------------------- **
       
   743     @function:    NW_WBXML_Dictionary_getTagToken2
       
   744 
       
   745     @synopsis:    Get tag token using name (alt.)
       
   746 
       
   747     @scope:       public
       
   748 
       
   749     @parameters:
       
   750        [in] NW_WBXML_Dictionary_t* dictionary
       
   751                   The dictionary.
       
   752 
       
   753        [in] NW_Uint32 encoding
       
   754                   The encoding.
       
   755 
       
   756        [in] NW_Uint32 charCount
       
   757                   Length of value.
       
   758 
       
   759        [in] NW_Uint8* pBuf
       
   760                   The value.
       
   761 
       
   762        [out] NW_Uint16* pPageToken
       
   763                   The returned token.
       
   764 
       
   765     @description: Get tag token using name (alt.)
       
   766 
       
   767     @returns:     NW_Status_t
       
   768                   Status of operation.
       
   769 
       
   770        [NW_STAT_SUCCESS]
       
   771                   Token returned.
       
   772 
       
   773        [NW_STAT_FAILURE]
       
   774                   Token not found or required parameter is NULL.
       
   775 
       
   776  ** ----------------------------------------------------------------------- **/
       
   777 NW_Status_t
       
   778 NW_WBXML_Dictionary_getTagToken2(NW_WBXML_Dictionary_t* dictionary,
       
   779                                  NW_Uint32 encoding,
       
   780                                  NW_Uint32 charCount,
       
   781                                  NW_Uint8* pBuf,
       
   782                                  NW_Uint16* pPageToken);
       
   783 
       
   784 /* 1. returns success, oom, or failure
       
   785    2. if oom or failure, no leaks and no residual memory allocations
       
   786    3. if oom or failure on return *ppDocType is NULL
       
   787    4  if success on return *ppDocType is a valid string or NULL if
       
   788    no matching dictionary or dictionary did not have a doc_type string. */
       
   789 NW_Status_t
       
   790 NW_WBXML_Dictionary_publicId_to_doctypeString(NW_Uint32 publicId,
       
   791                                               NW_String_t** ppDocType);
       
   792 
       
   793 
       
   794 
       
   795 /** ----------------------------------------------------------------------- **
       
   796     @function:    CXML_Additional_Feature_Supprted
       
   797 
       
   798     @synopsis:    To decide about differnt. This helps in the debugging the 
       
   799                   cXML Library. It is not for any client. So, this function 
       
   800                   may not be used.
       
   801 
       
   802     @scope:       public
       
   803 
       
   804     @parameters:
       
   805        
       
   806     @description: There are bit masks defined for different features and for
       
   807                   internal use only.
       
   808               
       
   809     @returns:     
       
   810 
       
   811              Bit mask of features supported. If not feature is supported 
       
   812              then this function returns zero.
       
   813 
       
   814  ** ----------------------------------------------------------------------- **/
       
   815 IMPORT_C
       
   816 CXML_Int32 CXML_Additional_Feature_Supprted();
       
   817 
       
   818 
       
   819 
       
   820 #ifdef __cplusplus
       
   821 } /* extern "C" { */
       
   822 #endif /* __cplusplus */
       
   823 
       
   824 #endif  /* NW_PARSER_WBXML_DICTIONARY_H */