Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * This file is part of libdom test suite.
  3.  * Licensed under the MIT License,
  4.  *                http://www.opensource.org/licenses/mit-license.php
  5.  * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
  6.  */
  7.  
  8. #ifndef domts_foreach_h_
  9. #define domts_foreach_h_
  10.  
  11. #include <dom/dom.h>
  12.  
  13. #include <list.h>
  14.  
  15. /* The following six functions are used for the XML testcase's
  16.    <for-each> element.
  17.    And the <for-each> element can be converted to :
  18.  
  19.    unsigned int iterator;
  20.    foreach_initialise_*(list, &iterator);
  21.    while(get_next_*(list, &iterator, ret)){
  22.           do the loop work.
  23.    }
  24. */
  25.  
  26. void foreach_initialise_domnodelist(dom_nodelist *list, unsigned int *iterator);
  27. void foreach_initialise_list(list *list, unsigned int *iterator);
  28. void foreach_initialise_domnamednodemap(dom_namednodemap *map, unsigned int *iterator);
  29. void foreach_initialise_domhtmlcollection(dom_html_collection *coll, unsigned int *iterator);
  30.  
  31. bool _get_next_domnodelist(dom_nodelist *list, unsigned int *iterator, dom_node **ret);
  32. #define get_next_domnodelist(l, i, r) _get_next_domnodelist( \
  33.                 (dom_nodelist *) (l), (unsigned int *) (i), (dom_node **) (r))
  34.  
  35. bool get_next_list(list *list, unsigned int *iterator, void **ret);
  36.  
  37. bool _get_next_domnamednodemap(dom_namednodemap *map, unsigned int *iterator, dom_node **ret);
  38. #define get_next_domnamednodemap(m, i, r) _get_next_domnamednodemap( \
  39.                 (dom_namednodemap *) (m), (unsigned int *) (i), (dom_node **) (r))
  40.  
  41. bool _get_next_domhtmlcollection(dom_html_collection *coll, unsigned int *iterator, dom_node **ret);
  42. #define get_next_domhtmlcollection(c, i, r) _get_next_domhtmlcollection( \
  43.                 (dom_html_collection *) (c), (unsigned int *) (i), (dom_node **) (r))
  44.  
  45. #endif
  46.