亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? dict.c

?? libxml,在UNIX/LINUX下非常重要的一個(gè)庫(kù),為XML相關(guān)應(yīng)用提供方便.目前上載的是最新版本,若要取得最新版本,請(qǐng)參考里面的readme.
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* * dict.c: dictionary of reusable strings, just used to avoid allocation *         and freeing operations. * * Copyright (C) 2003 Daniel Veillard. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. * * Author: daniel@veillard.com */#define IN_LIBXML#include "libxml.h"#include <string.h>#include <libxml/tree.h>#include <libxml/dict.h>#include <libxml/xmlmemory.h>#include <libxml/xmlerror.h>#include <libxml/globals.h>#define MAX_HASH_LEN 4#define MIN_DICT_SIZE 128#define MAX_DICT_HASH 8 * 2048/* #define ALLOW_REMOVAL *//* #define DEBUG_GROW *//* * An entry in the dictionnary */typedef struct _xmlDictEntry xmlDictEntry;typedef xmlDictEntry *xmlDictEntryPtr;struct _xmlDictEntry {    struct _xmlDictEntry *next;    const xmlChar *name;    int len;    int valid;};typedef struct _xmlDictStrings xmlDictStrings;typedef xmlDictStrings *xmlDictStringsPtr;struct _xmlDictStrings {    xmlDictStringsPtr next;    xmlChar *free;    xmlChar *end;    int size;    int nbStrings;    xmlChar array[1];};/* * The entire dictionnary */struct _xmlDict {    int ref_counter;    xmlRMutexPtr mutex;    struct _xmlDictEntry *dict;    int size;    int nbElems;    xmlDictStringsPtr strings;    struct _xmlDict *subdict;};/* * A mutex for modifying the reference counter for shared * dictionaries. */static xmlRMutexPtr xmlDictMutex = NULL;/* * Whether the dictionary mutex was initialized. */static int xmlDictInitialized = 0;/** * xmlInitializeDict: * * Do the dictionary mutex initialization. * this function is not thread safe, initialization should * preferably be done once at startup */static int xmlInitializeDict(void) {    if (xmlDictInitialized)        return(1);    if ((xmlDictMutex = xmlNewRMutex()) == NULL)        return(0);    xmlDictInitialized = 1;    return(1);}/** * xmlDictCleanup: * * Free the dictionary mutex. */voidxmlDictCleanup(void) {    if (!xmlDictInitialized)        return;    xmlFreeRMutex(xmlDictMutex);    xmlDictInitialized = 0;}/* * xmlDictAddString: * @dict: the dictionnary * @name: the name of the userdata * @len: the length of the name, if -1 it is recomputed * * Add the string to the array[s] * * Returns the pointer of the local string, or NULL in case of error. */static const xmlChar *xmlDictAddString(xmlDictPtr dict, const xmlChar *name, int namelen) {    xmlDictStringsPtr pool;    const xmlChar *ret;    int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */    pool = dict->strings;    while (pool != NULL) {	if (pool->end - pool->free > namelen)	    goto found_pool;	if (pool->size > size) size = pool->size;	pool = pool->next;    }    /*     * Not found, need to allocate     */    if (pool == NULL) {        if (size == 0) size = 1000;	else size *= 4; /* exponential growth */        if (size < 4 * namelen) 	    size = 4 * namelen; /* just in case ! */	pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);	if (pool == NULL)	    return(NULL);	pool->size = size;	pool->nbStrings = 0;	pool->free = &pool->array[0];	pool->end = &pool->array[size];	pool->next = dict->strings;	dict->strings = pool;    }found_pool:    ret = pool->free;    memcpy(pool->free, name, namelen);    pool->free += namelen;    *(pool->free++) = 0;    return(ret);}/* * xmlDictAddQString: * @dict: the dictionnary * @prefix: the prefix of the userdata * @name: the name of the userdata * @len: the length of the name, if -1 it is recomputed * * Add the QName to the array[s] * * Returns the pointer of the local string, or NULL in case of error. */static const xmlChar *xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix,                 const xmlChar *name, int namelen){    xmlDictStringsPtr pool;    const xmlChar *ret;    int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */    int plen;    if (prefix == NULL) return(xmlDictAddString(dict, name, namelen));    plen = xmlStrlen(prefix);    pool = dict->strings;    while (pool != NULL) {	if (pool->end - pool->free > namelen)	    goto found_pool;	if (pool->size > size) size = pool->size;	pool = pool->next;    }    /*     * Not found, need to allocate     */    if (pool == NULL) {        if (size == 0) size = 1000;	else size *= 4; /* exponential growth */        if (size < 4 * namelen) 	    size = 4 * namelen; /* just in case ! */	pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);	if (pool == NULL)	    return(NULL);	pool->size = size;	pool->nbStrings = 0;	pool->free = &pool->array[0];	pool->end = &pool->array[size];	pool->next = dict->strings;	dict->strings = pool;    }found_pool:    ret = pool->free;    memcpy(pool->free, prefix, plen);    pool->free += plen;    *(pool->free++) = ':';    namelen -= plen + 1;    memcpy(pool->free, name, namelen);    pool->free += namelen;    *(pool->free++) = 0;    return(ret);}/* * xmlDictComputeKey: * Calculate the hash key */static unsigned longxmlDictComputeKey(const xmlChar *name, int namelen) {    unsigned long value = 0L;        if (name == NULL) return(0);    value = *name;    value <<= 5;    if (namelen > 10) {        value += name[namelen - 1];        namelen = 10;    }    switch (namelen) {        case 10: value += name[9];        case 9: value += name[8];        case 8: value += name[7];        case 7: value += name[6];        case 6: value += name[5];        case 5: value += name[4];        case 4: value += name[3];        case 3: value += name[2];        case 2: value += name[1];        default: break;    }    return(value);}/* * xmlDictComputeQKey: * Calculate the hash key */static unsigned longxmlDictComputeQKey(const xmlChar *prefix, const xmlChar *name, int len){    unsigned long value = 0L;    int plen;        if (prefix == NULL)        return(xmlDictComputeKey(name, len));    plen = xmlStrlen(prefix);    if (plen == 0)	value += 30 * (unsigned long) ':';    else	value += 30 * (*prefix);        if (len > 10) {        value += name[len - (plen + 1 + 1)];        len = 10;	if (plen > 10)	    plen = 10;    }    switch (plen) {        case 10: value += prefix[9];        case 9: value += prefix[8];        case 8: value += prefix[7];        case 7: value += prefix[6];        case 6: value += prefix[5];        case 5: value += prefix[4];        case 4: value += prefix[3];        case 3: value += prefix[2];        case 2: value += prefix[1];        case 1: value += prefix[0];        default: break;    }    len -= plen;    if (len > 0) {        value += (unsigned long) ':';	len--;    }    switch (len) {        case 10: value += name[9];        case 9: value += name[8];        case 8: value += name[7];        case 7: value += name[6];        case 6: value += name[5];        case 5: value += name[4];        case 4: value += name[3];        case 3: value += name[2];        case 2: value += name[1];        case 1: value += name[0];        default: break;    }    return(value);}/** * xmlDictCreate: * * Create a new dictionary * * Returns the newly created dictionnary, or NULL if an error occured. */xmlDictPtrxmlDictCreate(void) {    xmlDictPtr dict;    if (!xmlDictInitialized)        if (!xmlInitializeDict())            return(NULL);     dict = xmlMalloc(sizeof(xmlDict));    if (dict) {        dict->ref_counter = 1;        dict->size = MIN_DICT_SIZE;	dict->nbElems = 0;        dict->dict = xmlMalloc(MIN_DICT_SIZE * sizeof(xmlDictEntry));	dict->strings = NULL;	dict->subdict = NULL;        if (dict->dict) {            if ((dict->mutex = xmlNewRMutex()) != NULL) {                memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry));                return(dict);            }            xmlFree(dict->dict);        }        xmlFree(dict);    }    return(NULL);}/** * xmlDictCreateSub: * @sub: an existing dictionnary * * Create a new dictionary, inheriting strings from the read-only * dictionnary @sub. On lookup, strings are first searched in the * new dictionnary, then in @sub, and if not found are created in the * new dictionnary. * * Returns the newly created dictionnary, or NULL if an error occured. */xmlDictPtrxmlDictCreateSub(xmlDictPtr sub) {    xmlDictPtr dict = xmlDictCreate();      if ((dict != NULL) && (sub != NULL)) {        dict->subdict = sub;	xmlDictReference(dict->subdict);    }    return(dict);}/** * xmlDictReference: * @dict: the dictionnary * * Increment the reference counter of a dictionary * * Returns 0 in case of success and -1 in case of error */intxmlDictReference(xmlDictPtr dict) {    if (!xmlDictInitialized)        if (!xmlInitializeDict())            return(-1);    if (dict == NULL) return -1;    xmlRMutexLock(xmlDictMutex);    dict->ref_counter++;    xmlRMutexUnlock(xmlDictMutex);    return(0);}/** * xmlDictGrow: * @dict: the dictionnary * @size: the new size of the dictionnary * * resize the dictionnary * * Returns 0 in case of success, -1 in case of failure */static intxmlDictGrow(xmlDictPtr dict, int size) {    unsigned long key;    int oldsize, i;    xmlDictEntryPtr iter, next;    struct _xmlDictEntry *olddict;#ifdef DEBUG_GROW    unsigned long nbElem = 0;#endif      if (dict == NULL)	return(-1);    if (size < 8)        return(-1);    if (size > 8 * 2048)	return(-1);    oldsize = dict->size;    olddict = dict->dict;    if (olddict == NULL)        return(-1);      dict->dict = xmlMalloc(size * sizeof(xmlDictEntry));    if (dict->dict == NULL) {	dict->dict = olddict;	return(-1);    }    memset(dict->dict, 0, size * sizeof(xmlDictEntry));    dict->size = size;    /*	If the two loops are merged, there would be situations where	a new entry needs to allocated and data copied into it from 	the main dict. So instead, we run through the array twice, first	copying all the elements in the main array (where we can't get	conflicts) and then the rest, so we only free (and don't allocate)    */    for (i = 0; i < oldsize; i++) {	if (olddict[i].valid == 0) 	    continue;	key = xmlDictComputeKey(olddict[i].name, olddict[i].len) % dict->size;	memcpy(&(dict->dict[key]), &(olddict[i]), sizeof(xmlDictEntry));	dict->dict[key].next = NULL;#ifdef DEBUG_GROW	nbElem++;#endif    }    for (i = 0; i < oldsize; i++) {	iter = olddict[i].next;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品久久99久久在免费线| 欧美日韩大陆一区二区| 成人一级片网址| 97se亚洲国产综合自在线| 欧美亚洲愉拍一区二区| 欧美电影免费提供在线观看| 国产欧美日韩久久| 亚洲r级在线视频| 国产在线国偷精品产拍免费yy| 91丨九色丨国产丨porny| 在线电影院国产精品| 国产亚洲美州欧州综合国| 亚洲综合视频在线| 国产一区二区三区免费播放| 91麻豆免费在线观看| 欧美一区二区三区影视| 国产精品免费网站在线观看| 青草国产精品久久久久久| 不卡的av电影在线观看| 日韩午夜精品电影| 亚洲精品国产第一综合99久久| 精品一区二区免费看| 91成人在线免费观看| www国产亚洲精品久久麻豆| 亚洲第一激情av| www.亚洲在线| 日韩美女视频在线| 亚洲精品日韩一| 国产麻豆视频一区| 91精品国产色综合久久ai换脸| 成人欧美一区二区三区黑人麻豆| 久久精品国产久精国产爱| 欧洲日韩一区二区三区| 中文成人综合网| 久久成人综合网| 欧美日本在线播放| 亚洲毛片av在线| 成人一道本在线| 久久久久久久综合| 免费在线一区观看| 欧美最猛性xxxxx直播| 中文字幕中文字幕在线一区| 久久97超碰国产精品超碰| 欧美日韩视频在线一区二区| 亚洲视频在线一区观看| 国产成人精品一区二区三区网站观看| 欧美人成免费网站| 亚洲黄色小视频| 99久久99久久免费精品蜜臀| 国产欧美一区二区精品性色超碰 | 99精品国产视频| 久久综合九色综合97婷婷女人 | 欧美日韩国产高清一区二区三区| 国产精品久久久久久久久动漫| 黄页视频在线91| 欧美电视剧免费全集观看| 热久久一区二区| 91麻豆精品久久久久蜜臀| 亚洲成人手机在线| 欧美日本国产视频| 亚洲成va人在线观看| 欧美在线一区二区三区| 一区二区三区资源| 91尤物视频在线观看| 亚洲欧美日韩在线不卡| 成人福利视频在线| 国产精品国产成人国产三级| fc2成人免费人成在线观看播放| 国产欧美日韩中文久久| 久久精品国产精品青草| 欧美成人a∨高清免费观看| 另类综合日韩欧美亚洲| 欧美一区二区免费观在线| 美国毛片一区二区| 精品捆绑美女sm三区| 国产精选一区二区三区| 国产偷国产偷精品高清尤物 | 中文在线资源观看网站视频免费不卡| 天堂va蜜桃一区二区三区漫画版| 欧美天天综合网| 婷婷激情综合网| 日韩一区二区影院| 久久精品国产网站| 国产丝袜在线精品| 成a人片亚洲日本久久| 亚洲欧美欧美一区二区三区| 91麻豆免费看| 视频一区二区中文字幕| 日韩天堂在线观看| 国产美女在线精品| 国产精品福利电影一区二区三区四区 | 在线视频国内自拍亚洲视频| 亚洲小少妇裸体bbw| 欧美一区二区三区四区久久| 极品少妇xxxx偷拍精品少妇| 国产婷婷精品av在线| 色噜噜狠狠成人网p站| 五月婷婷另类国产| 精品福利一区二区三区免费视频| 国产成人综合视频| 亚洲激情男女视频| 日韩欧美色综合网站| 成人美女在线观看| 亚洲高清视频在线| 久久久综合视频| 色婷婷综合久色| 蜜桃视频在线一区| 国产精品青草久久| 欧美日韩成人综合在线一区二区| 国产一区二区久久| 亚洲理论在线观看| 日韩免费视频线观看| 99视频国产精品| 日韩精品亚洲专区| 国产精品欧美久久久久无广告 | 日韩精品免费视频人成| 国产日韩精品久久久| 欧美色窝79yyyycom| 国产一区二区在线视频| 亚洲黄色录像片| 久久女同互慰一区二区三区| 91精品91久久久中77777| 久久av老司机精品网站导航| 亚洲婷婷综合色高清在线| 91精品久久久久久久99蜜桃 | 亚洲天堂免费看| 制服丝袜在线91| 成人免费看视频| 日韩黄色免费网站| 国产精品欧美久久久久无广告| 91 com成人网| 99久久久久久99| 久久成人精品无人区| 亚洲一区二区综合| 亚洲国产成人在线| 日韩欧美成人激情| 欧美亚洲一区三区| 成人性生交大片免费看中文| 日韩专区一卡二卡| 夜夜嗨av一区二区三区四季av| 国产视频一区在线观看| 在线不卡中文字幕播放| 99精品视频一区| 国产在线国偷精品产拍免费yy| 五月激情综合网| 亚洲免费av高清| ww亚洲ww在线观看国产| 6080国产精品一区二区| 91精品福利在线| 91亚洲精品久久久蜜桃网站| 国产91高潮流白浆在线麻豆| 另类中文字幕网| 亚洲成人三级小说| 一区二区成人在线| 欧美国产一区在线| 久久综合九色综合欧美98| 日韩欧美在线观看一区二区三区| 欧美色图免费看| 色综合天天综合给合国产| 成人一级片网址| 国产91露脸合集magnet| 国内久久精品视频| 久久成人精品无人区| 麻豆视频观看网址久久| 舔着乳尖日韩一区| 亚洲第一福利视频在线| 亚洲18影院在线观看| 亚洲无线码一区二区三区| 亚洲一区中文在线| 亚洲国产精品麻豆| 亚洲成人免费观看| 亚洲福利视频一区二区| 亚洲一二三专区| 亚洲午夜免费电影| 亚洲国产一区视频| 亚洲一区二区三区美女| 一区二区三区四区视频精品免费 | heyzo一本久久综合| 国产成人自拍网| 国产ts人妖一区二区| 国产一区日韩二区欧美三区| 国产一区二区影院| 国产精品一区二区不卡| 国产成人亚洲综合a∨婷婷| 国产精品综合av一区二区国产馆| 国产一区二区三区黄视频 | 久久伊99综合婷婷久久伊| 精品精品欲导航| 久久蜜桃香蕉精品一区二区三区| 精品欧美乱码久久久久久| 欧美mv和日韩mv国产网站| 久久无码av三级| 国产欧美综合色| 中文字幕一区二区在线播放| 中文字幕欧美一区| 亚洲精品国产成人久久av盗摄| 亚洲国产毛片aaaaa无费看 | 欧美一卡二卡三卡| 亚洲精品一区二区三区影院| 久久免费看少妇高潮|