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 LibCSS
  3.  * Licensed under the MIT License,
  4.  *                http://www.opensource.org/licenses/mit-license.php
  5.  * Copyright 2009 John-Mark Bell <jmb@netsurf-browser.org>
  6.  */
  7.  
  8. #ifndef css_select_hash_h_
  9. #define css_select_hash_h_
  10.  
  11. #include <libwapcaplet/libwapcaplet.h>
  12.  
  13. #include <libcss/errors.h>
  14. #include <libcss/functypes.h>
  15.  
  16. /* Ugh. We need this to avoid circular includes. Happy! */
  17. struct css_selector;
  18.  
  19. typedef struct css_selector_hash css_selector_hash;
  20.  
  21. typedef css_error (*css_selector_hash_iterator)(
  22.                 const struct css_selector **current,
  23.                 const struct css_selector ***next);
  24.  
  25. css_error css__selector_hash_create(css_allocator_fn alloc, void *pw,
  26.                 css_selector_hash **hash);
  27. css_error css__selector_hash_destroy(css_selector_hash *hash);
  28.  
  29. css_error css__selector_hash_insert(css_selector_hash *hash,
  30.                 const struct css_selector *selector);
  31. css_error css__selector_hash_remove(css_selector_hash *hash,
  32.                 const struct css_selector *selector);
  33.  
  34. css_error css__selector_hash_find(css_selector_hash *hash,
  35.                 css_qname *qname,
  36.                 css_selector_hash_iterator *iterator,
  37.                 const struct css_selector ***matched);
  38. css_error css__selector_hash_find_by_class(css_selector_hash *hash,
  39.                 lwc_string *name,
  40.                 css_selector_hash_iterator *iterator,
  41.                 const struct css_selector ***matched);
  42. css_error css__selector_hash_find_by_id(css_selector_hash *hash,
  43.                 lwc_string *name,
  44.                 css_selector_hash_iterator *iterator,
  45.                 const struct css_selector ***matched);
  46. css_error css__selector_hash_find_universal(css_selector_hash *hash,
  47.                 css_selector_hash_iterator *iterator,
  48.                 const struct css_selector ***matched);
  49.  
  50. css_error css__selector_hash_size(css_selector_hash *hash, size_t *size);
  51.  
  52. #endif
  53.  
  54.