Changeset 2100

Show
Ignore:
Timestamp:
03/26/08 20:40:57 (2 months ago)
Author:
karpet
Message:

use swish hash function rather than raw libxml2 version

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libswish3/trunk/src/libswish3/config.c

    r2098 r2100  
    205205       a little awkward, but saves var names.  
    206206    */ 
    207     tmpmeta = xmlHashLookup(config->metanames, (xmlChar*)SWISH_DEFAULT_METANAME); 
     207    tmpmeta = swish_hash_fetch(config->metanames, (xmlChar*)SWISH_DEFAULT_METANAME); 
    208208    tmpmeta->ref_cnt++; 
    209209    tmpmeta->id = SWISH_META_DEFAULT_ID; 
    210     tmpmeta = xmlHashLookup(config->metanames, (xmlChar*)SWISH_TITLE_METANAME); 
     210    tmpmeta = swish_hash_fetch(config->metanames, (xmlChar*)SWISH_TITLE_METANAME); 
    211211    tmpmeta->ref_cnt++; 
    212212    tmpmeta->id = SWISH_META_TITLE_ID; 
     
    260260 
    261261    /* same deal as metanames above */ 
    262     tmpprop = xmlHashLookup(config->properties, (xmlChar*)SWISH_PROP_DESCRIPTION); 
     262    tmpprop = swish_hash_fetch(config->properties, (xmlChar*)SWISH_PROP_DESCRIPTION); 
    263263    tmpprop->ref_cnt++; 
    264264    tmpprop->id = SWISH_PROP_DESCRIPTION_ID; 
    265     tmpprop = xmlHashLookup(config->properties, (xmlChar*)SWISH_PROP_TITLE); 
     265    tmpprop = swish_hash_fetch(config->properties, (xmlChar*)SWISH_PROP_TITLE); 
    266266    tmpprop->ref_cnt++; 
    267267    tmpprop->id = SWISH_PROP_TITLE_ID; 
  • libswish3/trunk/src/libswish3/header.c

    r2098 r2100  
    148148            /* is this an existing metaname? pull it from hash and update */ 
    149149            if (swish_hash_exists( h->config->metanames, newname )) { 
    150                 newmeta = xmlHashLookup( h->config->metanames, newname ); 
     150                newmeta = swish_hash_fetch( h->config->metanames, newname ); 
    151151            } 
    152152            else { 
  • libswish3/trunk/src/libswish3/mime_types.c

    r2097 r2100  
    219219{ 
    220220    xmlChar * mime; 
    221     mime = xmlHashLookup( config->mimes, fileext ); 
     221    mime = swish_hash_fetch( config->mimes, fileext ); 
    222222    if ( mime == NULL ) 
    223223    { 
     
    235235    xmlChar *deftype; 
    236236     
    237     parser = xmlHashLookup( config->parsers, mime ); 
     237    parser = swish_hash_fetch( config->parsers, mime ); 
    238238     
    239239    if (SWISH_DEBUG > 9) 
    240240        SWISH_DEBUG_MSG("using parser '%s' based on MIME '%s'", parser, mime ); 
    241241     
    242     deftype = xmlHashLookup( config->parsers, (xmlChar *)SWISH_DEFAULT_PARSER ); /* error check?? */ 
     242    deftype = swish_hash_fetch( config->parsers, (xmlChar *)SWISH_DEFAULT_PARSER ); /* error check?? */ 
    243243         
    244244    if ( parser == NULL ) 
  • libswish3/trunk/src/libswish3/namedbuffer.c

    r2096 r2100  
    131131{ 
    132132    xmlChar * nowhitesp; 
    133     xmlBufferPtr buf = xmlHashLookup(nb->hash, name); 
     133    xmlBufferPtr buf = swish_hash_fetch(nb->hash, name); 
    134134     
    135135    if (!buf) 
     
    139139            /* spring to life */ 
    140140            add_name_to_hash(NULL, nb->hash, name); 
    141             buf = xmlHashLookup(nb->hash, name); 
     141            buf = swish_hash_fetch(nb->hash, name); 
    142142        } 
    143143         
     
    197197{ 
    198198    xmlBufferPtr buf; 
    199     buf = xmlHashLookup(nb->hash, key); 
     199    buf = swish_hash_fetch(nb->hash, key); 
    200200    return (xmlChar*)xmlBufferContent(buf); 
    201201} 
  • libswish3/trunk/src/libswish3/parser.c

    r2098 r2100  
    293293 
    294294    /* change our internal name for this tag if it is aliased in config */ 
    295     alias = xmlHashLookup(parser_data->s3->config->tag_aliases, swishtag); 
     295    alias = swish_hash_fetch(parser_data->s3->config->tag_aliases, swishtag); 
    296296    if (alias) 
    297297    { 
     
    18921892     
    18931893    if (tag != NULL) { 
    1894         prop = xmlHashLookup(parser_data->s3->config->properties, tag); 
     1894        prop = swish_hash_fetch(parser_data->s3->config->properties, tag); 
    18951895         
    18961896        /* should we strip whitespace from this particular property ? */