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 LibParserUtils.
  3.  * Licensed under the MIT License,
  4.  *                http://www.opensource.org/licenses/mit-license.php
  5.  * Copyright 2008 John-Mark Bell <jmb@netsurf-browser.org>
  6.  */
  7.  
  8. #ifndef parserutils_utils_stack_h_
  9. #define parserutils_utils_stack_h_
  10.  
  11. #ifdef __cplusplus
  12. extern "C"
  13. {
  14. #endif
  15.  
  16. #include <stddef.h>
  17.  
  18. #include <parserutils/errors.h>
  19. #include <parserutils/functypes.h>
  20.  
  21. struct parserutils_stack;
  22. typedef struct parserutils_stack parserutils_stack;
  23.  
  24. parserutils_error parserutils_stack_create(size_t item_size, size_t chunk_size,
  25.                 parserutils_alloc alloc, void *pw, parserutils_stack **stack);
  26. parserutils_error parserutils_stack_destroy(parserutils_stack *stack);
  27.  
  28. parserutils_error parserutils_stack_push(parserutils_stack *stack,
  29.                 const void *item);
  30. parserutils_error parserutils_stack_pop(parserutils_stack *stack, void *item);
  31.  
  32. void *parserutils_stack_get_current(parserutils_stack *stack);
  33.  
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37.  
  38. #endif
  39.  
  40.