]> git.wh0rd.org - ICEs.git/blobdiff - 411691/id_manager.i.1
more
[ICEs.git] / 411691 / id_manager.i.1
diff --git a/411691/id_manager.i.1 b/411691/id_manager.i.1
new file mode 100644 (file)
index 0000000..3a104a7
--- /dev/null
@@ -0,0 +1,333 @@
+      namespace std {
+        typedef long unsigned int size_t;
+        }
+          typedef long unsigned int size_t;
+          namespace std __attribute__ ((__visibility__ ("default"))) {
+        template<typename _Tp> inline _Tp* __addressof(_Tp& __r) {
+      }
+        template<class _Sp, class _Tp> struct __traitor {
+      };
+        template<typename _Tp> struct __is_integer {
+      };
+        template<typename _Tp> struct __is_floating {
+      };
+        template<typename _Tp> struct __is_pointer {
+      };
+        template<typename _Tp> struct __is_normal_iterator {
+      };
+        template<typename _Tp> struct __is_arithmetic : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> > {
+      };
+        template<typename _Tp> struct __is_scalar : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> > {
+      };
+        }
+          namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+        template<bool, typename> struct __enable_if {
+      };
+        }
+          namespace std __attribute__ ((__visibility__ ("default"))) {
+        template<typename _Iterator, bool _HasBase> struct _Iter_base {
+      };
+        }
+          namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+        template<typename _Iterator, typename _Container> class __normal_iterator {
+      protected: _Iterator _M_current;
+      public: typedef _Iterator iterator_type;
+      __normal_iterator() : _M_current(_Iterator()) {
+    }
+      };
+        }
+          namespace std __attribute__ ((__visibility__ ("default"))) {
+        template<typename _Iterator> struct _Niter_base : _Iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value> {
+      };
+        template<typename _Iterator> inline typename _Niter_base<_Iterator>::iterator_type __niter_base(_Iterator __it) {
+      }
+        template<typename _CharT> struct char_traits;
+        }
+          extern "C++" {
+        namespace std {
+      class exception {
+    public: exception() throw() {
+    }
+    virtual ~exception() throw();
+    };
+      }
+        }
+          namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+        template<typename _Tp> class new_allocator {
+      public: typedef size_t size_type;
+      typedef const _Tp* const_pointer;
+      typedef _Tp& reference;
+      };
+        }
+          namespace std __attribute__ ((__visibility__ ("default"))) {
+        template<typename _Tp> class allocator: public __gnu_cxx::new_allocator<_Tp> {
+      public: typedef size_t size_type;
+      template<typename _Tp1> struct rebind {
+    typedef allocator<_Tp1> other;
+    };
+      };
+        template<typename _InputIterator, typename _ForwardIterator, typename _Allocator> _ForwardIterator __uninitialized_copy_a(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _Allocator& __alloc) {
+      try {
+    }
+      catch(...) {
+    }
+      }
+        }
+          namespace boost {
+        template<class T> class scoped_ptr {
+      private: T * px;
+      public: typedef T element_type;
+      explicit scoped_ptr( T * p = 0 ): px( p ) {
+    }
+      };
+        }
+          namespace std __attribute__ ((__visibility__ ("default"))) {
+        template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_string;
+        typedef basic_string<char> string;
+        template<> struct char_traits<char> {
+      typedef char char_type;
+      static void assign(char_type& __c1, const char_type& __c2) {
+    }
+      }
+        __pthread_unwind_buf_t __attribute__ ((__aligned__));
+        }
+          typedef int _Atomic_word;
+          namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+        static inline _Atomic_word __attribute__ ((__unused__)) __exchange_and_add_dispatch(_Atomic_word* __mem, int __val) {
+      }
+        }
+          namespace std __attribute__ ((__visibility__ ("default"))) {
+        template<typename _CharT, typename _Traits, typename _Alloc> class basic_string {
+      typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
+      public: typedef _Traits traits_type;
+      typedef _Alloc allocator_type;
+      typedef typename _CharT_alloc_type::size_type size_type;
+      typedef typename _CharT_alloc_type::reference reference;
+      typedef typename _CharT_alloc_type::const_pointer const_pointer;
+      typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string> const_iterator;
+      private: struct _Rep_base {
+    _Atomic_word _M_refcount;
+    };
+      struct _Rep : _Rep_base {
+    void _M_set_length_and_sharable(size_type __n) {
+    }
+    _CharT* _M_refdata() throw() {
+    return reinterpret_cast<_CharT*>(this + 1);
+    }
+    void _M_dispose(const _Alloc& __a) {
+    if (__builtin_expect(this != &_S_empty_rep(), false)) {
+    if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0) {
+  _M_destroy(__a);
+  }
+    }
+    }
+    void _M_destroy(const _Alloc&) throw();
+    };
+      struct _Alloc_hider : _Alloc {
+    _Alloc_hider(_CharT* __dat, const _Alloc& __a) : _Alloc(__a), _M_p(__dat) {
+    }
+    _CharT* _M_p;
+    };
+      public: static const size_type npos = static_cast<size_type>(-1);
+      private: mutable _Alloc_hider _M_dataplus;
+      _Rep* _M_rep() const {
+    }
+      size_type _M_limit(size_type __pos, size_type __off) const {
+    }
+      static _Rep& _S_empty_rep() {
+    }
+      public: basic_string() : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) {
+    }
+      ~basic_string() {
+    _M_rep()->_M_dispose(this->get_allocator());
+    }
+      size_type length() const {
+    }
+      reference operator[](size_type __pos) {
+    }
+      basic_string& erase(size_type __pos = 0, size_type __n = npos) {
+    }
+      allocator_type get_allocator() const {
+    }
+      };
+        }
+          namespace boost {
+        namespace detail {
+      template <typename T> class empty_base {
+    };
+      }
+        template <class T, class U, class B = ::boost::detail::empty_base<T> > struct less_than_comparable2 : B {
+      };
+        template <class T, class U, class B = ::boost::detail::empty_base<T> > struct equality_comparable2 : B {
+      };
+        namespace detail {
+      struct false_t {
+   };
+      }
+        template<class T> struct is_chained_base {
+      typedef ::boost::detail::false_t value;
+      };
+        template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct less_than_comparable : less_than_comparable2<T, U, B> {
+     };
+        template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct equality_comparable : equality_comparable2<T, U, B> {
+     };
+        namespace type_traits {
+      }
+        template<class T> class intrusive_ptr {
+      private: typedef intrusive_ptr this_type;
+      public: typedef T element_type;
+      intrusive_ptr(): px( 0 ) {
+    }
+      intrusive_ptr( T * p, bool add_ref = true ): px( p ) {
+    }
+      ~intrusive_ptr() {
+    if( px != 0 ) intrusive_ptr_release( px );
+    }
+      T * operator->() const {
+    return px;
+    }
+      typedef T * this_type::*unspecified_bool_type;
+      operator unspecified_bool_type() const {
+    }
+      private: T * px;
+      };
+        }
+          namespace quickbook {
+        struct section_info;
+        struct string_ref : boost::less_than_comparable<string_ref, boost::less_than_comparable<string_ref, std::string, boost::equality_comparable<string_ref, boost::equality_comparable<string_ref, std::string> > > > {
+      public: typedef std::string::const_iterator iterator;
+      private: iterator begin_, end_;
+      public: string_ref() : begin_(), end_() {
+    }
+      };
+        namespace exception_detail {
+      }
+        }
+          extern "C++" {
+        namespace std {
+      class bad_cast : public exception {
+    };
+      }
+        }
+          namespace quickbook {
+        template <typename T> struct intrusive_base {
+      intrusive_base() : ref_count_(0) {
+   }
+      ~intrusive_base() {
+    }
+      friend void intrusive_ptr_release(T* ptr) {
+    if(--ptr->ref_count_ == 0) delete ptr;
+    }
+      private: unsigned ref_count_;
+      };
+        struct id_category {
+      enum categories {
+    default_category = 0, numbered, generated, generated_heading, generated_section, generated_doc, explicit_id, explicit_section_id, explicit_anchor_id };
+      categories c;
+      };
+        struct id_state;
+        struct id_manager {
+      id_manager();
+      private: boost::scoped_ptr<id_state> state;
+      };
+        }
+          namespace boost{
+        namespace detail {
+      }
+        }
+          namespace std __attribute__ ((__visibility__ ("default"))) {
+        template<typename _Tp, typename _Ref, typename _Ptr> struct _Deque_iterator {
+      };
+        template<typename _Tp, typename _Alloc> class _Deque_base {
+      public: typedef _Alloc allocator_type;
+      typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
+      _Deque_base() : _M_impl() {
+    _M_initialize_map(0);
+    }
+      typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+      struct _Deque_impl : public _Tp_alloc_type {
+    _Tp** _M_map;
+    size_t _M_map_size;
+    iterator _M_start;
+    iterator _M_finish;
+    _Deque_impl() : _Tp_alloc_type(), _M_map(0), _M_map_size(0), _M_start(), _M_finish() {
+    }
+    };
+      protected: void _M_initialize_map(size_t);
+      _Deque_impl _M_impl;
+      };
+        template<typename _Tp, typename _Alloc = std::allocator<_Tp> > class deque : protected _Deque_base<_Tp, _Alloc> {
+      };
+        namespace numeric {
+      enum range_check_result {
+    cInRange = 0 , cNegOverflow = 1 , cPosOverflow = 2 }
+      ;
+      class bad_numeric_cast : public std::bad_cast {
+    };
+      class negative_overflow : public bad_numeric_cast {
+    void operator() ( range_check_result r ) {
+    if ( r == cNegOverflow ) throw negative_overflow() ;
+    }
+    }
+      ;
+      }
+        }
+          namespace quickbook {
+        static const std::size_t max_size = 32;
+        struct id_placeholder {
+      };
+        struct file_info;
+        struct doc_info;
+        struct id_state {
+      boost::intrusive_ptr<file_info> current_file;
+      std::deque<id_placeholder> placeholders;
+      private: id_placeholder* add_id_to_section( std::string const& id, id_category category, boost::intrusive_ptr<section_info> const& section);
+      };
+        struct file_info : intrusive_base<file_info> {
+      boost::intrusive_ptr<file_info> parent;
+      boost::intrusive_ptr<doc_info> document;
+      bool document_root;
+      unsigned compatibility_version;
+      boost::intrusive_ptr<section_info> switched_section;
+      id_placeholder* original_placeholder;
+      std::string doc_id_1_1;
+      file_info(boost::intrusive_ptr<file_info> const& parent, unsigned compatibility_version) : parent(parent), document(parent->document), document_root(false), compatibility_version(compatibility_version), switched_section(), original_placeholder() {
+   }
+      };
+        struct doc_info : intrusive_base<doc_info> {
+      boost::intrusive_ptr<section_info> current_section;
+      std::string last_title_1_1;
+      std::string section_id_1_1;
+      };
+        struct section_info : intrusive_base<section_info> {
+      boost::intrusive_ptr<section_info> parent;
+      unsigned compatibility_version;
+      unsigned level;
+      std::string id_1_1;
+      id_placeholder* placeholder_1_6;
+      section_info(boost::intrusive_ptr<section_info> const& parent, unsigned compatibility_version, std::string const& id) : parent(parent), compatibility_version(compatibility_version), level(parent ? parent->level + 1 : 1), id_1_1(), placeholder_1_6(0) {
+    }
+      };
+        id_manager::id_manager() : state(new id_state) {
+      }
+        namespace {
+      std::string normalize_id( std::string src_id, std::size_t prefix = 0, std::size_t size = max_size) {
+    std::string id;
+    std::size_t src = prefix;
+    std::size_t dst = prefix;
+    if (src >= id.length()) {
+    if (id[src] == '_') {
+    }
+    }
+    id.erase(dst);
+    }
+      }
+        id_placeholder* id_state::add_id_to_section( std::string const& id, id_category category, boost::intrusive_ptr<section_info> const& section) {
+      std::string id_part = id;
+      if (current_file->compatibility_version >= 106u && category.c < id_category::explicit_id) {
+    id_part = normalize_id(id);
+    }
+      boost::intrusive_ptr<section_info> parent = current_file->document->current_section;
+      boost::intrusive_ptr<section_info> new_section = new section_info(parent, current_file->compatibility_version, id);
+      };
+        }