File: foreach.h

package info (click to toggle)
netsurf 3.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 51,332 kB
  • ctags: 27,027
  • sloc: ansic: 279,666; xml: 81,901; objc: 8,341; cpp: 5,716; perl: 4,127; makefile: 1,894; yacc: 1,509; jsp: 1,156; sh: 895; lex: 479; asm: 288; python: 121; php: 6
file content (45 lines) | stat: -rw-r--r-- 1,691 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * This file is part of libdom test suite.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
 */

#ifndef domts_foreach_h_
#define domts_foreach_h_

#include <dom/dom.h>

#include <list.h>

/* The following six functions are used for the XML testcase's 
   <for-each> element. 
   And the <for-each> element can be converted to :

   unsigned int iterator;
   foreach_initialise_*(list, &iterator);
   while(get_next_*(list, &iterator, ret)){
	  do the loop work.
   }
*/

void foreach_initialise_domnodelist(dom_nodelist *list, unsigned int *iterator);
void foreach_initialise_list(list *list, unsigned int *iterator);
void foreach_initialise_domnamednodemap(dom_namednodemap *map, unsigned int *iterator);
void foreach_initialise_domhtmlcollection(dom_html_collection *coll, unsigned int *iterator);

bool _get_next_domnodelist(dom_nodelist *list, unsigned int *iterator, dom_node **ret);
#define get_next_domnodelist(l, i, r) _get_next_domnodelist( \
		(dom_nodelist *) (l), (unsigned int *) (i), (dom_node **) (r))

bool get_next_list(list *list, unsigned int *iterator, void **ret);

bool _get_next_domnamednodemap(dom_namednodemap *map, unsigned int *iterator, dom_node **ret);
#define get_next_domnamednodemap(m, i, r) _get_next_domnamednodemap( \
		(dom_namednodemap *) (m), (unsigned int *) (i), (dom_node **) (r))

bool _get_next_domhtmlcollection(dom_html_collection *coll, unsigned int *iterator, dom_node **ret);
#define get_next_domhtmlcollection(c, i, r) _get_next_domhtmlcollection( \
		(dom_html_collection *) (c), (unsigned int *) (i), (dom_node **) (r))

#endif