Lines Matching refs:buf

41     HTMLElement **buf;  member
54 static void elem_vector_add(elem_vector_t *buf, HTMLElement *elem) in elem_vector_add() argument
56 if(buf->len == buf->size) { in elem_vector_add()
57 buf->size <<= 1; in elem_vector_add()
58 buf->buf = heap_realloc(buf->buf, buf->size*sizeof(HTMLElement*)); in elem_vector_add()
61 buf->buf[buf->len++] = elem; in elem_vector_add()
64 static void elem_vector_normalize(elem_vector_t *buf) in elem_vector_normalize() argument
66 if(!buf->len) { in elem_vector_normalize()
67 heap_free(buf->buf); in elem_vector_normalize()
68 buf->buf = NULL; in elem_vector_normalize()
69 }else if(buf->size > buf->len) { in elem_vector_normalize()
70 buf->buf = heap_realloc(buf->buf, buf->len*sizeof(HTMLElement*)); in elem_vector_normalize()
73 buf->size = buf->len; in elem_vector_normalize()
438 elem_vector_t buf = {NULL, 0, 8}; in HTMLElementCollection_item() local
440 buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*)); in HTMLElementCollection_item()
445 elem_vector_add(&buf, This->elems[i]); in HTMLElementCollection_item()
449 if(buf.len > 1) { in HTMLElementCollection_item()
450 elem_vector_normalize(&buf); in HTMLElementCollection_item()
451 *pdisp = (IDispatch*)HTMLElementCollection_Create(buf.buf, buf.len); in HTMLElementCollection_item()
453 if(buf.len == 1) { in HTMLElementCollection_item()
455 *pdisp = (IDispatch*)&buf.buf[0]->IHTMLElement_iface; in HTMLElementCollection_item()
458 heap_free(buf.buf); in HTMLElementCollection_item()
481 elem_vector_t buf = {NULL, 0, 8}; in HTMLElementCollection_tags() local
490 buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*)); in HTMLElementCollection_tags()
504 elem_vector_add(&buf, This->elems[i]); in HTMLElementCollection_tags()
509 elem_vector_normalize(&buf); in HTMLElementCollection_tags()
511 TRACE("fount %d tags\n", buf.len); in HTMLElementCollection_tags()
513 *pdisp = (IDispatch*)HTMLElementCollection_Create(buf.buf, buf.len); in HTMLElementCollection_tags()
614 static void create_all_list(HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vector_t *buf) in create_all_list() argument
648 elem_vector_add(buf, elem_from_HTMLDOMNode(node)); in create_all_list()
649 create_all_list(doc, node, buf); in create_all_list()
656 elem_vector_t buf = {NULL, 0, 8}; in create_all_collection() local
658 buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*)); in create_all_collection()
662 elem_vector_add(&buf, elem_from_HTMLDOMNode(node)); in create_all_collection()
664 create_all_list(node->doc, node, &buf); in create_all_collection()
665 elem_vector_normalize(&buf); in create_all_collection()
667 return HTMLElementCollection_Create(buf.buf, buf.len); in create_all_collection()
674 elem_vector_t buf; in create_collection_from_nodelist() local
679 buf.len = 0; in create_collection_from_nodelist()
680 buf.size = length; in create_collection_from_nodelist()
684 buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*)); in create_collection_from_nodelist()
692 buf.buf[buf.len++] = elem_from_HTMLDOMNode(node); in create_collection_from_nodelist()
697 elem_vector_normalize(&buf); in create_collection_from_nodelist()
699 buf.buf = NULL; in create_collection_from_nodelist()
702 return HTMLElementCollection_Create(buf.buf, buf.len); in create_collection_from_nodelist()
708 elem_vector_t buf; in create_collection_from_htmlcol() local
714 buf.len = buf.size = length; in create_collection_from_htmlcol()
715 if(buf.len) { in create_collection_from_htmlcol()
718 buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*)); in create_collection_from_htmlcol()
726 buf.buf[i] = elem_from_HTMLDOMNode(node); in create_collection_from_htmlcol()
729 buf.buf = NULL; in create_collection_from_htmlcol()
733 heap_free(buf.buf); in create_collection_from_htmlcol()
737 return HTMLElementCollection_Create(buf.buf, buf.len); in create_collection_from_htmlcol()
742 elem_vector_t buf = {NULL, 0, 8}; in get_elem_source_index() local
786 buf.buf = heap_alloc(buf.size*sizeof(*buf.buf)); in get_elem_source_index()
787 if(!buf.buf) { in get_elem_source_index()
792 create_all_list(elem->node.doc, node, &buf); in get_elem_source_index()
794 for(i=0; i < buf.len; i++) { in get_elem_source_index()
795 if(buf.buf[i] == elem) in get_elem_source_index()
799 heap_free(buf.buf); in get_elem_source_index()
800 if(i == buf.len) { in get_elem_source_index()