aq.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. http://www.boost.org/
  4. Copyright (c) 2001 Daniel C. Nuffer.
  5. Copyright (c) 2001-2012 Hartmut Kaiser.
  6. Distributed under the Boost Software License, Version 1.0. (See accompanying
  7. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. =============================================================================*/
  9. #if !defined(BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
  10. #define BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED
  11. #include <boost/wave/wave_config.hpp>
  12. #include <cstdlib>
  13. // this must occur after all of the includes and before any code appears
  14. #ifdef BOOST_HAS_ABI_HEADERS
  15. #include BOOST_ABI_PREFIX
  16. #endif
  17. ///////////////////////////////////////////////////////////////////////////////
  18. namespace boost {
  19. namespace wave {
  20. namespace cpplexer {
  21. namespace re2clex {
  22. typedef std::size_t aq_stdelement;
  23. typedef struct tag_aq_queuetype
  24. {
  25. std::size_t head;
  26. std::size_t tail;
  27. std::size_t size;
  28. std::size_t max_size;
  29. aq_stdelement* queue;
  30. } aq_queuetype;
  31. typedef aq_queuetype* aq_queue;
  32. BOOST_WAVE_DECL int aq_enqueue(aq_queue q, aq_stdelement e);
  33. int aq_enqueue_front(aq_queue q, aq_stdelement e);
  34. int aq_serve(aq_queue q, aq_stdelement *e);
  35. BOOST_WAVE_DECL int aq_pop(aq_queue q);
  36. #define AQ_EMPTY(q) (q->size == 0)
  37. #define AQ_FULL(q) (q->size == q->max_size)
  38. int aq_grow(aq_queue q);
  39. BOOST_WAVE_DECL aq_queue aq_create(void);
  40. BOOST_WAVE_DECL void aq_terminate(aq_queue q);
  41. ///////////////////////////////////////////////////////////////////////////////
  42. } // namespace re2clex
  43. } // namespace cpplexer
  44. } // namespace wave
  45. } // namespace boost
  46. // the suffix header occurs after all of the code
  47. #ifdef BOOST_HAS_ABI_HEADERS
  48. #include BOOST_ABI_SUFFIX
  49. #endif
  50. #endif // !defined(BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)