2 // { dg-additional-options "-Wno-return-type" }
4 namespace std __attribute__ ((__visibility__ ("default"))) {
5 template<typename _Iterator> struct iterator_traits {
7 template<typename _Tp> struct iterator_traits<_Tp*> {
8 typedef _Tp& reference;
11 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
12 using std::iterator_traits;
13 template<typename _Iterator, typename _Container> class __normal_iterator {
15 typedef iterator_traits<_Iterator> __traits_type;
17 typedef typename __traits_type::reference reference;
18 explicit __normal_iterator(const _Iterator& __i) : _M_current(__i) {
20 reference operator*() const {
23 __normal_iterator operator++(int) {
24 return __normal_iterator(_M_current++);
27 template<typename _Tp> class new_allocator {
30 template<typename _Tp1> struct rebind {
31 typedef new_allocator<_Tp1> other;
35 namespace std __attribute__ ((__visibility__ ("default"))) {
36 template<typename _Tp> class allocator: public __gnu_cxx::new_allocator<_Tp> {
39 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
40 template<typename _Alloc> struct __alloc_traits {
41 typedef typename _Alloc::pointer pointer;
42 template<typename _Tp> struct rebind {
43 typedef typename _Alloc::template rebind<_Tp>::other other;
47 namespace std __attribute__ ((__visibility__ ("default"))) {
48 template<typename _Tp, typename _Alloc> struct _Vector_base {
49 typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type;
50 typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer pointer;
51 struct _Vector_impl : public _Tp_alloc_type {
56 template<typename _Tp, typename _Alloc = std::allocator<_Tp> > class vector : protected _Vector_base<_Tp, _Alloc> {
57 typedef _Vector_base<_Tp, _Alloc> _Base;
59 typedef typename _Base::pointer pointer;
60 typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
62 return iterator(this->_M_impl._M_start);
67 static std::vector<myServer *> server_list;
69 class myFolder *currentFolder;
70 static bool eventloop(Callback *);
73 typedef unsigned int uint32_t;
74 typedef uint32_t unicode_char;
75 extern int strcmp (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
79 class Curses : public CursesObj {
85 Key(unicode_char ch) : ukey(ch), keycode(0) {
91 bool operator==(const Key &k) const {
92 return strcmp(keycode ? keycode:
93 "", k.keycode ? k.keycode:
94 "") == 0 && ukey == k.ukey;
97 static bool processKey(const Key &k);
99 class CursesContainer : public Curses {
103 void checkExpunged();
107 static Typeahead *typeahead;
113 class CursesScreen : public CursesContainer {
118 extern CursesScreen *cursesScreen;
119 bool myServer::eventloop(myServer::Callback *callback) {
120 Curses::Key k1= (callback == __null && !Typeahead::typeahead->empty() ? Typeahead::typeahead->pop() : cursesScreen->getKey());
121 if (callback == __null || (k1.plain() && k1.ukey == '\x03')) {
123 bool rc=Curses::processKey(k1);
124 if (rc) { while (k1.plain() && k1 == '\x03' && !Typeahead::typeahead->empty()) Typeahead::typeahead->pop(); }
127 vector<myServer *>::iterator b=server_list.begin();
130 if (p->currentFolder) p->currentFolder->checkExpunged();