Lines Matching defs:pool

371   STRING_POOL pool;
536 static XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc,
538 static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc,
540 static XML_Bool FASTCALL poolGrow(STRING_POOL *pool);
541 static const XML_Char *FASTCALL poolCopyString(STRING_POOL *pool,
543 static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s,
545 static const XML_Char *FASTCALL poolAppendString(STRING_POOL *pool,
593 #define poolStart(pool) ((pool)->start)
594 #define poolEnd(pool) ((pool)->ptr)
595 #define poolLength(pool) ((pool)->ptr - (pool)->start)
596 #define poolChop(pool) ((void)--(pool->ptr))
597 #define poolLastChar(pool) (((pool)->ptr)[-1])
598 #define poolDiscard(pool) ((pool)->ptr = (pool)->start)
599 #define poolFinish(pool) ((pool)->start = (pool)->ptr)
600 #define poolAppendChar(pool, c) \
601 (((pool)->ptr == (pool)->end && ! poolGrow(pool)) \
603 : ((*((pool)->ptr)++ = c), 1))
1553 p = poolCopyString(&parser->m_dtd->pool, p);
2848 name = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar,
2853 poolDiscard(&dtd->pool);
3270 const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
4793 = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar,
4799 poolFinish(&dtd->pool);
4998 s + enc->minBytesPerChar, next - enc->minBytesPerChar, &dtd->pool,
5002 attVal = poolStart(&dtd->pool);
5003 poolFinish(&dtd->pool);
5096 = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar,
5101 poolFinish(&dtd->pool);
5123 = poolStoreString(&dtd->pool, enc, s, next);
5126 poolFinish(&dtd->pool);
5150 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
5158 poolDiscard(&dtd->pool);
5161 poolFinish(&dtd->pool);
5173 poolDiscard(&dtd->pool);
5180 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
5188 poolDiscard(&dtd->pool);
5191 poolFinish(&dtd->pool);
5203 poolDiscard(&dtd->pool);
5376 name = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar,
5381 poolDiscard(&dtd->pool);
5869 const char *ptr, const char *end, STRING_POOL *pool,
5872 = appendAttributeValue(parser, enc, isCdata, ptr, end, pool, account);
5875 if (! isCdata && poolLength(pool) && poolLastChar(pool) == 0x20)
5876 poolChop(pool);
5877 if (! poolAppendChar(pool, XML_T('\0')))
5884 const char *ptr, const char *end, STRING_POOL *pool,
5922 && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20))
5935 if (! poolAppendChar(pool, buf[i]))
5940 if (! poolAppend(pool, enc, ptr, next))
5948 if (! isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20))
5950 if (! poolAppendChar(pool, 0x20))
5968 if (! poolAppendChar(pool, ch))
5982 if (pool == &dtd->pool) /* are we called from prolog? */
5989 else /* if (pool == &parser->m_tempPool): we are called from content */
6004 if ((pool == &parser->m_tempPool) && parser->m_defaultHandler)
6050 (const char *)textEnd, pool,
6087 STRING_POOL *pool = &(dtd->entityValuePool);
6098 if (! pool->blocks) {
6099 if (! poolGrow(pool))
6192 if (! poolAppend(pool, enc, entityTextPtr, next)) {
6201 if (pool->end == pool->ptr && ! poolGrow(pool)) {
6205 *(pool->ptr)++ = 0xA;
6228 if (pool->end == pool->ptr && ! poolGrow(pool)) {
6232 *(pool->ptr)++ = buf[i];
6452 if (! poolAppendChar(&dtd->pool, *s))
6455 if (! poolAppendChar(&dtd->pool, XML_T('\0')))
6457 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
6461 if (prefix->name == poolStart(&dtd->pool))
6462 poolFinish(&dtd->pool);
6464 poolDiscard(&dtd->pool);
6478 if (! poolAppendChar(&dtd->pool, XML_T('\0')))
6480 name = poolStoreString(&dtd->pool, enc, start, end);
6490 poolDiscard(&dtd->pool);
6492 poolFinish(&dtd->pool);
6512 if (! poolAppendChar(&dtd->pool, name[j]))
6515 if (! poolAppendChar(&dtd->pool, XML_T('\0')))
6518 poolStart(&dtd->pool), sizeof(PREFIX));
6521 if (id->prefix->name == poolStart(&dtd->pool))
6522 poolFinish(&dtd->pool);
6524 poolDiscard(&dtd->pool);
6556 * URI into the parser's temporary string pool. Previously,
6557 * that URI was copied into the same string pool, with a
6559 * the pool was cleared, that leaves a block definitely big
6560 * enough to hold the URI on the free block list of the pool.
6564 * If the pool is used between the setContext() and
6662 prefix->name = poolCopyString(&dtd->pool, prefix->name);
6717 poolInit(&(p->pool), ms);
6763 poolClear(&(p->pool));
6803 poolDestroy(&(p->pool));
6828 name = poolCopyString(&(newDtd->pool), oldP->name);
6847 if (! poolAppendChar(&(newDtd->pool), XML_T('\0')))
6849 name = poolCopyString(&(newDtd->pool), oldA->name);
6879 name = poolCopyString(&(newDtd->pool), oldE->name);
6906 = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value);
6915 if (! copyEntityTable(oldParser, &(newDtd->generalEntities), &(newDtd->pool),
6920 if (! copyEntityTable(oldParser, &(newDtd->paramEntities), &(newDtd->pool),
7172 poolInit(STRING_POOL *pool, const XML_Memory_Handling_Suite *ms) {
7173 pool->blocks = NULL;
7174 pool->freeBlocks = NULL;
7175 pool->start = NULL;
7176 pool->ptr = NULL;
7177 pool->end = NULL;
7178 pool->mem = ms;
7182 poolClear(STRING_POOL *pool) {
7183 if (! pool->freeBlocks)
7184 pool->freeBlocks = pool->blocks;
7186 BLOCK *p = pool->blocks;
7189 p->next = pool->freeBlocks;
7190 pool->freeBlocks = p;
7194 pool->blocks = NULL;
7195 pool->start = NULL;
7196 pool->ptr = NULL;
7197 pool->end = NULL;
7201 poolDestroy(STRING_POOL *pool) {
7202 BLOCK *p = pool->blocks;
7205 pool->mem->free_fcn(p);
7208 p = pool->freeBlocks;
7211 pool->mem->free_fcn(p);
7217 poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr,
7219 if (! pool->ptr && ! poolGrow(pool))
7223 enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end);
7227 if (! poolGrow(pool))
7230 return pool->start;
7234 poolCopyString(STRING_POOL *pool, const XML_Char *s) {
7236 if (! poolAppendChar(pool, *s))
7239 s = pool->start;
7240 poolFinish(pool);
7245 poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) {
7246 if (! pool->ptr && ! poolGrow(pool)) {
7250 * point, the name of the entity is already stored in the pool, so
7251 * pool->ptr cannot be NULL.
7261 if (! poolAppendChar(pool, *s))
7264 s = pool->start;
7265 poolFinish(pool);
7270 poolAppendString(STRING_POOL *pool, const XML_Char *s) {
7272 if (! poolAppendChar(pool, *s))
7276 return pool->start;
7280 poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr,
7282 if (! poolAppend(pool, enc, ptr, end))
7284 if (pool->ptr == pool->end && ! poolGrow(pool))
7286 *(pool->ptr)++ = 0;
7287 return pool->start;
7319 poolGrow(STRING_POOL *pool) {
7320 if (pool->freeBlocks) {
7321 if (pool->start == 0) {
7322 pool->blocks = pool->freeBlocks;
7323 pool->freeBlocks = pool->freeBlocks->next;
7324 pool->blocks->next = NULL;
7325 pool->start = pool->blocks->s;
7326 pool->end = pool->start + pool->blocks->size;
7327 pool->ptr = pool->start;
7330 if (pool->end - pool->start < pool->freeBlocks->size) {
7331 BLOCK *tem = pool->freeBlocks->next;
7332 pool->freeBlocks->next = pool->blocks;
7333 pool->blocks = pool->freeBlocks;
7334 pool->freeBlocks = tem;
7335 memcpy(pool->blocks->s, pool->start,
7336 (pool->end - pool->start) * sizeof(XML_Char));
7337 pool->ptr = pool->blocks->s + (pool->ptr - pool->start);
7338 pool->start = pool->blocks->s;
7339 pool->end = pool->start + pool->blocks->size;
7343 if (pool->blocks && pool->start == pool->blocks->s) {
7345 int blockSize = (int)((unsigned)(pool->end - pool->start) * 2U);
7350 const ptrdiff_t offsetInsideBlock = pool->ptr - pool->start;
7366 temp = (BLOCK *)pool->mem->realloc_fcn(pool->blocks,
7370 pool->blocks = temp;
7371 pool->blocks->size = blockSize;
7372 pool->ptr = pool->blocks->s + offsetInsideBlock;
7373 pool->start = pool->blocks->s;
7374 pool->end = pool->start + blockSize;
7377 int blockSize = (int)(pool->end - pool->start);
7385 * the pool control fields have been corrupted (which could
7407 tem = pool->mem->malloc_fcn(bytesToAllocate);
7411 tem->next = pool->blocks;
7412 pool->blocks = tem;
7413 if (pool->ptr != pool->start)
7414 memcpy(tem->s, pool->start, (pool->ptr - pool->start) * sizeof(XML_Char));
7415 pool->ptr = tem->s + (pool->ptr - pool->start);
7416 pool->start = tem->s;
7417 pool->end = tem->s + blockSize;
7614 const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end);
7624 poolDiscard(&dtd->pool);
7626 poolFinish(&dtd->pool);