epoc32/include/stdapis/libxml2/libxml2_dict.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2  * Summary: string dictionnary
     3  * Description: dictionary of reusable strings, just used to avoid allocation
     4  *         and freeing operations.
     5  *
     6  * Copy: See Copyright for the status of this software.
     7  *
     8  * Author: Daniel Veillard
     9  * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
    10  */
    11 
    12 /** @file
    13 @publishedAll
    14 @released
    15 */
    16 
    17 #ifndef XML_DICT_H
    18 #define XML_DICT_H
    19 
    20 #include "libxml2_xmlstring.h"
    21 
    22 #ifdef __cplusplus
    23 extern "C" {
    24 #endif
    25 
    26 typedef struct _xmlDictStrings xmlDictStrings;
    27 typedef xmlDictStrings* xmlDictStringsPtr;
    28 
    29 struct _xmlDictStrings {
    30     xmlDictStringsPtr next;
    31     xmlChar* free;
    32     xmlChar* end;
    33     int size;
    34     int nbStrings;
    35     xmlChar array[1];
    36 };
    37 
    38 /*
    39  * An entry in the dictionnary
    40  */
    41 typedef struct _xmlDictEntry xmlDictEntry;
    42 typedef xmlDictEntry* xmlDictEntryPtr;
    43 struct _xmlDictEntry {
    44     xmlDictEntryPtr next;
    45     const xmlChar* name;
    46     int len;
    47     int valid;
    48 };
    49 /*
    50  * The dictionnary.
    51  */
    52 typedef struct _xmlDict xmlDict;
    53 typedef xmlDict* xmlDictPtr;
    54 
    55 /*
    56  * The entire dictionnary
    57  */
    58 struct _xmlDict {
    59     int ref_counter;
    60 
    61     xmlDictEntryPtr dict;
    62     int size;
    63     int nbElems;
    64     xmlDictStringsPtr strings;
    65 
    66     xmlDictPtr      subdict;
    67 };
    68 
    69 /*
    70  * Constructor and destructor.
    71  */
    72 XMLPUBFUN xmlDictPtr XMLCALL
    73                         xmlDictCreate   (void);
    74 
    75 XMLPUBFUN xmlDictPtr XMLCALL xmlDictCreateSub(xmlDictPtr sub);
    76 
    77 XMLPUBFUN int XMLCALL
    78                         xmlDictReference(xmlDictPtr dict);
    79 XMLPUBFUN void XMLCALL
    80                         xmlDictFree     (xmlDictPtr dict);
    81 
    82 /*
    83  * Lookup of entry in the dictionnary.
    84  */
    85 XMLPUBFUN const xmlChar* XMLCALL
    86                         xmlDictLookup   (xmlDictPtr dict,
    87                                          const xmlChar *name,
    88                                          int len);
    89 
    90 XMLPUBFUN const xmlChar * XMLCALL
    91                         xmlDictQLookup  (xmlDictPtr dict,
    92                                          const xmlChar *prefix,
    93                                          const xmlChar *name);
    94 
    95 #ifndef XMLENGINE_EXCLUDE_UNUSED
    96 XMLPUBFUN int XMLCALL
    97                         xmlDictSize     (xmlDictPtr dict);
    98 #endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
    99 
   100 XMLPUBFUN int XMLCALL
   101                         xmlDictOwns     (xmlDictPtr dict,
   102                                          const xmlChar *str);
   103 #ifdef __cplusplus
   104 }
   105 #endif
   106 #endif /* XML_DICT_H */
   107